Changeset View
Changeset View
Standalone View
Standalone View
src/test/hash_tests.cpp
Show All 12 Lines | |||||
#include <boost/test/unit_test.hpp> | #include <boost/test/unit_test.hpp> | ||||
#include <vector> | #include <vector> | ||||
BOOST_FIXTURE_TEST_SUITE(hash_tests, BasicTestingSetup) | BOOST_FIXTURE_TEST_SUITE(hash_tests, BasicTestingSetup) | ||||
BOOST_AUTO_TEST_CASE(murmurhash3) { | BOOST_AUTO_TEST_CASE(murmurhash3) { | ||||
#define T(expected, seed, data) \ | #define T(expected, seed, data) \ | ||||
BOOST_CHECK_EQUAL(MurmurHash3(seed, ParseHex(data)), expected) | BOOST_CHECK_EQUAL(MurmurHash3(seed, ParseHex(data)), expected) | ||||
// Test MurmurHash3 with various inputs. Of course this is retested in the | // Test MurmurHash3 with various inputs. Of course this is retested in the | ||||
// bloom filter tests - they would fail if MurmurHash3() had any problems - | // bloom filter tests - they would fail if MurmurHash3() had any problems - | ||||
// but is useful for those trying to implement Bitcoin libraries as a | // but is useful for those trying to implement Bitcoin libraries as a | ||||
// source of test data for their MurmurHash3() primitive during | // source of test data for their MurmurHash3() primitive during | ||||
// development. | // development. | ||||
▲ Show 20 Lines • Show All 178 Lines • Show Last 20 Lines |