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

Method testVectorData

test/IECore/DataConvertTest.h:68–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66
67 template<typename F, typename T>
68 void testVectorData()
69 {
70 typename F::Ptr from = new F();
71
72 from->writable().resize( 1024 );
73
74 for ( unsigned i = 0; i < 1024; i ++ )
75 {
76 from->writable()[i] = i;
77 }
78
79 typedef DoubleItDataConversion< typename F::ValueType::value_type, typename T::ValueType::value_type > Conv;
80
81 typename T::Ptr to = DataConvert< F, T, Conv >()( from );
82 BOOST_CHECK( to );
83 BOOST_CHECK_EQUAL( (int)to->readable().size(), 1024 );
84 BOOST_CHECK_EQUAL( (float)to->readable()[512], 1024.f );
85 }
86
87 template<typename F, typename T>
88 void testSimpleData()

Callers

nothing calls this directly

Calls 4

readableMethod · 0.80
resizeMethod · 0.45
writableMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected