]> granicus.if.org Git - icinga2/commitdiff
tests: Ensure IcingaApplication is initialized before adding config 6181/head
authorMarkus Frosch <markus.frosch@icinga.com>
Fri, 23 Mar 2018 12:31:34 +0000 (13:31 +0100)
committerMarkus Frosch <markus.frosch@icinga.com>
Mon, 26 Mar 2018 11:58:12 +0000 (13:58 +0200)
This avoids an ordering problem noticed in Boost 1.55

test/livestatus-fixture.cpp

index 8007b159aa30b5c5b033d2f55bc89c4c7e61ae30..c016ffe951e79c459afb2a9e38c6c79d38a96d78 100644 (file)
@@ -21,6 +21,7 @@
 #include "config/configitem.hpp"
 #include "base/application.hpp"
 #include "base/loader.hpp"
+#include "icingaapplication-fixture.hpp"
 #include <BoostTestTargetConfig.h>
 
 using namespace icinga;
@@ -29,6 +30,9 @@ struct LivestatusFixture
 {
        LivestatusFixture()
        {
+               // ensure IcingaApplication is initialized before we try to add config
+               IcingaApplicationFixture icinga;
+
                BOOST_TEST_MESSAGE("Preparing config objects...");
 
                ConfigItem::RunWithActivationContext(new Function("CreateTestObjects", CreateTestObjects));