From a6cd22451be6684f4bebbc34d5344371afdeaa4b Mon Sep 17 00:00:00 2001 From: Stephen Morris Date: Thu, 25 Jul 2013 16:11:34 +0100 Subject: [2981] Final modifications before review --- src/bin/dhcp4/tests/marker_file.cc | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'src/bin/dhcp4/tests/marker_file.cc') diff --git a/src/bin/dhcp4/tests/marker_file.cc b/src/bin/dhcp4/tests/marker_file.cc index d05ff60cb5..d1c4aba1c5 100644 --- a/src/bin/dhcp4/tests/marker_file.cc +++ b/src/bin/dhcp4/tests/marker_file.cc @@ -34,22 +34,10 @@ checkMarkerFile(const char* name, const char* expected) { // Is it open? if (!file.is_open()) { - - // No. This is OK if we don't expected is to be present but is - // a failure otherwise. - if (expected == NULL) { - return (true); - } ADD_FAILURE() << "Unable to open " << name << ". It was expected " << "to be present and to contain the string '" << expected << "'"; return (false); - } else if (expected == NULL) { - - // File is open but we don't expect it to be present. - ADD_FAILURE() << "Opened " << name << " but it is not expected to " - << "be present."; - return (false); } // OK, is open, so read the data and see what we have. Compare it @@ -58,7 +46,8 @@ checkMarkerFile(const char* name, const char* expected) { getline(file, content); string expected_str(expected); - EXPECT_EQ(expected_str, content) << "Data was read from " << name; + EXPECT_EQ(expected_str, content) << "Marker file " << name + << "did not contain the expected data"; file.close(); return (expected_str == content); -- cgit v1.2.3