swig/Examples/test-suite/python/li_std_auto_ptr_runme.py
William S Fulton cf8788c411 Update Python tests to not use flatstaticmethod access
Use Python class staticmethod syntax to access C++ static member functions,
such as Klass.memberfunction, instead of Klass_memberfunction.
Examples and test-suite changes in preparation for issue #2137.
2022-01-14 22:48:11 +00:00

17 lines
390 B
Python

from li_std_auto_ptr import *
k1 = makeKlassAutoPtr("first")
k2 = makeKlassAutoPtr("second")
if Klass.getTotal_count() != 2:
raise "number of objects should be 2"
del k1
if Klass.getTotal_count() != 1:
raise "number of objects should be 1"
if k2.getLabel() != "second":
raise "wrong object label"
del k2
if Klass.getTotal_count() != 0:
raise "no objects should be left"