Parcourir la source

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

Marcin Siodelski il y a 11 ans
Parent
commit
c936de6a26
1 fichiers modifiés avec 8 ajouts et 6 suppressions
  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 {
         src_pkt->pack();
     } 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.
     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()),
                                buf.getLength()));
     } 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 {