[Libreoffice-commits] online.git: loolwsd/test

Tor Lillqvist tml at collabora.com
Mon Apr 4 07:14:47 UTC 2016


 loolwsd/test/httpposttest.cpp |    3 +--
 loolwsd/test/httpwstest.cpp   |    3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

New commits:
commit d262f43b93baac18440b03e337d1f8d9ad55b0bb
Author: Tor Lillqvist <tml at collabora.com>
Date:   Mon Apr 4 10:08:18 2016 +0300

    ClientPortNumber here can never differ from DEFAULT_CLIENT_PORT_NUMBER
    
    So just use DEFAULT_CLIENT_PORT_NUMBER and don't confusingly include
    ChildProcessSession.hpp in the test program sources just to define a
    static (file-local) ClientPortNumber variable that never gets set to
    anything except its initialized value. ChildProcessSession is specific
    to the internals of loolwsd and loolbroker and should not be used in
    the test programs.

diff --git a/loolwsd/test/httpposttest.cpp b/loolwsd/test/httpposttest.cpp
index 791cbc4..a4b0b03 100644
--- a/loolwsd/test/httpposttest.cpp
+++ b/loolwsd/test/httpposttest.cpp
@@ -23,7 +23,6 @@
 
 #include <Common.hpp>
 #include <Util.hpp>
-#include <ChildProcessSession.hpp>
 
 /// Tests the HTTP POST API of loolwsd. The server has to be started manually before running this test.
 class HTTPPostTest : public CPPUNIT_NS::TestFixture
@@ -55,7 +54,7 @@ void HTTPPostTest::testConvertTo()
 {
     const auto srcPath = Util::getTempFilePath(TDOC, "hello.odt");
 
-    Poco::URI uri("https://127.0.0.1:" + std::to_string(ClientPortNumber));
+    Poco::URI uri("https://127.0.0.1:" + std::to_string(DEFAULT_CLIENT_PORT_NUMBER));
     Poco::Net::HTTPSClientSession session(uri.getHost(), uri.getPort());
 
     Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_POST, "/convert-to");
diff --git a/loolwsd/test/httpwstest.cpp b/loolwsd/test/httpwstest.cpp
index d01aa4d..c41aceb 100644
--- a/loolwsd/test/httpwstest.cpp
+++ b/loolwsd/test/httpwstest.cpp
@@ -28,7 +28,6 @@
 #include <Common.hpp>
 #include <Util.hpp>
 #include <LOOLProtocol.hpp>
-#include <ChildProcessSession.hpp>
 
 /// Tests the HTTP WebSocket API of loolwsd. The server has to be started manually before running this test.
 class HTTPWSTest : public CPPUNIT_NS::TestFixture
@@ -79,7 +78,7 @@ class HTTPWSTest : public CPPUNIT_NS::TestFixture
                             const bool isLine);
 public:
     HTTPWSTest()
-        : _uri("https://127.0.0.1:" + std::to_string(ClientPortNumber))
+        : _uri("https://127.0.0.1:" + std::to_string(DEFAULT_CLIENT_PORT_NUMBER))
     {
         Poco::Net::initializeSSL();
         // Just accept the certificate anyway for testing purposes


More information about the Libreoffice-commits mailing list