]> granicus.if.org Git - icinga2/commitdiff
Redo tests
authorJean-Marcel Flach <jean-marcel.flach@netways.de>
Fri, 10 Jul 2015 12:54:46 +0000 (14:54 +0200)
committerJean-Marcel Flach <jean-marcel.flach@netways.de>
Fri, 10 Jul 2015 12:54:46 +0000 (14:54 +0200)
refs #9470

test/base-url.cpp

index 301cb238d41de3f6f0ef054f48e818f375334635..a15aa096a973b98f32a7b2202175061cdd736aec 100644 (file)
@@ -24,9 +24,6 @@
 
 using namespace icinga;
 
-#define VALID(X)   BOOST_CHECK(new Url(X))
-#define INVALID(X) BOOST_CHECK_THROW(new Url(X), std::invalid_argument)
-
 BOOST_AUTO_TEST_SUITE(base_url)
 
 BOOST_AUTO_TEST_CASE(id_and_path)
@@ -74,12 +71,18 @@ BOOST_AUTO_TEST_CASE(format)
 
 BOOST_AUTO_TEST_CASE(illegal_legal_strings)
 {
-       INVALID("/?foo=barr&foo[]=bazz");       VALID("/?foo=baz??&\?\?=/?");
-       INVALID("/?]=gar");                                     VALID("/");
-       INVALID("/#?[]");                                       VALID("///////");
-       INVALID("/?foo=bar&foo=ba");            VALID("/??[]=?#?=?");
-       INVALID("/?foo=bar&[]=d");                      VALID("http://foo/#bar");
-       INVALID("/?fo=&bar=garOA");                     VALID("//foo/");
+       BOOST_CHECK_THROW(new Url("/?foo=barr&foo[]=bazz"), std::invalid_argument);
+       BOOST_CHECK_THROW(new Url("/?]=gar"), std::invalid_argument);
+       BOOST_CHECK_THROW(new Url("/#?[]"), std::invalid_argument);
+       BOOST_CHECK_THROW(new Url("/?foo=bar&foo=ba"), std::invalid_argument);
+       BOOST_CHECK_THROW(new Url("/?foo=bar&[]=d"), std::invalid_argument);
+       BOOST_CHECK_THROW(new Url("/?fo=&bar=garOA"), std::invalid_argument);
+       BOOST_CHECK(new Url("/?foo=baz??&\?\?=/?"));
+       BOOST_CHECK(new Url("/"));
+       BOOST_CHECK(new Url("///////"));
+       BOOST_CHECK(new Url("/??[]=?#?=?"));
+       BOOST_CHECK(new Url("http://foo/#bar"));
+       BOOST_CHECK(new Url("//foo/"));
 }
 
 BOOST_AUTO_TEST_SUITE_END()