[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-1-0' - loolwsd/test

Henry Castro hcastro at collabora.com
Tue May 31 14:48:07 UTC 2016


 loolwsd/test/TileCacheTests.cpp |    6 +++++-
 loolwsd/test/httpwstest.cpp     |    6 +++++-
 2 files changed, 10 insertions(+), 2 deletions(-)

New commits:
commit 82408599881ee3b22468baefdaf5e8900732752f
Author: Henry Castro <hcastro at collabora.com>
Date:   Mon May 30 20:26:40 2016 -0400

    loolwsd: test: update unit test getPartHashCodes

diff --git a/loolwsd/test/TileCacheTests.cpp b/loolwsd/test/TileCacheTests.cpp
index da10783..ddf620b 100644
--- a/loolwsd/test/TileCacheTests.cpp
+++ b/loolwsd/test/TileCacheTests.cpp
@@ -334,8 +334,12 @@ void TileCacheTests::checkTiles(Poco::Net::WebSocket& socket, const std::string&
     getResponseMessage(socket, "status:", response, false);
     CPPUNIT_ASSERT_MESSAGE("did not receive a status: message as expected", !response.empty());
     {
+        std::string line;
+        std::istringstream istr(response);
+        std::getline(istr, line);
+
         std::cout << "status: " << response << std::endl;
-        Poco::StringTokenizer tokens(response, " ", Poco::StringTokenizer::TOK_IGNORE_EMPTY | Poco::StringTokenizer::TOK_TRIM);
+        Poco::StringTokenizer tokens(line, " ", Poco::StringTokenizer::TOK_IGNORE_EMPTY | Poco::StringTokenizer::TOK_TRIM);
         CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(5), tokens.count());
 
         // Expected format is something like 'type= parts= current= width= height='.
diff --git a/loolwsd/test/httpwstest.cpp b/loolwsd/test/httpwstest.cpp
index 7e11c89..7328115 100644
--- a/loolwsd/test/httpwstest.cpp
+++ b/loolwsd/test/httpwstest.cpp
@@ -1323,10 +1323,14 @@ void HTTPWSTest::testNoExtraLoolKitsLeft()
 void HTTPWSTest::getPartHashCodes(const std::string status,
                                   std::vector<std::string>& parts)
 {
+    std::string line;
+    std::istringstream istr(status);
+    std::getline(istr, line);
+
     std::cerr << "Reading parts from [" << status << "]." << std::endl;
 
     // Expected format is something like 'type= parts= current= width= height='.
-    Poco::StringTokenizer tokens(status, " ", Poco::StringTokenizer::TOK_IGNORE_EMPTY | Poco::StringTokenizer::TOK_TRIM);
+    Poco::StringTokenizer tokens(line, " ", Poco::StringTokenizer::TOK_IGNORE_EMPTY | Poco::StringTokenizer::TOK_TRIM);
     CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(5), tokens.count());
 
     const auto type = tokens[0].substr(std::string("type=").size());


More information about the Libreoffice-commits mailing list