diff options
author | 2011-03-20 19:21:20 +0000 | |
---|---|---|
committer | 2011-03-20 19:21:20 +0000 | |
commit | b139d148182be100c25d5b04baa9611ebd4abd87 (patch) | |
tree | 639490f4fc58638a230c9e277b12ada4bbff26ae /paludis/util/hashes_TEST.cc | |
parent | f475a230cc53eb170cdbdd7589250b253f24e37b (diff) | |
download | paludis-b139d148182be100c25d5b04baa9611ebd4abd87.tar.gz paludis-b139d148182be100c25d5b04baa9611ebd4abd87.tar.xz |
gtest more
Diffstat (limited to 'paludis/util/hashes_TEST.cc')
-rw-r--r-- | paludis/util/hashes_TEST.cc | 40 |
1 files changed, 16 insertions, 24 deletions
diff --git a/paludis/util/hashes_TEST.cc b/paludis/util/hashes_TEST.cc index 46ada4e8f..2cf3ea561 100644 --- a/paludis/util/hashes_TEST.cc +++ b/paludis/util/hashes_TEST.cc @@ -18,34 +18,26 @@ */ #include <paludis/util/hashes.hh> -#include <test/test_runner.hh> -#include <test/test_framework.hh> + #include <set> -using namespace test; +#include <gtest/gtest.h> + using namespace paludis; -namespace test_cases +TEST(Hashes, Tuple) { - struct HashTupleTest : TestCase - { - HashTupleTest() : TestCase("hash tuple") { } - - void run() - { - std::set<std::size_t> hashes; - - for (int x(1) ; x < 20 ; ++x) - TEST_CHECK(hashes.insert(Hash<std::tuple<int> >()(std::make_tuple(x))).second); - - for (int x(1) ; x < 20 ; ++x) - for (int y(1) ; y < 20 ; ++y) - TEST_CHECK(hashes.insert(Hash<std::tuple<int, int> >()(std::make_tuple(x, y))).second); - - for (int x(1) ; x < 20 ; ++x) - for (int y(1) ; y < 20 ; ++y) - TEST_CHECK(hashes.insert(Hash<std::tuple<int, int, int> >()(std::make_tuple(x, y, 42))).second); - } - } test_hash_tuple; + std::set<std::size_t> hashes; + + for (int x(1) ; x < 20 ; ++x) + ASSERT_TRUE(hashes.insert(Hash<std::tuple<int> >()(std::make_tuple(x))).second); + + for (int x(1) ; x < 20 ; ++x) + for (int y(1) ; y < 20 ; ++y) + ASSERT_TRUE(hashes.insert(Hash<std::tuple<int, int> >()(std::make_tuple(x, y))).second); + + for (int x(1) ; x < 20 ; ++x) + for (int y(1) ; y < 20 ; ++y) + ASSERT_TRUE(hashes.insert(Hash<std::tuple<int, int, int> >()(std::make_tuple(x, y, 42))).second); } |