diff options
author | Luciano Wolf <luciano.wolf@openbossa.org> | 2009-12-01 11:22:14 -0300 |
---|---|---|
committer | Marcelo Lira <marcelo.lira@openbossa.org> | 2009-12-01 11:27:37 -0300 |
commit | 3cd048ce7e6be098b5428bff3e59f0fe1aa14293 (patch) | |
tree | e717455173e438e95e955a35b19188b35e6cbdfc /tests/samplebinding/ownership_invalidate_nonpolymorphic_test.py | |
parent | 1b1c6f7dadaeb5872a3d3a170782cb8cf52f4940 (diff) |
Fix some ownership tests.
Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
Diffstat (limited to 'tests/samplebinding/ownership_invalidate_nonpolymorphic_test.py')
-rwxr-xr-x | tests/samplebinding/ownership_invalidate_nonpolymorphic_test.py | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/tests/samplebinding/ownership_invalidate_nonpolymorphic_test.py b/tests/samplebinding/ownership_invalidate_nonpolymorphic_test.py index 6d8561e66..4970694d1 100755 --- a/tests/samplebinding/ownership_invalidate_nonpolymorphic_test.py +++ b/tests/samplebinding/ownership_invalidate_nonpolymorphic_test.py @@ -37,24 +37,11 @@ class OwnershipInvalidateNonPolymorphicTest(unittest.TestCase): def testOwnershipTransference(self): '''Ownership transference from Python to C++ and back again.''' p1 = Point(10, 20) - p1_refcnt = sys.getrefcount(p1) - p2 = Point(25, 35) - p2_refcnt = sys.getrefcount(p2) bb = BlackBox() - bb.keepPoint(p1) - bb.keepPoint(p2) - #self.assertEqual(bb.points(), [p1, p2]) - #self.assertEqual(p1.x(), 10) - #self.assertEqual(p2.x(), 25) - #self.assertEqual(sys.getrefcount(p1), p1_refcnt) - #self.assertEqual(sys.getrefcount(p2), p2_refcnt) - #p2 = bb.retrievePoint(p2) - #self.assertEqual(sys.getrefcount(p2), p2_refcnt) - #del bb - #self.assertRaises(RuntimeError, p1.x) - #self.assertEqual(p2.y(), 35) - #self.assertEqual(sys.getrefcount(p2), p2_refcnt) - + p1_ticket = bb.keepPoint(p1) + self.assertRaises(RuntimeError, p1.x) + p1_ret = bb.retrievePoint(p1_ticket) + self.assertEqual(p1_ret, Point(10, 20)) if __name__ == '__main__': unittest.main() |