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

Method testUInt

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

Source from the content-addressed store, hash-verified

77 self.assertTrue( d[ idx[ i ] ] >= d[ idx[ i - 1 ] ] )
78
79 def testUInt( self ) :
80
81 random.seed( 14 )
82
83 s = IECore.RadixSort()
84
85 d = IECore.UIntVectorData()
86
87 for i in range( 0, 10000 ):
88 d.append( int( random.uniform( IECore.UIntData().minValue, IECore.UIntData().maxValue ) ) )
89
90 idx = s.sort( d )
91
92 self.assertEqual( len(idx), 10000 )
93
94 for i in range( 1, 10000 ):
95
96 self.assertTrue( d[ idx[ i ] ] >= d[ idx[ i - 1 ] ] )
97
98
99if __name__ == "__main__":

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