[Libreoffice-commits] online.git: loolwsd/test
Ashod Nakashian
ashod.nakashian at collabora.co.uk
Wed Sep 28 13:29:35 UTC 2016
loolwsd/test/httpwstest.cpp | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
New commits:
commit 0e03ac54e60ec8d3a3e2638fcc87550b56c75c65
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date: Wed Sep 28 09:11:15 2016 -0400
loolwsd: unittest fixes
Change-Id: I77f7b225c444ca0bc352de4b45b0ead4ad454714
Reviewed-on: https://gerrit.libreoffice.org/29361
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 640938b..91df94b 100644
--- a/loolwsd/test/httpwstest.cpp
+++ b/loolwsd/test/httpwstest.cpp
@@ -2049,7 +2049,6 @@ void HTTPWSTest::testEachView(const std::string& doc, const std::string& type, c
for (auto socketView : views)
{
sendTextFrame(*socketView, "load url=" + documentURL);
- CPPUNIT_ASSERT_MESSAGE(Poco::format(load, itView) + documentURL, isDocumentLoaded(*socketView, Poco::format(view, itView), true));
// Expected to receive response each view
getResponseMessage(*socketView, protocolView, response, false, Poco::format(view, itView));
@@ -2161,6 +2160,8 @@ void HTTPWSTest::testCursorPosition()
{
try
{
+ const auto testname = "cursorPosition ";
+
// Load a document.
std::string docPath;
std::string docURL;
@@ -2172,22 +2173,20 @@ void HTTPWSTest::testCursorPosition()
Poco::Net::WebSocket socket0 = *connectLOKit(_uri, request, _response);
sendTextFrame(socket0, "load url=" + docURL);
- CPPUNIT_ASSERT_MESSAGE("cannot load the document " + docURL, isDocumentLoaded(socket0));
// receive cursor position
- getResponseMessage(socket0, "invalidatecursor:", response, false);
- CPPUNIT_ASSERT_MESSAGE("did not receive a invalidatecursor: message as expected", !response.empty());
+ getResponseMessage(socket0, "invalidatecursor:", response, false, testname);
Poco::StringTokenizer cursorTokens(response, ",", Poco::StringTokenizer::TOK_IGNORE_EMPTY | Poco::StringTokenizer::TOK_TRIM);
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(4), cursorTokens.count());
+ assertResponseLine(socket0, "status:", testname);
// Create second view
Poco::Net::WebSocket socket1 = *connectLOKit(_uri, request, _response);
sendTextFrame(socket1, "load url=" + docURL);
- CPPUNIT_ASSERT_MESSAGE("cannot load the document " + docURL, isDocumentLoaded(socket1));
//receive view cursor position
- getResponseMessage(socket0, "invalidateviewcursor:", response, false);
- CPPUNIT_ASSERT_MESSAGE("did not receive a invalidateviewcursor: message as expected", !response.empty());
+ getResponseMessage(socket1, "invalidateviewcursor:", response, false, testname);
+ assertResponseLine(socket1, "status:", testname);
Poco::JSON::Parser parser;
const auto result = parser.parse(response);
More information about the Libreoffice-commits
mailing list