[Libreoffice-commits] online.git: loolwsd/test

Jan Holesovsky kendy at collabora.com
Tue Apr 26 09:54:51 UTC 2016


 loolwsd/test/httpwstest.cpp |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit f5abfcde68775d8663b98f770a08d3450158690a
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Tue Apr 26 11:52:43 2016 +0200

    Improve test to be able to see the message directly.
    
    The test was unreliable, but any change there made it reliable, so not sure
    yet what was the root cause - but at least this should help seeing the
    brokeness once it appears again.

diff --git a/loolwsd/test/httpwstest.cpp b/loolwsd/test/httpwstest.cpp
index 492ebf1..299b1e0 100644
--- a/loolwsd/test/httpwstest.cpp
+++ b/loolwsd/test/httpwstest.cpp
@@ -224,8 +224,7 @@ void HTTPWSTest::testHandShake()
         std::string receive;
         socket.setReceiveTimeout(0);
         bytes = socket.receiveFrame(buffer, sizeof(buffer), flags);
-        CPPUNIT_ASSERT_EQUAL((int) payload.size(), bytes);
-        CPPUNIT_ASSERT(payload.compare(0, payload.size(), buffer, 0, bytes) == 0);
+        CPPUNIT_ASSERT_EQUAL(std::string(payload), std::string(buffer, bytes));
         CPPUNIT_ASSERT(flags == Poco::Net::WebSocket::FRAME_TEXT);
 
         bytes = socket.receiveFrame(buffer, sizeof(buffer), flags);


More information about the Libreoffice-commits mailing list