diff options
author | 2011-03-19 22:41:05 +0000 | |
---|---|---|
committer | 2011-03-20 16:20:40 +0000 | |
commit | 3d33c91fdd23f937291ec341eff58498ef090ca6 (patch) | |
tree | 8e94a84727d12506294c9d67e3047d0c24647070 | |
parent | c9b51672c21efcc2e52e4a744a0e4d7ca5406dea (diff) | |
download | paludis-3d33c91fdd23f937291ec341eff58498ef090ca6.tar.gz paludis-3d33c91fdd23f937291ec341eff58498ef090ca6.tar.xz |
More gtesting
-rw-r--r-- | paludis/util/extract_host_from_url_TEST.cc | 34 | ||||
-rw-r--r-- | paludis/util/files.m4 | 2 |
2 files changed, 18 insertions, 18 deletions
diff --git a/paludis/util/extract_host_from_url_TEST.cc b/paludis/util/extract_host_from_url_TEST.cc index ad3e90319..43225b0b3 100644 --- a/paludis/util/extract_host_from_url_TEST.cc +++ b/paludis/util/extract_host_from_url_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,24 +18,24 @@ */ #include <paludis/util/extract_host_from_url.hh> -#include <test/test_runner.hh> -#include <test/test_framework.hh> + +#include <gtest/gtest.h> using namespace paludis; -using namespace test; -namespace test_cases +TEST(ExtractHostFromURL, Empty) +{ + EXPECT_EQ("", extract_host_from_url("")); +} + +TEST(ExtractHostFromURL, NoPath) { - struct TestExtractHostFromURL : TestCase - { - TestExtractHostFromURL() : TestCase("extract host from url") { } - - void run() - { - TEST_CHECK_EQUAL(extract_host_from_url(""), ""); - TEST_CHECK_EQUAL(extract_host_from_url("http://foo"), "foo"); - TEST_CHECK_EQUAL(extract_host_from_url("http://foo/bar"), "foo"); - TEST_CHECK_EQUAL(extract_host_from_url("http://foo/bar/baz"), "foo"); - } - } test_extract_host_from_url; + EXPECT_EQ("foo", extract_host_from_url("http://foo")); } + +TEST(ExtractHostFromURL, WithPath) +{ + EXPECT_EQ("foo", extract_host_from_url("http://foo/bar")); + EXPECT_EQ("foo", extract_host_from_url("http://foo/bar/baz")); +} + diff --git a/paludis/util/files.m4 b/paludis/util/files.m4 index ca8ff77e7..6e8d32b0e 100644 --- a/paludis/util/files.m4 +++ b/paludis/util/files.m4 @@ -34,7 +34,7 @@ add(`elf_types', `hh') add(`enum_iterator', `hh', `cc', `fwd', `gtest') add(`exception', `hh', `cc') add(`executor', `hh', `cc', `fwd') -add(`extract_host_from_url', `hh', `cc', `fwd', `test') +add(`extract_host_from_url', `hh', `cc', `fwd', `gtest') add(`fd_holder', `hh') add(`fs_iterator', `hh', `cc', `fwd', `se', `test', `testscript') add(`fs_error', `hh', `cc') |