( self )
| 43 | class BufferTest( unittest.TestCase ) : |
| 44 | |
| 45 | def test( self ) : |
| 46 | |
| 47 | d = IECore.V3fVectorData( [ imath.V3f( x ) for x in range( 0, 100 ) ] ) |
| 48 | |
| 49 | b = IECoreGL.CachedConverter.defaultCachedConverter().convert( d ) |
| 50 | self.assertTrue( isinstance( b, IECoreGL.Buffer ) ) |
| 51 | |
| 52 | self.assertEqual( b.size(), 100 * 3 * 4 ) |
| 53 | |
| 54 | b2 = IECoreGL.CachedConverter.defaultCachedConverter().convert( d ) |
| 55 | self.assertTrue( b2.isSame( b ) ) |
| 56 | |
| 57 | d2 = IECore.V3fVectorData( [ imath.V3f( x * 2 ) for x in range( 0, 50 ) ] ) |
| 58 | |
| 59 | b3 = IECoreGL.CachedConverter.defaultCachedConverter().convert( d2 ) |
| 60 | self.assertTrue( isinstance( b, IECoreGL.Buffer ) ) |
| 61 | self.assertFalse( b3.isSame( b ) ) |
| 62 | |
| 63 | if __name__ == "__main__": |
| 64 | unittest.main() |
nothing calls this directly
no test coverage detected