diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2020-12-18 18:04:24 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2020-12-18 18:04:24 +0000 |
commit | 495a3884c89aec21031b810599fe163aa1bce319 (patch) | |
tree | 6dc32ae07fc0d5073139e59a43cbe3928be3b94c | |
parent | Fix header in testAccept (diff) | |
download | icespider-495a3884c89aec21031b810599fe163aa1bce319.tar.bz2 icespider-495a3884c89aec21031b810599fe163aa1bce319.tar.xz icespider-495a3884c89aec21031b810599fe163aa1bce319.zip |
Fix memory of units in test case
-rw-r--r-- | icespider/unittests/testCompile.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/icespider/unittests/testCompile.cpp b/icespider/unittests/testCompile.cpp index 811de52..fa16de3 100644 --- a/icespider/unittests/testCompile.cpp +++ b/icespider/unittests/testCompile.cpp @@ -41,8 +41,10 @@ BOOST_AUTO_TEST_CASE(testLoadConfiguration) Compile::RouteCompiler rc; rc.searchPath.push_back(rootDir); auto cfg = rc.loadConfiguration(rootDir / "testRoutes.json"); - auto u = rc.loadUnits(cfg); - rc.applyDefaults(cfg, u); + BOOST_REQUIRE(cfg); + auto units = rc.loadUnits(cfg); + BOOST_REQUIRE(!units.empty()); + rc.applyDefaults(cfg, units); BOOST_REQUIRE_EQUAL("common", cfg->name); BOOST_REQUIRE_EQUAL(13, cfg->routes.size()); @@ -69,6 +71,10 @@ BOOST_AUTO_TEST_CASE(testLoadConfiguration) BOOST_REQUIRE_EQUAL(1, cfg->slices.size()); BOOST_REQUIRE_EQUAL("test-api.ice", cfg->slices[0]); + + for (auto & u : units) { + u.second->destroy(); + } } BOOST_AUTO_TEST_CASE(testRouteCompile) |