Commit a92d0500 authored by Tomek Mrugalski's avatar Tomek Mrugalski 🛰
Browse files

[5305] Minor tweaks in tests.

parent 95fdb0e5
......@@ -29,6 +29,9 @@ TEST(CfgSharedNetworks4Test, getByName) {
ASSERT_TRUE(returned_network1);
SharedNetwork4Ptr returned_network2 = cfg.getByName("dog");
ASSERT_TRUE(returned_network2);
// Check that non-existent name does not return bogus data.
EXPECT_FALSE(cfg.getByName("ant"));
}
// This test verifies that it is possible to delete a network.
......@@ -53,6 +56,10 @@ TEST(CfgSharedNetworks4Test, deleteByName) {
ASSERT_NO_THROW(cfg.del(network2->getName()));
ASSERT_FALSE(cfg.getByName(network1->getName()));
ASSERT_FALSE(cfg.getByName(network2->getName()));
// Check that attempting to delete the same subnet twice will fail.
ASSERT_THROW(cfg.del(network1->getName()), BadValue);
ASSERT_THROW(cfg.del(network2->getName()), BadValue);
}
// This test verifies that shared networks must have unique names.
......
......@@ -29,6 +29,9 @@ TEST(CfgSharedNetworks6Test, getByName) {
ASSERT_TRUE(returned_network1);
SharedNetwork6Ptr returned_network2 = cfg.getByName("dog");
ASSERT_TRUE(returned_network2);
// Check that non-existent name does not return bogus data.
EXPECT_FALSE(cfg.getByName("ant"));
}
// This test verifies that it is possible to delete a network.
......@@ -53,6 +56,10 @@ TEST(CfgSharedNetworks6Test, deleteByName) {
ASSERT_NO_THROW(cfg.del(network2->getName()));
ASSERT_FALSE(cfg.getByName(network1->getName()));
ASSERT_FALSE(cfg.getByName(network2->getName()));
// Check that attempting to delete the same subnet twice will fail.
ASSERT_THROW(cfg.del(network1->getName()), BadValue);
ASSERT_THROW(cfg.del(network2->getName()), BadValue);
}
// This test verifies that shared networks must have unique names.
......
......@@ -287,7 +287,7 @@ TEST(SharedNetwork4Test, destructSharedNetwork) {
// This test verifies that shared network can be given a name and that
// this name can be retrieved.
TEST(SharedNetwork6Test, getName) {
// Create shared network with an initial name "dog".
// Create shared network with an initial name "frog".
SharedNetwork6Ptr network(new SharedNetwork6("frog"));
EXPECT_EQ("frog", network->getName());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment