~peter-pearse/ubuntu/oneiric/libglib-perl/prop001

« back to all changes in this revision

Viewing changes to t/3.t

  • Committer: Bazaar Package Importer
  • Author(s): Marc 'HE' Brockschmidt
  • Date: 2004-06-14 13:23:01 UTC
  • Revision ID: james.westby@ubuntu.com-20040614132301-3jexjlx4er0qzvwi
Tags: upstream-1.043
ImportĀ upstreamĀ versionĀ 1.043

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
print "1..6\n";
 
2
 
 
3
use strict;
 
4
use warnings;
 
5
 
 
6
use Glib;
 
7
 
 
8
print "ok 1\n";
 
9
 
 
10
# this will set @ISA for Foo, and register the type.
 
11
# note that if you aren't going to add properties, signals, or
 
12
# virtual overrides, there's no reason to do this rather than
 
13
# just re-blessing the object, so this is a rather contrived
 
14
# example.
 
15
 
 
16
my ($ok1, $ok2);
 
17
 
 
18
sub Foo::INIT_INSTANCE {
 
19
   print "ok $ok1\n";
 
20
}
 
21
 
 
22
sub Foo::FINALIZE_INSTANCE {
 
23
   print "ok $ok2\n";
 
24
}
 
25
 
 
26
Glib::Type->register (Glib::Object::, Foo::);
 
27
 
 
28
{
 
29
        $ok1 = 2; my $bar = new Foo;
 
30
        $ok2 = 3; undef $bar;
 
31
        $ok1 = 4; $bar = new Foo;
 
32
        $ok2 = 5;
 
33
}
 
34
 
 
35
print "ok 6\n";
 
36
 
 
37
$ok1 = $ok2 = -1;
 
38
 
 
39
 
 
40
__END__
 
41
 
 
42
Copyright (C) 2003 by the gtk2-perl team (see the file AUTHORS for the
 
43
full list)
 
44
 
 
45
This library is free software; you can redistribute it and/or modify it under
 
46
the terms of the GNU Library General Public License as published by the Free
 
47
Software Foundation; either version 2.1 of the License, or (at your option) any
 
48
later version.
 
49
 
 
50
This library is distributed in the hope that it will be useful, but WITHOUT ANY
 
51
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 
52
PARTICULAR PURPOSE.  See the GNU Library General Public License for more
 
53
details.
 
54
 
 
55
You should have received a copy of the GNU Library General Public License along
 
56
with this library; if not, write to the Free Software Foundation, Inc., 59
 
57
Temple Place - Suite 330, Boston, MA  02111-1307  USA.