diff options
-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()); } |