Jelle,
There's already one unit test for the GarbageCollector module (see below),
but I agree we shoul build a more complete set of unit tests dedicated to
the memory management issue.
Thomas
*class* Test(unittest.TestCase):
*def* *testGarbageCollector*(self):
*'''
Test GarbageColector features
'''*
*print* *'Test: GarbageCollector'*
number_of_collected_objects_1 =
len(GarbageCollector.garbage._collected_objects)
h = Standard_Transient().GetHandle()
*# The Standard_Transient object was deleted, it should now be
in the garbage* number_of_collected_objects_2 =
len(GarbageCollector.garbage._collected_objects)
self.assertEqual(number_of_collected_objects_2-number_of_collected_objects_1,1)
self.assertEqual(h.IsNull(), False)
*# Now free memory, i.e. kill all objects*
GarbageCollector.garbage.purge()
*# Now the handle should be NULL, since the Standard_Transient
object was killed* self.assertEqual(h.IsNull(), False)
2010/2/19 Jelle Feringa <[email protected]>
> This has been an impressive thread to follow! Thanks for your work Thomas
> & Frank, very interesting! Who knows we can use your script as the start of
> a unit test.
>
> Thanks,
>
> -jelle
> _______________________________________________
> Pythonocc-users mailing list
> [email protected]
> https://mail.gna.org/listinfo/pythonocc-users
>
_______________________________________________
Pythonocc-users mailing list
[email protected]
https://mail.gna.org/listinfo/pythonocc-users