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

Method testInt

test/IECore/RadixSortTest.py:60–77  ·  view source on GitHub ↗
( self )

Source from the content-addressed store, hash-verified

58 self.assertTrue( d[ idx[ i ] ] >= d[ idx[ i - 1 ] ] )
59
60 def testInt( self ) :
61
62 random.seed( 13 )
63
64 s = IECore.RadixSort()
65
66 d = IECore.IntVectorData()
67
68 for i in range( 0, 10000 ):
69 d.append( int( random.uniform( IECore.IntData().minValue, IECore.IntData().maxValue ) ) )
70
71 idx = s.sort( d )
72
73 self.assertEqual( len(idx), 10000 )
74
75 for i in range( 1, 10000 ):
76
77 self.assertTrue( d[ idx[ i ] ] >= d[ idx[ i - 1 ] ] )
78
79 def testUInt( self ) :
80

Callers

nothing calls this directly

Calls 4

RadixSortMethod · 0.80
appendMethod · 0.80
sortMethod · 0.80
lenFunction · 0.50

Tested by

no test coverage detected