aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-03-20 19:21:20 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-03-20 19:21:20 +0000
commitb139d148182be100c25d5b04baa9611ebd4abd87 (patch)
tree639490f4fc58638a230c9e277b12ada4bbff26ae
parentf475a230cc53eb170cdbdd7589250b253f24e37b (diff)
downloadpaludis-b139d148182be100c25d5b04baa9611ebd4abd87.tar.gz
paludis-b139d148182be100c25d5b04baa9611ebd4abd87.tar.xz
gtest more
-rw-r--r--paludis/util/files.m42
-rw-r--r--paludis/util/hashes_TEST.cc40
2 files changed, 17 insertions, 25 deletions
diff --git a/paludis/util/files.m4 b/paludis/util/files.m4
index 5024190..9f87c35 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 46ada4e..2cf3ea5 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);
}