aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-03-20 00:10:01 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-03-20 16:20:41 +0000
commit40a463a9aaa1ba649e2b13fb60f8cf08ade9838f (patch)
treec68fa891d76a60b1a697d4d1e8371d23c4f570af
parentfcd8650e2aaa5f5e3de0c867f34da2656a3524f3 (diff)
downloadpaludis-40a463a9aaa1ba649e2b13fb60f8cf08ade9838f.tar.gz
paludis-40a463a9aaa1ba649e2b13fb60f8cf08ade9838f.tar.xz
gtest more
-rw-r--r--paludis/util/active_object_ptr_TEST.cc54
-rw-r--r--paludis/util/files.m42
2 files changed, 17 insertions, 39 deletions
diff --git a/paludis/util/active_object_ptr_TEST.cc b/paludis/util/active_object_ptr_TEST.cc
index 6d204f2..fcae327 100644
--- a/paludis/util/active_object_ptr_TEST.cc
+++ b/paludis/util/active_object_ptr_TEST.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008, 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2008, 2009, 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,49 +18,27 @@
*/
#include <paludis/util/active_object_ptr.hh>
-#include <test/test_runner.hh>
-#include <test/test_framework.hh>
-#include <test/test_concepts.hh>
+
+#include <gtest/gtest.h>
using namespace paludis;
-using namespace test;
-namespace test_cases
+TEST(ActiveObjectPtr, Dereference)
{
- typedef ActiveObjectPtr<int *> ActiveIntPtr;
- TESTCASE_SEMIREGULAR(ActiveIntPtr, ActiveIntPtr(new int(10)));
-
- typedef ActiveObjectPtr<std::shared_ptr<int> > ActiveSharedIntPtr;
- TESTCASE_SEMIREGULAR(ActiveSharedIntPtr, ActiveSharedIntPtr(std::make_shared<int>(10)));
-
- struct TestDereference : TestCase
- {
- TestDereference() : TestCase("dereference") { }
-
- void run()
- {
- ActiveObjectPtr<std::string *> p(new std::string("monkey"));
- TEST_CHECK_EQUAL(p->length(), 6u);
+ ActiveObjectPtr<std::string *> p(new std::string("monkey"));
+ EXPECT_EQ(6u, p->length());
- ActiveObjectPtr<std::shared_ptr<std::string> > q(
- std::make_shared<std::string>("chimp"));
- TEST_CHECK_EQUAL(q->length(), 5u);
- }
- } test_dereference;
-
- struct TestValue : TestCase
- {
- TestValue() : TestCase("value") { }
+ ActiveObjectPtr<std::shared_ptr<std::string> > q(std::make_shared<std::string>("chimp"));
+ EXPECT_EQ(5u, q->length());
+}
- void run()
- {
- ActiveObjectPtr<std::string *> p(new std::string("monkey"));
- TEST_CHECK_EQUAL(p.value()->length(), 6u);
+TEST(ActiveObjectPtr, Value)
+{
+ ActiveObjectPtr<std::string *> p(new std::string("monkey"));
+ EXPECT_EQ(6u, p.value()->length());
- ActiveObjectPtr<std::shared_ptr<std::string> > q(
- std::make_shared<std::string>("chimp"));
- TEST_CHECK_EQUAL(q.value()->length(), 5u);
- }
- } test_value;
+ ActiveObjectPtr<std::shared_ptr<std::string> > q(
+ std::make_shared<std::string>("chimp"));
+ EXPECT_EQ(5u, q.value()->length());
}
diff --git a/paludis/util/files.m4 b/paludis/util/files.m4
index 0333b25..3d65023 100644
--- a/paludis/util/files.m4
+++ b/paludis/util/files.m4
@@ -10,7 +10,7 @@ dnl on this file at present...
add(`accept_visitor', `hh')
add(`action_queue', `hh', `cc', `gtest')
-add(`active_object_ptr', `hh', `cc', `fwd', `test')
+add(`active_object_ptr', `hh', `cc', `fwd', `gtest')
add(`attributes', `hh')
add(`buffer_output_stream', `hh', `cc', `fwd', `test')
add(`byte_swap', `hh', `test')