MCPcopy Create free account
hub / github.com/ImageEngine/cortex / testMultipleReferences

Method testMultipleReferences

test/IECore/MemoryUsage.py:40–54  ·  view source on GitHub ↗

When an object has multiple references to the same child, that child should not be counted multiple times in the memory usage total.

( self )

Source from the content-addressed store, hash-verified

38class TestMemoryUsage( unittest.TestCase ) :
39
40 def testMultipleReferences( self ) :
41
42 """When an object has multiple references to the same child, that child
43 should not be counted multiple times in the memory usage total."""
44
45 c = IECore.CompoundObject()
46 d = IECore.IntVectorData( 10000 )
47
48 c["a"] = d
49
50 m = c.memoryUsage()
51 dm = d.memoryUsage()
52
53 c["b"] = d
54 self.assertTrue( c.memoryUsage() < m + dm )
55
56 def testMultipleReferencesToStringData( self ) :
57

Callers

nothing calls this directly

Calls 3

memoryUsageMethod · 0.95
CompoundObjectMethod · 0.80
memoryUsageMethod · 0.45

Tested by

no test coverage detected