#include <cstdlib>
#include <ctime>
+#include <gtest/gtest.h>
+
using namespace ::folly::hash;
static bool failed = false;
};
// fastest conceivable hash function (for comparison)
-static void Add(const void *data, size_t length, uint64_t *hash1, uint64_t *hash2)
+static void Add(const void *data, size_t length,
+ uint64_t *hash1, uint64_t *hash2)
{
uint64_t *p64 = (uint64_t *)data;
uint64_t *end = p64 + length/8;
{
buf1[j/8] ^= (1 << (j%8));
}
- SpookyHashV1::Hash128(buf1, h, &measure[0][0], &measure[0][1]);
- SpookyHashV1::Hash128(buf2, h, &measure[1][0], &measure[1][1]);
+ SpookyHashV1::Hash128(buf1, h,
+ &measure[0][0], &measure[0][1]);
+ SpookyHashV1::Hash128(buf2, h,
+ &measure[1][0], &measure[1][1]);
for (int l=0; l<2; ++l) {
measure[2][l] = measure[0][l] ^ measure[1][l];
measure[3][l] = ~(measure[0][l] ^ measure[1][l]);
}
#undef BUFSIZE
-int main(int argc, const char **argv)
-{
+TEST(SpookyHashV1, Main) {
TestResults();
TestAlignment();
TestPieces();
- DoTimingBig(argc);
+ DoTimingBig(1);
// tudorb@fb.com: Commented out slow tests
#if 0
DoTimingSmall(argc);
TestDeltas(argc);
#endif
- return failed;
+ CHECK_EQ(failed, 0);
}