| 102 | }; |
| 103 | |
| 104 | void 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 |
nothing calls this directly
no test coverage detected