[Libreoffice-commits] online.git: test/httpcrashtest.cpp
Ashod Nakashian
ashod.nakashian at collabora.co.uk
Mon Jan 16 01:49:02 UTC 2017
test/httpcrashtest.cpp | 20 ++++++--------------
1 file changed, 6 insertions(+), 14 deletions(-)
New commits:
commit 2be0d16e7bd44ed603740ec432847f0f2448af40
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date: Sun Jan 15 12:17:19 2017 -0500
wsd: improved crash kit test
Change-Id: Iddc056383aa37bfe278d4f4003b56696b8f2bf13
Reviewed-on: https://gerrit.libreoffice.org/33118
Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
Tested-by: Ashod Nakashian <ashnakash at gmail.com>
diff --git a/test/httpcrashtest.cpp b/test/httpcrashtest.cpp
index 16105a7..f34c214 100644
--- a/test/httpcrashtest.cpp
+++ b/test/httpcrashtest.cpp
@@ -140,25 +140,17 @@ void HTTPCrashTest::testCrashKit()
// Drain the socket.
getResponseMessage(socket, "", testname, 1000);
- // 5 seconds timeout
- socket->setReceiveTimeout(5000000);
-
- // receive close frame handshake
- int bytes;
- int flags;
- char buffer[READ_BUFFER_SIZE];
- do
- {
- bytes = socket->receiveFrame(buffer, sizeof(buffer), flags);
- std::cerr << testname << "Got " << LOOLProtocol::getAbbreviatedFrameDump(buffer, bytes, flags) << std::endl;
- }
- while ((flags & Poco::Net::WebSocket::FRAME_OP_BITMASK) != Poco::Net::WebSocket::FRAME_OP_CLOSE);
+ std::string message;
+ const auto statusCode = getErrorCode(socket, message, testname);
+ CPPUNIT_ASSERT_EQUAL(static_cast<int>(Poco::Net::WebSocket::WS_ENDPOINT_GOING_AWAY), statusCode);
// respond close frame
socket->shutdown();
// no more messages is received.
- bytes = socket->receiveFrame(buffer, sizeof(buffer), flags);
+ int flags;
+ char buffer[READ_BUFFER_SIZE];
+ const int bytes = socket->receiveFrame(buffer, sizeof(buffer), flags);
std::cerr << testname << "Got " << LOOLProtocol::getAbbreviatedFrameDump(buffer, bytes, flags) << std::endl;
// While we expect no more messages after shutdown call, apparently
More information about the Libreoffice-commits
mailing list