diff options
author | 2011-03-20 19:21:20 +0000 | |
---|---|---|
committer | 2011-03-20 19:21:20 +0000 | |
commit | b139d148182be100c25d5b04baa9611ebd4abd87 (patch) | |
tree | 639490f4fc58638a230c9e277b12ada4bbff26ae | |
parent | f475a230cc53eb170cdbdd7589250b253f24e37b (diff) | |
download | paludis-b139d148182be100c25d5b04baa9611ebd4abd87.tar.gz paludis-b139d148182be100c25d5b04baa9611ebd4abd87.tar.xz |
gtest more
-rw-r--r-- | paludis/util/files.m4 | 2 | ||||
-rw-r--r-- | paludis/util/hashes_TEST.cc | 40 |
2 files changed, 17 insertions, 25 deletions
diff --git a/paludis/util/files.m4 b/paludis/util/files.m4 index 502419084..9f87c3552 100644 --- a/paludis/util/files.m4 +++ b/paludis/util/files.m4 @@ -42,7 +42,7 @@ add(`fs_error', `hh', `cc') add(`fs_path', `hh', `cc', `fwd', `se', `test', `testscript') add(`fs_stat', `hh', `cc', `fwd', `test', `testscript') add(`graph', `hh', `cc', `fwd', `impl', `test') -add(`hashes', `hh', `cc', `test') +add(`hashes', `hh', `cc', `gtest') add(`iterator_funcs', `hh', `test') add(`indirect_iterator', `hh', `fwd', `impl', `gtest') add(`is_file_with_extension', `hh', `cc', `se', `gtest', `testscript') 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); } |