Sync llcommon with Alchemy a bit.
llmath::llround->ll_round LL_ICC->LL_INTELC Add llpredicate Add LL_CPP11 macro Remove llhash Update llinitparam, llsd and all relatives of it.
This commit is contained in:
@@ -49,7 +49,6 @@
|
||||
#include "llsd.h"
|
||||
#include "llsdserialize.h"
|
||||
#include "u64.h"
|
||||
#include "llhash.h"
|
||||
|
||||
#if LL_WINDOWS
|
||||
// disable overflow warnings
|
||||
@@ -638,38 +637,3 @@ namespace tut
|
||||
// seems to be deprecated - could not find it being used
|
||||
// anywhere in the tarball - skipping unit tests for now
|
||||
}
|
||||
|
||||
|
||||
namespace tut
|
||||
{
|
||||
struct hash_data
|
||||
{
|
||||
};
|
||||
typedef test_group<hash_data> hash_test;
|
||||
typedef hash_test::object hash_object;
|
||||
tut::hash_test hash_tester("hash_test");
|
||||
|
||||
template<> template<>
|
||||
void hash_object::test<1>()
|
||||
{
|
||||
const char * str1 = "test string one";
|
||||
const char * same_as_str1 = "test string one";
|
||||
|
||||
size_t hash1 = llhash(str1);
|
||||
size_t same_as_hash1 = llhash(same_as_str1);
|
||||
|
||||
|
||||
ensure("Hashes from identical strings should be equal", hash1 == same_as_hash1);
|
||||
|
||||
char str[100];
|
||||
strcpy( str, "Another test" );
|
||||
|
||||
size_t hash2 = llhash(str);
|
||||
|
||||
strcpy( str, "Different string, same pointer" );
|
||||
|
||||
size_t hash3 = llhash(str);
|
||||
|
||||
ensure("Hashes from same pointer but different string should not be equal", hash2 != hash3);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user