// Check subnet 1.
auto subnet = subnets->begin();
+ ASSERT_TRUE(subnet != subnets->end());
EXPECT_EQ("192.0.2.0", (*subnet)->get().first.toText());
EXPECT_EQ(24, (*subnet)->get().second);
// Check subnet 2.
++subnet;
+ ASSERT_TRUE(subnet != subnets->end());
EXPECT_EQ("192.0.3.0", (*subnet)->get().first.toText());
EXPECT_EQ(24, (*subnet)->get().second);
// And finally check subnet 3.
++subnet;
+ ASSERT_TRUE(subnet != subnets->end());
EXPECT_EQ("192.0.4.0", (*subnet)->get().first.toText());
EXPECT_EQ(24, (*subnet)->get().second);
// Check subnet 1.
auto subnet = subnets->begin();
+ ASSERT_TRUE(subnet != subnets->end());
EXPECT_EQ("192.0.2.0", (*subnet)->get().first.toText());
EXPECT_EQ(22, (*subnet)->get().second);
// Check subnet 1.
auto subnet = subnets->begin();
+ ASSERT_TRUE(subnet != subnets->end());
EXPECT_EQ("192.0.2.0", (*subnet)->get().first.toText());
EXPECT_EQ(22, (*subnet)->get().second);
TEST_F(JSONFileBackendTest, cBlockComments) {
string config_c_block_comments = "/* This is a comment. It should be \n"
- "ignored. Real config starts in line below*/\n"
+ "ignored. Real config starts in line below*/\n"
"{ \"Dhcp4\": {"
"\"interfaces-config\": {"
" \"interfaces\": [ \"*\" ]"
// Check subnet 1.
auto subnet = subnets->begin();
+ ASSERT_TRUE(subnet != subnets->end());
EXPECT_EQ("192.0.2.0", (*subnet)->get().first.toText());
EXPECT_EQ(22, (*subnet)->get().second);
// Check subnet 1.
auto subnet = subnets->begin();
+ ASSERT_TRUE(subnet != subnets->end());
EXPECT_EQ("192.0.2.0", (*subnet)->get().first.toText());
EXPECT_EQ(22, (*subnet)->get().second);
/// @c CBControlDHCPv6 object.
class NakedControlledDhcpv6Srv: public ControlledDhcpv6Srv {
public:
+
/// @brief Constructor.
NakedControlledDhcpv6Srv()
: ControlledDhcpv6Srv(0) {
" } ],"
"\"valid-lifetime\": 4000 }"
"}";
+
writeFile(TEST_FILE, config);
// Now initialize the server
ASSERT_TRUE(subnets);
ASSERT_EQ(3, subnets->size()); // We expect 3 subnets.
-
// Check subnet 1.
auto subnet = subnets->begin();
ASSERT_TRUE(subnet != subnets->end());
srv.reset(new ControlledDhcpv6Srv(0))
);
- // And configure it using config without
+ // And configure it using config with comments.
EXPECT_NO_THROW(srv->init(TEST_FILE));
// Now check if the configuration has been applied correctly.
srv.reset(new ControlledDhcpv6Srv(0))
);
- // And configure it using config without
+ // And configure it using config with comments.
EXPECT_NO_THROW(srv->init(TEST_FILE));
// Now check if the configuration has been applied correctly.
"\"valid-lifetime\": 4000 }"
"}";
- writeFile(TEST_FILE, config_c_block_comments);
+ writeFile(TEST_FILE, config_c_block_comments);
// Now initialize the server
boost::scoped_ptr<ControlledDhcpv6Srv> srv;
srv.reset(new ControlledDhcpv6Srv(0))
);
- // And configure it using config without
+ // And configure it using config with comments.
EXPECT_NO_THROW(srv->init(TEST_FILE));
// Now check if the configuration has been applied correctly.
srv.reset(new ControlledDhcpv6Srv(0))
);
- // And configure it using config without
+ // And configure it using config with comments.
EXPECT_NO_THROW(srv->init(TEST_FILE));
// Now check if the configuration has been applied correctly.
writeFile(TEST_FILE, config_recursive_include);
writeFile(TEST_INCLUDE, include);
-
// Now initialize the server
boost::scoped_ptr<ControlledDhcpv6Srv> srv;
ASSERT_NO_THROW(
srv.reset(new ControlledDhcpv6Srv(0))
);
- // And configure it using config
+ // And configure it using config with comments.
try {
srv->init(TEST_FILE);
FAIL() << "Expected Dhcp6ParseError but nothing was raised";
}
}
-// This test checks if configuration can be read from a JSON file.
// This test checks if configuration detects failure when trying:
// - empty file
// - empty filename
EXPECT_NO_THROW(static_cast<void>(LeaseMgrFactory::instance()));
}
-
// This test verifies that the timer triggering configuration updates
// is invoked according to the configured value of the
// config-fetch-wait-time.
///
/// Destroys MySQL schema.
virtual ~JSONFileBackendMySQLTest() {
- // If data wipe enabled, delete transient data otherwise destroy the schema
+ // If data wipe enabled, delete transient data otherwise destroy the schema.
destroyMySQLSchema();
}