diff options
author | 2011-03-20 13:09:44 +0000 | |
---|---|---|
committer | 2011-03-20 16:20:41 +0000 | |
commit | 6dbf35311b3b21f242938b03b06bf54847487385 (patch) | |
tree | 7e44ec01790f0dd8c380aec94797b5a4ab5cc1ce | |
parent | a9311ad5b670a53daf9e9767af2ff795ff890110 (diff) | |
download | paludis-6dbf35311b3b21f242938b03b06bf54847487385.tar.gz paludis-6dbf35311b3b21f242938b03b06bf54847487385.tar.xz |
gtest more
-rw-r--r-- | paludis/util/files.m4 | 2 | ||||
-rw-r--r-- | paludis/util/tribool_TEST.cc | 74 |
2 files changed, 30 insertions, 46 deletions
diff --git a/paludis/util/files.m4 b/paludis/util/files.m4 index 7f76816b7..73fe7856c 100644 --- a/paludis/util/files.m4 +++ b/paludis/util/files.m4 @@ -88,7 +88,7 @@ add(`thread', `hh', `cc', `test') add(`thread_pool', `hh', `cc', `test') add(`timestamp', `hh', `cc', `fwd') add(`tokeniser', `hh', `cc', `test') -add(`tribool', `hh', `cc', `fwd', `test') +add(`tribool', `hh', `cc', `fwd', `gtest') add(`type_list', `hh', `cc', `fwd') add(`util', `hh') add(`visitor', `hh', `cc', `fwd', `impl') diff --git a/paludis/util/tribool_TEST.cc b/paludis/util/tribool_TEST.cc index cd418fd76..c381ab5ee 100644 --- a/paludis/util/tribool_TEST.cc +++ b/paludis/util/tribool_TEST.cc @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2008 Ciaran McCreesh + * Copyright (c) 2008, 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,56 +18,40 @@ */ #include <paludis/util/tribool.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(Tribool, DefaultCtor) { - struct TriboolDefaultCtorTest : TestCase - { - TriboolDefaultCtorTest() : TestCase("default ctor") { } - - void run() - { - Tribool b; - TEST_CHECK(b.is_false()); - TEST_CHECK(! b.is_true()); - TEST_CHECK(! b.is_indeterminate()); - } - } test_default_ctor; - - struct TriboolBoolCtorTest : TestCase - { - TriboolBoolCtorTest() : TestCase("bool ctor") { } - - void run() - { - Tribool b(true); - TEST_CHECK(! b.is_false()); - TEST_CHECK(b.is_true()); - TEST_CHECK(! b.is_indeterminate()); + Tribool b; + EXPECT_TRUE(b.is_false()); + EXPECT_TRUE(! b.is_true()); + EXPECT_TRUE(! b.is_indeterminate()); +} - Tribool f(false); - TEST_CHECK(f.is_false()); - TEST_CHECK(! f.is_true()); - TEST_CHECK(! f.is_indeterminate()); - } - } test_bool_ctor; +TEST(Tribool, TrueCtor) +{ + Tribool b(true); + EXPECT_TRUE(! b.is_false()); + EXPECT_TRUE(b.is_true()); + EXPECT_TRUE(! b.is_indeterminate()); +} - struct TriboolIndetCtorTest : TestCase - { - TriboolIndetCtorTest() : TestCase("indet ctor") { } +TEST(Tribool, FalseCtor) +{ + Tribool f(false); + EXPECT_TRUE(f.is_false()); + EXPECT_TRUE(! f.is_true()); + EXPECT_TRUE(! f.is_indeterminate()); +} - void run() - { - Tribool b(indeterminate); - TEST_CHECK(! b.is_false()); - TEST_CHECK(! b.is_true()); - TEST_CHECK(b.is_indeterminate()); - } - } test_indet_ctor; +TEST(Tribool, IndetCtor) +{ + Tribool b(indeterminate); + EXPECT_TRUE(! b.is_false()); + EXPECT_TRUE(! b.is_true()); + EXPECT_TRUE(b.is_indeterminate()); } |