Fix build error when using boost 1.59

fixes #9814

Signed-off-by: Gunnar Beutner <gunnar@beutner.name>
This commit is contained in:
Paul Richards 2015-08-02 15:18:45 +01:00 committed by Gunnar Beutner
parent 53e9061dcf
commit 70457b2e5a
1 changed files with 10 additions and 10 deletions

View File

@ -38,7 +38,7 @@ struct GlobalConfigFixture {
GlobalConfigFixture() GlobalConfigFixture()
: TestConfig("test-config.conf") : TestConfig("test-config.conf")
{ {
BOOST_MESSAGE("setup global config fixture"); BOOST_TEST_MESSAGE("setup global config fixture");
String cfg_file_path = TestConfig; String cfg_file_path = TestConfig;
String cfg_file_path_tmp = TestConfig + ".tmp"; String cfg_file_path_tmp = TestConfig + ".tmp";
@ -76,7 +76,7 @@ struct GlobalConfigFixture {
<< boost::errinfo_file_name(cfg_file_path_tmp)); << boost::errinfo_file_name(cfg_file_path_tmp));
} }
BOOST_MESSAGE( "Preparing config objects..."); BOOST_TEST_MESSAGE( "Preparing config objects...");
/* start the Icinga application and load the configuration */ /* start the Icinga application and load the configuration */
Application::DeclareApplicationType("icinga/IcingaApplication"); Application::DeclareApplicationType("icinga/IcingaApplication");
@ -98,7 +98,7 @@ struct GlobalConfigFixture {
~GlobalConfigFixture() ~GlobalConfigFixture()
{ {
BOOST_MESSAGE("cleanup global config fixture"); BOOST_TEST_MESSAGE("cleanup global config fixture");
unlink(TestConfig.CStr()); unlink(TestConfig.CStr());
} }
@ -106,6 +106,8 @@ struct GlobalConfigFixture {
String TestConfig; String TestConfig;
}; };
BOOST_GLOBAL_FIXTURE(GlobalConfigFixture);
struct LocalFixture { struct LocalFixture {
LocalFixture() { } LocalFixture() { }
~LocalFixture() { } ~LocalFixture() { }
@ -139,20 +141,18 @@ String LivestatusQueryHelper(const std::vector<String>& lines)
break; break;
} }
BOOST_MESSAGE("Query Result: " + output); BOOST_TEST_MESSAGE("Query Result: " + output);
return output; return output;
} }
//____________________________________________________________________________// //____________________________________________________________________________//
BOOST_GLOBAL_FIXTURE(GlobalConfigFixture)
BOOST_FIXTURE_TEST_SUITE(livestatus, LocalFixture) BOOST_FIXTURE_TEST_SUITE(livestatus, LocalFixture)
BOOST_AUTO_TEST_CASE(hosts) BOOST_AUTO_TEST_CASE(hosts)
{ {
BOOST_MESSAGE( "Querying Livestatus..."); BOOST_TEST_MESSAGE( "Querying Livestatus...");
std::vector<String> lines; std::vector<String> lines;
lines.push_back("GET hosts"); lines.push_back("GET hosts");
@ -177,12 +177,12 @@ BOOST_AUTO_TEST_CASE(hosts)
BOOST_CHECK(res1->Contains("127.0.0.1") || res2->Contains("127.0.0.1")); BOOST_CHECK(res1->Contains("127.0.0.1") || res2->Contains("127.0.0.1"));
BOOST_CHECK(res1->Contains("127.0.0.2") || res2->Contains("127.0.0.2")); BOOST_CHECK(res1->Contains("127.0.0.2") || res2->Contains("127.0.0.2"));
BOOST_MESSAGE("Done with testing livestatus hosts..."); BOOST_TEST_MESSAGE("Done with testing livestatus hosts...");
} }
BOOST_AUTO_TEST_CASE(services) BOOST_AUTO_TEST_CASE(services)
{ {
BOOST_MESSAGE( "Querying Livestatus..."); BOOST_TEST_MESSAGE( "Querying Livestatus...");
std::vector<String> lines; std::vector<String> lines;
lines.push_back("GET services"); lines.push_back("GET services");
@ -205,7 +205,7 @@ BOOST_AUTO_TEST_CASE(services)
BOOST_CHECK(res1->Contains("livestatus") || res2->Contains("livestatus")); //service_description BOOST_CHECK(res1->Contains("livestatus") || res2->Contains("livestatus")); //service_description
BOOST_CHECK(res1->Contains("test livestatus") || res2->Contains("test livestatus")); //notes BOOST_CHECK(res1->Contains("test livestatus") || res2->Contains("test livestatus")); //notes
BOOST_MESSAGE("Done with testing livestatus services..."); BOOST_TEST_MESSAGE("Done with testing livestatus services...");
} }
//____________________________________________________________________________// //____________________________________________________________________________//