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

Ashod Nakashian ashod.nakashian at collabora.co.uk
Fri Apr 29 21:20:32 UTC 2016


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

New commits:
commit 4be73e593466efef017ac031f10b15cbdabb14c1
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date:   Fri Apr 29 17:17:28 2016 -0400

    loolwsd: minor improvement to testing socket flags
    
    Change-Id: I87d4d6a22fccef97bf69fce249ec0374db417714
    Reviewed-on: https://gerrit.libreoffice.org/24502
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Tested-by: Ashod Nakashian <ashnakash at gmail.com>

diff --git a/loolwsd/test/httpwstest.cpp b/loolwsd/test/httpwstest.cpp
index 3840bb6..258b44f 100644
--- a/loolwsd/test/httpwstest.cpp
+++ b/loolwsd/test/httpwstest.cpp
@@ -232,27 +232,27 @@ void HTTPWSTest::testHandShake()
         socket.setReceiveTimeout(0);
         bytes = socket.receiveFrame(buffer, sizeof(buffer), flags);
         CPPUNIT_ASSERT_EQUAL(std::string(payload), std::string(buffer, bytes));
-        CPPUNIT_ASSERT_EQUAL(static_cast<int>(Poco::Net::WebSocket::FRAME_TEXT), flags);
+        CPPUNIT_ASSERT_EQUAL(static_cast<int>(Poco::Net::WebSocket::FRAME_TEXT), flags & Poco::Net::WebSocket::FRAME_TEXT);
 
         bytes = socket.receiveFrame(buffer, sizeof(buffer), flags);
         if (!std::strstr(buffer, fail))
         {
             payload = "statusindicator: connect";
             CPPUNIT_ASSERT_EQUAL(payload, std::string(buffer, bytes));
-            CPPUNIT_ASSERT_EQUAL(static_cast<int>(Poco::Net::WebSocket::FRAME_TEXT), flags);
+            CPPUNIT_ASSERT_EQUAL(static_cast<int>(Poco::Net::WebSocket::FRAME_TEXT), flags & Poco::Net::WebSocket::FRAME_TEXT);
 
             bytes = socket.receiveFrame(buffer, sizeof(buffer), flags);
             if (!std::strstr(buffer, fail))
             {
                 payload = "statusindicator: ready";
                 CPPUNIT_ASSERT_EQUAL(payload, std::string(buffer, bytes));
-                CPPUNIT_ASSERT_EQUAL(static_cast<int>(Poco::Net::WebSocket::FRAME_TEXT), flags);
+                CPPUNIT_ASSERT_EQUAL(static_cast<int>(Poco::Net::WebSocket::FRAME_TEXT), flags & Poco::Net::WebSocket::FRAME_TEXT);
             }
             else
             {
                 // check error message
                 CPPUNIT_ASSERT(std::strstr(buffer, SERVICE_UNAVALABLE_INTERNAL_ERROR) != nullptr);
-                CPPUNIT_ASSERT_EQUAL(static_cast<int>(Poco::Net::WebSocket::FRAME_TEXT), flags);
+                CPPUNIT_ASSERT_EQUAL(static_cast<int>(Poco::Net::WebSocket::FRAME_TEXT), flags & Poco::Net::WebSocket::FRAME_TEXT);
 
                 // close frame message
                 bytes = socket.receiveFrame(buffer, sizeof(buffer), flags);
@@ -264,7 +264,7 @@ void HTTPWSTest::testHandShake()
         {
             // check error message
             CPPUNIT_ASSERT(std::strstr(buffer, SERVICE_UNAVALABLE_INTERNAL_ERROR) != nullptr);
-            CPPUNIT_ASSERT_EQUAL(static_cast<int>(Poco::Net::WebSocket::FRAME_TEXT), flags);
+            CPPUNIT_ASSERT_EQUAL(static_cast<int>(Poco::Net::WebSocket::FRAME_TEXT), flags & Poco::Net::WebSocket::FRAME_TEXT);
 
             // close frame message
             bytes = socket.receiveFrame(buffer, sizeof(buffer), flags);


More information about the Libreoffice-commits mailing list