]> granicus.if.org Git - icinga2/commitdiff
Fixed unit tests.
authorGunnar Beutner <gunnar.beutner@netways.de>
Fri, 14 Sep 2012 09:41:15 +0000 (11:41 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Fri, 14 Sep 2012 09:41:15 +0000 (11:41 +0200)
test/Makefile.am
test/base-dictionary.cpp

index 305b6e06cd10ef3bdec59fc48cbf339ef0f85554..11c288a9d21d5623c06488533f9b6cd66d529af7 100644 (file)
@@ -11,14 +11,12 @@ base_dictionary_SOURCES = \
 
 base_dictionary_CPPFLAGS = \
        $(BOOST_CPPFLAGS) \
-       -I${top_srcdir}/base \
-       -I${top_srcdir}/jsonrpc \
-       -I${top_srcdir}/icinga \
+       -I${top_srcdir}/lib/base \
+       -I${top_srcdir}/lib/icinga \
        -I${top_srcdir}
 
 base_dictionary_LDADD = \
        $(BOOST_LDFLAGS) \
        $(BOOST_UNIT_TEST_FRAMEWORK_LIB) \
-       ${top_builddir}/base/libbase.la \
-       ${top_builddir}/jsonrpc/libjsonrpc.la \
-       ${top_builddir}/icinga/libicinga.la
+       ${top_builddir}/lib/base/libbase.la \
+       ${top_builddir}/lib/icinga/libicinga.la
index 0af73d52511d658ac8703d1f6fec4a442222c50f..d09b74fc86b3d743de167edf77978a7c4d228c3b 100644 (file)
@@ -17,16 +17,17 @@ BOOST_AUTO_TEST_CASE(getproperty)
        dictionary->Set("test1", 7);
        dictionary->Set("test2", "hello world");
 
-       long test1;
-       BOOST_REQUIRE(dictionary->Get("test1", &test1));
+       Value test1;
+       test1 = dictionary->Get("test1");
        BOOST_REQUIRE(test1 == 7);
 
-       string test2;
-       BOOST_REQUIRE(dictionary->Get("test2", &test2));
+       Value test2;
+       test2 = dictionary->Get("test2");
        BOOST_REQUIRE(test2 == "hello world");
 
-       long test3;
-       BOOST_REQUIRE(!dictionary->Get("test3", &test3));
+       Value test3;
+       test3 = dictionary->Get("test3");
+       BOOST_REQUIRE(test3.IsEmpty());
 }
 
 BOOST_AUTO_TEST_CASE(getproperty_dict)
@@ -36,12 +37,11 @@ BOOST_AUTO_TEST_CASE(getproperty_dict)
 
        dictionary->Set("test1", other);
 
-       Dictionary::Ptr test1;
-       BOOST_REQUIRE(dictionary->Get("test1", &test1));
+       Dictionary::Ptr test1 = dictionary->Get("test1");
        BOOST_REQUIRE(other == test1);
 
-       Dictionary::Ptr test2;
-       BOOST_REQUIRE(!dictionary->Get("test2", &test2));
+       Dictionary::Ptr test2 = dictionary->Get("test2");
+       BOOST_REQUIRE(!test2);
 }
 
 BOOST_AUTO_TEST_CASE(unnamed)