PageRenderTime 7ms CodeModel.GetById 1ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Examples/test-suite/python/default_constructor_runme.py

#
Python | 115 lines | 79 code | 33 blank | 3 comment | 0 complexity | e4c41384018353b5686db3dd305c2f70 MD5 | raw file
  1# This test is expected to fail with -builtin option.
  2# It uses the old static syntax (e.g., dc.new_A() rather than dc.A()),
  3# which is not provided with the -builtin option.
  4
  5import _default_constructor
  6
  7dc = _default_constructor
  8
  9a = dc.new_A()
 10dc.delete_A(a)
 11
 12aa = dc.new_AA()
 13dc.delete_AA(aa)
 14
 15try:
 16    b = dc.new_B()
 17    print "Whoa. new_BB created."
 18except:
 19    pass
 20
 21del_b = dc.delete_B
 22
 23try:
 24    bb = dc.new_BB();
 25    print "Whoa. new_BB created."
 26except:
 27    pass
 28
 29del_bb = dc.delete_BB
 30
 31try:
 32    c = dc.new_C()
 33    print "Whoa. new_C created."
 34except:
 35    pass
 36
 37del_c = dc.delete_C
 38
 39cc = dc.new_CC()
 40dc.delete_CC(cc)
 41
 42try:
 43    d = dc.new_D();
 44    print "Whoa. new_D created"
 45except:
 46    pass
 47
 48del_d = dc.delete_D
 49
 50try:
 51    dd = dc.new_DD()
 52    print "Whoa. new_DD created"
 53except:
 54    pass
 55
 56dd = dc.delete_DD
 57
 58try:
 59    ad = dc.new_AD()
 60    print "Whoa. new_AD created"
 61except:
 62    pass
 63
 64del_ad = dc.delete_AD
 65
 66e = dc.new_E()
 67dc.delete_E(e)
 68
 69ee = dc.new_EE()
 70dc.delete_EE(ee)
 71
 72try:
 73    eb = dc.new_EB()
 74    print "Whoa. new_EB created"
 75except:
 76    pass
 77
 78del_eb = dc.delete_EB
 79
 80f = dc.new_F()
 81
 82try:
 83    del_f = dc.delete_F
 84    print "Whoa. delete_F created"
 85except AttributeError:
 86    pass
 87
 88dc.F_destroy(f)
 89
 90ff = dc.new_FFF()
 91try:
 92    del_ff = dc.delete_FFF
 93    print "Whoa. delete_FFF created"
 94except AttributeError:
 95    pass
 96
 97dc.F_destroy(ff)
 98
 99g = dc.new_G()
100
101try:
102    del_g = dc.delete_G
103    print "Whoa. delete_G created"
104except AttributeError:
105    pass
106
107dc.G_destroy(g)
108
109gg = dc.new_GG()
110dc.delete_GG(gg)
111
112
113import default_constructor
114hh = default_constructor.HH(1,1)
115