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

Tor Lillqvist tml at collabora.com
Wed Apr 27 11:20:27 UTC 2016


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

New commits:
commit ee7f8c158a47a0d3cfc035fef0d51790af15b4a7
Author: Tor Lillqvist <tml at collabora.com>
Date:   Wed Apr 27 14:17:53 2016 +0300

    Actually we want to check only for it starting with the expected string
    
    As this assert fails at the moment (it did even before my previous
    commit), I can't be 100% sure it is correct now. So sue me. Or revert
    both my changes.

diff --git a/loolwsd/test/httpwstest.cpp b/loolwsd/test/httpwstest.cpp
index 13f121c..e2a46eb 100644
--- a/loolwsd/test/httpwstest.cpp
+++ b/loolwsd/test/httpwstest.cpp
@@ -9,6 +9,7 @@
 
 #include "config.h"
 
+#include <algorithm>
 #include <regex>
 
 #include <Poco/DirectoryIterator.h>
@@ -232,7 +233,7 @@ void HTTPWSTest::testHandShake()
         {
             // After document broker finish searching it sends editlok
             // it should be at end on handshake
-            CPPUNIT_ASSERT_EQUAL(prefixEdit, std::string(buffer, bytes));
+            CPPUNIT_ASSERT_EQUAL(prefixEdit, std::string(buffer, std::min((std::string::size_type)bytes, prefixEdit.size())));
             CPPUNIT_ASSERT(flags == Poco::Net::WebSocket::FRAME_TEXT);
 
             payload = "statusindicator: connect";


More information about the Libreoffice-commits mailing list