~ubuntu-branches/ubuntu/quantal/swig2.0/quantal

« back to all changes in this revision

Viewing changes to Examples/test-suite/python/refcount_runme.py

  • Committer: Package Import Robot
  • Author(s): Stefano Rivera
  • Date: 2012-06-01 17:05:17 UTC
  • mfrom: (1.1.6) (10.1.9 sid)
  • Revision ID: package-import@ubuntu.com-20120601170517-q0ik32ij61i4r6f0
Tags: 2.0.7-2ubuntu1
* Merge from Debian unstable (LP: #1006387). Remaining changes:
  - Drop libchicken-dev from the build-depends (in universe).

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
 
11
11
 
12
12
if a.ref_count() != 3:
13
 
  print "This program will crash... now"
 
13
  raise RuntimeError("Count = %d" % a.ref_count())
14
14
 
15
15
 
16
16
rca = b2.get_rca()
17
17
b3 = B.create(rca)
18
18
 
19
19
if a.ref_count() != 5:
20
 
  print "This program will crash... now"
 
20
  raise RuntimeError("Count = %d" % a.ref_count())
21
21
 
22
22
 
23
23
v = vector_A(2)
27
27
x = v[0]
28
28
del v
29
29
 
30
 
 
31
 
 
 
30
if a.ref_count() != 6:
 
31
  raise RuntimeError("Count = %d" % a.ref_count())
 
32
 
 
33
# Check %newobject
 
34
b4 = b2.cloner()
 
35
if b4.ref_count() != 1:
 
36
  raise RuntimeError
 
37
 
 
38
b5 = global_create(a)
 
39
if b5.ref_count() != 1:
 
40
  raise RuntimeError
 
41
 
 
42
b6 = Factory.create(a)
 
43
if b6.ref_count() != 1:
 
44
  raise RuntimeError
 
45
 
 
46
b7 = Factory().create2(a)
 
47
if b7.ref_count() != 1:
 
48
  raise RuntimeError
 
49
 
 
50
 
 
51
if a.ref_count() != 10:
 
52
  raise RuntimeError("Count = %d" % a.ref_count())
 
53
 
 
54
del b4
 
55
del b5
 
56
del b6
 
57
del b7
 
58
 
 
59
if a.ref_count() != 6:
 
60
  raise RuntimeError("Count = %d" % a.ref_count())
32
61