Fixed unit tests.

This commit is contained in:
Gunnar Beutner 2012-09-14 11:41:15 +02:00
parent 5c5db5b3a5
commit 46ff4a9857
2 changed files with 14 additions and 16 deletions

View File

@ -11,14 +11,12 @@ base_dictionary_SOURCES = \
base_dictionary_CPPFLAGS = \ base_dictionary_CPPFLAGS = \
$(BOOST_CPPFLAGS) \ $(BOOST_CPPFLAGS) \
-I${top_srcdir}/base \ -I${top_srcdir}/lib/base \
-I${top_srcdir}/jsonrpc \ -I${top_srcdir}/lib/icinga \
-I${top_srcdir}/icinga \
-I${top_srcdir} -I${top_srcdir}
base_dictionary_LDADD = \ base_dictionary_LDADD = \
$(BOOST_LDFLAGS) \ $(BOOST_LDFLAGS) \
$(BOOST_UNIT_TEST_FRAMEWORK_LIB) \ $(BOOST_UNIT_TEST_FRAMEWORK_LIB) \
${top_builddir}/base/libbase.la \ ${top_builddir}/lib/base/libbase.la \
${top_builddir}/jsonrpc/libjsonrpc.la \ ${top_builddir}/lib/icinga/libicinga.la
${top_builddir}/icinga/libicinga.la

View File

@ -17,16 +17,17 @@ BOOST_AUTO_TEST_CASE(getproperty)
dictionary->Set("test1", 7); dictionary->Set("test1", 7);
dictionary->Set("test2", "hello world"); dictionary->Set("test2", "hello world");
long test1; Value test1;
BOOST_REQUIRE(dictionary->Get("test1", &test1)); test1 = dictionary->Get("test1");
BOOST_REQUIRE(test1 == 7); BOOST_REQUIRE(test1 == 7);
string test2; Value test2;
BOOST_REQUIRE(dictionary->Get("test2", &test2)); test2 = dictionary->Get("test2");
BOOST_REQUIRE(test2 == "hello world"); BOOST_REQUIRE(test2 == "hello world");
long test3; Value test3;
BOOST_REQUIRE(!dictionary->Get("test3", &test3)); test3 = dictionary->Get("test3");
BOOST_REQUIRE(test3.IsEmpty());
} }
BOOST_AUTO_TEST_CASE(getproperty_dict) BOOST_AUTO_TEST_CASE(getproperty_dict)
@ -36,12 +37,11 @@ BOOST_AUTO_TEST_CASE(getproperty_dict)
dictionary->Set("test1", other); dictionary->Set("test1", other);
Dictionary::Ptr test1; Dictionary::Ptr test1 = dictionary->Get("test1");
BOOST_REQUIRE(dictionary->Get("test1", &test1));
BOOST_REQUIRE(other == test1); BOOST_REQUIRE(other == test1);
Dictionary::Ptr test2; Dictionary::Ptr test2 = dictionary->Get("test2");
BOOST_REQUIRE(!dictionary->Get("test2", &test2)); BOOST_REQUIRE(!test2);
} }
BOOST_AUTO_TEST_CASE(unnamed) BOOST_AUTO_TEST_CASE(unnamed)