diff options
author | 2011-03-20 19:57:22 +0000 | |
---|---|---|
committer | 2011-03-20 19:57:22 +0000 | |
commit | 55dc95f473d02b4fc0ea0634e20719d5505a0fe6 (patch) | |
tree | 52f49c2d06cc407c83e09e1c36e2d0eea1a4599b | |
parent | 6c450b30438db98c1dea5cdfb1ac6b17c6af67f5 (diff) | |
download | paludis-55dc95f473d02b4fc0ea0634e20719d5505a0fe6.tar.gz paludis-55dc95f473d02b4fc0ea0634e20719d5505a0fe6.tar.xz |
gtest more
-rw-r--r-- | paludis/util/create_iterator_TEST.cc | 32 | ||||
-rw-r--r-- | paludis/util/files.m4 | 2 |
2 files changed, 13 insertions, 21 deletions
diff --git a/paludis/util/create_iterator_TEST.cc b/paludis/util/create_iterator_TEST.cc index 9c2ae36c1..db8482e31 100644 --- a/paludis/util/create_iterator_TEST.cc +++ b/paludis/util/create_iterator_TEST.cc @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2007 Ciaran McCreesh + * Copyright (c) 2007, 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 @@ -19,13 +19,13 @@ #include <paludis/util/create_iterator-impl.hh> #include <paludis/util/join.hh> + #include <algorithm> #include <vector> -#include <test/test_framework.hh> -#include <test/test_runner.hh> + +#include <gtest/gtest.h> using namespace paludis; -using namespace test; namespace { @@ -46,24 +46,16 @@ namespace } } -namespace test_cases +TEST(CreateIterator, Works) { - struct CreateIteratorTest : TestCase - { - CreateIteratorTest() : TestCase("create iterator") { } + std::vector<int> x; + x.push_back(1); + x.push_back(2); + x.push_back(3); - void run() - { - std::vector<int> x; - x.push_back(1); - x.push_back(2); - x.push_back(3); - - std::vector<Foo> y; - std::copy(x.begin(), x.end(), create_inserter<Foo>(std::back_inserter(y))); + std::vector<Foo> y; + std::copy(x.begin(), x.end(), create_inserter<Foo>(std::back_inserter(y))); - TEST_CHECK_EQUAL(join(y.begin(), y.end(), " "), "<1> <2> <3>"); - } - } create_iterator_test; + EXPECT_EQ("<1> <2> <3>", join(y.begin(), y.end(), " ")); } diff --git a/paludis/util/files.m4 b/paludis/util/files.m4 index c5b8c3ff4..f3ad1f640 100644 --- a/paludis/util/files.m4 +++ b/paludis/util/files.m4 @@ -20,7 +20,7 @@ add(`clone', `hh', `impl') add(`config_file', `hh', `cc', `fwd', `se', `test', `testscript') add(`condition_variable', `hh', `cc', `test') add(`cookie', `hh', `cc') -add(`create_iterator', `hh', `fwd', `impl', `test') +add(`create_iterator', `hh', `fwd', `impl', `gtest') add(`damerau_levenshtein', `hh', `cc', `gtest') add(`destringify', `hh', `cc', `gtest') add(`deferred_construction_ptr', `hh', `cc', `fwd', `gtest') |