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

Method testFloat

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

Source from the content-addressed store, hash-verified

39class RadixSortTest( unittest.TestCase ) :
40
41 def testFloat( self ) :
42
43 random.seed( 12 )
44
45 s = IECore.RadixSort()
46
47 d = IECore.FloatVectorData()
48
49 for i in range( 0, 10000 ):
50 d.append( random.uniform( IECore.FloatData().minValue, IECore.FloatData().maxValue ) )
51
52 idx = s.sort( d )
53
54 self.assertEqual( len(idx), 10000 )
55
56 for i in range( 1, 10000 ):
57
58 self.assertTrue( d[ idx[ i ] ] >= d[ idx[ i - 1 ] ] )
59
60 def testInt( self ) :
61

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