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

Tor Lillqvist tml at collabora.com
Thu Apr 14 14:05:34 UTC 2016


 loolwsd/test/httpwstest.cpp |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 2edf15a18bd56c8f6d5b1ee2fe9c23772dbd1e9b
Author: Tor Lillqvist <tml at collabora.com>
Date:   Thu Apr 14 17:04:34 2016 +0300

    Use CPPUNIT_ASSERT_EQUAL() to get expected and actual values into output

diff --git a/loolwsd/test/httpwstest.cpp b/loolwsd/test/httpwstest.cpp
index a236750..3529f73 100644
--- a/loolwsd/test/httpwstest.cpp
+++ b/loolwsd/test/httpwstest.cpp
@@ -200,7 +200,7 @@ void HTTPWSTest::testHandShake()
 
         std::string receive;
         bytes = socket.receiveFrame(buffer, sizeof(buffer), flags);
-        CPPUNIT_ASSERT(bytes == (int) payload.size());
+        CPPUNIT_ASSERT_EQUAL((int) payload.size(), bytes);
         CPPUNIT_ASSERT(payload.compare(0, payload.size(), buffer, 0, bytes) == 0);
         CPPUNIT_ASSERT(flags == Poco::Net::WebSocket::FRAME_TEXT);
 
@@ -212,7 +212,7 @@ void HTTPWSTest::testHandShake()
 
         payload = "statusindicator: connect";
         bytes = socket.receiveFrame(buffer, sizeof(buffer), flags);
-        CPPUNIT_ASSERT(bytes == (int) payload.size());
+        CPPUNIT_ASSERT_EQUAL((int) payload.size(), bytes);
         CPPUNIT_ASSERT(payload.compare(0, payload.size(), buffer, 0, bytes) == 0);
         CPPUNIT_ASSERT(flags == Poco::Net::WebSocket::FRAME_TEXT);
 
@@ -220,14 +220,14 @@ void HTTPWSTest::testHandShake()
         if (std::strstr(buffer, fail))
         {
             payload = "statusindicator: fail";
-            CPPUNIT_ASSERT(bytes == (int) payload.size());
+            CPPUNIT_ASSERT_EQUAL((int) payload.size(), bytes);
             CPPUNIT_ASSERT(payload.compare(0, payload.size(), buffer, 0, bytes) == 0);
             CPPUNIT_ASSERT(flags == Poco::Net::WebSocket::FRAME_TEXT);
         }
         else
         {
             payload = "statusindicator: ready";
-            CPPUNIT_ASSERT(bytes == (int) payload.size());
+            CPPUNIT_ASSERT_EQUAL((int) payload.size(), bytes);
             CPPUNIT_ASSERT(payload.compare(0, payload.size(), buffer, 0, bytes) == 0);
             CPPUNIT_ASSERT(flags == Poco::Net::WebSocket::FRAME_TEXT);
         }


More information about the Libreoffice-commits mailing list