diff options
author | 2011-03-20 15:08:45 +0000 | |
---|---|---|
committer | 2011-03-20 16:20:42 +0000 | |
commit | 6d16f1563c4c584302229ed72ffcff506ae06f6f (patch) | |
tree | 8db0775c34449ac2b3ef23a04272b13a663cedb9 | |
parent | fe95b916ffefaae70fec38fc79adf13af093f98f (diff) | |
download | paludis-6d16f1563c4c584302229ed72ffcff506ae06f6f.tar.gz paludis-6d16f1563c4c584302229ed72ffcff506ae06f6f.tar.xz |
gtest more
-rw-r--r-- | paludis/util/files.m4 | 2 | ||||
-rw-r--r-- | paludis/util/return_literal_function_TEST.cc | 21 |
2 files changed, 7 insertions, 16 deletions
diff --git a/paludis/util/files.m4 b/paludis/util/files.m4 index b3a3d822c..fd2231f52 100644 --- a/paludis/util/files.m4 +++ b/paludis/util/files.m4 @@ -67,7 +67,7 @@ add(`pty', `hh', `cc', `test') add(`random', `hh', `cc', `test') add(`realpath', `hh', `cc', `test', `testscript') add(`remove_shared_ptr', `hh') -add(`return_literal_function', `hh', `cc', `fwd', `test') +add(`return_literal_function', `hh', `cc', `fwd', `gtest') add(`rmd160', `hh', `cc', `gtest') add(`safe_ifstream', `hh', `cc', `fwd', `gtest', `testscript') add(`safe_ofstream', `hh', `cc', `gtest', `testscript') diff --git a/paludis/util/return_literal_function_TEST.cc b/paludis/util/return_literal_function_TEST.cc index d8001121e..4efabbce4 100644 --- a/paludis/util/return_literal_function_TEST.cc +++ b/paludis/util/return_literal_function_TEST.cc @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2009 Ciaran McCreesh + * Copyright (c) 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 @@ -18,23 +18,14 @@ */ #include <paludis/util/return_literal_function.hh> -#include <test/test_framework.hh> -#include <test/test_runner.hh> + +#include <gtest/gtest.h> using namespace paludis; -using namespace test; -namespace test_cases +TEST(ReturnLiteralFunction, Int) { - struct ReturnLiteralFunctionTest : TestCase - { - ReturnLiteralFunctionTest() : TestCase("return literal") { } - - void run() - { - const std::function<int ()> f = return_literal_function(3); - TEST_CHECK_EQUAL(f(), 3); - } - } test_return_literal_function; + const std::function<int ()> f = return_literal_function(3); + EXPECT_EQ(3, f()); } |