]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#1077] Log UT failures in YANG and NETCONF
authorTomek Mrugalski <tomek@isc.org>
Fri, 23 Jul 2021 15:04:59 +0000 (17:04 +0200)
committerTomek Mrugalski <tomek@isc.org>
Mon, 26 Jul 2021 07:10:32 +0000 (07:10 +0000)
 - Reimplemented !1328 (was easier to do it from scratch than
   solve a massive conflict.

21 files changed:
src/bin/netconf/tests/control_socket_unittests.cc
src/bin/netconf/tests/get_config_unittest.cc
src/bin/netconf/tests/netconf_cfg_mgr_unittests.cc
src/bin/netconf/tests/netconf_controller_unittests.cc
src/bin/netconf/tests/netconf_process_unittests.cc
src/bin/netconf/tests/netconf_unittests.cc
src/bin/netconf/tests/parser_unittests.cc
src/lib/yang/tests/adaptor_config_unittests.cc
src/lib/yang/tests/adaptor_host_unittests.cc
src/lib/yang/tests/adaptor_option_unittests.cc
src/lib/yang/tests/adaptor_pool_unittests.cc
src/lib/yang/tests/adaptor_subnet_unittests.cc
src/lib/yang/tests/adaptor_unittests.cc
src/lib/yang/tests/config_unittests.cc
src/lib/yang/tests/translator_control_socket_unittests.cc
src/lib/yang/tests/translator_database_unittests.cc
src/lib/yang/tests/translator_logger_unittests.cc
src/lib/yang/tests/translator_option_data_unittests.cc
src/lib/yang/tests/translator_option_def_unittests.cc
src/lib/yang/tests/translator_pool_unittests.cc
src/lib/yang/tests/translator_unittests.cc

index 5ce429e444a4262c1b1afb97e15a1e51c94a3387..cbc024f17bd0496d5b5417705fc4fb01e18c6c1a 100644 (file)
@@ -104,7 +104,7 @@ TEST(StdoutControlSocketTest, configTest) {
     StdoutControlSocketPtr scs(new StdoutControlSocket(cfg));
     ASSERT_TRUE(scs);
     ConstElementPtr answer;
-    ASSERT_NO_THROW(answer = scs->configTest(ConstElementPtr(), "foo"));
+    ASSERT_NO_THROW_LOG(answer = scs->configTest(ConstElementPtr(), "foo"));
 
     // Check answer.
     ASSERT_TRUE(answer);
@@ -123,7 +123,7 @@ TEST(StdoutControlSocketTest, configSet) {
     ASSERT_TRUE(tscs);
     ConstElementPtr json = Element::fromJSON("{ \"bar\": 1 }");
     ConstElementPtr answer;
-    ASSERT_NO_THROW(answer = tscs->configSet(json, "foo"));
+    ASSERT_NO_THROW_LOG(answer = tscs->configSet(json, "foo"));
 
     // Check answer.
     ASSERT_TRUE(answer);
@@ -577,7 +577,7 @@ public:
 
         // If the thread is ready to go, start the listener.
         if (listener_) {
-            ASSERT_NO_THROW(listener_->start());
+            ASSERT_NO_THROW_LOG(listener_->start());
         }
     }
 
@@ -598,7 +598,7 @@ public:
         // Thread has terminated. We can stop the HTTP
         // listener safely.
         if (listener_) {
-            ASSERT_NO_THROW(listener_->stop());
+            ASSERT_NO_THROW_LOG(listener_->stop());
         }
     }
 
index 9640ac428ade684d5a09275f6cf79024ad2605eb..a6b1734963f1e6d6a881da3af07f8b14f275db0f 100644 (file)
@@ -232,13 +232,13 @@ TEST_F(NetconfGetCfgTest, simple) {
     // get the simple configuration
     std::string simple_file = string(CFG_EXAMPLES) + "/" + "simple-dhcp4.json";
     std::string config;
-    ASSERT_NO_THROW(config = readFile(simple_file));
+    ASSERT_NO_THROW_LOG(config = readFile(simple_file));
 
     // get the expected configuration
     std::string expected_file =
         std::string(NETCONF_TEST_DATA_DIR) + "/" + "get_config.json";
     std::string expected;
-    ASSERT_NO_THROW(expected = readFile(expected_file));
+    ASSERT_NO_THROW_LOG(expected = readFile(expected_file));
 
     // execute the sample configuration
     ASSERT_TRUE(executeConfiguration(config, "simple config"));
@@ -246,26 +246,26 @@ TEST_F(NetconfGetCfgTest, simple) {
     // unparse it
     NetconfConfigPtr context = srv_->getNetconfConfig();
     ConstElementPtr unparsed;
-    ASSERT_NO_THROW(unparsed = context->toElement());
+    ASSERT_NO_THROW_LOG(unparsed = context->toElement());
 
     // dump if wanted else check
     if (generate_action) {
         std::cerr << "// Generated Configuration (remove this line)\n";
-        ASSERT_NO_THROW(expected = prettyPrint(unparsed));
+        ASSERT_NO_THROW_LOG(expected = prettyPrint(unparsed));
         prettyPrint(unparsed, std::cerr, 0, 4);
         std::cerr << "\n";
     } else {
         // get the expected config using the netconf syntax parser
         ElementPtr jsond;
-        ASSERT_NO_THROW(jsond = parseNETCONF(expected, true));
+        ASSERT_NO_THROW_LOG(jsond = parseNETCONF(expected, true));
         // get the expected config using the generic JSON syntax parser
         ElementPtr jsonj;
-        ASSERT_NO_THROW(jsonj = parseJSON(expected));
+        ASSERT_NO_THROW_LOG(jsonj = parseJSON(expected));
         // the generic JSON parser does not handle comments
         EXPECT_TRUE(isEquivalent(jsond, moveComments(jsonj)));
         // replace the path by its actual value
         ConstElementPtr ca;
-        ASSERT_NO_THROW(ca = jsonj->get("Netconf"));
+        ASSERT_NO_THROW_LOG(ca = jsonj->get("Netconf"));
         ASSERT_TRUE(ca);
         pathReplacer(ca);
         // check that unparsed and updated expected values match
@@ -285,7 +285,7 @@ TEST_F(NetconfGetCfgTest, simple) {
     // is it a fixed point?
     NetconfConfigPtr context2 = srv_->getNetconfConfig();
     ConstElementPtr unparsed2;
-    ASSERT_NO_THROW(unparsed2 = context2->toElement());
+    ASSERT_NO_THROW_LOG(unparsed2 = context2->toElement());
     ASSERT_TRUE(unparsed2);
     EXPECT_TRUE(isEquivalent(unparsed, unparsed2));
 }
index 9304bffd6a716295eabe11c0b3c2ef09d408cb15..4b50a8178efc2a84465cc2ed6e8ea59c47c96f60 100644 (file)
@@ -40,11 +40,11 @@ TEST(NetconfCfgMgr, construction) {
     boost::scoped_ptr<NetconfCfgMgr> cfg_mgr;
 
     // Verify that configuration manager constructions without error.
-    ASSERT_NO_THROW(cfg_mgr.reset(new NetconfCfgMgr()));
+    ASSERT_NO_THROW_LOG(cfg_mgr.reset(new NetconfCfgMgr()));
 
     // Verify that the context can be retrieved and is not null.
     NetconfConfigPtr context;
-    ASSERT_NO_THROW(context = cfg_mgr->getNetconfConfig());
+    ASSERT_NO_THROW_LOG(context = cfg_mgr->getNetconfConfig());
     EXPECT_TRUE(context);
 
     // Verify that the manager can be destructed without error.
@@ -56,7 +56,7 @@ TEST(NetconfCfgMgr, getContext) {
     NetconfCfgMgr cfg_mgr;
 
     NetconfConfigPtr ctx;
-    ASSERT_NO_THROW(ctx = cfg_mgr.getNetconfConfig());
+    ASSERT_NO_THROW_LOG(ctx = cfg_mgr.getNetconfConfig());
     ASSERT_TRUE(ctx);
 }
 
@@ -96,7 +96,7 @@ TEST(NetconfCfgMgr, contextServer) {
 
     // Now check the values returned
     EXPECT_EQ(1, ctx.getCfgServersMap()->size());
-    ASSERT_NO_THROW(ctx.getCfgServersMap()->at("d2"));
+    ASSERT_NO_THROW_LOG(ctx.getCfgServersMap()->at("d2"));
     EXPECT_EQ(server1, ctx.getCfgServersMap()->at("d2"));
     EXPECT_THROW(ctx.getCfgServersMap()->at("dhcp4"), std::out_of_range);
 
@@ -105,7 +105,7 @@ TEST(NetconfCfgMgr, contextServer) {
 
     // Should be possible to retrieve two servers
     EXPECT_EQ(2, ctx.getCfgServersMap()->size());
-    ASSERT_NO_THROW(ctx.getCfgServersMap()->at("dhcp6"));
+    ASSERT_NO_THROW_LOG(ctx.getCfgServersMap()->at("dhcp6"));
     EXPECT_EQ(server1, ctx.getCfgServersMap()->at("d2"));
     EXPECT_EQ(server2, ctx.getCfgServersMap()->at("dhcp6"));
 
@@ -113,8 +113,8 @@ TEST(NetconfCfgMgr, contextServer) {
     EXPECT_NO_THROW(ctx.getCfgServersMap()->insert(make_pair("dhcp4", server3)));
     EXPECT_NO_THROW(ctx.getCfgServersMap()->insert(make_pair("ca", server4)));
     EXPECT_EQ(4, ctx.getCfgServersMap()->size());
-    ASSERT_NO_THROW(ctx.getCfgServersMap()->at("dhcp4"));
-    ASSERT_NO_THROW(ctx.getCfgServersMap()->at("ca"));
+    ASSERT_NO_THROW_LOG(ctx.getCfgServersMap()->at("dhcp4"));
+    ASSERT_NO_THROW_LOG(ctx.getCfgServersMap()->at("ca"));
     EXPECT_EQ(server3, ctx.getCfgServersMap()->at("dhcp4"));
     EXPECT_EQ(server4, ctx.getCfgServersMap()->at("ca"));
 }
@@ -162,10 +162,10 @@ TEST(NetconfCfgMgr, contextGlobals) {
     " \"alist\": [ 1, 2, 3 ],\n"
     " \"abool\": true\n"
         "}\n";
-    ASSERT_NO_THROW(global_cfg = Element::fromJSON(global_cfg_str));
+    ASSERT_NO_THROW_LOG(global_cfg = Element::fromJSON(global_cfg_str));
 
     // Extract globals from the config.
-    ASSERT_NO_THROW(ctx.extractConfiguredGlobals(global_cfg));
+    ASSERT_NO_THROW_LOG(ctx.extractConfiguredGlobals(global_cfg));
 
     // Now see if the extract was correct.
     globals = ctx.getConfiguredGlobals();
@@ -439,7 +439,7 @@ TEST_F(NetconfParserTest, configParseEmptyCfgServer) {
     ASSERT_TRUE(ctx);
     ASSERT_TRUE(ctx->getCfgServersMap());
     EXPECT_EQ(1, ctx->getCfgServersMap()->size());
-    ASSERT_NO_THROW(ctx->getCfgServersMap()->at("dhcp4"));
+    ASSERT_NO_THROW_LOG(ctx->getCfgServersMap()->at("dhcp4"));
     CfgServerPtr server = ctx->getCfgServersMap()->at("dhcp4");
     ASSERT_TRUE(server);
     EXPECT_EQ(KEA_DHCP4_SERVER, server->getModel());
@@ -460,7 +460,7 @@ TEST_F(NetconfParserTest, configParseDefaults) {
     ASSERT_TRUE(ctx);
     ASSERT_TRUE(ctx->getCfgServersMap());
     EXPECT_EQ(1, ctx->getCfgServersMap()->size());
-    ASSERT_NO_THROW(ctx->getCfgServersMap()->at("dhcp4"));
+    ASSERT_NO_THROW_LOG(ctx->getCfgServersMap()->at("dhcp4"));
     CfgServerPtr server = ctx->getCfgServersMap()->at("dhcp4");
     ASSERT_TRUE(server);
     EXPECT_EQ(KEA_DHCP4_SERVER, server->getModel());
@@ -485,7 +485,7 @@ TEST_F(NetconfParserTest, configParseServerDhcp4) {
     ASSERT_TRUE(ctx);
     ASSERT_TRUE(ctx->getCfgServersMap());
     EXPECT_EQ(1, ctx->getCfgServersMap()->size());
-    ASSERT_NO_THROW(ctx->getCfgServersMap()->at("dhcp4"));
+    ASSERT_NO_THROW_LOG(ctx->getCfgServersMap()->at("dhcp4"));
     CfgServerPtr server = ctx->getCfgServersMap()->at("dhcp4");
     ASSERT_TRUE(server);
     EXPECT_EQ(KEA_DHCP4_SERVER, server->getModel());
@@ -508,7 +508,7 @@ TEST_F(NetconfParserTest, configParseServerD2) {
     ASSERT_TRUE(ctx);
     ASSERT_TRUE(ctx->getCfgServersMap());
     EXPECT_EQ(1, ctx->getCfgServersMap()->size());
-    ASSERT_NO_THROW(ctx->getCfgServersMap()->at("d2"));
+    ASSERT_NO_THROW_LOG(ctx->getCfgServersMap()->at("d2"));
     CfgServerPtr server = ctx->getCfgServersMap()->at("d2");
     ASSERT_TRUE(server);
     EXPECT_EQ(KEA_DHCP_DDNS, server->getModel());
@@ -530,7 +530,7 @@ TEST_F(NetconfParserTest, configParseServerDhcp6) {
     ASSERT_TRUE(ctx);
     ASSERT_TRUE(ctx->getCfgServersMap());
     EXPECT_EQ(1, ctx->getCfgServersMap()->size());
-    ASSERT_NO_THROW(ctx->getCfgServersMap()->at("dhcp6"));
+    ASSERT_NO_THROW_LOG(ctx->getCfgServersMap()->at("dhcp6"));
     CfgServerPtr server = ctx->getCfgServersMap()->at("dhcp6");
     ASSERT_TRUE(server);
     EXPECT_EQ(KEA_DHCP6_SERVER, server->getModel());
@@ -551,7 +551,7 @@ TEST_F(NetconfParserTest, configParse4Servers) {
     ASSERT_TRUE(ctx->getCfgServersMap());
     EXPECT_EQ(4, ctx->getCfgServersMap()->size());
 
-    ASSERT_NO_THROW(ctx->getCfgServersMap()->at("dhcp4"));
+    ASSERT_NO_THROW_LOG(ctx->getCfgServersMap()->at("dhcp4"));
     CfgServerPtr server = ctx->getCfgServersMap()->at("dhcp4");
     ASSERT_TRUE(server);
     EXPECT_EQ(KEA_DHCP4_SERVER, server->getModel());
@@ -564,7 +564,7 @@ TEST_F(NetconfParserTest, configParse4Servers) {
     EXPECT_EQ("/tmp/socket-v4", socket->getName());
     EXPECT_EQ("http://127.0.0.1:8000/", socket->getUrl().toText());
 
-    ASSERT_NO_THROW(ctx->getCfgServersMap()->at("dhcp6"));
+    ASSERT_NO_THROW_LOG(ctx->getCfgServersMap()->at("dhcp6"));
     server = ctx->getCfgServersMap()->at("dhcp6");
     ASSERT_TRUE(server);
     EXPECT_EQ(KEA_DHCP6_SERVER, server->getModel());
@@ -577,7 +577,7 @@ TEST_F(NetconfParserTest, configParse4Servers) {
     EXPECT_EQ("/tmp/socket-v6", socket->getName());
     EXPECT_EQ("http://127.0.0.1:8000/", socket->getUrl().toText());
 
-    ASSERT_NO_THROW(ctx->getCfgServersMap()->at("d2"));
+    ASSERT_NO_THROW_LOG(ctx->getCfgServersMap()->at("d2"));
     server = ctx->getCfgServersMap()->at("d2");
     ASSERT_TRUE(server);
     EXPECT_EQ(KEA_DHCP_DDNS, server->getModel());
@@ -590,7 +590,7 @@ TEST_F(NetconfParserTest, configParse4Servers) {
     EXPECT_EQ("/tmp/socket-d2", socket->getName());
     EXPECT_EQ("http://127.0.0.1:8000/", socket->getUrl().toText());
 
-    ASSERT_NO_THROW(ctx->getCfgServersMap()->at("ca"));
+    ASSERT_NO_THROW_LOG(ctx->getCfgServersMap()->at("ca"));
     server = ctx->getCfgServersMap()->at("ca");
     ASSERT_TRUE(server);
     EXPECT_EQ(KEA_CTRL_AGENT, server->getModel());
@@ -703,7 +703,7 @@ TEST_F(NetconfParserTest, comments) {
 
     // There is a DHCP4 server.
     ASSERT_TRUE(netconf_ctx->getCfgServersMap());
-    ASSERT_NO_THROW(netconf_ctx->getCfgServersMap()->at("dhcp4"));
+    ASSERT_NO_THROW_LOG(netconf_ctx->getCfgServersMap()->at("dhcp4"));
     CfgServerPtr server = netconf_ctx->getCfgServersMap()->at("dhcp4");
     ASSERT_TRUE(server);
 
@@ -715,7 +715,7 @@ TEST_F(NetconfParserTest, comments) {
     EXPECT_EQ("\"dhcp4 server\"", ctx4->get("comment")->str());
 
     // There is a DHCP6 server.
-    ASSERT_NO_THROW(netconf_ctx->getCfgServersMap()->at("dhcp6"));
+    ASSERT_NO_THROW_LOG(netconf_ctx->getCfgServersMap()->at("dhcp6"));
     server = netconf_ctx->getCfgServersMap()->at("dhcp6");
     ASSERT_TRUE(server);
 
index 6ae4a6bc7f9b5bd4177fa7e3bce3a15d1a20d924..8159ea22b9846450fa1644c62be1130931489744 100644 (file)
@@ -90,7 +90,7 @@ TEST_F(NetconfControllerTest, basicInstanceTesting) {
     // it has the correct type.
     DControllerBasePtr& controller = DControllerTest::getController();
     ASSERT_TRUE(controller);
-    ASSERT_NO_THROW(boost::dynamic_pointer_cast<NetconfController>(controller));
+    ASSERT_NO_THROW_LOG(boost::dynamic_pointer_cast<NetconfController>(controller));
 
     // Verify that controller's app name is correct.
     EXPECT_TRUE(checkAppName(NetconfController::netconf_app_name_));
@@ -139,7 +139,7 @@ TEST_F(NetconfControllerTest, commandLineArgs) {
 // Tests application process creation and initialization.
 // Verifies that the process can be successfully created and initialized.
 TEST_F(NetconfControllerTest, initProcessTesting) {
-    ASSERT_NO_THROW(initProcess());
+    ASSERT_NO_THROW_LOG(initProcess());
     EXPECT_TRUE(checkProcess());
 }
 
index c16b7e72339e0ef964eff985e78804e32de72a60..9cce4cf485541f7af01961632e1dfb2c3a807ab7 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2018-2020 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2018-2021 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -52,7 +52,7 @@ TEST(NetconfProcess, construction) {
 
     // Verify that the constructor succeeds with a valid io_service
     lcl_io_service.reset(new IOService());
-    ASSERT_NO_THROW(NetconfProcess("TestProcess", lcl_io_service));
+    ASSERT_NO_THROW_LOG(NetconfProcess("TestProcess", lcl_io_service));
 
     // Verify tha the configuration is accessible after construction.
     NetconfProcess netconf_process("TestProcess", lcl_io_service);
index ceaa2fc8184e6b9577fdbf6ebac7ba808d1e49b7..cd6ee6293cc2ee16df147d1abfa4a3a4f8b4109f 100644 (file)
@@ -411,7 +411,7 @@ TEST_F(NetconfAgentLogTest, checkModules) {
 
     // Run checkModules but it will be indirectly checked as
     // emitting nothing.
-    ASSERT_NO_THROW(agent_->checkModules());
+    ASSERT_NO_THROW_LOG(agent_->checkModules());
 
     // Remove kea-dhcp6-server.
     const string& module = "kea-dhcp6-server";
@@ -419,7 +419,7 @@ TEST_F(NetconfAgentLogTest, checkModules) {
     if (it6 != agent_->modules_.end()) {
         agent_->modules_.erase(it6);
     }
-    ASSERT_NO_THROW(agent_->checkModules());
+    ASSERT_NO_THROW_LOG(agent_->checkModules());
     ostringstream mmsg;
     mmsg << "NETCONF_MODULE_MISSING_WARN Missing module " << module
          << " in sysrepo";
@@ -428,7 +428,7 @@ TEST_F(NetconfAgentLogTest, checkModules) {
     // Add it back with a bad revision.
     const string& bad_revision = "2018-07-14";
     agent_->modules_.insert(make_pair(module, bad_revision));
-    ASSERT_NO_THROW(agent_->checkModules());
+    ASSERT_NO_THROW_LOG(agent_->checkModules());
     ostringstream rmsg;
     rmsg << "NETCONF_MODULE_REVISION_WARN Module " << module
          << " does NOT have the right revision: expected "
@@ -455,9 +455,9 @@ TEST_F(NetconfAgentLogTest, logChanges) {
           "10.0.2.0/24", SR_STRING_T, true }
     });
     // Load initial YANG configuration.
-    ASSERT_NO_THROW(agent_->initSysrepo());
+    ASSERT_NO_THROW_LOG(agent_->initSysrepo());
     YangRepr repr(KEA_DHCP4_SERVER);
-    ASSERT_NO_THROW(repr.set(tree0, agent_->startup_sess_));
+    ASSERT_NO_THROW_LOG(repr.set(tree0, agent_->startup_sess_));
     EXPECT_NO_THROW(agent_->startup_sess_->apply_changes());
 
     // Subscribe configuration changes.
@@ -525,9 +525,9 @@ TEST_F(NetconfAgentLogTest, logChanges2) {
           "10.0.2.0/24", SR_STRING_T, true }
     });
     // Load initial YANG configuration.
-    ASSERT_NO_THROW(agent_->initSysrepo());
+    ASSERT_NO_THROW_LOG(agent_->initSysrepo());
     YangRepr repr(KEA_DHCP4_SERVER);
-    ASSERT_NO_THROW(repr.set(tree0, agent_->startup_sess_));
+    ASSERT_NO_THROW_LOG(repr.set(tree0, agent_->startup_sess_));
     EXPECT_NO_THROW(agent_->startup_sess_->apply_changes());
 
     // Subscribe configuration changes.
@@ -633,12 +633,12 @@ TEST_F(NetconfAgentTest, keaConfig) {
     ASSERT_EQ(1, requests_.size());
     const string& request_str = requests_[0];
     ConstElementPtr request;
-    ASSERT_NO_THROW(request = Element::fromJSON(request_str));
+    ASSERT_NO_THROW_LOG(request = Element::fromJSON(request_str));
     string expected_str = "{\n"
         "\"command\": \"config-get\"\n"
         "}";
     ConstElementPtr expected;
-    ASSERT_NO_THROW(expected = Element::fromJSON(expected_str));
+    ASSERT_NO_THROW_LOG(expected = Element::fromJSON(expected_str));
     EXPECT_TRUE(expected->equals(*request));
     // Alternative showing more for debugging...
     // EXPECT_EQ(prettyPrint(expected), prettyPrint(request));
@@ -647,14 +647,14 @@ TEST_F(NetconfAgentTest, keaConfig) {
     ASSERT_EQ(1, responses_.size());
     const string& response_str = responses_[0];
     ConstElementPtr response;
-    ASSERT_NO_THROW(response = Element::fromJSON(response_str));
+    ASSERT_NO_THROW_LOG(response = Element::fromJSON(response_str));
     expected_str = "{\n"
         "\"result\": 0,\n"
         "\"arguments\": {\n"
         "    \"comment\": \"empty\"\n"
         "    }\n"
         "}";
-    ASSERT_NO_THROW(expected = Element::fromJSON(expected_str));
+    ASSERT_NO_THROW_LOG(expected = Element::fromJSON(expected_str));
     EXPECT_TRUE(expected->equals(*response));
 }
 
@@ -676,9 +676,9 @@ TEST_F(NetconfAgentTest, yangConfig) {
           "10.0.2.0/24", SR_STRING_T, true }
     });
     // Load YANG configuration.
-    ASSERT_NO_THROW(agent_->initSysrepo());
+    ASSERT_NO_THROW_LOG(agent_->initSysrepo());
     YangRepr repr(KEA_DHCP4_SERVER);
-    ASSERT_NO_THROW(repr.set(tree, agent_->startup_sess_));
+    ASSERT_NO_THROW_LOG(repr.set(tree, agent_->startup_sess_));
     EXPECT_NO_THROW(agent_->startup_sess_->apply_changes());
 
     // Netconf configuration.
@@ -734,7 +734,7 @@ TEST_F(NetconfAgentTest, yangConfig) {
     ASSERT_EQ(1, requests_.size());
     const string& request_str = requests_[0];
     ConstElementPtr request;
-    ASSERT_NO_THROW(request = Element::fromJSON(request_str));
+    ASSERT_NO_THROW_LOG(request = Element::fromJSON(request_str));
     string expected_str = "{\n"
         "\"command\": \"config-set\",\n"
         "\"arguments\": {\n"
@@ -753,7 +753,7 @@ TEST_F(NetconfAgentTest, yangConfig) {
         "  }\n"
         "}";
     ConstElementPtr expected;
-    ASSERT_NO_THROW(expected = Element::fromJSON(expected_str));
+    ASSERT_NO_THROW_LOG(expected = Element::fromJSON(expected_str));
 
     sortSubnets(expected);
     sortSubnets(request);
@@ -763,11 +763,11 @@ TEST_F(NetconfAgentTest, yangConfig) {
     ASSERT_EQ(1, responses_.size());
     const string& response_str = responses_[0];
     ConstElementPtr response;
-    ASSERT_NO_THROW(response = Element::fromJSON(response_str));
+    ASSERT_NO_THROW_LOG(response = Element::fromJSON(response_str));
     expected_str = "{\n"
         "\"result\": 0\n"
         "}";
-    ASSERT_NO_THROW(expected = Element::fromJSON(expected_str));
+    ASSERT_NO_THROW_LOG(expected = Element::fromJSON(expected_str));
     EXPECT_TRUE(expected->equals(*response));
 }
 
@@ -812,7 +812,7 @@ TEST_F(NetconfAgentTest, subscribeConfig) {
 
     // Try subscribeConfig.
     EXPECT_EQ(0, agent_->subscriptions_.size());
-    ASSERT_NO_THROW(agent_->initSysrepo());
+    ASSERT_NO_THROW_LOG(agent_->initSysrepo());
     EXPECT_EQ(0, agent_->subscriptions_.size());
     EXPECT_NO_THROW(agent_->subscribeConfig(service_pair));
     EXPECT_EQ(1, agent_->subscriptions_.size());
@@ -839,9 +839,9 @@ TEST_F(NetconfAgentTest, update) {
           "10.0.2.0/24", SR_STRING_T, true }
     });
     // Load initial YANG configuration.
-    ASSERT_NO_THROW(agent_->initSysrepo());
+    ASSERT_NO_THROW_LOG(agent_->initSysrepo());
     YangRepr repr(KEA_DHCP4_SERVER);
-    ASSERT_NO_THROW(repr.set(tree0, agent_->startup_sess_));
+    ASSERT_NO_THROW_LOG(repr.set(tree0, agent_->startup_sess_));
     EXPECT_NO_THROW(agent_->startup_sess_->apply_changes());
 
     // Netconf configuration.
@@ -918,7 +918,7 @@ TEST_F(NetconfAgentTest, update) {
     ASSERT_EQ(1, requests_.size());
     const string& request_str = requests_[0];
     ConstElementPtr request;
-    ASSERT_NO_THROW(request = Element::fromJSON(request_str));
+    ASSERT_NO_THROW_LOG(request = Element::fromJSON(request_str));
     string expected_str = "{\n"
         "\"command\": \"config-set\",\n"
         "\"arguments\": {\n"
@@ -937,7 +937,7 @@ TEST_F(NetconfAgentTest, update) {
         "  }\n"
         "}";
     ConstElementPtr expected;
-    ASSERT_NO_THROW(expected = Element::fromJSON(expected_str));
+    ASSERT_NO_THROW_LOG(expected = Element::fromJSON(expected_str));
 
     sortSubnets(expected);
     sortSubnets(request);
@@ -947,11 +947,11 @@ TEST_F(NetconfAgentTest, update) {
     ASSERT_EQ(1, responses_.size());
     const string& response_str = responses_[0];
     ConstElementPtr response;
-    ASSERT_NO_THROW(response = Element::fromJSON(response_str));
+    ASSERT_NO_THROW_LOG(response = Element::fromJSON(response_str));
     expected_str = "{\n"
         "\"result\": 0\n"
         "}";
-    ASSERT_NO_THROW(expected = Element::fromJSON(expected_str));
+    ASSERT_NO_THROW_LOG(expected = Element::fromJSON(expected_str));
     EXPECT_TRUE(expected->equals(*response));
 }
 
@@ -974,9 +974,9 @@ TEST_F(NetconfAgentTest, validate) {
           "10.0.2.0/24", SR_STRING_T, true }
     });
     // Load initial YANG configuration.
-    ASSERT_NO_THROW(agent_->initSysrepo());
+    ASSERT_NO_THROW_LOG(agent_->initSysrepo());
     YangRepr repr(KEA_DHCP4_SERVER);
-    ASSERT_NO_THROW(repr.set(tree0, agent_->startup_sess_));
+    ASSERT_NO_THROW_LOG(repr.set(tree0, agent_->startup_sess_));
     EXPECT_NO_THROW(agent_->startup_sess_->apply_changes());
 
     // Netconf configuration.
@@ -1056,7 +1056,7 @@ TEST_F(NetconfAgentTest, validate) {
     ASSERT_LE(1, requests_.size());
     string request_str = requests_[0];
     ConstElementPtr request;
-    ASSERT_NO_THROW(request = Element::fromJSON(request_str));
+    ASSERT_NO_THROW_LOG(request = Element::fromJSON(request_str));
     string expected_str = "{\n"
         "\"command\": \"config-test\",\n"
         "\"arguments\": {\n"
@@ -1075,7 +1075,7 @@ TEST_F(NetconfAgentTest, validate) {
         "  }\n"
         "}";
     ConstElementPtr expected;
-    ASSERT_NO_THROW(expected = Element::fromJSON(expected_str));
+    ASSERT_NO_THROW_LOG(expected = Element::fromJSON(expected_str));
 
     sortSubnets(expected);
     sortSubnets(request);
@@ -1084,7 +1084,7 @@ TEST_F(NetconfAgentTest, validate) {
     // Check that the fakse server received the second request.
     ASSERT_EQ(2, requests_.size());
     request_str = requests_[1];
-    ASSERT_NO_THROW(request = Element::fromJSON(request_str));
+    ASSERT_NO_THROW_LOG(request = Element::fromJSON(request_str));
     expected_str = "{\n"
         "\"command\": \"config-set\",\n"
         "\"arguments\": {\n"
@@ -1102,7 +1102,7 @@ TEST_F(NetconfAgentTest, validate) {
         "    }\n"
         "  }\n"
         "}";
-    ASSERT_NO_THROW(expected = Element::fromJSON(expected_str));
+    ASSERT_NO_THROW_LOG(expected = Element::fromJSON(expected_str));
 
     sortSubnets(expected);
     sortSubnets(request);
@@ -1112,19 +1112,19 @@ TEST_F(NetconfAgentTest, validate) {
     ASSERT_EQ(2, responses_.size());
     string response_str = responses_[0];
     ConstElementPtr response;
-    ASSERT_NO_THROW(response = Element::fromJSON(response_str));
+    ASSERT_NO_THROW_LOG(response = Element::fromJSON(response_str));
     expected_str = "{\n"
         "\"result\": 0\n"
         "}";
-    ASSERT_NO_THROW(expected = Element::fromJSON(expected_str));
+    ASSERT_NO_THROW_LOG(expected = Element::fromJSON(expected_str));
     EXPECT_TRUE(expected->equals(*response));
 
     response_str = responses_[1];
-    ASSERT_NO_THROW(response = Element::fromJSON(response_str));
+    ASSERT_NO_THROW_LOG(response = Element::fromJSON(response_str));
     expected_str = "{\n"
         "\"result\": 0\n"
         "}";
-    ASSERT_NO_THROW(expected = Element::fromJSON(expected_str));
+    ASSERT_NO_THROW_LOG(expected = Element::fromJSON(expected_str));
     EXPECT_TRUE(expected->equals(*response));
 }
 
@@ -1140,9 +1140,9 @@ TEST_F(NetconfAgentTest, noValidate) {
           "10.0.0.0/24", SR_STRING_T, true }
     });
     // Load initial YANG configuration.
-    ASSERT_NO_THROW(agent_->initSysrepo());
+    ASSERT_NO_THROW_LOG(agent_->initSysrepo());
     YangRepr repr(KEA_DHCP4_SERVER);
-    ASSERT_NO_THROW(repr.set(tree0, agent_->startup_sess_));
+    ASSERT_NO_THROW_LOG(repr.set(tree0, agent_->startup_sess_));
     EXPECT_NO_THROW(agent_->startup_sess_->apply_changes());
 
     // Netconf configuration.
index 65be83dba50380afc74761638e742bd839dd6826..1788716ee1a1705f9130294e0b8fbbaa98a090e5 100644 (file)
@@ -50,7 +50,7 @@ void testParser(const std::string& txt, ParserContext::ParserType parser_type,
     bool compare = true) {
     ConstElementPtr test_json;
 
-    ASSERT_NO_THROW({
+    ASSERT_NO_THROW_LOG({
             try {
                 ParserContext ctx;
                 test_json = ctx.parseString(txt, parser_type);
@@ -67,7 +67,7 @@ void testParser(const std::string& txt, ParserContext::ParserType parser_type,
 
     // Now compare if both representations are the same.
     ElementPtr reference_json;
-    ASSERT_NO_THROW(reference_json = Element::fromJSON(txt, true));
+    ASSERT_NO_THROW_LOG(reference_json = Element::fromJSON(txt, true));
     compareJSON(reference_json, test_json);
 }
 
@@ -732,7 +732,7 @@ TEST(ParserTest, unicodeEscapes) {
         ins[1] = c;
         ConstElementPtr e(new StringElement(ins));
         json = e->str();
-        ASSERT_NO_THROW(
+        ASSERT_NO_THROW_LOG(
         try {
             ParserContext ctx;
             result = ctx.parseString(json, ParserContext::PARSER_JSON);
@@ -750,7 +750,7 @@ TEST(ParserTest, unicodeSlash) {
     // check the 4 possible encodings of solidus '/'
     ConstElementPtr result;
     string json = "\"/\\/\\u002f\\u002F\"";
-    ASSERT_NO_THROW(
+    ASSERT_NO_THROW_LOG(
     try {
         ParserContext ctx;
         result = ctx.parseString(json, ParserContext::PARSER_JSON);
index 7e7f7b654bd2c9665419e7f27310b76b009e82ca..9f350d16861bc1d596fc614ac87861ad0bd49166 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2018-2019 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2018-2021 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -45,9 +45,9 @@ void testFile(const std::string& fname, bool v6, ElementPtr& result) {
 
     string before = json->str();
     if (v6) {
-        ASSERT_NO_THROW(AdaptorConfig::preProcess6(json));
+        ASSERT_NO_THROW_LOG(AdaptorConfig::preProcess6(json));
     } else {
-        ASSERT_NO_THROW(AdaptorConfig::preProcess4(json));
+        ASSERT_NO_THROW_LOG(AdaptorConfig::preProcess4(json));
     }
     string after = json->str();
 
index dbed7cb472ff4818770478164e9afa7ab1a57020..95eb3a2588b2059cc058b6a75e3620d198182f39 100644 (file)
@@ -26,7 +26,7 @@ TEST(AdaptorHostTest, notFlexId) {
         " \"ip-address\": \"192.0.2.201\"\n"
         "}";
     ElementPtr json;
-    ASSERT_NO_THROW(json = Element::fromJSON(config));
+    ASSERT_NO_THROW_LOG(json = Element::fromJSON(config));
     ConstElementPtr copied = copy(json);
     EXPECT_NO_THROW(AdaptorHost::quoteIdentifier(json));
     EXPECT_TRUE(copied->equals(*json));
@@ -40,7 +40,7 @@ TEST(AdaptorHostTest, noQuote) {
         " \"ip-address\": \"192.0.2.206\"\n"
         "}";
     ElementPtr json;
-    ASSERT_NO_THROW(json = Element::fromJSON(config));
+    ASSERT_NO_THROW_LOG(json = Element::fromJSON(config));
     ConstElementPtr copied = copy(json);
     EXPECT_NO_THROW(AdaptorHost::quoteIdentifier(json));
     EXPECT_TRUE(copied->equals(*json));
@@ -53,7 +53,7 @@ TEST(AdaptorHostTest, quotes) {
         " \"ip-addresses\": \"2001:db8:1:cafe::2\"\n"
         "}";
     ElementPtr json;
-    ASSERT_NO_THROW(json = Element::fromJSON(config));
+    ASSERT_NO_THROW_LOG(json = Element::fromJSON(config));
     ConstElementPtr copied = copy(json);
     EXPECT_NO_THROW(AdaptorHost::quoteIdentifier(json));
     EXPECT_FALSE(copied->equals(*json));
@@ -71,7 +71,7 @@ TEST(AdaptorHostTest, extraQuote) {
         " \"ip-addresses\": \"2001:db8:1:cafe::2\"\n"
         "}";
     ElementPtr json;
-    ASSERT_NO_THROW(json = Element::fromJSON(config));
+    ASSERT_NO_THROW_LOG(json = Element::fromJSON(config));
     ConstElementPtr copied = copy(json);
     EXPECT_NO_THROW(AdaptorHost::quoteIdentifier(json));
     EXPECT_FALSE(copied->equals(*json));
@@ -88,7 +88,7 @@ TEST(AdaptorHostTest, notStandard) {
         " \"ip-addresses\": \"2001:db8:1:cafe::2\"\n"
         "}";
     ElementPtr json;
-    ASSERT_NO_THROW(json = Element::fromJSON(config));
+    ASSERT_NO_THROW_LOG(json = Element::fromJSON(config));
     ConstElementPtr copied = copy(json);
     EXPECT_NO_THROW(AdaptorHost::quoteIdentifier(json));
     EXPECT_FALSE(copied->equals(*json));
@@ -106,7 +106,7 @@ TEST(AdaptorHostTest, notQuoted) {
         " \"ip-addresses\": \"2001:db8:1:cafe::2\"\n"
         "}";
     ElementPtr json;
-    ASSERT_NO_THROW(json = Element::fromJSON(config));
+    ASSERT_NO_THROW_LOG(json = Element::fromJSON(config));
     ConstElementPtr copied = copy(json);
     EXPECT_NO_THROW(AdaptorHost::quoteIdentifier(json));
     EXPECT_FALSE(copied->equals(*json));
index 1e53802d644203575c64f8b64a80304c105b42df..e4a3f738d97283762bbf2ce97d84eaca240e72f5 100644 (file)
@@ -27,7 +27,7 @@ TEST(AdaptorOptionTest, setSpaceNoSpace) {
     string config = "{\n"
         "}";
     ElementPtr json;
-    ASSERT_NO_THROW(json = Element::fromJSON(config));
+    ASSERT_NO_THROW_LOG(json = Element::fromJSON(config));
     ConstElementPtr copied = copy(json);
     EXPECT_NO_THROW(AdaptorOption::setSpace(json, "foo"));
     EXPECT_FALSE(copied->equals(*json));
@@ -43,7 +43,7 @@ TEST(AdaptorOptionTest, setSpace) {
         " \"space\": \"dhcp4\"\n"
         "}";
     ElementPtr json;
-    ASSERT_NO_THROW(json = Element::fromJSON(config));
+    ASSERT_NO_THROW_LOG(json = Element::fromJSON(config));
     ConstElementPtr copied = copy(json);
     EXPECT_NO_THROW(AdaptorOption::setSpace(json, "foo"));
     EXPECT_TRUE(copied->equals(*json));
@@ -55,7 +55,7 @@ TEST(AdaptorOptionTest, checkType) {
         " \"type\": \"string\"\n"
         "}";
     ConstElementPtr json;
-    ASSERT_NO_THROW(json = Element::fromJSON(config));
+    ASSERT_NO_THROW_LOG(json = Element::fromJSON(config));
     EXPECT_NO_THROW(AdaptorOption::checkType(json));
 }
 
@@ -64,7 +64,7 @@ TEST(AdaptorOptionTest, checkTypeNoType) {
     string config = "{\n"
         "}";
     ConstElementPtr json;
-    ASSERT_NO_THROW(json = Element::fromJSON(config));
+    ASSERT_NO_THROW_LOG(json = Element::fromJSON(config));
     EXPECT_THROW(AdaptorOption::checkType(json), MissingKey);
 }
 
@@ -74,7 +74,7 @@ TEST(AdaptorOptionTest, checkCode) {
         " \"code\": 123\n"
         "}";
     ConstElementPtr json;
-    ASSERT_NO_THROW(json = Element::fromJSON(config));
+    ASSERT_NO_THROW_LOG(json = Element::fromJSON(config));
     EXPECT_NO_THROW(AdaptorOption::checkCode(json));
 }
 
@@ -83,7 +83,7 @@ TEST(AdaptorOptionTest, checkCodeNoCode) {
     string config = "{\n"
         "}";
     ConstElementPtr json;
-    ASSERT_NO_THROW(json = Element::fromJSON(config));
+    ASSERT_NO_THROW_LOG(json = Element::fromJSON(config));
     EXPECT_THROW(AdaptorOption::checkCode(json), MissingKey);
 }
 
@@ -95,9 +95,9 @@ TEST(AdaptorOptionTest, collect) {
         " \"space\": \"bar\"\n"
         "}";
     ConstElementPtr json;
-    ASSERT_NO_THROW(json = Element::fromJSON(config));
+    ASSERT_NO_THROW_LOG(json = Element::fromJSON(config));
     OptionCodes codes;
-    ASSERT_NO_THROW(AdaptorOption::collect(json, codes));
+    ASSERT_NO_THROW_LOG(AdaptorOption::collect(json, codes));
     EXPECT_EQ(1, codes.size());
     EXPECT_EQ(123, codes["bar@foo"]);
     EXPECT_THROW(codes.at("foo@bar"), out_of_range);
@@ -111,9 +111,9 @@ TEST(AdaptorOptionTest, collectKnown) {
         " \"space\": \"bar\"\n"
         "}";
     ConstElementPtr json;
-    ASSERT_NO_THROW(json = Element::fromJSON(config));
+    ASSERT_NO_THROW_LOG(json = Element::fromJSON(config));
     OptionCodes codes = { { "bar@foo", 111 } };
-    ASSERT_NO_THROW(AdaptorOption::collect(json, codes));
+    ASSERT_NO_THROW_LOG(AdaptorOption::collect(json, codes));
     EXPECT_EQ(1, codes.size());
     EXPECT_EQ(111, codes["bar@foo"]);
 }
@@ -126,7 +126,7 @@ TEST(AdaptorOptionTest, setCodeNoCode) {
         " \"space\": \"bar\"\n"
         "}";
     ElementPtr json;
-    ASSERT_NO_THROW(json = Element::fromJSON(config));
+    ASSERT_NO_THROW_LOG(json = Element::fromJSON(config));
     ConstElementPtr copied = copy(json);
     OptionCodes codes = { { "bar@foo", 123 } };
     EXPECT_NO_THROW(AdaptorOption::setCode(json, codes));
@@ -143,7 +143,7 @@ TEST(AdaptorOptionTest, setCode) {
         " \"code\": \"dhcp4\"\n"
         "}";
     ElementPtr json;
-    ASSERT_NO_THROW(json = Element::fromJSON(config));
+    ASSERT_NO_THROW_LOG(json = Element::fromJSON(config));
     ConstElementPtr copied = copy(json);
     OptionCodes codes;
     EXPECT_NO_THROW(AdaptorOption::setCode(json, codes));
@@ -156,7 +156,7 @@ TEST(AdaptorOptionTest, setCodeNoName) {
         " \"space\": \"bar\"\n"
         "}";
     ElementPtr json;
-    ASSERT_NO_THROW(json = Element::fromJSON(config));
+    ASSERT_NO_THROW_LOG(json = Element::fromJSON(config));
     OptionCodes codes;
     EXPECT_THROW(AdaptorOption::setCode(json, codes), MissingKey);
 }
@@ -171,7 +171,7 @@ TEST(AdaptorOptionTest, setCodeNotInMap) {
         " \"space\": \"bar\"\n"
         "}";
     ElementPtr json;
-    ASSERT_NO_THROW(json = Element::fromJSON(config));
+    ASSERT_NO_THROW_LOG(json = Element::fromJSON(config));
     OptionCodes codes;
     EXPECT_THROW(AdaptorOption::setCode(json, codes), MissingKey);
 }
@@ -192,7 +192,7 @@ TEST(AdaptorOptionTest, initCodesInternal) {
     };
     const size_t DEFS_SIZE = sizeof(DEFS) / sizeof(DEFS[0]);
     OptionCodes codes;
-    ASSERT_NO_THROW(TestAdaptorOption::initCodesInternal(codes,
+    ASSERT_NO_THROW_LOG(TestAdaptorOption::initCodesInternal(codes,
                                                          DHCP4_OPTION_SPACE,
                                                          DEFS,
                                                          DEFS_SIZE));
@@ -204,7 +204,7 @@ TEST(AdaptorOptionTest, initCodesInternal) {
 // Verifies that initCodes works as expected with DHCPv4.
 TEST(AdaptorOptionTest, initCodes4) {
     OptionCodes codes;
-    ASSERT_NO_THROW(AdaptorOption::initCodes(codes, DHCP4_OPTION_SPACE));
+    ASSERT_NO_THROW_LOG(AdaptorOption::initCodes(codes, DHCP4_OPTION_SPACE));
     EXPECT_EQ(DHO_SUBNET_MASK, codes["dhcp4@subnet-mask"]);
     EXPECT_EQ(DHO_TIME_OFFSET, codes["dhcp4@time-offset"]);
     EXPECT_THROW(codes.at("dhcp6@clientid"), out_of_range);
@@ -220,7 +220,7 @@ TEST(AdaptorOptionTest, initCodes4) {
 // Verifies that initCodes works as expected with DHCPv6.
 TEST(AdaptorOptionTest, initCodes6) {
     OptionCodes codes;
-    ASSERT_NO_THROW(AdaptorOption::initCodes(codes, DHCP6_OPTION_SPACE));
+    ASSERT_NO_THROW_LOG(AdaptorOption::initCodes(codes, DHCP6_OPTION_SPACE));
     EXPECT_EQ(D6O_CLIENTID, codes["dhcp6@clientid"]);
     EXPECT_EQ(D6O_SERVERID, codes["dhcp6@serverid"]);
     EXPECT_THROW(codes.at("dhcp4@subnet-mask"), out_of_range);
index be8e71ecbcb3e4f42f14b6cba4b3152469f27ded..5325c6b077d668a8979c9e548590604df7f8947f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2018 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2018-2021 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -24,7 +24,7 @@ TEST(AdaptorPoolTest, canonizePoolPrefixNoSpace) {
         " \"pool\": \"192.0.2.128/28\"\n"
         "}";
     ElementPtr json;
-    ASSERT_NO_THROW(json = Element::fromJSON(config));
+    ASSERT_NO_THROW_LOG(json = Element::fromJSON(config));
     ConstElementPtr copied = copy(json);
     EXPECT_NO_THROW(AdaptorPool::canonizePool(json));
     EXPECT_TRUE(copied->equals(*json));
@@ -36,7 +36,7 @@ TEST(AdaptorPoolTest, canonizePoolRange) {
         " \"pool\": \"192.0.2.1 - 192.0.2.200\"\n"
         "}";
     ElementPtr json;
-    ASSERT_NO_THROW(json = Element::fromJSON(config));
+    ASSERT_NO_THROW_LOG(json = Element::fromJSON(config));
     ConstElementPtr copied = copy(json);
     EXPECT_NO_THROW(AdaptorPool::canonizePool(json));
     EXPECT_TRUE(copied->equals(*json));
@@ -48,7 +48,7 @@ TEST(AdaptorPoolTest, canonizePoolPrefixSpaces) {
         " \"pool\": \"192.0.2.128 /\t28\"\n"
         "}";
     ElementPtr json;
-    ASSERT_NO_THROW(json = Element::fromJSON(config));
+    ASSERT_NO_THROW_LOG(json = Element::fromJSON(config));
     ConstElementPtr copied = copy(json);
     EXPECT_NO_THROW(AdaptorPool::canonizePool(json));
     EXPECT_FALSE(copied->equals(*json));
@@ -64,7 +64,7 @@ TEST(AdaptorPoolTest, canonizePoolRangeNoSpace) {
         " \"pool\": \"192.0.2.1-192.0.2.200\"\n"
         "}";
     ElementPtr json;
-    ASSERT_NO_THROW(json = Element::fromJSON(config));
+    ASSERT_NO_THROW_LOG(json = Element::fromJSON(config));
     ConstElementPtr copied = copy(json);
     EXPECT_NO_THROW(AdaptorPool::canonizePool(json));
     EXPECT_FALSE(copied->equals(*json));
@@ -80,7 +80,7 @@ TEST(AdaptorPoolTest, canonizePoolRangeExtraSpaces) {
         " \"pool\": \"192.0.2.1  -  192.0.2.200\"\n"
         "}";
     ElementPtr json;
-    ASSERT_NO_THROW(json = Element::fromJSON(config));
+    ASSERT_NO_THROW_LOG(json = Element::fromJSON(config));
     ConstElementPtr copied = copy(json);
     EXPECT_NO_THROW(AdaptorPool::canonizePool(json));
     EXPECT_FALSE(copied->equals(*json));
@@ -105,7 +105,7 @@ TEST(AdaptorPoolTest, fromSubnetKea) {
         " \"rebind-timer\": 2000\n"
         "}";
     ElementPtr json;
-    ASSERT_NO_THROW(json = Element::fromJSON(config));
+    ASSERT_NO_THROW_LOG(json = Element::fromJSON(config));
     ConstElementPtr copied = copy(json);
     ConstElementPtr pools = json->get("pools");
 
@@ -137,7 +137,7 @@ TEST(AdaptorPoolTest, fromSubnet) {
         " \"rebind-timer\": 2000\n"
         "}";
     ElementPtr json;
-    ASSERT_NO_THROW(json = Element::fromJSON(config));
+    ASSERT_NO_THROW_LOG(json = Element::fromJSON(config));
     ConstElementPtr copied = copy(json);
     ConstElementPtr pools = json->get("pools");
     EXPECT_NO_THROW(AdaptorPool::fromSubnet(IETF_DHCPV6_SERVER, json, pools));
@@ -180,7 +180,7 @@ TEST(AdaptorPoolTest, toSubnetKea) {
         " \"rebind-timer\": 2000\n"
         "}";
     ElementPtr json;
-    ASSERT_NO_THROW(json = Element::fromJSON(config));
+    ASSERT_NO_THROW_LOG(json = Element::fromJSON(config));
     ConstElementPtr copied = copy(json);
     ConstElementPtr pools = json->get("pools");
     EXPECT_NO_THROW(AdaptorPool::toSubnet(KEA_DHCP4_SERVER, json, pools));
@@ -213,7 +213,7 @@ TEST(AdaptorPoolTest, toSubnet) {
         "     } ]\n"
         "}";
     ElementPtr json;
-    ASSERT_NO_THROW(json = Element::fromJSON(config));
+    ASSERT_NO_THROW_LOG(json = Element::fromJSON(config));
     ConstElementPtr copied = copy(json);
     ConstElementPtr pools = json->get("pools");
     EXPECT_NO_THROW(AdaptorPool::toSubnet(IETF_DHCPV6_SERVER, json, pools));
@@ -264,7 +264,7 @@ TEST(AdaptorPoolTest, toSubnetBad) {
         "     } ]\n"
         "}";
     ElementPtr json;
-    ASSERT_NO_THROW(json = Element::fromJSON(config));
+    ASSERT_NO_THROW_LOG(json = Element::fromJSON(config));
     ConstElementPtr pools = json->get("pools");
     EXPECT_THROW(AdaptorPool::toSubnet(IETF_DHCPV6_SERVER, json, pools),
                  BadValue);
index 04bd84dae077647536f3f71f258c06d0157a72cf..e8605aa08f42e828bf31ef333828073e44755a77 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2018 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2018-2021 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -24,10 +24,10 @@ TEST(AdaptorSubnetTest, collectNoId) {
         " \"subnet\": \"192.0.2.0/24\"\n"
         "}";
     ConstElementPtr json;
-    ASSERT_NO_THROW(json = Element::fromJSON(config));
+    ASSERT_NO_THROW_LOG(json = Element::fromJSON(config));
     SubnetIDSet set;
     bool ret = true;
-    ASSERT_NO_THROW(ret = AdaptorSubnet::collectID(json, set));
+    ASSERT_NO_THROW_LOG(ret = AdaptorSubnet::collectID(json, set));
     EXPECT_FALSE(ret);
     EXPECT_EQ(0, set.size());
 }
@@ -39,10 +39,10 @@ TEST(AdaptorSubnetTest, collectId) {
         " \"id\": 123\n"
         "}";
     ConstElementPtr json;
-    ASSERT_NO_THROW(json = Element::fromJSON(config));
+    ASSERT_NO_THROW_LOG(json = Element::fromJSON(config));
     SubnetIDSet set;
     bool ret = false;
-    ASSERT_NO_THROW(ret = AdaptorSubnet::collectID(json, set));
+    ASSERT_NO_THROW_LOG(ret = AdaptorSubnet::collectID(json, set));
     EXPECT_TRUE(ret);
     EXPECT_EQ(1, set.size());
     EXPECT_EQ(1, set.count(123));
@@ -56,10 +56,10 @@ TEST(AdaptorSubnetTest, collectKnownId) {
         " \"id\": 123\n"
         "}";
     ConstElementPtr json;
-    ASSERT_NO_THROW(json = Element::fromJSON(config));
+    ASSERT_NO_THROW_LOG(json = Element::fromJSON(config));
     SubnetIDSet set = { 123 };
     bool ret = false;
-    ASSERT_NO_THROW(ret = AdaptorSubnet::collectID(json, set));
+    ASSERT_NO_THROW_LOG(ret = AdaptorSubnet::collectID(json, set));
     EXPECT_TRUE(ret);
     EXPECT_EQ(1, set.size());
     EXPECT_EQ(1, set.count(123));
@@ -72,11 +72,11 @@ TEST(AdaptorSubnetTest, assignNoId) {
         " \"subnet\": \"192.0.2.0/24\"\n"
         "}";
     ElementPtr json;
-    ASSERT_NO_THROW(json = Element::fromJSON(config));
+    ASSERT_NO_THROW_LOG(json = Element::fromJSON(config));
     ConstElementPtr copied = copy(json);
     SubnetIDSet set;
     SubnetID next_id = 123;
-    ASSERT_NO_THROW(AdaptorSubnet::assignID(json, set, next_id));
+    ASSERT_NO_THROW_LOG(AdaptorSubnet::assignID(json, set, next_id));
     EXPECT_FALSE(copied->equals(*json));
     EXPECT_EQ(1, set.size());
     EXPECT_EQ(1, set.count(123));
@@ -94,11 +94,11 @@ TEST(AdaptorSubnetTest, assignNoIdUsed) {
         " \"subnet\": \"192.0.2.0/24\"\n"
         "}";
     ElementPtr json;
-    ASSERT_NO_THROW(json = Element::fromJSON(config));
+    ASSERT_NO_THROW_LOG(json = Element::fromJSON(config));
     ConstElementPtr copied = copy(json);
     SubnetIDSet set = { 123 };
     SubnetID next_id = 123;
-    ASSERT_NO_THROW(AdaptorSubnet::assignID(json, set, next_id));
+    ASSERT_NO_THROW_LOG(AdaptorSubnet::assignID(json, set, next_id));
     EXPECT_FALSE(copied->equals(*json));
     EXPECT_EQ(2, set.size());
     EXPECT_EQ(1, set.count(123));
@@ -117,11 +117,11 @@ TEST(AdaptorSubnetTest, assignId) {
         " \"id\": 123\n"
         "}";
     ElementPtr json;
-    ASSERT_NO_THROW(json = Element::fromJSON(config));
+    ASSERT_NO_THROW_LOG(json = Element::fromJSON(config));
     ConstElementPtr copied = copy(json);
     SubnetIDSet set; // ignored.
     SubnetID next_id = 123; // ignored.
-    ASSERT_NO_THROW(AdaptorSubnet::assignID(json, set, next_id));
+    ASSERT_NO_THROW_LOG(AdaptorSubnet::assignID(json, set, next_id));
     EXPECT_TRUE(copied->equals(*json));
     EXPECT_EQ(0, set.size());
     EXPECT_EQ(123, next_id);
@@ -133,9 +133,9 @@ TEST(AdaptorSubnetTest, updateNoRelay) {
         " \"subnet\": \"192.0.2.0/24\"\n"
         "}";
     ElementPtr json;
-    ASSERT_NO_THROW(json = Element::fromJSON(config));
+    ASSERT_NO_THROW_LOG(json = Element::fromJSON(config));
     ConstElementPtr copied = copy(json);
-    ASSERT_NO_THROW(AdaptorSubnet::updateRelay(json));
+    ASSERT_NO_THROW_LOG(AdaptorSubnet::updateRelay(json));
     EXPECT_TRUE(copied->equals(*json));
 }
 
@@ -147,9 +147,9 @@ TEST(AdaptorSubnetTest, updateEmptyRelay) {
         " \"relay\": { }\n"
         "}";
     ElementPtr json;
-    ASSERT_NO_THROW(json = Element::fromJSON(config));
+    ASSERT_NO_THROW_LOG(json = Element::fromJSON(config));
     ConstElementPtr copied = copy(json);
-    ASSERT_NO_THROW(AdaptorSubnet::updateRelay(json));
+    ASSERT_NO_THROW_LOG(AdaptorSubnet::updateRelay(json));
     EXPECT_FALSE(copied->equals(*json));
     EXPECT_FALSE(json->get("relay"));
 }
@@ -164,9 +164,9 @@ TEST(AdaptorSubnetTest, updateRelayEmptyAddresses) {
         " }\n"
         "}";
     ElementPtr json;
-    ASSERT_NO_THROW(json = Element::fromJSON(config));
+    ASSERT_NO_THROW_LOG(json = Element::fromJSON(config));
     ConstElementPtr copied = copy(json);
-    ASSERT_NO_THROW(AdaptorSubnet::updateRelay(json));
+    ASSERT_NO_THROW_LOG(AdaptorSubnet::updateRelay(json));
     EXPECT_FALSE(copied->equals(*json));
     EXPECT_FALSE(json->get("relay"));
 }
@@ -181,9 +181,9 @@ TEST(AdaptorSubnetTest, updateRelayAddresses) {
         " }\n"
         "}";
     ElementPtr json;
-    ASSERT_NO_THROW(json = Element::fromJSON(config));
+    ASSERT_NO_THROW_LOG(json = Element::fromJSON(config));
     ConstElementPtr copied = copy(json);
-    ASSERT_NO_THROW(AdaptorSubnet::updateRelay(json));
+    ASSERT_NO_THROW_LOG(AdaptorSubnet::updateRelay(json));
     EXPECT_TRUE(copied->equals(*json));
 }
 
@@ -197,9 +197,9 @@ TEST(AdaptorSubnetTest, updateRelayAddress) {
         " }\n"
         "}";
     ElementPtr json;
-    ASSERT_NO_THROW(json = Element::fromJSON(config));
+    ASSERT_NO_THROW_LOG(json = Element::fromJSON(config));
     ConstElementPtr copied = copy(json);
-    ASSERT_NO_THROW(AdaptorSubnet::updateRelay(json));
+    ASSERT_NO_THROW_LOG(AdaptorSubnet::updateRelay(json));
     EXPECT_FALSE(copied->equals(*json));
     ConstElementPtr relay = json->get("relay");
     ASSERT_TRUE(relay);
index 73660be3de6141f805382ab322bb7793b1e323f9..c06b272657173c9039a79c8d55520b1a24452c3b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2018 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2018-2021 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -25,7 +25,7 @@ TEST(AdaptorTest, getContext) {
         "}\n";
     ConstElementPtr json = Element::fromJSON(config);
     ConstElementPtr context;
-    ASSERT_NO_THROW(context = Adaptor::getContext(json));
+    ASSERT_NO_THROW_LOG(context = Adaptor::getContext(json));
     EXPECT_FALSE(context);
 
     // No relevant.
@@ -33,7 +33,7 @@ TEST(AdaptorTest, getContext) {
         " \"foo\": 1\n"
         "}\n";
     json = Element::fromJSON(config);
-    ASSERT_NO_THROW(context = Adaptor::getContext(json));
+    ASSERT_NO_THROW_LOG(context = Adaptor::getContext(json));
     EXPECT_FALSE(context);
 
     // User context.
@@ -42,7 +42,7 @@ TEST(AdaptorTest, getContext) {
         " \"user-context\": { \"bar\": 2 }\n"
         "}\n";
     json = Element::fromJSON(config);
-    ASSERT_NO_THROW(context = Adaptor::getContext(json));
+    ASSERT_NO_THROW_LOG(context = Adaptor::getContext(json));
     ASSERT_TRUE(context);
     EXPECT_EQ("{ \"bar\": 2 }", context->str());
 
@@ -52,7 +52,7 @@ TEST(AdaptorTest, getContext) {
         " \"comment\": \"a comment\"\n"
         "}\n";
     json = Element::fromJSON(config);
-    ASSERT_NO_THROW(context = Adaptor::getContext(json));
+    ASSERT_NO_THROW_LOG(context = Adaptor::getContext(json));
     ASSERT_TRUE(context);
     EXPECT_EQ("{ \"comment\": \"a comment\" }", context->str());
 
@@ -63,7 +63,7 @@ TEST(AdaptorTest, getContext) {
         " \"comment\": \"a comment\"\n"
         "}\n";
     json = Element::fromJSON(config);
-    ASSERT_NO_THROW(context = Adaptor::getContext(json));
+    ASSERT_NO_THROW_LOG(context = Adaptor::getContext(json));
     ASSERT_TRUE(context);
     EXPECT_EQ("{ \"bar\": 2, \"comment\": \"a comment\" }", context->str());
 
@@ -77,7 +77,7 @@ TEST(AdaptorTest, getContext) {
         " \"comment\": \"a comment\"\n"
         "}\n";
     json = Element::fromJSON(config);
-    ASSERT_NO_THROW(context = Adaptor::getContext(json));
+    ASSERT_NO_THROW_LOG(context = Adaptor::getContext(json));
     ASSERT_TRUE(context);
     EXPECT_EQ("{ \"bar\": 2, \"comment\": \"a comment\" }", context->str());
 }
@@ -176,10 +176,10 @@ TEST(AdaptorTest, modifyMapInsert) {
         "   \"bar\": {\n"
         "}}}\n";
     ElementPtr json;
-    ASSERT_NO_THROW(json = Element::fromJSON(config));
+    ASSERT_NO_THROW_LOG(json = Element::fromJSON(config));
     string spath = "[ \"foo\", \"bar\" ]";
     ConstElementPtr path;
-    ASSERT_NO_THROW(path = Element::fromJSON(spath));
+    ASSERT_NO_THROW_LOG(path = Element::fromJSON(spath));
     string sactions = "[\n"
         "{\n"
         "  \"action\": \"insert\",\n"
@@ -187,15 +187,15 @@ TEST(AdaptorTest, modifyMapInsert) {
         "  \"value\": 1234\n"
         "}]\n";
     ConstElementPtr actions;
-    ASSERT_NO_THROW(actions = Element::fromJSON(sactions));
+    ASSERT_NO_THROW_LOG(actions = Element::fromJSON(sactions));
     string result = "{\n"
         " \"foo\": {\n"
         "   \"bar\": {\n"
         "     \"test\": 1234\n"
         "}}}\n";
     ConstElementPtr expected;
-    ASSERT_NO_THROW(expected = Element::fromJSON(result));
-    ASSERT_NO_THROW(Adaptor::modify(path, actions, json));
+    ASSERT_NO_THROW_LOG(expected = Element::fromJSON(result));
+    ASSERT_NO_THROW_LOG(Adaptor::modify(path, actions, json));
     EXPECT_TRUE(expected->equals(*json));
 }
 
@@ -208,10 +208,10 @@ TEST(AdaptorTest, modifyMapReplace) {
         "     \"test2\": 1234\n"
         "}}}\n";
     ElementPtr json;
-    ASSERT_NO_THROW(json = Element::fromJSON(config));
+    ASSERT_NO_THROW_LOG(json = Element::fromJSON(config));
     string spath = "[ \"foo\", \"bar\" ]";
     ConstElementPtr path;
-    ASSERT_NO_THROW(path = Element::fromJSON(spath));
+    ASSERT_NO_THROW_LOG(path = Element::fromJSON(spath));
     string sactions = "[\n"
         "{\n"
         "  \"action\": \"insert\",\n"
@@ -223,7 +223,7 @@ TEST(AdaptorTest, modifyMapReplace) {
         "  \"value\": 5678\n"
         "}]\n";
     ConstElementPtr actions;
-    ASSERT_NO_THROW(actions = Element::fromJSON(sactions));
+    ASSERT_NO_THROW_LOG(actions = Element::fromJSON(sactions));
     string result = "{\n"
         " \"foo\": {\n"
         "   \"bar\": {\n"
@@ -231,8 +231,8 @@ TEST(AdaptorTest, modifyMapReplace) {
         "     \"test2\": 5678\n"
         "}}}\n";
     ConstElementPtr expected;
-    ASSERT_NO_THROW(expected = Element::fromJSON(result));
-    ASSERT_NO_THROW(Adaptor::modify(path, actions, json));
+    ASSERT_NO_THROW_LOG(expected = Element::fromJSON(result));
+    ASSERT_NO_THROW_LOG(Adaptor::modify(path, actions, json));
     EXPECT_TRUE(expected->equals(*json));
 }
 
@@ -244,24 +244,24 @@ TEST(AdaptorTest, modifyMapDelete) {
         "     \"test\": 1234\n"
         "}}}\n";
     ElementPtr json;
-    ASSERT_NO_THROW(json = Element::fromJSON(config));
+    ASSERT_NO_THROW_LOG(json = Element::fromJSON(config));
     string spath = "[ \"foo\", \"bar\" ]";
     ConstElementPtr path;
-    ASSERT_NO_THROW(path = Element::fromJSON(spath));
+    ASSERT_NO_THROW_LOG(path = Element::fromJSON(spath));
     string sactions = "[\n"
         "{\n"
         "  \"action\": \"delete\",\n"
         "  \"key\": \"test\"\n"
         "}]\n";
     ConstElementPtr actions;
-    ASSERT_NO_THROW(actions = Element::fromJSON(sactions));
+    ASSERT_NO_THROW_LOG(actions = Element::fromJSON(sactions));
     string result = "{\n"
         " \"foo\": {\n"
         "   \"bar\": {\n"
         "}}}\n";
     ConstElementPtr expected;
-    ASSERT_NO_THROW(expected = Element::fromJSON(result));
-    ASSERT_NO_THROW(Adaptor::modify(path, actions, json));
+    ASSERT_NO_THROW_LOG(expected = Element::fromJSON(result));
+    ASSERT_NO_THROW_LOG(Adaptor::modify(path, actions, json));
     EXPECT_TRUE(expected->equals(*json));
 }
 
@@ -272,10 +272,10 @@ TEST(AdaptorTest, modifyListInsert) {
         " \"foo\": \"bar\"\n"
         "}]]\n";
     ElementPtr json;
-    ASSERT_NO_THROW(json = Element::fromJSON(config));
+    ASSERT_NO_THROW_LOG(json = Element::fromJSON(config));
     string spath = "[ 0, { \"key\": \"foo\", \"value\": \"bar\" }]";
     ConstElementPtr path;
-    ASSERT_NO_THROW(path = Element::fromJSON(spath));
+    ASSERT_NO_THROW_LOG(path = Element::fromJSON(spath));
     string sactions = "[\n"
         "{\n"
         "  \"action\": \"insert\",\n"
@@ -283,15 +283,15 @@ TEST(AdaptorTest, modifyListInsert) {
         "  \"value\": 1234\n"
         "}]\n";
     ConstElementPtr actions;
-    ASSERT_NO_THROW(actions = Element::fromJSON(sactions));
+    ASSERT_NO_THROW_LOG(actions = Element::fromJSON(sactions));
     string result = "[\n"
         "[{\n"
         " \"foo\": \"bar\",\n"
         " \"test\": 1234\n"
         "}]]\n";
     ConstElementPtr expected;
-    ASSERT_NO_THROW(expected = Element::fromJSON(result));
-    ASSERT_NO_THROW(Adaptor::modify(path, actions, json));
+    ASSERT_NO_THROW_LOG(expected = Element::fromJSON(result));
+    ASSERT_NO_THROW_LOG(Adaptor::modify(path, actions, json));
     EXPECT_TRUE(expected->equals(*json));
 }
 
@@ -303,10 +303,10 @@ TEST(AdaptorTest, modifyListAllInsert) {
         "{ \"test\": 1234 },\n"
         "]\n";
     ElementPtr json;
-    ASSERT_NO_THROW(json = Element::fromJSON(config));
+    ASSERT_NO_THROW_LOG(json = Element::fromJSON(config));
     string spath = "[ -1 ]";
     ConstElementPtr path;
-    ASSERT_NO_THROW(path = Element::fromJSON(spath));
+    ASSERT_NO_THROW_LOG(path = Element::fromJSON(spath));
     string sactions = "[\n"
         "{\n"
         "  \"action\": \"insert\",\n"
@@ -314,15 +314,15 @@ TEST(AdaptorTest, modifyListAllInsert) {
         "  \"value\": 5678\n"
         "}]\n";
     ConstElementPtr actions;
-    ASSERT_NO_THROW(actions = Element::fromJSON(sactions));
+    ASSERT_NO_THROW_LOG(actions = Element::fromJSON(sactions));
     string result = "[\n"
         "{ \"test\": 5678 },\n"
         "{ \"test\": 5678 },\n"
         "{ \"test\": 1234 }\n"
         "]\n";
     ConstElementPtr expected;
-    ASSERT_NO_THROW(expected = Element::fromJSON(result));
-    ASSERT_NO_THROW(Adaptor::modify(path, actions, json));
+    ASSERT_NO_THROW_LOG(expected = Element::fromJSON(result));
+    ASSERT_NO_THROW_LOG(Adaptor::modify(path, actions, json));
     EXPECT_TRUE(expected->equals(*json));
 }
 
@@ -335,10 +335,10 @@ TEST(AdaptorTest, modifyListDelete) {
         "0, 1, 2, 3\n"
         "]]]\n";
     ElementPtr json;
-    ASSERT_NO_THROW(json = Element::fromJSON(config));
+    ASSERT_NO_THROW_LOG(json = Element::fromJSON(config));
     string spath = "[ 0 ]";
     ConstElementPtr path;
-    ASSERT_NO_THROW(path = Element::fromJSON(spath));
+    ASSERT_NO_THROW_LOG(path = Element::fromJSON(spath));
     // Put the positional first as it applies after previous actions...
     string sactions = "[\n"
         "{\n"
@@ -349,11 +349,11 @@ TEST(AdaptorTest, modifyListDelete) {
         "  \"key\": { \"key\": \"foo\", \"value\": \"bar\" }\n"
         "}]\n";
     ConstElementPtr actions;
-    ASSERT_NO_THROW(actions = Element::fromJSON(sactions));
+    ASSERT_NO_THROW_LOG(actions = Element::fromJSON(sactions));
     string result = "[[{}]]\n";
     ConstElementPtr expected;
-    ASSERT_NO_THROW(expected = Element::fromJSON(result));
-    ASSERT_NO_THROW(Adaptor::modify(path, actions, json));
+    ASSERT_NO_THROW_LOG(expected = Element::fromJSON(result));
+    ASSERT_NO_THROW_LOG(Adaptor::modify(path, actions, json));
     EXPECT_TRUE(expected->equals(*json));
 }
 
@@ -366,12 +366,12 @@ TEST(AdaptorTest, modifyListAllDelete) {
         "0, 1, 2, 3\n"
         "]]]\n";
     ElementPtr json;
-    ASSERT_NO_THROW(json = Element::fromJSON(config));
+    ASSERT_NO_THROW_LOG(json = Element::fromJSON(config));
     // The main change from the previous unit test is key 0 -> -1 so
     // modify() applies the delete to all elements vs only the first one.
     string spath = "[ -1 ]";
     ConstElementPtr path;
-    ASSERT_NO_THROW(path = Element::fromJSON(spath));
+    ASSERT_NO_THROW_LOG(path = Element::fromJSON(spath));
     // Put the positional first as it applies after previous actions...
     string sactions = "[\n"
         "{\n"
@@ -382,11 +382,11 @@ TEST(AdaptorTest, modifyListAllDelete) {
         "  \"key\": { \"key\": \"foo\", \"value\": \"bar\" }\n"
         "}]\n";
     ConstElementPtr actions;
-    ASSERT_NO_THROW(actions = Element::fromJSON(sactions));
+    ASSERT_NO_THROW_LOG(actions = Element::fromJSON(sactions));
     string result = "[[{}]]\n";
     ConstElementPtr expected;
-    ASSERT_NO_THROW(expected = Element::fromJSON(result));
-    ASSERT_NO_THROW(Adaptor::modify(path, actions, json));
+    ASSERT_NO_THROW_LOG(expected = Element::fromJSON(result));
+    ASSERT_NO_THROW_LOG(Adaptor::modify(path, actions, json));
     EXPECT_TRUE(expected->equals(*json));
 }
 
index 11b1c34c9189cef41c6edf1807602ae7731ffab5..18f3895a4a6d6aa4d4ce3fdce5e42325e426647c 100644 (file)
@@ -107,7 +107,7 @@ public:
     /// @param config The JSON tree to load in textual format.
     void load(const string& config) {
         ElementPtr json;
-        ASSERT_NO_THROW(json = Element::fromJSON(config));
+        ASSERT_NO_THROW_LOG(json = Element::fromJSON(config));
         load(json);
     }
 
@@ -216,12 +216,12 @@ struct ConfigTestIetfV6 : ConfigTest {
 // Check empty config with ietf-dhcpv6-server model.
 TEST_F(ConfigTestIetfV6, emptyIetf6) {
     YRTree tree;
-    ASSERT_NO_THROW(load(tree));
+    ASSERT_NO_THROW_LOG(load(tree));
     EXPECT_TRUE(verify(tree));
 
     ConstElementPtr json = Element::fromJSON(emptyJson6);
     EXPECT_TRUE(verify(json));
-    ASSERT_NO_THROW(load(json));
+    ASSERT_NO_THROW_LOG(load(json));
     EXPECT_TRUE(verify(emptyJson6));
     EXPECT_TRUE(verify(tree));
 }
@@ -229,12 +229,12 @@ TEST_F(ConfigTestIetfV6, emptyIetf6) {
 // Check empty config with kea-dhcp4-server:config model.
 TEST_F(ConfigTestKeaV4, emptyKeaDhcp4) {
     YRTree tree;
-    ASSERT_NO_THROW(load(tree));
+    ASSERT_NO_THROW_LOG(load(tree));
     EXPECT_TRUE(verify(emptyTreeKeaDhcp4));
 
     ConstElementPtr json = Element::fromJSON(emptyJson4);
     EXPECT_TRUE(verify(json));
-    ASSERT_NO_THROW(load(json));
+    ASSERT_NO_THROW_LOG(load(json));
     EXPECT_TRUE(verify(emptyJson4));
     EXPECT_TRUE(verify(emptyTreeKeaDhcp4));
 }
@@ -242,12 +242,12 @@ TEST_F(ConfigTestKeaV4, emptyKeaDhcp4) {
 // Check empty config with kea-dhcp6-server:config model.
 TEST_F(ConfigTestKeaV6, emptyKeaDhcp6) {
     YRTree tree;
-    ASSERT_NO_THROW(load(tree));
+    ASSERT_NO_THROW_LOG(load(tree));
     EXPECT_TRUE(verify(emptyTreeKeaDhcp6));
 
     ConstElementPtr json = Element::fromJSON(emptyJson6);
     EXPECT_TRUE(verify(json));
-    ASSERT_NO_THROW(load(json));
+    ASSERT_NO_THROW_LOG(load(json));
     EXPECT_TRUE(verify(emptyJson6));
     EXPECT_TRUE(verify(emptyTreeKeaDhcp6));
 }
@@ -257,12 +257,12 @@ TEST_F(ConfigTestKeaV6, emptyKeaDhcp6) {
 // container with a mandatory ent-num leaf and no presence flag,
 // and of course the candidate YANG tree has nothing for this.
 TEST_F(ConfigTestIetfV6, subnetTwoPoolsIetf6) {
-    ASSERT_NO_THROW(load(subnetTwoPoolsTreeIetf6));
+    ASSERT_NO_THROW_LOG(load(subnetTwoPoolsTreeIetf6));
     EXPECT_TRUE(verify(subnetTwoPoolsJson6));
 
     resetSession();
 
-    ASSERT_NO_THROW(load(subnetTwoPoolsJson6));
+    ASSERT_NO_THROW_LOG(load(subnetTwoPoolsJson6));
     EXPECT_TRUE(verify(subnetTwoPoolsTreeIetf6));
 
     EXPECT_FALSE(validate());
@@ -271,12 +271,12 @@ TEST_F(ConfigTestIetfV6, subnetTwoPoolsIetf6) {
 // Check subnet with a pool and option data lists with
 // kea-dhcp4-server:config model.
 TEST_F(ConfigTestKeaV4, subnetOptionsKeaDhcp4) {
-    ASSERT_NO_THROW(load(subnetOptionsTreeKeaDhcp4));
+    ASSERT_NO_THROW_LOG(load(subnetOptionsTreeKeaDhcp4));
     EXPECT_TRUE(verify(subnetOptionsJson4));
 
     resetSession();
 
-    ASSERT_NO_THROW(load(subnetOptionsJson4));
+    ASSERT_NO_THROW_LOG(load(subnetOptionsJson4));
     EXPECT_TRUE(verify(subnetOptionsTreeKeaDhcp4));
 
     EXPECT_TRUE(validate());
@@ -285,12 +285,12 @@ TEST_F(ConfigTestKeaV4, subnetOptionsKeaDhcp4) {
 // Check subnet with a pool and option data lists with
 // kea-dhcp6-server:config model.
 TEST_F(ConfigTestKeaV6, subnetOptionsKeaDhcp6) {
-    ASSERT_NO_THROW(load(subnetOptionsTreeKeaDhcp6));
+    ASSERT_NO_THROW_LOG(load(subnetOptionsTreeKeaDhcp6));
     EXPECT_TRUE(verify(subnetOptionsJson6));
 
     resetSession();
 
-    ASSERT_NO_THROW(load(subnetOptionsJson6));
+    ASSERT_NO_THROW_LOG(load(subnetOptionsJson6));
     EXPECT_TRUE(verify(subnetOptionsTreeKeaDhcp6));
 
     EXPECT_TRUE(validate());
@@ -298,18 +298,18 @@ TEST_F(ConfigTestKeaV6, subnetOptionsKeaDhcp6) {
 
 // Check with timers.
 TEST_F(ConfigTestIetfV6, subnetTimersIetf6) {
-    ASSERT_NO_THROW(load(subnetTimersIetf6));
+    ASSERT_NO_THROW_LOG(load(subnetTimersIetf6));
     EXPECT_TRUE(verify(subnetTimersJson6));
 
     resetSession();
 
-    ASSERT_NO_THROW(load(subnetTimersJson6));
+    ASSERT_NO_THROW_LOG(load(subnetTimersJson6));
     EXPECT_TRUE(verify(subnetTimersIetf6));
 }
 
 // Check a ietf-dhcpv6-server configuration which validates.
 TEST_F(ConfigTestIetfV6, validateIetf6) {
-    ASSERT_NO_THROW(load(validTreeIetf6));
+    ASSERT_NO_THROW_LOG(load(validTreeIetf6));
     EXPECT_TRUE(verify(validTreeIetf6));
 
     // If this validation fails, make sure you have the model *and its
@@ -352,7 +352,7 @@ TEST_F(ConfigTestKeaV4, examples4) {
         string path = string(CFG_EXAMPLES) + "/kea4/" + file;
         cout << "Testing file " << path << endl;
         ConstElementPtr json;
-        ASSERT_NO_THROW(json = loadFile(path));
+        ASSERT_NO_THROW_LOG(json = loadFile(path));
         json = isc::test::moveComments(json);
         EXPECT_TRUE(verify(json));
         EXPECT_TRUE(validate());
@@ -394,7 +394,7 @@ TEST_F(ConfigTestKeaV6, examples6) {
         string path = string(CFG_EXAMPLES) + "/kea6/" + file;
         cout << "Testing file " << path << endl;
         ConstElementPtr json;
-        ASSERT_NO_THROW(json = loadFile(path));
+        ASSERT_NO_THROW_LOG(json = loadFile(path));
         json = isc::test::moveComments(json);
         EXPECT_TRUE(verify(json));
         EXPECT_TRUE(validate());
@@ -403,12 +403,12 @@ TEST_F(ConfigTestKeaV6, examples6) {
 
 // Check the example in the design document.
 TEST_F(ConfigTestIetfV6, designExample) {
-    ASSERT_NO_THROW(load(designExampleTree));
+    ASSERT_NO_THROW_LOG(load(designExampleTree));
     EXPECT_TRUE(verify(designExampleJson));
 
     resetSession();
 
-    ASSERT_NO_THROW(load(designExampleJson));
+    ASSERT_NO_THROW_LOG(load(designExampleJson));
     EXPECT_TRUE(verify(designExampleTree));
 }
 
index 8c7d4602a892158ca3e0073618c95033486db65d..3d9d4feb1b890ae3c9f5fd7862d72b6fe06d0615 100644 (file)
@@ -118,7 +118,7 @@ TEST_F(TranslatorControlSocketTestCtrlAgent, set) {
     } catch (const std::exception& ex) {
         cerr << "setControlSocket fail with " << ex.what() << endl;
     }
-    ASSERT_NO_THROW(t_obj_->setControlSocket(xpath, sock));
+    ASSERT_NO_THROW_LOG(t_obj_->setControlSocket(xpath, sock));
 
     // Get it back.
     ConstElementPtr got;
index a279ea1d18c7a62581b62ca41296f1f54a1a2126..6c4eb29b93476ef18df04a1079af772044b52d85 100644 (file)
@@ -91,7 +91,7 @@ TEST_F(TranslatorDatabaseTestv4, set) {
     ElementPtr database = Element::createMap();
     database->set("type", Element::create(string("memfile")));
     database->set("lfc-interval", Element::create(3600));
-    ASSERT_NO_THROW(t_obj_->setDatabase(xpath, database));
+    ASSERT_NO_THROW_LOG(t_obj_->setDatabase(xpath, database));
 
     // Get it back.
     ConstElementPtr got;
@@ -124,7 +124,7 @@ TEST_F(TranslatorDatabaseTestv4, setEmpty) {
     sess_->apply_changes();
 
     // Reset to empty.
-    ASSERT_NO_THROW(t_obj_->setDatabase(xpath, ConstElementPtr()));
+    ASSERT_NO_THROW_LOG(t_obj_->setDatabase(xpath, ConstElementPtr()));
 
     // Get it back.
     ConstElementPtr database;
@@ -233,7 +233,7 @@ TEST_F(TranslatorDatabasesTestv6, set) {
     database->set("lfc-interval", Element::create(3600));
     ElementPtr databases = Element::createList();
     databases->add(database);
-    ASSERT_NO_THROW(t_obj_->setDatabases(xpath, databases));
+    ASSERT_NO_THROW_LOG(t_obj_->setDatabases(xpath, databases));
 
     // Get it back.
     ConstElementPtr gots;
index 92e87b447eb3c982f60e8eebd8639838bc50216c..2dbfbcc1d6f784e82bfa10270e0efef60075492a 100644 (file)
@@ -117,7 +117,7 @@ TEST_F(TranslatorLoggersTestv4, set) {
     logger->set("output_options", options);
     ElementPtr loggers = Element::createList();
     loggers->add(logger);
-    ASSERT_NO_THROW(t_obj_->setLoggers(xpath, loggers));
+    ASSERT_NO_THROW_LOG(t_obj_->setLoggers(xpath, loggers));
 
     // Get it back.
     ConstElementPtr gots;
index 8270c0599e16aed5048e26c40b8046ba93b808e9..b02284c7f906f78cfd83f85f2c00c77a0b667b76 100644 (file)
@@ -66,10 +66,10 @@ TEST_F(TranslatorOptionDataListTestv6, get) {
     const string& xdata = xoption + "/data";
     const string& xsend = xoption + "/always-send";
     S_Val s_false(new Val(false));
-    ASSERT_NO_THROW(sess_->set_item(xformat.c_str(), s_false));
+    ASSERT_NO_THROW_LOG(sess_->set_item(xformat.c_str(), s_false));
     S_Val s_data(new Val("12121212"));
-    ASSERT_NO_THROW(sess_->set_item(xdata.c_str(), s_data));
-    ASSERT_NO_THROW(sess_->set_item(xsend.c_str(), s_false));
+    ASSERT_NO_THROW_LOG(sess_->set_item(xdata.c_str(), s_data));
+    ASSERT_NO_THROW_LOG(sess_->set_item(xsend.c_str(), s_false));
 
     // Get the option data.
     ConstElementPtr option;
index b056076713aee2eefe7b56ca7fb36e70c6cab78d..d6c3cdf9d2d9cf22a48b4fe71f180db0c7437bae 100644 (file)
@@ -74,11 +74,11 @@ TEST_F(TranslatorOptionDefListTestKeaV6, get) {
     const string& xtype = xdef + "/type";
     const string& xarray = xdef + "/array";
     S_Val s_name(new Val("foo"));
-    ASSERT_NO_THROW(sess_->set_item(xname.c_str(), s_name));
+    ASSERT_NO_THROW_LOG(sess_->set_item(xname.c_str(), s_name));
     S_Val s_type(new Val("string"));
-    ASSERT_NO_THROW(sess_->set_item(xtype.c_str(), s_type));
+    ASSERT_NO_THROW_LOG(sess_->set_item(xtype.c_str(), s_type));
     S_Val s_array(new Val(false));
-    ASSERT_NO_THROW(sess_->set_item(xarray.c_str(), s_array));
+    ASSERT_NO_THROW_LOG(sess_->set_item(xarray.c_str(), s_array));
 
     // Get the option def.
     ConstElementPtr def;
index 54d005a22c9df2f09936abca034fdcd79583bc7a..d8386b59fd6733fa37b53c0ae52580241ab92566 100644 (file)
@@ -121,7 +121,7 @@ TEST_F(TranslatorPoolsTestKeaV6, getKea) {
     const string& prefix = "2001:db8::1:0/112";
     string start_addr;
     string end_addr;
-    ASSERT_NO_THROW(TranslatorPool::getAddresses(prefix,
+    ASSERT_NO_THROW_LOG(TranslatorPool::getAddresses(prefix,
                                                  start_addr, end_addr));
     EXPECT_EQ("2001:db8::1:0", start_addr);
     EXPECT_EQ("2001:db8::1:ffff", end_addr);
index f5c96293e132d8b16dfb65111398348b9400a0d7..a602b2860403af07e0eaab8ffd7747e3232dc748 100644 (file)
@@ -155,7 +155,7 @@ TEST(TranslatorBasicTest, getItem) {
     S_Connection conn(std::make_shared<Connection>());
     S_Session sess(new Session(conn, SR_DS_CANDIDATE));
     boost::scoped_ptr<TranslatorBasic> t_obj;
-    ASSERT_NO_THROW(t_obj.reset(new TranslatorBasic(sess, "")));
+    ASSERT_NO_THROW_LOG(t_obj.reset(new TranslatorBasic(sess, "")));
     S_Val s_val;
     ConstElementPtr elem;
     string xpath;
@@ -453,7 +453,7 @@ TEST(TranslatorBasicTest, setItem) {
     S_Connection conn(std::make_shared<Connection>());
     S_Session sess(new Session(conn, SR_DS_CANDIDATE));
     boost::scoped_ptr<TranslatorBasic> t_obj;
-    ASSERT_NO_THROW(t_obj.reset(new TranslatorBasic(sess, "")));
+    ASSERT_NO_THROW_LOG(t_obj.reset(new TranslatorBasic(sess, "")));
 
     // Container.
     string xpath = "/keatest-module:container";
@@ -661,7 +661,7 @@ TEST(TranslatorBasicTest, list) {
     S_Connection conn(std::make_shared<Connection>());
     S_Session sess(new Session(conn, SR_DS_CANDIDATE));
     boost::scoped_ptr<TranslatorBasic> t_obj;
-    ASSERT_NO_THROW(t_obj.reset(new TranslatorBasic(sess, "")));
+    ASSERT_NO_THROW_LOG(t_obj.reset(new TranslatorBasic(sess, "")));
     string xpath;
 
     // Empty list.