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

Ashod Nakashian ashod.nakashian at collabora.co.uk
Sat Apr 30 14:37:28 UTC 2016


 loolwsd/test/httpcrashtest.cpp           |   25 +++++++++++++++++++++++++
 loolwsd/test/httpwstest.cpp              |    2 +-
 loolwsd/test/integration-http-server.cpp |    2 +-
 3 files changed, 27 insertions(+), 2 deletions(-)

New commits:
commit fd9983414732b25165d1c2144793c348b1917f17
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date:   Sat Apr 30 10:23:26 2016 -0400

    loolwsd: always run the lokit process count tests
    
    Change-Id: I47365609850c23843624f714d6600f07629461ae
    Reviewed-on: https://gerrit.libreoffice.org/24527
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Tested-by: Ashod Nakashian <ashnakash at gmail.com>

diff --git a/loolwsd/test/httpcrashtest.cpp b/loolwsd/test/httpcrashtest.cpp
index 7615677..15a2f4b 100644
--- a/loolwsd/test/httpcrashtest.cpp
+++ b/loolwsd/test/httpcrashtest.cpp
@@ -43,6 +43,7 @@
 #include <Util.hpp>
 #include <LOOLProtocol.hpp>
 #include "helpers.hpp"
+#include "countloolkits.hpp"
 
 using namespace helpers;
 
@@ -51,16 +52,25 @@ class HTTPCrashTest : public CPPUNIT_NS::TestFixture
 {
     const Poco::URI _uri;
     Poco::Net::HTTPResponse _response;
+    static int _initialLoolKitCount;
 
     CPPUNIT_TEST_SUITE(HTTPCrashTest);
 
+    // This should be the first test:
+    CPPUNIT_TEST(testCountHowManyLoolkits);
+
     CPPUNIT_TEST(testBarren);
     CPPUNIT_TEST(testCrashKit);
 
+    // This should be the last test:
+    CPPUNIT_TEST(testNoExtraLoolKitsLeft);
+
     CPPUNIT_TEST_SUITE_END();
 
+    void testCountHowManyLoolkits();
     void testBarren();
     void testCrashKit();
+    void testNoExtraLoolKitsLeft();
 
     static
     void killLoKitProcesses();
@@ -99,6 +109,21 @@ public:
     }
 };
 
+int HTTPCrashTest::_initialLoolKitCount = 0;
+
+void HTTPCrashTest::testCountHowManyLoolkits()
+{
+    _initialLoolKitCount = countLoolKitProcesses(1);
+    CPPUNIT_ASSERT(_initialLoolKitCount > 0);
+}
+
+void HTTPCrashTest::testNoExtraLoolKitsLeft()
+{
+    const auto countNow = countLoolKitProcesses(_initialLoolKitCount);
+
+    CPPUNIT_ASSERT_EQUAL(_initialLoolKitCount, countNow);
+}
+
 void HTTPCrashTest::testBarren()
 {
     // Kill all kit processes and try loading a document.
diff --git a/loolwsd/test/httpwstest.cpp b/loolwsd/test/httpwstest.cpp
index 258b44f..c0bc549 100644
--- a/loolwsd/test/httpwstest.cpp
+++ b/loolwsd/test/httpwstest.cpp
@@ -167,7 +167,7 @@ int HTTPWSTest::_initialLoolKitCount = 0;
 
 void HTTPWSTest::testCountHowManyLoolkits()
 {
-    _initialLoolKitCount = getLoolKitProcessCount();
+    _initialLoolKitCount = countLoolKitProcesses(1);
     CPPUNIT_ASSERT(_initialLoolKitCount > 0);
 }
 
diff --git a/loolwsd/test/integration-http-server.cpp b/loolwsd/test/integration-http-server.cpp
index f527511..fff7ad4 100644
--- a/loolwsd/test/integration-http-server.cpp
+++ b/loolwsd/test/integration-http-server.cpp
@@ -82,7 +82,7 @@ int HTTPServerTest::_initialLoolKitCount = 0;
 
 void HTTPServerTest::testCountHowManyLoolkits()
 {
-    _initialLoolKitCount = getLoolKitProcessCount();
+    _initialLoolKitCount = countLoolKitProcesses(1);
     CPPUNIT_ASSERT(_initialLoolKitCount > 0);
 }
 


More information about the Libreoffice-commits mailing list