aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-03-20 12:43:53 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-03-20 16:20:41 +0000
commit176b06a0d389684d24825719464250c6d86f6d2f (patch)
treede135fbc8c5d218fb4c80bf45c77d571db251980
parent77bcfa0f5b9b75d80d51639a65d662de84251d89 (diff)
downloadpaludis-176b06a0d389684d24825719464250c6d86f6d2f.tar.gz
paludis-176b06a0d389684d24825719464250c6d86f6d2f.tar.xz
gtest more
-rw-r--r--paludis/util/files.m42
-rw-r--r--paludis/util/wrapped_value_TEST.cc50
2 files changed, 23 insertions, 29 deletions
diff --git a/paludis/util/files.m4 b/paludis/util/files.m4
index 4a303dd..e9c4a2c 100644
--- a/paludis/util/files.m4
+++ b/paludis/util/files.m4
@@ -96,5 +96,5 @@ add(`visitor_cast', `hh', `cc', `fwd')
add(`wildcard_expander', `hh', `cc', `test', `testscript')
add(`wrapped_forward_iterator', `hh', `fwd', `impl', `test')
add(`wrapped_output_iterator', `hh', `fwd', `impl')
-add(`wrapped_value', `hh', `fwd', `impl', `test')
+add(`wrapped_value', `hh', `fwd', `impl', `gtest')
diff --git a/paludis/util/wrapped_value_TEST.cc b/paludis/util/wrapped_value_TEST.cc
index 59ab39e..451a2a2 100644
--- a/paludis/util/wrapped_value_TEST.cc
+++ b/paludis/util/wrapped_value_TEST.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2010 Ciaran McCreesh
+ * Copyright (c) 2010, 2011 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -18,11 +18,11 @@
*/
#include <paludis/util/wrapped_value-impl.hh>
-#include <test/test_framework.hh>
-#include <test/test_runner.hh>
+
#include <string>
-using namespace test;
+#include <gtest/gtest.h>
+
using namespace paludis;
namespace
@@ -75,33 +75,27 @@ namespace paludis
};
}
-namespace test_cases
+TEST(Dormouse, Works)
{
- struct DormouseTest : TestCase
- {
- DormouseTest() : TestCase("dormouse tests") { }
+ Dormouse dormouse("glis glis");
+ ASSERT_EQ("glis glis", dormouse.value());
- void run()
- {
- Dormouse dormouse("glis glis");
- TEST_CHECK_EQUAL(dormouse.value(), "glis glis");
- dormouse = Dormouse("muscardinus avellanarius");
- TEST_CHECK_EQUAL(dormouse.value(), "muscardinus avellanarius");
- TEST_CHECK_THROWS(dormouse = Dormouse("mesocricetus auratus"), NotADormouseError);
- }
- } test_dormouse;
+ dormouse = Dormouse("muscardinus avellanarius");
+ ASSERT_EQ( "muscardinus avellanarius", dormouse.value());
+}
- struct CheeseTest : TestCase
- {
- CheeseTest() : TestCase("cheese tests") { }
+TEST(Dormouse, Throws)
+{
+ Dormouse dormouse("glis glis");
+ ASSERT_THROW(dormouse = Dormouse("mesocricetus auratus"), NotADormouseError);
+}
- void run()
- {
- Cheese cheese("stilton", false);
- TEST_CHECK_THROWS(cheese = Cheese("camembert", true), NoCheeseError);
- cheese = Cheese("camembert", false);
- TEST_CHECK_EQUAL(cheese.value(), "camembert");
- }
- } test_cheese;
+TEST(Cheese, Works)
+{
+ Cheese cheese("stilton", false);
+ ASSERT_THROW(cheese = Cheese("camembert", true), NoCheeseError);
+
+ cheese = Cheese("camembert", false);
+ ASSERT_EQ("camembert", cheese.value());
}