[Libreoffice-commits] online.git: loolwsd/test
Henry Castro
hcastro at collabora.com
Tue May 31 00:26:14 UTC 2016
loolwsd/test/TileCacheTests.cpp | 6 +++++-
loolwsd/test/httpwstest.cpp | 6 +++++-
2 files changed, 10 insertions(+), 2 deletions(-)
New commits:
commit 58580a45ce03f7c0105d3316381b73c9f4f6b325
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 bd2c307..95e46e9 100644
--- a/loolwsd/test/TileCacheTests.cpp
+++ b/loolwsd/test/TileCacheTests.cpp
@@ -563,8 +563,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 e1111a6..0572fbb 100644
--- a/loolwsd/test/httpwstest.cpp
+++ b/loolwsd/test/httpwstest.cpp
@@ -1245,10 +1245,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