Browse Source

[3200] In two additional AssertionFailures, pass the message as parameter.

Marcin Siodelski 11 years ago
parent
commit
c936de6a26
1 changed files with 8 additions and 6 deletions
  1. 8 6
      src/bin/dhcp4/tests/dhcp4_test_utils.cc

+ 8 - 6
src/bin/dhcp4/tests/dhcp4_test_utils.cc

@@ -348,9 +348,9 @@ Dhcpv4SrvTest::createPacketFromBuffer(const Pkt4Ptr& src_pkt,
     try {
     try {
         src_pkt->pack();
         src_pkt->pack();
     } catch (const Exception& ex) {
     } catch (const Exception& ex) {
-        return (::testing::AssertionFailure() <<
-                "Failed to parse source packet: "
-                << ex.what());
+        return (::testing::AssertionFailure(::testing::Message()
+                                            << "Failed to parse source packet: "
+                                            << ex.what()));
     }
     }
     // Get the output buffer from the source packet.
     // Get the output buffer from the source packet.
     const util::OutputBuffer& buf = src_pkt->getBuffer();
     const util::OutputBuffer& buf = src_pkt->getBuffer();
@@ -360,9 +360,11 @@ Dhcpv4SrvTest::createPacketFromBuffer(const Pkt4Ptr& src_pkt,
         dst_pkt.reset(new Pkt4(static_cast<const uint8_t*>(buf.getData()),
         dst_pkt.reset(new Pkt4(static_cast<const uint8_t*>(buf.getData()),
                                buf.getLength()));
                                buf.getLength()));
     } catch (const Exception& ex) {
     } catch (const Exception& ex) {
-        return (::testing::AssertionFailure()
-                << "Failed to create a destination packet from the buffer: "
-                << ex.what());
+        return (::testing::AssertionFailure(::testing::Message()
+                                            << "Failed to create a"
+                                            " destination packet from"
+                                            " the buffer: "
+                                            << ex.what()));
     }
     }
 
 
     try {
     try {