[Libreoffice-commits] online.git: test/helpers.hpp test/httpwstest.cpp
Ashod Nakashian
ashod.nakashian at collabora.co.uk
Mon Jan 23 05:42:06 UTC 2017
test/helpers.hpp | 2 +-
test/httpwstest.cpp | 19 ++++++++++++++-----
2 files changed, 15 insertions(+), 6 deletions(-)
New commits:
commit 0f73bd9bf2afba5f6a24aa5d0127be553ee55c02
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date: Fri Jan 20 16:34:44 2017 -0500
wsd: improved testConnectNoLoad
Change-Id: I8eff5b4862067444c8623582dc4f3baa585f164e
Reviewed-on: https://gerrit.libreoffice.org/33425
Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
Tested-by: Ashod Nakashian <ashnakash at gmail.com>
diff --git a/test/helpers.hpp b/test/helpers.hpp
index 4dd8f86..cc8205e 100644
--- a/test/helpers.hpp
+++ b/test/helpers.hpp
@@ -176,7 +176,7 @@ int getErrorCode(LOOLWebSocket& ws, std::string& message, const std::string& tes
bytes = ws.receiveFrame(buffer.begin(), READ_BUFFER_SIZE, flags);
std::cerr << testname << "Got " << LOOLProtocol::getAbbreviatedFrameDump(buffer.begin(), bytes, flags) << std::endl;
}
- while (bytes > 0 && (flags & Poco::Net::WebSocket::FRAME_OP_BITMASK) != Poco::Net::WebSocket::FRAME_OP_CLOSE);
+ while (bytes != 0 && (flags & Poco::Net::WebSocket::FRAME_OP_BITMASK) != Poco::Net::WebSocket::FRAME_OP_CLOSE);
if (bytes > 0)
{
diff --git a/test/httpwstest.cpp b/test/httpwstest.cpp
index 32635d1..ff48454 100644
--- a/test/httpwstest.cpp
+++ b/test/httpwstest.cpp
@@ -360,26 +360,35 @@ void HTTPWSTest::loadDoc(const std::string& documentURL, const std::string& test
void HTTPWSTest::testConnectNoLoad()
{
+ const auto testname1 = "connectNoLoad-1 ";
+ const auto testname2 = "connectNoLoad-2 ";
+ const auto testname3 = "connectNoLoad-3 ";
+
std::string documentPath, documentURL;
getDocumentPathAndURL("hello.odt", documentPath, documentURL);
Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_GET, documentURL);
- auto socket = connectLOKit(_uri, request, _response);
+ std::cerr << testname1 << "Connecting." << std::endl;
+ auto socket = connectLOKit(_uri, request, _response, testname1);
CPPUNIT_ASSERT_MESSAGE("Failed to connect.", socket);
+ std::cerr << testname1 << "Disconnecting." << std::endl;
socket.reset();
// Connect and load first view.
- auto socket1 = connectLOKit(_uri, request, _response);
+ std::cerr << testname2 << "Connecting." << std::endl;
+ auto socket1 = connectLOKit(_uri, request, _response, testname2);
CPPUNIT_ASSERT_MESSAGE("Failed to connect.", socket1);
- sendTextFrame(socket1, "load url=" + documentURL);
+ sendTextFrame(socket1, "load url=" + documentURL, testname2);
CPPUNIT_ASSERT_MESSAGE("cannot load the document " + documentURL, isDocumentLoaded(socket1));
// Connect but don't load second view.
- auto socket2 = connectLOKit(_uri, request, _response);
+ std::cerr << testname3 << "Connecting." << std::endl;
+ auto socket2 = connectLOKit(_uri, request, _response, testname3);
CPPUNIT_ASSERT_MESSAGE("Failed to connect.", socket2);
+ std::cerr << testname3 << "Disconnecting." << std::endl;
socket2.reset();
- sendTextFrame(socket1, "status");
+ sendTextFrame(socket1, "status", testname2);
assertResponseString(socket1, "status:");
}
More information about the Libreoffice-commits
mailing list