test/httpcrashtest.cpp | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-)
New commits: commit 2be0d16e7bd44ed603740ec432847f0f2448af40 Author: Ashod Nakashian <ashod.nakash...@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 <ashnak...@gmail.com> Tested-by: Ashod Nakashian <ashnak...@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 _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits