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

Function testMurmurHashDispatch

src/IECorePython/MurmurHashBinding.cpp:104–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102};
103
104void testMurmurHashDispatch()
105{
106
107 // If the dispatch can even compile, that means we have hash functions defined for all the types
108 // that dispatch uses. We should also check a few types to make sure the Data dispatch actually works
109 HashDispatchFunctor hashFunctor;
110 IECore::MurmurHash h;
111 h.append( 42.37f );
112 IECORETEST_ASSERT( h == IECore::dispatch( IECore::FloatDataPtr( new IECore::FloatData( 42.37 ) ).get(), hashFunctor ) );
113
114 h = IECore::MurmurHash();
115 h.append( std::string("foo") );
116 IECORETEST_ASSERT( h == IECore::dispatch( IECore::StringDataPtr( new IECore::StringData( "foo" ) ).get(), hashFunctor ) );
117
118 h = IECore::MurmurHash();
119 h.append( std::vector<float>{ 1, 3, 37.03 } );
120 IECORETEST_ASSERT( h == IECore::dispatch( IECore::FloatVectorDataPtr( new IECore::FloatVectorData( std::vector<float>{ 1, 3, 37.03 } ) ).get(), hashFunctor ) );
121}
122
123} // namespace
124

Callers

nothing calls this directly

Calls 3

MurmurHashClass · 0.85
appendMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected