#include #include "testhash.h" #include "../hash.h" void test_String_hashes_unsigned_int() { unsigned int h1 = Hash::hash( "foo" ); assert( h1 > 0 ); } void test_Strings_hash_to_different_ints() { unsigned int h1 = Hash::hash( "foo" ); unsigned int h2 = Hash::hash( "bar" ); unsigned int h3 = Hash::hash( "baz" ); unsigned int h4 = Hash::hash( "qux" ); unsigned int h5 = Hash::hash( "quux" ); assert( h1 != h2 || h1 != h3 || h1 != h4 || h1 != h5 ); } void test_hash() { test_String_hashes_unsigned_int(); test_Strings_hash_to_different_ints(); }