From: Tomek Mrugalski Date: Fri, 18 Jan 2013 13:04:22 +0000 (+0100) Subject: [2596] Error message in unlikely case that the system has nonexistent0 interface. X-Git-Tag: bind10-1.1.0beta1-release~72^2~42^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f2c0ce1adf8090ecb9ed76e6f3f201d0b044e060;p=thirdparty%2Fkea.git [2596] Error message in unlikely case that the system has nonexistent0 interface. --- diff --git a/src/bin/dhcp6/tests/config_parser_unittest.cc b/src/bin/dhcp6/tests/config_parser_unittest.cc index caca8eb0e2..ea84a1cff3 100644 --- a/src/bin/dhcp6/tests/config_parser_unittest.cc +++ b/src/bin/dhcp6/tests/config_parser_unittest.cc @@ -52,11 +52,18 @@ public: // There must be some interface detected if (ifaces.empty()) { + // We can't use ASSERT in constructor ADD_FAILURE() << "No interfaces detected."; } valid_iface_ = ifaces.begin()->getName(); bogus_iface_ = "nonexisting0"; + + if (IfaceMgr::instance().getIface(bogus_iface_)) { + ADD_FAILURE() << "The '" << bogus_iface_ << "' exists on this system" + << " while the test assumes that it doesn't to execute" + << " some negative scenarios. Can't continue this test"; + } } ~Dhcp6ParserTest() {