loolwsd/ChildProcessSession.hpp | 2 ++ loolwsd/test/httpwstest.cpp | 14 +++++--------- 2 files changed, 7 insertions(+), 9 deletions(-)
New commits: commit bbcc2c43daa9e7b472dc3849befeceb8c042c094 Author: Tor Lillqvist <[email protected]> Date: Thu Feb 25 10:31:36 2016 +0200 I think it makes more sense to output to std::cout here Because that is where cppunit outputs, I am told, so less chance of out-of-order mixing, maybe. diff --git a/loolwsd/test/httpwstest.cpp b/loolwsd/test/httpwstest.cpp index 0a7b054..96394bb 100644 --- a/loolwsd/test/httpwstest.cpp +++ b/loolwsd/test/httpwstest.cpp @@ -106,7 +106,7 @@ void HTTPWSTest::testPaste() n = socket.receiveFrame(buffer, sizeof(buffer), flags); if (n > 0 && (flags & Poco::Net::WebSocket::FRAME_OP_BITMASK) != Poco::Net::WebSocket::FRAME_OP_CLOSE) { - std::cerr << "Received message length " << n << ": " << LOOLProtocol::getAbbreviatedMessage(buffer, n) << '\n'; + std::cout << "Received message length " << n << ": " << LOOLProtocol::getAbbreviatedMessage(buffer, n) << '\n'; const std::string line = LOOLProtocol::getFirstLine(buffer, n); const std::string prefix = "textselectioncontent: "; if (line.find(prefix) == 0) @@ -160,7 +160,7 @@ void HTTPWSTest::testLargePaste() n = socket.receiveFrame(buffer, sizeof(buffer), flags); if (n > 0 && (flags & Poco::Net::WebSocket::FRAME_OP_BITMASK) != Poco::Net::WebSocket::FRAME_OP_CLOSE) { - std::cerr << "Received message length " << n << ": " << LOOLProtocol::getAbbreviatedMessage(buffer, n) << '\n'; + std::cout << "Received message length " << n << ": " << LOOLProtocol::getAbbreviatedMessage(buffer, n) << '\n'; std::string line = LOOLProtocol::getFirstLine(buffer, n); std::string prefix = "textselectioncontent: "; if (line.find(prefix) == 0) @@ -198,7 +198,7 @@ void HTTPWSTest::testRenderingOptions() n = socket.receiveFrame(buffer, sizeof(buffer), flags); if (n > 0 && (flags & Poco::Net::WebSocket::FRAME_OP_BITMASK) != Poco::Net::WebSocket::FRAME_OP_CLOSE) { - std::cerr << "Received message length " << n << ": " << LOOLProtocol::getAbbreviatedMessage(buffer, n) << '\n'; + std::cout << "Received message length " << n << ": " << LOOLProtocol::getAbbreviatedMessage(buffer, n) << '\n'; std::string line = LOOLProtocol::getFirstLine(buffer, n); std::string prefix = "status: "; if (line.find(prefix) == 0) @@ -401,7 +401,7 @@ bool HTTPWSTest::isDocumentLoaded(Poco::Net::WebSocket& ws) bytes = ws.receiveFrame(buffer, sizeof(buffer), flags); if (bytes > 0 && (flags & Poco::Net::WebSocket::FRAME_OP_BITMASK) != Poco::Net::WebSocket::FRAME_OP_CLOSE) { - std::cerr << "Received message length " << bytes << ": " << LOOLProtocol::getAbbreviatedMessage(buffer, bytes) << '\n'; + std::cout << "Received message length " << bytes << ": " << LOOLProtocol::getAbbreviatedMessage(buffer, bytes) << '\n'; const std::string line = LOOLProtocol::getFirstLine(buffer, bytes); const std::string prefixIndicator = "statusindicatorfinish:"; const std::string prefixStatus = "status:"; @@ -448,7 +448,7 @@ void HTTPWSTest::getResponseMessage(Poco::Net::WebSocket& ws, const std::string& bytes = ws.receiveFrame(buffer, sizeof(buffer), flags); if (bytes > 0 && (flags & Poco::Net::WebSocket::FRAME_OP_BITMASK) != Poco::Net::WebSocket::FRAME_OP_CLOSE) { - std::cerr << "Received message length " << bytes << ": " << LOOLProtocol::getAbbreviatedMessage(buffer, bytes) << '\n'; + std::cout << "Received message length " << bytes << ": " << LOOLProtocol::getAbbreviatedMessage(buffer, bytes) << '\n'; const std::string message = isLine ? LOOLProtocol::getFirstLine(buffer, bytes) : std::string(buffer, bytes); commit 3f107ed8ca602af6d2d733d509601313a7f969bb Author: Tor Lillqvist <[email protected]> Date: Wed Feb 24 17:48:03 2016 +0200 Add snide comment diff --git a/loolwsd/ChildProcessSession.hpp b/loolwsd/ChildProcessSession.hpp index 1187a63..01b6191 100644 --- a/loolwsd/ChildProcessSession.hpp +++ b/loolwsd/ChildProcessSession.hpp @@ -21,6 +21,8 @@ #include "LOOLSession.hpp" // The client port number, which is changed via loolwsd args. +// Except that it isn't. This is "static" so it is a *separate* variable +// in each compilation unit. static int ClientPortNumber = DEFAULT_CLIENT_PORT_NUMBER; class CallbackWorker; commit dbd5e3877d5802d595758ce261a3b3ee62b30014 Author: Tor Lillqvist <[email protected]> Date: Wed Feb 24 17:45:20 2016 +0200 Don't send "disconnect" frames here either The JavaScript code does not either. diff --git a/loolwsd/test/httpwstest.cpp b/loolwsd/test/httpwstest.cpp index 05e67b1..0a7b054 100644 --- a/loolwsd/test/httpwstest.cpp +++ b/loolwsd/test/httpwstest.cpp @@ -117,7 +117,6 @@ void HTTPWSTest::testPaste() } } while (n > 0 && (flags & Poco::Net::WebSocket::FRAME_OP_BITMASK) != Poco::Net::WebSocket::FRAME_OP_CLOSE); - sendTextFrame(socket, "disconnect"); socket.shutdown(); CPPUNIT_ASSERT_EQUAL(std::string("aaa bbb ccc"), selection); } @@ -169,7 +168,6 @@ void HTTPWSTest::testLargePaste() } } while (n > 0 && (flags & Poco::Net::WebSocket::FRAME_OP_BITMASK) != Poco::Net::WebSocket::FRAME_OP_CLOSE); - sendTextFrame(socket, "disconnect"); socket.shutdown(); } catch (const Poco::Exception& exc) @@ -211,7 +209,6 @@ void HTTPWSTest::testRenderingOptions() } } while (n > 0 && (flags & Poco::Net::WebSocket::FRAME_OP_BITMASK) != Poco::Net::WebSocket::FRAME_OP_CLOSE); - sendTextFrame(socket, "disconnect"); socket.shutdown(); // Expected format is something like 'type=text parts=2 current=0 width=12808 height=1142'. Poco::StringTokenizer tokens(status, " ", Poco::StringTokenizer::TOK_IGNORE_EMPTY | Poco::StringTokenizer::TOK_TRIM); @@ -277,7 +274,6 @@ void HTTPWSTest::testPasswordProtectedDocument() sendTextFrame(socket, "load url=" + documentURL + " password=1"); CPPUNIT_ASSERT_MESSAGE("cannot load the document with correct password " + documentURL, isDocumentLoaded(socket)); - sendTextFrame(socket, "disconnect"); socket.shutdown(); } catch (const Poco::Exception& exc) _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
