aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-03-20 12:45:27 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-03-20 16:20:41 +0000
commit549dc011420fa1a14b5b62a802db2cdf5a965412 (patch)
treea0d2d22e09592990f93db9e2f7b8915821cd0470
parent176b06a0d389684d24825719464250c6d86f6d2f (diff)
downloadpaludis-549dc011420fa1a14b5b62a802db2cdf5a965412.tar.gz
paludis-549dc011420fa1a14b5b62a802db2cdf5a965412.tar.xz
gtest more
-rw-r--r--paludis/util/files.m42
-rw-r--r--paludis/util/wrapped_forward_iterator_TEST.cc34
2 files changed, 14 insertions, 22 deletions
diff --git a/paludis/util/files.m4 b/paludis/util/files.m4
index e9c4a2c..194cd7f 100644
--- a/paludis/util/files.m4
+++ b/paludis/util/files.m4
@@ -94,7 +94,7 @@ add(`util', `hh')
add(`visitor', `hh', `cc', `fwd', `impl')
add(`visitor_cast', `hh', `cc', `fwd')
add(`wildcard_expander', `hh', `cc', `test', `testscript')
-add(`wrapped_forward_iterator', `hh', `fwd', `impl', `test')
+add(`wrapped_forward_iterator', `hh', `fwd', `impl', `gtest')
add(`wrapped_output_iterator', `hh', `fwd', `impl')
add(`wrapped_value', `hh', `fwd', `impl', `gtest')
diff --git a/paludis/util/wrapped_forward_iterator_TEST.cc b/paludis/util/wrapped_forward_iterator_TEST.cc
index 53aef37..b9fd4e2 100644
--- a/paludis/util/wrapped_forward_iterator_TEST.cc
+++ b/paludis/util/wrapped_forward_iterator_TEST.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2009 Ciaran McCreesh
+ * Copyright (c) 2007, 2009, 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
@@ -20,12 +20,12 @@
#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <paludis/util/join.hh>
#include <paludis/util/iterator_funcs.hh>
-#include <test/test_runner.hh>
-#include <test/test_framework.hh>
+
#include <vector>
#include <list>
-using namespace test;
+#include <gtest/gtest.h>
+
using namespace paludis;
namespace paludis
@@ -37,23 +37,15 @@ namespace paludis
};
}
-namespace test_cases
+TEST(WrappedForwardIterator, Works)
{
- struct WrappedForwardIteratorTest : TestCase
- {
- WrappedForwardIteratorTest() : TestCase("wrapped_forward_iterator") { }
-
- void run()
- {
- std::list<int> l;
- l.push_back(1);
- l.push_back(2);
- l.push_back(3);
-
- typedef WrappedForwardIterator<void, int> I;
- TEST_CHECK_EQUAL(join(I(l.begin()), I(l.end()), ", "), "1, 2, 3");
- TEST_CHECK(I(l.begin()).underlying_iterator<std::list<int>::iterator>() == l.begin());
- }
- } test_wrapped_forward_iterator;
+ std::list<int> l;
+ l.push_back(1);
+ l.push_back(2);
+ l.push_back(3);
+
+ typedef WrappedForwardIterator<void, int> I;
+ ASSERT_EQ("1, 2, 3", join(I(l.begin()), I(l.end()), ", "));
+ ASSERT_TRUE(I(l.begin()).underlying_iterator<std::list<int>::iterator>() == l.begin());
}