[Libreoffice-commits] online.git: test/countloolkits.hpp test/DeltaTests.cpp test/fakesockettest.cpp test/helpers.hpp test/httpcrashtest.cpp test/httpwstest.cpp test/integration-http-server.cpp test/lokassert.hpp test/Makefile.am test/TileCacheTests.cpp test/TileQueueTests.cpp test/UnitAdmin.cpp test/UnitBadDocLoad.cpp test/UnitCalc.cpp test/UnitClose.cpp test/UnitCursor.cpp test/UnitEachView.cpp test/UnitHosting.cpp test/UnitHTTP.cpp test/UnitInsertDelete.cpp test/UnitLargePaste.cpp test/UnitLoad.cpp test/UnitLoadTorture.cpp test/UnitOAuth.cpp test/UnitPasswordProtected.cpp test/UnitPaste.cpp test/UnitRenderingOptions.cpp test/UnitRenderShape.cpp test/UnitSession.cpp test/UnitTiffLoad.cpp test/UnitUNOCommand.cpp test/UnitWOPI.cpp test/UnitWOPIRenameFile.cpp test/UnitWOPISaveAs.cpp test/UnitWOPITemplate.cpp test/WhiteBoxTests.cpp test/WopiTestServer.hpp

Ashod Nakashian (via logerrit) logerrit at kemper.freedesktop.org
Sat Mar 14 14:45:18 UTC 2020


 test/DeltaTests.cpp              |   40 +--
 test/Makefile.am                 |    2 
 test/TileCacheTests.cpp          |  172 ++++++------
 test/TileQueueTests.cpp          |  160 ++++++------
 test/UnitAdmin.cpp               |    4 
 test/UnitBadDocLoad.cpp          |   22 -
 test/UnitCalc.cpp                |   42 +--
 test/UnitClose.cpp               |   26 -
 test/UnitCursor.cpp              |   84 +++---
 test/UnitEachView.cpp            |   10 
 test/UnitHTTP.cpp                |    8 
 test/UnitHosting.cpp             |   30 +-
 test/UnitInsertDelete.cpp        |   74 ++---
 test/UnitLargePaste.cpp          |    6 
 test/UnitLoad.cpp                |   20 -
 test/UnitLoadTorture.cpp         |    8 
 test/UnitOAuth.cpp               |    4 
 test/UnitPasswordProtected.cpp   |   30 +-
 test/UnitPaste.cpp               |    4 
 test/UnitRenderShape.cpp         |   14 -
 test/UnitRenderingOptions.cpp    |   12 
 test/UnitSession.cpp             |   52 +--
 test/UnitTiffLoad.cpp            |    4 
 test/UnitUNOCommand.cpp          |   10 
 test/UnitWOPI.cpp                |   10 
 test/UnitWOPIRenameFile.cpp      |    2 
 test/UnitWOPISaveAs.cpp          |    4 
 test/UnitWOPITemplate.cpp        |    4 
 test/WhiteBoxTests.cpp           |  520 +++++++++++++++++++--------------------
 test/WopiTestServer.hpp          |    6 
 test/countloolkits.hpp           |    4 
 test/fakesockettest.cpp          |  140 +++++-----
 test/helpers.hpp                 |   30 +-
 test/httpcrashtest.cpp           |   14 -
 test/httpwstest.cpp              |   60 ++--
 test/integration-http-server.cpp |   58 ++--
 test/lokassert.hpp               |   88 ++++++
 37 files changed, 934 insertions(+), 844 deletions(-)

New commits:
commit 82560d9657234f4c5358695de4804a5e5a0f1032
Author:     Ashod Nakashian <ashod.nakashian at collabora.co.uk>
AuthorDate: Mon Jan 20 11:45:53 2020 -0500
Commit:     Michael Meeks <michael.meeks at collabora.com>
CommitDate: Sat Mar 14 15:45:00 2020 +0100

    wsd: test assertion macros
    
    Because the new-style tests are intrustive,
    the exception that CppUnit throws on assertion
    failures is caught and processed with the
    application logic, which is far from ideal,
    because it's very difficult to find the
    cause of failure.
    
    What we'd like is a way to control what happens
    when an test assertion fails, such that we can
    properly log/print the failure, and even break
    in the debugger.
    
    The new macros allow us to control the behavior
    at compile-time and have added flexibility.
    For now, they log an assertion failure before
    invoking the CPPUNIT macro, and support a
    compile-time directive to assert, which is
    useful for breaking in the debugger.
    
    Change-Id: If464ba246e3ec747f31496a4215cb73ef735dfaf
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/87625
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>

diff --git a/test/DeltaTests.cpp b/test/DeltaTests.cpp
index 9c3eef273..1af8acf33 100644
--- a/test/DeltaTests.cpp
+++ b/test/DeltaTests.cpp
@@ -9,7 +9,7 @@
 
 #include <config.h>
 
-#include <cppunit/extensions/HelperMacros.h>
+#include <test/lokassert.hpp>
 
 #include <Delta.hpp>
 #include <Util.hpp>
@@ -66,13 +66,13 @@ std::vector<char> DeltaTests::applyDelta(
     png_uint_32 width, png_uint_32 height,
     const std::vector<char> &delta)
 {
-    CPPUNIT_ASSERT(delta.size() >= 4);
-    CPPUNIT_ASSERT(delta[0] == 'D');
+    LOK_ASSERT(delta.size() >= 4);
+    LOK_ASSERT(delta[0] == 'D');
 
     // start with the same state.
     std::vector<char> output = pixmap;
-    CPPUNIT_ASSERT_EQUAL(output.size(), size_t(pixmap.size()));
-    CPPUNIT_ASSERT_EQUAL(output.size(), size_t(width * height * 4));
+    LOK_ASSERT_EQUAL(output.size(), size_t(pixmap.size()));
+    LOK_ASSERT_EQUAL(output.size(), size_t(width * height * 4));
 
     size_t offset = 0, i;
     for (i = 1; i < delta.size() && offset < output.size();)
@@ -104,7 +104,7 @@ std::vector<char> DeltaTests::applyDelta(
             i += 4;
 
 //            std::cout << "new " << length << " at " << destCol << ", " << destRow << "\n";
-            CPPUNIT_ASSERT(length <= width - destCol);
+            LOK_ASSERT(length <= width - destCol);
 
             char *dest = &output[width * destRow * 4 + destCol * 4];
             for (size_t j = 0; j < length * 4 && i < delta.size(); ++j)
@@ -113,11 +113,11 @@ std::vector<char> DeltaTests::applyDelta(
         }
         default:
             std::cout << "Unknown delta code " << delta[i] << "\n";
-            CPPUNIT_ASSERT(false);
+            LOK_ASSERT(false);
             break;
         }
     }
-    CPPUNIT_ASSERT_EQUAL(delta.size(), i);
+    LOK_ASSERT_EQUAL(delta.size(), i);
     return output;
 }
 
@@ -125,7 +125,7 @@ void DeltaTests::assertEqual(const std::vector<char> &a,
                              const std::vector<char> &b,
                              int width, int /* height */)
 {
-    CPPUNIT_ASSERT_EQUAL(a.size(), b.size());
+    LOK_ASSERT_EQUAL(a.size(), b.size());
     for (size_t i = 0; i < a.size(); ++i)
     {
         if (a[i] != b[i])
@@ -141,7 +141,7 @@ void DeltaTests::assertEqual(const std::vector<char> &a,
                     std::cout<< "\n";
             }
             std::cout << " size " << len << "\n";
-            CPPUNIT_ASSERT(false);
+            LOK_ASSERT(false);
         }
     }
 }
@@ -155,30 +155,30 @@ void DeltaTests::testDeltaSequence()
     std::vector<char> text =
         DeltaTests::loadPng(TDOC "/delta-text.png",
                             height, width, rowBytes);
-    CPPUNIT_ASSERT(height == 256 && width == 256 && rowBytes == 256*4);
-    CPPUNIT_ASSERT_EQUAL(size_t(256 * 256 * 4), text.size());
+    LOK_ASSERT(height == 256 && width == 256 && rowBytes == 256*4);
+    LOK_ASSERT_EQUAL(size_t(256 * 256 * 4), text.size());
 
     const TileWireId text2Wid = 2;
     std::vector<char> text2 =
         DeltaTests::loadPng(TDOC "/delta-text2.png",
                             height, width, rowBytes);
-    CPPUNIT_ASSERT(height == 256 && width == 256 && rowBytes == 256*4);
-    CPPUNIT_ASSERT_EQUAL(size_t(256 * 256 * 4), text2.size());
+    LOK_ASSERT(height == 256 && width == 256 && rowBytes == 256*4);
+    LOK_ASSERT_EQUAL(size_t(256 * 256 * 4), text2.size());
 
     std::vector<char> delta;
     // Stash it in the cache
-    CPPUNIT_ASSERT(gen.createDelta(
+    LOK_ASSERT(gen.createDelta(
                        reinterpret_cast<unsigned char *>(&text[0]),
                        0, 0, width, height, width, height,
                        delta, textWid, 0) == false);
-    CPPUNIT_ASSERT(delta.size() == 0);
+    LOK_ASSERT(delta.size() == 0);
 
     // Build a delta between text2 & textWid
-    CPPUNIT_ASSERT(gen.createDelta(
+    LOK_ASSERT(gen.createDelta(
                        reinterpret_cast<unsigned char *>(&text2[0]),
                        0, 0, width, height, width, height,
                        delta, text2Wid, textWid) == true);
-    CPPUNIT_ASSERT(delta.size() > 0);
+    LOK_ASSERT(delta.size() > 0);
 
     // Apply it to move to the second frame
     std::vector<char> reText2 = applyDelta(text, width, height, delta);
@@ -186,11 +186,11 @@ void DeltaTests::testDeltaSequence()
 
     // Build a delta between text & text2Wid
     std::vector<char> two2one;
-    CPPUNIT_ASSERT(gen.createDelta(
+    LOK_ASSERT(gen.createDelta(
                        reinterpret_cast<unsigned char *>(&text[0]),
                        0, 0, width, height, width, height,
                        two2one, textWid, text2Wid) == true);
-    CPPUNIT_ASSERT(two2one.size() > 0);
+    LOK_ASSERT(two2one.size() > 0);
 
     // Apply it to get back to where we started
     std::vector<char> reText = applyDelta(text2, width, height, two2one);
diff --git a/test/Makefile.am b/test/Makefile.am
index 3732c6a4e..214e6297a 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -54,7 +54,7 @@ endif
 # the server side and here in unit tests with conditional compilation
 # based on BUILDING_TESTS
 
-AM_CPPFLAGS = -pthread -I$(top_srcdir) -DBUILDING_TESTS
+AM_CPPFLAGS = -pthread -I$(top_srcdir) -DBUILDING_TESTS -DLOK_ABORT_ON_ASSERTION
 
 wsd_sources = \
             ../common/FileUtil.cpp \
diff --git a/test/TileCacheTests.cpp b/test/TileCacheTests.cpp
index 1b02fab86..58b21ecbd 100644
--- a/test/TileCacheTests.cpp
+++ b/test/TileCacheTests.cpp
@@ -183,8 +183,8 @@ void TileCacheTests::testDesc()
     TileCacheDesc descA = TileDesc(0, 0, 256, 256, 0, 0, 3200, 3200, /* ignored in cache */ 0, 1234, 1, true);
     TileCacheDesc descB = TileDesc(0, 0, 256, 256, 0, 0, 3200, 3200, /* ignored in cache */ 1, 1235, 2, false);
 
-    CPPUNIT_ASSERT_MESSAGE("versions do match", descA.getVersion() != descB.getVersion());
-    CPPUNIT_ASSERT_MESSAGE("Compare includes fields it should not", descA == descB);
+    LOK_ASSERT_MESSAGE("versions do match", descA.getVersion() != descB.getVersion());
+    LOK_ASSERT_MESSAGE("Compare includes fields it should not", descA == descB);
 }
 
 void TileCacheTests::testSimple()
@@ -211,7 +211,7 @@ void TileCacheTests::testSimple()
 
     // No Cache
     TileCache::Tile tileData = tc.lookupTile(tile);
-    CPPUNIT_ASSERT_MESSAGE("found tile when none was expected", !tileData);
+    LOK_ASSERT_MESSAGE("found tile when none was expected", !tileData);
 
     // Cache Tile
     const int size = 1024;
@@ -220,15 +220,15 @@ void TileCacheTests::testSimple()
 
     // Find Tile
     tileData = tc.lookupTile(tile);
-    CPPUNIT_ASSERT_MESSAGE("tile not found when expected", tileData);
-    CPPUNIT_ASSERT_MESSAGE("cached tile corrupted", data == *tileData);
+    LOK_ASSERT_MESSAGE("tile not found when expected", tileData);
+    LOK_ASSERT_MESSAGE("cached tile corrupted", data == *tileData);
 
     // Invalidate Tiles
     tc.invalidateTiles("invalidatetiles: EMPTY", nviewid);
 
     // No Cache
     tileData = tc.lookupTile(tile);
-    CPPUNIT_ASSERT_MESSAGE("found tile when none was expected", !tileData);
+    LOK_ASSERT_MESSAGE("found tile when none was expected", !tileData);
 }
 
 void TileCacheTests::testSimpleCombine()
@@ -243,15 +243,15 @@ void TileCacheTests::testSimpleCombine()
     sendTextFrame(socket1, "tilecombine nviewid=0  part=0 width=256 height=256 tileposx=0,3840 tileposy=0,0 tilewidth=3840 tileheight=3840");
 
     std::vector<char> tile1a = getResponseMessage(socket1, "tile:", testname);
-    CPPUNIT_ASSERT_MESSAGE("did not receive a tile: message as expected", !tile1a.empty());
+    LOK_ASSERT_MESSAGE("did not receive a tile: message as expected", !tile1a.empty());
     std::vector<char> tile1b = getResponseMessage(socket1, "tile:", testname);
-    CPPUNIT_ASSERT_MESSAGE("did not receive a tile: message as expected", !tile1b.empty());
+    LOK_ASSERT_MESSAGE("did not receive a tile: message as expected", !tile1b.empty());
     sendTextFrame(socket1, "tilecombine nviewid=0 part=0 width=256 height=256 tileposx=0,3840 tileposy=0,0 tilewidth=3840 tileheight=3840");
 
     tile1a = getResponseMessage(socket1, "tile:", testname);
-    CPPUNIT_ASSERT_MESSAGE("did not receive a tile: message as expected", !tile1a.empty());
+    LOK_ASSERT_MESSAGE("did not receive a tile: message as expected", !tile1a.empty());
     tile1b = getResponseMessage(socket1, "tile:", testname);
-    CPPUNIT_ASSERT_MESSAGE("did not receive a tile: message as expected", !tile1b.empty());
+    LOK_ASSERT_MESSAGE("did not receive a tile: message as expected", !tile1b.empty());
 
     // Second.
     TST_LOG("Connecting second client.");
@@ -260,9 +260,9 @@ void TileCacheTests::testSimpleCombine()
     sendTextFrame(socket2, "tilecombine nviewid=0 part=0 width=256 height=256 tileposx=0,3840 tileposy=0,0 tilewidth=3840 tileheight=3840");
 
     std::vector<char> tile2a = getResponseMessage(socket2, "tile:", testname);
-    CPPUNIT_ASSERT_MESSAGE("did not receive a tile: message as expected", !tile2a.empty());
+    LOK_ASSERT_MESSAGE("did not receive a tile: message as expected", !tile2a.empty());
     std::vector<char> tile2b = getResponseMessage(socket2, "tile:", testname);
-    CPPUNIT_ASSERT_MESSAGE("did not receive a tile: message as expected", !tile2b.empty());
+    LOK_ASSERT_MESSAGE("did not receive a tile: message as expected", !tile2b.empty());
 }
 
 void TileCacheTests::testSize()
@@ -291,7 +291,7 @@ void TileCacheTests::testSize()
         tile.setWireId(id++);
         tc.saveTileAndNotify(tile, data.data(), data.size());
     }
-    CPPUNIT_ASSERT_MESSAGE("tile cache too big", tc.getMemorySize() < maxSize);
+    LOK_ASSERT_MESSAGE("tile cache too big", tc.getMemorySize() < maxSize);
 }
 
 void TileCacheTests::testCancelTiles()
@@ -323,7 +323,7 @@ void TileCacheTests::testCancelTiles()
         {
             if (i == repeat)
             {
-                CPPUNIT_ASSERT_MESSAGE("Did not expect getting message [" + res + "].", res.empty());
+                LOK_ASSERT_MESSAGE("Did not expect getting message [" + res + "].", res.empty());
             }
 
             TST_LOG("Unexpected: [" << res << "]");
@@ -360,7 +360,7 @@ void TileCacheTests::testCancelTilesMultiView()
         {
             if (j == repeat)
             {
-                CPPUNIT_ASSERT_MESSAGE("Did not expect getting message [" + res1 + "].", res1.empty());
+                LOK_ASSERT_MESSAGE("Did not expect getting message [" + res1 + "].", res1.empty());
             }
 
             TST_LOG("Unexpected: [" << res1 << "]");
@@ -381,7 +381,7 @@ void TileCacheTests::testCancelTilesMultiView()
         {
             if (j == repeat)
             {
-                CPPUNIT_ASSERT_MESSAGE("Did not expect getting message [" + res2 + "].", res1.empty());
+                LOK_ASSERT_MESSAGE("Did not expect getting message [" + res2 + "].", res1.empty());
             }
 
             TST_LOG("Unexpected: [" << res2 << "]");
@@ -480,7 +480,7 @@ void TileCacheTests::testUnresponsiveClient()
         for (int i = 0; i < 8; ++i)
         {
             std::vector<char> tile = getResponseMessage(socket2, "tile:", testname + "2 ");
-            CPPUNIT_ASSERT_MESSAGE("Did not receive tile #" + std::to_string(i+1) + " of 8: message as expected", !tile.empty());
+            LOK_ASSERT_MESSAGE("Did not receive tile #" + std::to_string(i+1) + " of 8: message as expected", !tile.empty());
         }
         /// Send canceltiles message to clear tiles-on-fly list, otherwise wsd waits for tileprocessed messages
         sendTextFrame(socket2, "canceltiles", testname + "2 ");
@@ -499,7 +499,7 @@ void TileCacheTests::testImpressTiles()
     }
     catch (const Poco::Exception& exc)
     {
-        CPPUNIT_FAIL(exc.displayText());
+        LOK_ASSERT_FAIL(exc.displayText());
     }
 }
 
@@ -516,7 +516,7 @@ void TileCacheTests::testClientPartImpress()
     }
     catch (const Poco::Exception& exc)
     {
-        CPPUNIT_FAIL(exc.displayText());
+        LOK_ASSERT_FAIL(exc.displayText());
     }
 }
 
@@ -533,7 +533,7 @@ void TileCacheTests::testClientPartCalc()
     }
     catch (const Poco::Exception& exc)
     {
-        CPPUNIT_FAIL(exc.displayText());
+        LOK_ASSERT_FAIL(exc.displayText());
     }
 }
 
@@ -551,8 +551,8 @@ void TileCacheTests::testTilesRenderedJustOnce()
         sendTextFrame(socket, "ping", testname);
         const auto ping1 = assertResponseString(socket, "pong", testname);
         int renderCount1 = 0;
-        CPPUNIT_ASSERT(LOOLProtocol::getTokenIntegerFromMessage(ping1, "rendercount", renderCount1));
-        CPPUNIT_ASSERT_EQUAL(i * 3, renderCount1);
+        LOK_ASSERT(LOOLProtocol::getTokenIntegerFromMessage(ping1, "rendercount", renderCount1));
+        LOK_ASSERT_EQUAL(i * 3, renderCount1);
 
         // Modify.
         sendText(socket, "a", testname);
@@ -568,32 +568,32 @@ void TileCacheTests::testTilesRenderedJustOnce()
         sendTextFrame(socket, "ping", testname);
         const auto ping2 = assertResponseString(socket, "pong", testname);
         int renderCount2 = 0;
-        CPPUNIT_ASSERT(LOOLProtocol::getTokenIntegerFromMessage(ping2, "rendercount", renderCount2));
-        CPPUNIT_ASSERT_EQUAL((i+1) * 3, renderCount2);
+        LOK_ASSERT(LOOLProtocol::getTokenIntegerFromMessage(ping2, "rendercount", renderCount2));
+        LOK_ASSERT_EQUAL((i+1) * 3, renderCount2);
 
         // Get same 3 tiles.
         sendTextFrame(socket, "tilecombine nviewid=0 part=0 width=256 height=256 tileposx=0,3840,7680 tileposy=0,0,0 tilewidth=3840 tileheight=3840", testname);
         const auto tile1 = assertResponseString(socket, "tile:", testname);
         std::string renderId1;
         LOOLProtocol::getTokenStringFromMessage(tile1, "renderid", renderId1);
-        CPPUNIT_ASSERT_EQUAL(std::string("cached"), renderId1);
+        LOK_ASSERT_EQUAL(std::string("cached"), renderId1);
 
         const auto tile2 = assertResponseString(socket, "tile:", testname);
         std::string renderId2;
         LOOLProtocol::getTokenStringFromMessage(tile2, "renderid", renderId2);
-        CPPUNIT_ASSERT_EQUAL(std::string("cached"), renderId2);
+        LOK_ASSERT_EQUAL(std::string("cached"), renderId2);
 
         const auto tile3 = assertResponseString(socket, "tile:", testname);
         std::string renderId3;
         LOOLProtocol::getTokenStringFromMessage(tile3, "renderid", renderId3);
-        CPPUNIT_ASSERT_EQUAL(std::string("cached"), renderId3);
+        LOK_ASSERT_EQUAL(std::string("cached"), renderId3);
 
         // Get new rendercount.
         sendTextFrame(socket, "ping", testname);
         const auto ping3 = assertResponseString(socket, "pong", testname);
         int renderCount3 = 0;
-        CPPUNIT_ASSERT(LOOLProtocol::getTokenIntegerFromMessage(ping3, "rendercount", renderCount3));
-        CPPUNIT_ASSERT_EQUAL(renderCount2, renderCount3);
+        LOK_ASSERT(LOOLProtocol::getTokenIntegerFromMessage(ping3, "rendercount", renderCount3));
+        LOK_ASSERT_EQUAL(renderCount2, renderCount3);
     }
 }
 
@@ -629,8 +629,8 @@ void TileCacheTests::testTilesRenderedJustOnceMultiClient()
         sendTextFrame(socket, "ping", testname1);
         const auto ping1 = assertResponseString(socket, "pong", testname1);
         int renderCount1 = 0;
-        CPPUNIT_ASSERT(LOOLProtocol::getTokenIntegerFromMessage(ping1, "rendercount", renderCount1));
-        CPPUNIT_ASSERT_EQUAL(i * 3, renderCount1);
+        LOK_ASSERT(LOOLProtocol::getTokenIntegerFromMessage(ping1, "rendercount", renderCount1));
+        LOK_ASSERT_EQUAL(i * 3, renderCount1);
 
         // Modify.
         sendText(socket, "a", testname1);
@@ -664,32 +664,32 @@ void TileCacheTests::testTilesRenderedJustOnceMultiClient()
         sendTextFrame(socket, "ping", testname1);
         const auto ping2 = assertResponseString(socket, "pong", testname1);
         int renderCount2 = 0;
-        CPPUNIT_ASSERT(LOOLProtocol::getTokenIntegerFromMessage(ping2, "rendercount", renderCount2));
-        CPPUNIT_ASSERT_EQUAL((i+1) * 3, renderCount2);
+        LOK_ASSERT(LOOLProtocol::getTokenIntegerFromMessage(ping2, "rendercount", renderCount2));
+        LOK_ASSERT_EQUAL((i+1) * 3, renderCount2);
 
         // Get same 3 tiles.
         sendTextFrame(socket, "tilecombine nviewid=0 part=0 width=256 height=256 tileposx=0,3840,7680 tileposy=0,0,0 tilewidth=3840 tileheight=3840", testname1);
         const auto tile1 = assertResponseString(socket, "tile:", testname1);
         std::string renderId1;
         LOOLProtocol::getTokenStringFromMessage(tile1, "renderid", renderId1);
-        CPPUNIT_ASSERT_EQUAL(std::string("cached"), renderId1);
+        LOK_ASSERT_EQUAL(std::string("cached"), renderId1);
 
         const auto tile2 = assertResponseString(socket, "tile:", testname1);
         std::string renderId2;
         LOOLProtocol::getTokenStringFromMessage(tile2, "renderid", renderId2);
-        CPPUNIT_ASSERT_EQUAL(std::string("cached"), renderId2);
+        LOK_ASSERT_EQUAL(std::string("cached"), renderId2);
 
         const auto tile3 = assertResponseString(socket, "tile:", testname1);
         std::string renderId3;
         LOOLProtocol::getTokenStringFromMessage(tile3, "renderid", renderId3);
-        CPPUNIT_ASSERT_EQUAL(std::string("cached"), renderId3);
+        LOK_ASSERT_EQUAL(std::string("cached"), renderId3);
 
         // Get new rendercount.
         sendTextFrame(socket, "ping", testname1);
         const auto ping3 = assertResponseString(socket, "pong", testname1);
         int renderCount3 = 0;
-        CPPUNIT_ASSERT(LOOLProtocol::getTokenIntegerFromMessage(ping3, "rendercount", renderCount3));
-        CPPUNIT_ASSERT_EQUAL(renderCount2, renderCount3);
+        LOK_ASSERT(LOOLProtocol::getTokenIntegerFromMessage(ping3, "rendercount", renderCount3));
+        LOK_ASSERT_EQUAL(renderCount2, renderCount3);
     }
 }
 
@@ -722,7 +722,7 @@ void TileCacheTests::testSimultaneousTilesRenderedJustOnce()
         std::string renderId2;
         LOOLProtocol::getTokenStringFromMessage(response2, "renderid", renderId2);
 
-        CPPUNIT_ASSERT(renderId1 == renderId2 ||
+        LOK_ASSERT(renderId1 == renderId2 ||
                        (renderId1 == "cached" && renderId2 != "cached") ||
                        (renderId1 != "cached" && renderId2 == "cached"));
     }
@@ -751,11 +751,11 @@ void TileCacheTests::testLoad12ods()
     }
     catch (const Poco::Exception& exc)
     {
-        CPPUNIT_FAIL(exc.displayText());
+        LOK_ASSERT_FAIL(exc.displayText());
     }
     catch (...)
     {
-        CPPUNIT_FAIL("Unexpected exception thrown during ods load");
+        LOK_ASSERT_FAIL("Unexpected exception thrown during ods load");
     }
 }
 
@@ -786,9 +786,9 @@ void TileCacheTests::checkBlackTile(std::stringstream& tile)
         }
     }
 
-    CPPUNIT_ASSERT_MESSAGE("The tile is 100% black", black != height * width);
+    LOK_ASSERT_MESSAGE("The tile is 100% black", black != height * width);
     assert(height * width != 0);
-    CPPUNIT_ASSERT_MESSAGE("The tile is 90% black", (black * 100) / (height * width) < 90);
+    LOK_ASSERT_MESSAGE("The tile is 90% black", (black * 100) / (height * width) < 90);
 }
 
 void TileCacheTests::checkBlackTiles(std::shared_ptr<LOOLWebSocket>& socket, const int /*part*/, const int /*docWidth*/, const int /*docHeight*/, const std::string& name)
@@ -803,7 +803,7 @@ void TileCacheTests::checkBlackTiles(std::shared_ptr<LOOLWebSocket>& socket, con
     const std::vector<char> tile = getResponseMessage(socket, "tile:", name);
     if (!tile.size())
     {
-        CPPUNIT_FAIL("No tile returned to checkBlackTiles - failed load ?");
+        LOK_ASSERT_FAIL("No tile returned to checkBlackTiles - failed load ?");
         return;
     }
 
@@ -851,7 +851,7 @@ void TileCacheTests::testTileInvalidateWriter()
     }
 
     // While extra invalidates are not desirable, they are inevitable at the moment.
-    //CPPUNIT_ASSERT_MESSAGE("received unexpected invalidatetiles: message", getResponseMessage(socket, "invalidatetiles:").empty());
+    //LOK_ASSERT_MESSAGE("received unexpected invalidatetiles: message", getResponseMessage(socket, "invalidatetiles:").empty());
 
     // TODO: implement a random-sequence "monkey test"
 }
@@ -873,9 +873,9 @@ void TileCacheTests::testTileInvalidateWriterPage()
 
     const auto res = assertResponseString(socket, "invalidatetiles:", testname);
     int part = -1;
-    CPPUNIT_ASSERT_MESSAGE("No part# in invalidatetiles message.",
+    LOK_ASSERT_MESSAGE("No part# in invalidatetiles message.",
                            LOOLProtocol::getTokenIntegerFromMessage(res, "part", part));
-    CPPUNIT_ASSERT_EQUAL(0, part);
+    LOK_ASSERT_EQUAL(0, part);
 }
 
 // This isn't yet used
@@ -1020,12 +1020,12 @@ void TileCacheTests::testTileInvalidatePartCalc()
         const auto response1 = assertResponseString(socket1, "invalidatetiles:", testname1);
         int value1;
         LOOLProtocol::getTokenIntegerFromMessage(response1, "part", value1);
-        CPPUNIT_ASSERT_EQUAL(2, value1);
+        LOK_ASSERT_EQUAL(2, value1);
 
         const auto response2 = assertResponseString(socket2, "invalidatetiles:", testname2);
         int value2;
         LOOLProtocol::getTokenIntegerFromMessage(response2, "part", value2);
-        CPPUNIT_ASSERT_EQUAL(5, value2);
+        LOK_ASSERT_EQUAL(5, value2);
     }
 }
 
@@ -1059,12 +1059,12 @@ void TileCacheTests::testTileInvalidatePartImpress()
         const auto response1 = assertResponseString(socket1, "invalidatetiles:", testname1);
         int value1;
         LOOLProtocol::getTokenIntegerFromMessage(response1, "part", value1);
-        CPPUNIT_ASSERT_EQUAL(2, value1);
+        LOK_ASSERT_EQUAL(2, value1);
 
         const auto response2 = assertResponseString(socket2, "invalidatetiles:", testname2);
         int value2;
         LOOLProtocol::getTokenIntegerFromMessage(response2, "part", value2);
-        CPPUNIT_ASSERT_EQUAL(5, value2);
+        LOK_ASSERT_EQUAL(5, value2);
     }
 }
 
@@ -1098,9 +1098,9 @@ void TileCacheTests::checkTiles(std::shared_ptr<LOOLWebSocket>& socket, const st
             CPPUNIT_ASSERT_GREATEREQUAL(static_cast<size_t>(6), tokens.size());
 #else
         if (docType == "presentation")
-            CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(7), tokens.size()); // We have an extra field.
+            LOK_ASSERT_EQUAL(static_cast<size_t>(7), tokens.size()); // We have an extra field.
         else
-            CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(6), tokens.size());
+            LOK_ASSERT_EQUAL(static_cast<size_t>(6), tokens.size());
 #endif
 
         // Expected format is something like 'type= parts= current= width= height='.
@@ -1109,11 +1109,11 @@ void TileCacheTests::checkTiles(std::shared_ptr<LOOLWebSocket>& socket, const st
         currentPart = std::stoi(tokens[2].substr(current.size()));
         docWidth = std::stoi(tokens[3].substr(width.size()));
         docHeight = std::stoi(tokens[4].substr(height.size()));
-        CPPUNIT_ASSERT_EQUAL(docType, text);
-        CPPUNIT_ASSERT_EQUAL(10, totalParts);
-        CPPUNIT_ASSERT(currentPart > -1);
-        CPPUNIT_ASSERT(docWidth > 0);
-        CPPUNIT_ASSERT(docHeight > 0);
+        LOK_ASSERT_EQUAL(docType, text);
+        LOK_ASSERT_EQUAL(10, totalParts);
+        LOK_ASSERT(currentPart > -1);
+        LOK_ASSERT(docWidth > 0);
+        LOK_ASSERT(docHeight > 0);
     }
 
     if (docType == "presentation")
@@ -1201,15 +1201,15 @@ void TileCacheTests::requestTiles(std::shared_ptr<LOOLWebSocket>& socket,
             tile = assertResponseString(socket, "tile:", name);
             // expected tile: part= width= height= tileposx= tileposy= tilewidth= tileheight=
             StringVector tokens(LOOLProtocol::tokenize(tile, ' '));
-            CPPUNIT_ASSERT_EQUAL(std::string("tile:"), tokens[0]);
-            CPPUNIT_ASSERT_EQUAL(0, std::stoi(tokens[1].substr(std::string("nviewid=").size())));
-            CPPUNIT_ASSERT_EQUAL(part, std::stoi(tokens[2].substr(std::string("part=").size())));
-            CPPUNIT_ASSERT_EQUAL(pixTileSize, std::stoi(tokens[3].substr(std::string("width=").size())));
-            CPPUNIT_ASSERT_EQUAL(pixTileSize, std::stoi(tokens[4].substr(std::string("height=").size())));
-            CPPUNIT_ASSERT_EQUAL(tileX, std::stoi(tokens[5].substr(std::string("tileposx=").size())));
-            CPPUNIT_ASSERT_EQUAL(tileY, std::stoi(tokens[6].substr(std::string("tileposy=").size())));
-            CPPUNIT_ASSERT_EQUAL(tileWidth, std::stoi(tokens[7].substr(std::string("tileWidth=").size())));
-            CPPUNIT_ASSERT_EQUAL(tileHeight, std::stoi(tokens[8].substr(std::string("tileHeight=").size())));
+            LOK_ASSERT_EQUAL(std::string("tile:"), tokens[0]);
+            LOK_ASSERT_EQUAL(0, std::stoi(tokens[1].substr(std::string("nviewid=").size())));
+            LOK_ASSERT_EQUAL(part, std::stoi(tokens[2].substr(std::string("part=").size())));
+            LOK_ASSERT_EQUAL(pixTileSize, std::stoi(tokens[3].substr(std::string("width=").size())));
+            LOK_ASSERT_EQUAL(pixTileSize, std::stoi(tokens[4].substr(std::string("height=").size())));
+            LOK_ASSERT_EQUAL(tileX, std::stoi(tokens[5].substr(std::string("tileposx=").size())));
+            LOK_ASSERT_EQUAL(tileY, std::stoi(tokens[6].substr(std::string("tileposy=").size())));
+            LOK_ASSERT_EQUAL(tileWidth, std::stoi(tokens[7].substr(std::string("tileWidth=").size())));
+            LOK_ASSERT_EQUAL(tileHeight, std::stoi(tokens[8].substr(std::string("tileHeight=").size())));
         }
     }
 }
@@ -1231,7 +1231,7 @@ void TileCacheTests::testTileRequestByInvalidation()
 
     // Since we did not set client visible area wsd won't send tile
     std::vector<char> tile = getResponseMessage(socket, "tile:", testname);
-    CPPUNIT_ASSERT_MESSAGE("Not expected tile message arrived!", tile.empty());
+    LOK_ASSERT_MESSAGE("Not expected tile message arrived!", tile.empty());
 
     // 2. use case: invalidation of one tile inside the client visible area
     // Now set the client visible area
@@ -1270,7 +1270,7 @@ void TileCacheTests::testTileRequestByZoom()
     for (int i = 0; i < 20; ++i)
     {
         std::vector<char> tile = getResponseMessage(socket, "tile:", testname);
-        CPPUNIT_ASSERT_MESSAGE("Did not get tile as expected!", !tile.empty());
+        LOK_ASSERT_MESSAGE("Did not get tile as expected!", !tile.empty());
     }
 }
 
@@ -1293,7 +1293,7 @@ void TileCacheTests::testTileWireIDHandling()
     assertResponseString(socket, "invalidatetiles:", testname);
 
     // For the first input wsd will send all invalidated tiles
-    CPPUNIT_ASSERT_MESSAGE("Expected at least two tiles.", countMessages(socket, "tile:", testname, 500) > 1);
+    LOK_ASSERT_MESSAGE("Expected at least two tiles.", countMessages(socket, "tile:", testname, 500) > 1);
 
     // Let WSD know we got these so it wouldn't stop sending us modified tiles automatically.
     sendTextFrame(socket, "tileprocessed tile=0:0:0:3840:3840:0", testname);
@@ -1311,13 +1311,13 @@ void TileCacheTests::testTileWireIDHandling()
 
     // Or, at most 2. The reason is that sometimes we get line antialiasing differences that
     // are sub-pixel different, and that results in a different hash.
-    CPPUNIT_ASSERT_EQUAL(2, arrivedTiles);
+    LOK_ASSERT_EQUAL(2, arrivedTiles);
 
     // The third time, however, we shouldn't see anything but the tile we change.
     sendChar(socket, 'z', skNone, testname);
     assertResponseString(socket, "invalidatetiles:", testname);
 
-    CPPUNIT_ASSERT_MESSAGE("Expected exactly one tile.", countMessages(socket, "tile:", testname, 500) == 1);
+    LOK_ASSERT_MESSAGE("Expected exactly one tile.", countMessages(socket, "tile:", testname, 500) == 1);
 }
 
 void TileCacheTests::testTileProcessed()
@@ -1360,8 +1360,8 @@ void TileCacheTests::testTileProcessed()
 
     } while(gotTile);
 
-    CPPUNIT_ASSERT_MESSAGE("We expect two tiles at least!", arrivedTile > 1);
-    CPPUNIT_ASSERT_MESSAGE("We expect that wsd can't send all the tiles!", arrivedTile < 25);
+    LOK_ASSERT_MESSAGE("We expect two tiles at least!", arrivedTile > 1);
+    LOK_ASSERT_MESSAGE("We expect that wsd can't send all the tiles!", arrivedTile < 25);
 
     for(std::string& tileID : tileIDs)
     {
@@ -1379,7 +1379,7 @@ void TileCacheTests::testTileProcessed()
 
     } while(gotTile);
 
-    CPPUNIT_ASSERT_MESSAGE("We expect one tile at least!", arrivedTile2 > 1);
+    LOK_ASSERT_MESSAGE("We expect one tile at least!", arrivedTile2 > 1);
 }
 
 void TileCacheTests::testTileInvalidatedOutside()
@@ -1417,7 +1417,7 @@ void TileCacheTests::testTileInvalidatedOutside()
     // wsd does not send a new tile even if some of the invalidated tiles
     // are partly visible.
     std::vector<char> tile = getResponseMessage(socket, "tile:", testname);
-    CPPUNIT_ASSERT_MESSAGE("Not expected tile message arrived!", tile.empty());
+    LOK_ASSERT_MESSAGE("Not expected tile message arrived!", tile.empty());
 }
 
 void TileCacheTests::testTileBeingRenderedHandling()
@@ -1441,7 +1441,7 @@ void TileCacheTests::testTileBeingRenderedHandling()
     assertResponseString(socket, "invalidatetiles:", testname);
 
     // For the first input wsd will send all invalidated tiles
-    CPPUNIT_ASSERT_MESSAGE("Expected at least two tiles.", countMessages(socket, "tile:", testname, 500) > 1);
+    LOK_ASSERT_MESSAGE("Expected at least two tiles.", countMessages(socket, "tile:", testname, 500) > 1);
 
     // For the later inputs wsd will send one tile, since other ones are indentical
     for(int i = 0; i < 5; ++i)
@@ -1457,7 +1457,7 @@ void TileCacheTests::testTileBeingRenderedHandling()
         {
             // Or, at most 2. The reason is that sometimes we get line antialiasing differences that
             // are sub-pixel different, and that results in a different hash.
-            CPPUNIT_ASSERT_EQUAL(2, arrivedTiles);
+            LOK_ASSERT_EQUAL(2, arrivedTiles);
 
             sendTextFrame(socket, "tileprocessed tile=0:0:0:3200:3200:0", testname);
 
@@ -1465,7 +1465,7 @@ void TileCacheTests::testTileBeingRenderedHandling()
             sendChar(socket, 'z', skNone, testname);
             assertResponseString(socket, "invalidatetiles:", testname);
 
-            CPPUNIT_ASSERT_MESSAGE("Expected exactly one tile.", countMessages(socket, "tile:", testname, 500) == 1);
+            LOK_ASSERT_MESSAGE("Expected exactly one tile.", countMessages(socket, "tile:", testname, 500) == 1);
         }
     }
 }
@@ -1495,7 +1495,7 @@ void TileCacheTests::testWireIDFilteringOnWSDSide()
     assertResponseString(socket1, "invalidatetiles:", testname);
 
     // For the first input wsd will send all invalidated tiles
-    CPPUNIT_ASSERT_MESSAGE("Expected at least two tiles.", countMessages(socket1, "tile:", testname, 500) > 1);
+    LOK_ASSERT_MESSAGE("Expected at least two tiles.", countMessages(socket1, "tile:", testname, 500) > 1);
 
     // Let WSD know we got these so it wouldn't stop sending us modified tiles automatically.
     sendTextFrame(socket1, "tileprocessed tile=0:0:0:3840:3840:0", testname);
@@ -1513,24 +1513,24 @@ void TileCacheTests::testWireIDFilteringOnWSDSide()
 
     // Or, at most 2. The reason is that sometimes we get line antialiasing differences that
     // are sub-pixel different, and that results in a different hash.
-    CPPUNIT_ASSERT_MESSAGE("Expected at most 3 tiles.", arrivedTiles <= 3);
+    LOK_ASSERT_MESSAGE("Expected at most 3 tiles.", arrivedTiles <= 3);
 
     // The third time, however, we shouldn't see anything but the tile we change.
     sendChar(socket1, 'z', skNone, testname);
     assertResponseString(socket1, "invalidatetiles:", testname);
 
-    CPPUNIT_ASSERT_MESSAGE("Expected exactly one tile.", countMessages(socket1, "tile:", testname, 500) == 1);
+    LOK_ASSERT_MESSAGE("Expected exactly one tile.", countMessages(socket1, "tile:", testname, 500) == 1);
 
     //2. Now request the same tiles by the other client (e.g. scroll to the same view)
 
     sendTextFrame(socket2, "tilecombine nviewid=0 part=0 width=256 height=256 tileposx=0,3840,7680 tileposy=0,0,0 tilewidth=3840 tileheight=3840");
 
     // We expect three tiles sent to the second client
-    CPPUNIT_ASSERT_EQUAL(3, countMessages(socket2, "tile:", testname, 500));
+    LOK_ASSERT_EQUAL(3, countMessages(socket2, "tile:", testname, 500));
 
     // wsd should not send tiles messages for the first client
     std::vector<char> tile = getResponseMessage(socket1, "tile:", testname, 1000);
-    CPPUNIT_ASSERT_MESSAGE("Not expected tile message arrived!", tile.empty());
+    LOK_ASSERT_MESSAGE("Not expected tile message arrived!", tile.empty());
 }
 
 void TileCacheTests::testLimitTileVersionsOnFly()
@@ -1573,7 +1573,7 @@ void TileCacheTests::testLimitTileVersionsOnFly()
     sendChar(socket, 'x', skNone, testname);
 
     std::vector<char> tile1 = getResponseMessage(socket, "tile:", testname, 1000);
-    CPPUNIT_ASSERT_MESSAGE("Not expected tile message arrived!", tile1.empty());
+    LOK_ASSERT_MESSAGE("Not expected tile message arrived!", tile1.empty());
 
     // When the next tileprocessed message arrive with correct tileID
     // wsd sends the delayed tile
@@ -1589,7 +1589,7 @@ void TileCacheTests::testLimitTileVersionsOnFly()
             ++arrivedTiles;
     } while(gotTile);
 
-    CPPUNIT_ASSERT_EQUAL(1, arrivedTiles);
+    LOK_ASSERT_EQUAL(1, arrivedTiles);
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(TileCacheTests);
diff --git a/test/TileQueueTests.cpp b/test/TileQueueTests.cpp
index 1804ee8bf..b4283bf33 100644
--- a/test/TileQueueTests.cpp
+++ b/test/TileQueueTests.cpp
@@ -9,7 +9,7 @@
 
 #include <config.h>
 
-#include <cppunit/extensions/HelperMacros.h>
+#include <test/lokassert.hpp>
 
 #include <Common.hpp>
 #include <Protocol.hpp>
@@ -84,8 +84,8 @@ void TileQueueTests::testTileQueuePriority()
     queue.put(reqHigh);
 
     // Original order.
-    CPPUNIT_ASSERT_EQUAL(payloadLow, queue.get());
-    CPPUNIT_ASSERT_EQUAL(payloadHigh, queue.get());
+    LOK_ASSERT_EQUAL(payloadLow, queue.get());
+    LOK_ASSERT_EQUAL(payloadHigh, queue.get());
 
     // Request the tiles.
     queue.put(reqLow);
@@ -97,21 +97,21 @@ void TileQueueTests::testTileQueuePriority()
     queue.updateCursorPosition(0, 0, 0, 0, 10, 100);
 
     // Prioritized order.
-    CPPUNIT_ASSERT_EQUAL(payloadHigh, queue.get());
-    CPPUNIT_ASSERT_EQUAL(payloadLow, queue.get());
+    LOK_ASSERT_EQUAL(payloadHigh, queue.get());
+    LOK_ASSERT_EQUAL(payloadLow, queue.get());
 
     // Repeat with cursor position set.
     queue.put(reqLow);
     queue.put(reqHigh);
-    CPPUNIT_ASSERT_EQUAL(payloadHigh, queue.get());
-    CPPUNIT_ASSERT_EQUAL(payloadLow, queue.get());
+    LOK_ASSERT_EQUAL(payloadHigh, queue.get());
+    LOK_ASSERT_EQUAL(payloadLow, queue.get());
 
     // Repeat by changing cursor position.
     queue.put(reqLow);
     queue.put(reqHigh);
     queue.updateCursorPosition(0, 0, 0, 253450, 10, 100);
-    CPPUNIT_ASSERT_EQUAL(payloadLow, queue.get());
-    CPPUNIT_ASSERT_EQUAL(payloadHigh, queue.get());
+    LOK_ASSERT_EQUAL(payloadLow, queue.get());
+    LOK_ASSERT_EQUAL(payloadHigh, queue.get());
 }
 
 void TileQueueTests::testTileCombinedRendering()
@@ -132,18 +132,18 @@ void TileQueueTests::testTileCombinedRendering()
     // Horizontal.
     queue.put(req1);
     queue.put(req2);
-    CPPUNIT_ASSERT_EQUAL(payloadHor, queue.get());
+    LOK_ASSERT_EQUAL(payloadHor, queue.get());
 
     // Vertical.
     queue.put(req1);
     queue.put(req3);
-    CPPUNIT_ASSERT_EQUAL(payloadVer, queue.get());
+    LOK_ASSERT_EQUAL(payloadVer, queue.get());
 
     // Vertical.
     queue.put(req1);
     queue.put(req2);
     queue.put(req3);
-    CPPUNIT_ASSERT_EQUAL(payloadFull, queue.get());
+    LOK_ASSERT_EQUAL(payloadFull, queue.get());
 }
 
 namespace {
@@ -163,15 +163,15 @@ void TileQueueTests::testTileRecombining()
     queue.put("tilecombine nviewid=0 part=0 width=256 height=256 tileposx=0,3840 tileposy=0,0 tilewidth=3840 tileheight=3840");
 
     // the tilecombine's get merged, resulting in 3 "tile" messages
-    CPPUNIT_ASSERT_EQUAL(3, static_cast<int>(queue.getQueue().size()));
+    LOK_ASSERT_EQUAL(3, static_cast<int>(queue.getQueue().size()));
 
     // but when we later extract that, it is just one "tilecombine" message
     std::string message(payloadAsString(queue.get()));
 
-    CPPUNIT_ASSERT_EQUAL(std::string("tilecombine nviewid=0 part=0 width=256 height=256 tileposx=7680,0,3840 tileposy=0,0,0 imgsize=0,0,0 tilewidth=3840 tileheight=3840 ver=-1,-1,-1 oldwid=0,0,0 wid=0,0,0"), message);
+    LOK_ASSERT_EQUAL(std::string("tilecombine nviewid=0 part=0 width=256 height=256 tileposx=7680,0,3840 tileposy=0,0,0 imgsize=0,0,0 tilewidth=3840 tileheight=3840 ver=-1,-1,-1 oldwid=0,0,0 wid=0,0,0"), message);
 
     // and nothing remains in the queue
-    CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(queue.getQueue().size()));
+    LOK_ASSERT_EQUAL(0, static_cast<int>(queue.getQueue().size()));
 }
 
 void TileQueueTests::testViewOrder()
@@ -197,13 +197,13 @@ void TileQueueTests::testViewOrder()
     for (auto &tile : tiles)
         queue.put(tile);
 
-    CPPUNIT_ASSERT_EQUAL(4, static_cast<int>(queue.getQueue().size()));
+    LOK_ASSERT_EQUAL(4, static_cast<int>(queue.getQueue().size()));
 
     // should result in the 3, 2, 1, 0 order of the tiles thanks to the cursor
     // positions
     for (size_t i = 0; i < tiles.size(); ++i)
     {
-        CPPUNIT_ASSERT_EQUAL(tiles[3 - i], payloadAsString(queue.get()));
+        LOK_ASSERT_EQUAL(tiles[3 - i], payloadAsString(queue.get()));
     }
 }
 
@@ -225,11 +225,11 @@ void TileQueueTests::testPreviewsDeprioritization()
 
     for (size_t i = 0; i < previews.size(); ++i)
     {
-        CPPUNIT_ASSERT_EQUAL(previews[i], payloadAsString(queue.get()));
+        LOK_ASSERT_EQUAL(previews[i], payloadAsString(queue.get()));
     }
 
     // stays empty after all is done
-    CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(queue.getQueue().size()));
+    LOK_ASSERT_EQUAL(0, static_cast<int>(queue.getQueue().size()));
 
     // re-ordering case - put previews and normal tiles to the queue and get
     // everything back again but this time the tiles have to interleave with
@@ -245,18 +245,18 @@ void TileQueueTests::testPreviewsDeprioritization()
 
     queue.put(tiles[0]);
 
-    CPPUNIT_ASSERT_EQUAL(previews[0], payloadAsString(queue.get()));
-    CPPUNIT_ASSERT_EQUAL(tiles[0], payloadAsString(queue.get()));
-    CPPUNIT_ASSERT_EQUAL(previews[1], payloadAsString(queue.get()));
+    LOK_ASSERT_EQUAL(previews[0], payloadAsString(queue.get()));
+    LOK_ASSERT_EQUAL(tiles[0], payloadAsString(queue.get()));
+    LOK_ASSERT_EQUAL(previews[1], payloadAsString(queue.get()));
 
     queue.put(tiles[1]);
 
-    CPPUNIT_ASSERT_EQUAL(previews[2], payloadAsString(queue.get()));
-    CPPUNIT_ASSERT_EQUAL(tiles[1], payloadAsString(queue.get()));
-    CPPUNIT_ASSERT_EQUAL(previews[3], payloadAsString(queue.get()));
+    LOK_ASSERT_EQUAL(previews[2], payloadAsString(queue.get()));
+    LOK_ASSERT_EQUAL(tiles[1], payloadAsString(queue.get()));
+    LOK_ASSERT_EQUAL(previews[3], payloadAsString(queue.get()));
 
     // stays empty after all is done
-    CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(queue.getQueue().size()));
+    LOK_ASSERT_EQUAL(0, static_cast<int>(queue.getQueue().size()));
 
     // cursor positioning case - the cursor position should not prioritize the
     // previews
@@ -265,11 +265,11 @@ void TileQueueTests::testPreviewsDeprioritization()
     queue.put(tiles[1]);
     queue.put(previews[0]);
 
-    CPPUNIT_ASSERT_EQUAL(tiles[1], payloadAsString(queue.get()));
-    CPPUNIT_ASSERT_EQUAL(previews[0], payloadAsString(queue.get()));
+    LOK_ASSERT_EQUAL(tiles[1], payloadAsString(queue.get()));
+    LOK_ASSERT_EQUAL(previews[0], payloadAsString(queue.get()));
 
     // stays empty after all is done
-    CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(queue.getQueue().size()));
+    LOK_ASSERT_EQUAL(0, static_cast<int>(queue.getQueue().size()));
 }
 
 void TileQueueTests::testSenderQueue()
@@ -279,8 +279,8 @@ void TileQueueTests::testSenderQueue()
     std::shared_ptr<Message> item;
 
     // Empty queue
-    CPPUNIT_ASSERT_EQUAL(false, queue.dequeue(item));
-    CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(0), queue.size());
+    LOK_ASSERT_EQUAL(false, queue.dequeue(item));
+    LOK_ASSERT_EQUAL(static_cast<size_t>(0), queue.size());
 
     const std::vector<std::string> messages =
     {
@@ -294,21 +294,21 @@ void TileQueueTests::testSenderQueue()
         queue.enqueue(std::make_shared<Message>(msg, Message::Dir::Out));
     }
 
-    CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(3), queue.size());
+    LOK_ASSERT_EQUAL(static_cast<size_t>(3), queue.size());
 
-    CPPUNIT_ASSERT_EQUAL(true, queue.dequeue(item));
-    CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), queue.size());
-    CPPUNIT_ASSERT_EQUAL(messages[0], std::string(item->data().data(), item->data().size()));
+    LOK_ASSERT_EQUAL(true, queue.dequeue(item));
+    LOK_ASSERT_EQUAL(static_cast<size_t>(2), queue.size());
+    LOK_ASSERT_EQUAL(messages[0], std::string(item->data().data(), item->data().size()));
 
-    CPPUNIT_ASSERT_EQUAL(true, queue.dequeue(item));
-    CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), queue.size());
-    CPPUNIT_ASSERT_EQUAL(messages[1], std::string(item->data().data(), item->data().size()));
+    LOK_ASSERT_EQUAL(true, queue.dequeue(item));
+    LOK_ASSERT_EQUAL(static_cast<size_t>(1), queue.size());
+    LOK_ASSERT_EQUAL(messages[1], std::string(item->data().data(), item->data().size()));
 
-    CPPUNIT_ASSERT_EQUAL(true, queue.dequeue(item));
-    CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(0), queue.size());
-    CPPUNIT_ASSERT_EQUAL(messages[2], std::string(item->data().data(), item->data().size()));
+    LOK_ASSERT_EQUAL(true, queue.dequeue(item));
+    LOK_ASSERT_EQUAL(static_cast<size_t>(0), queue.size());
+    LOK_ASSERT_EQUAL(messages[2], std::string(item->data().data(), item->data().size()));
 
-    CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(0), queue.size());
+    LOK_ASSERT_EQUAL(static_cast<size_t>(0), queue.size());
 }
 
 void TileQueueTests::testSenderQueueTileDeduplication()
@@ -318,8 +318,8 @@ void TileQueueTests::testSenderQueueTileDeduplication()
     std::shared_ptr<Message> item;
 
     // Empty queue
-    CPPUNIT_ASSERT_EQUAL(false, queue.dequeue(item));
-    CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(0), queue.size());
+    LOK_ASSERT_EQUAL(false, queue.dequeue(item));
+    LOK_ASSERT_EQUAL(static_cast<size_t>(0), queue.size());
 
     const std::vector<std::string> part_messages =
     {
@@ -333,12 +333,12 @@ void TileQueueTests::testSenderQueueTileDeduplication()
         queue.enqueue(std::make_shared<Message>(msg, Message::Dir::Out));
     }
 
-    CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(3), queue.size());
-    CPPUNIT_ASSERT_EQUAL(true, queue.dequeue(item));
-    CPPUNIT_ASSERT_EQUAL(true, queue.dequeue(item));
-    CPPUNIT_ASSERT_EQUAL(true, queue.dequeue(item));
+    LOK_ASSERT_EQUAL(static_cast<size_t>(3), queue.size());
+    LOK_ASSERT_EQUAL(true, queue.dequeue(item));
+    LOK_ASSERT_EQUAL(true, queue.dequeue(item));
+    LOK_ASSERT_EQUAL(true, queue.dequeue(item));
 
-    CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(0), queue.size());
+    LOK_ASSERT_EQUAL(static_cast<size_t>(0), queue.size());
 
     const std::vector<std::string> dup_messages =
     {
@@ -352,13 +352,13 @@ void TileQueueTests::testSenderQueueTileDeduplication()
         queue.enqueue(std::make_shared<Message>(msg, Message::Dir::Out));
     }
 
-    CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), queue.size());
-    CPPUNIT_ASSERT_EQUAL(true, queue.dequeue(item));
+    LOK_ASSERT_EQUAL(static_cast<size_t>(1), queue.size());
+    LOK_ASSERT_EQUAL(true, queue.dequeue(item));
 
     // The last one should persist.
-    CPPUNIT_ASSERT_EQUAL(dup_messages[2], std::string(item->data().data(), item->data().size()));
+    LOK_ASSERT_EQUAL(dup_messages[2], std::string(item->data().data(), item->data().size()));
 
-    CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(0), queue.size());
+    LOK_ASSERT_EQUAL(static_cast<size_t>(0), queue.size());
 }
 
 void TileQueueTests::testInvalidateViewCursorDeduplication()
@@ -368,8 +368,8 @@ void TileQueueTests::testInvalidateViewCursorDeduplication()
     std::shared_ptr<Message> item;
 
     // Empty queue
-    CPPUNIT_ASSERT_EQUAL(false, queue.dequeue(item));
-    CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(0), queue.size());
+    LOK_ASSERT_EQUAL(false, queue.dequeue(item));
+    LOK_ASSERT_EQUAL(static_cast<size_t>(0), queue.size());
 
     const std::vector<std::string> view_messages =
     {
@@ -383,21 +383,21 @@ void TileQueueTests::testInvalidateViewCursorDeduplication()
         queue.enqueue(std::make_shared<Message>(msg, Message::Dir::Out));
     }
 
-    CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(3), queue.size());
+    LOK_ASSERT_EQUAL(static_cast<size_t>(3), queue.size());
 
-    CPPUNIT_ASSERT_EQUAL(true, queue.dequeue(item));
-    CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), queue.size());
-    CPPUNIT_ASSERT_EQUAL(view_messages[0], std::string(item->data().data(), item->data().size()));
+    LOK_ASSERT_EQUAL(true, queue.dequeue(item));
+    LOK_ASSERT_EQUAL(static_cast<size_t>(2), queue.size());
+    LOK_ASSERT_EQUAL(view_messages[0], std::string(item->data().data(), item->data().size()));
 
-    CPPUNIT_ASSERT_EQUAL(true, queue.dequeue(item));
-    CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), queue.size());
-    CPPUNIT_ASSERT_EQUAL(view_messages[1], std::string(item->data().data(), item->data().size()));
+    LOK_ASSERT_EQUAL(true, queue.dequeue(item));
+    LOK_ASSERT_EQUAL(static_cast<size_t>(1), queue.size());
+    LOK_ASSERT_EQUAL(view_messages[1], std::string(item->data().data(), item->data().size()));
 
-    CPPUNIT_ASSERT_EQUAL(true, queue.dequeue(item));
-    CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(0), queue.size());
-    CPPUNIT_ASSERT_EQUAL(view_messages[2], std::string(item->data().data(), item->data().size()));
+    LOK_ASSERT_EQUAL(true, queue.dequeue(item));
+    LOK_ASSERT_EQUAL(static_cast<size_t>(0), queue.size());
+    LOK_ASSERT_EQUAL(view_messages[2], std::string(item->data().data(), item->data().size()));
 
-    CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(0), queue.size());
+    LOK_ASSERT_EQUAL(static_cast<size_t>(0), queue.size());
 
     const std::vector<std::string> dup_messages =
     {
@@ -411,13 +411,13 @@ void TileQueueTests::testInvalidateViewCursorDeduplication()
         queue.enqueue(std::make_shared<Message>(msg, Message::Dir::Out));
     }
 
-    CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), queue.size());
-    CPPUNIT_ASSERT_EQUAL(true, queue.dequeue(item));
+    LOK_ASSERT_EQUAL(static_cast<size_t>(1), queue.size());
+    LOK_ASSERT_EQUAL(true, queue.dequeue(item));
 
     // The last one should persist.
-    CPPUNIT_ASSERT_EQUAL(dup_messages[2], std::string(item->data().data(), item->data().size()));
+    LOK_ASSERT_EQUAL(dup_messages[2], std::string(item->data().data(), item->data().size()));
 
-    CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(0), queue.size());
+    LOK_ASSERT_EQUAL(static_cast<size_t>(0), queue.size());
 }
 
 void TileQueueTests::testCallbackInvalidation()
@@ -428,9 +428,9 @@ void TileQueueTests::testCallbackInvalidation()
     queue.put("callback all 0 284, 1418, 11105, 275, 0");
     queue.put("callback all 0 4299, 1418, 7090, 275, 0");
 
-    CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(queue.getQueue().size()));
+    LOK_ASSERT_EQUAL(1, static_cast<int>(queue.getQueue().size()));
 
-    CPPUNIT_ASSERT_EQUAL(std::string("callback all 0 284, 1418, 11105, 275, 0"), payloadAsString(queue.get()));
+    LOK_ASSERT_EQUAL(std::string("callback all 0 284, 1418, 11105, 275, 0"), payloadAsString(queue.get()));
 
     // invalidate everything with EMPTY, but keep the different part intact
     queue.put("callback all 0 284, 1418, 11105, 275, 0");
@@ -438,13 +438,13 @@ void TileQueueTests::testCallbackInvalidation()
     queue.put("callback all 0 4299, 10418, 7090, 275, 0");
     queue.put("callback all 0 4299, 20418, 7090, 275, 0");
 
-    CPPUNIT_ASSERT_EQUAL(4, static_cast<int>(queue.getQueue().size()));
+    LOK_ASSERT_EQUAL(4, static_cast<int>(queue.getQueue().size()));
 
     queue.put("callback all 0 EMPTY, 0");
 
-    CPPUNIT_ASSERT_EQUAL(2, static_cast<int>(queue.getQueue().size()));
-    CPPUNIT_ASSERT_EQUAL(std::string("callback all 0 4299, 1418, 7090, 275, 1"), payloadAsString(queue.get()));
-    CPPUNIT_ASSERT_EQUAL(std::string("callback all 0 EMPTY, 0"), payloadAsString(queue.get()));
+    LOK_ASSERT_EQUAL(2, static_cast<int>(queue.getQueue().size()));
+    LOK_ASSERT_EQUAL(std::string("callback all 0 4299, 1418, 7090, 275, 1"), payloadAsString(queue.get()));
+    LOK_ASSERT_EQUAL(std::string("callback all 0 EMPTY, 0"), payloadAsString(queue.get()));
 }
 
 void TileQueueTests::testCallbackIndicatorValue()
@@ -455,8 +455,8 @@ void TileQueueTests::testCallbackIndicatorValue()
     queue.put("callback all 10 25");
     queue.put("callback all 10 50");
 
-    CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(queue.getQueue().size()));
-    CPPUNIT_ASSERT_EQUAL(std::string("callback all 10 50"), payloadAsString(queue.get()));
+    LOK_ASSERT_EQUAL(1, static_cast<int>(queue.getQueue().size()));
+    LOK_ASSERT_EQUAL(std::string("callback all 10 50"), payloadAsString(queue.get()));
 }
 
 void TileQueueTests::testCallbackPageSize()
@@ -467,8 +467,8 @@ void TileQueueTests::testCallbackPageSize()
     queue.put("callback all 13 12474, 188626");
     queue.put("callback all 13 12474, 205748");
 
-    CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(queue.getQueue().size()));
-    CPPUNIT_ASSERT_EQUAL(std::string("callback all 13 12474, 205748"), payloadAsString(queue.get()));
+    LOK_ASSERT_EQUAL(1, static_cast<int>(queue.getQueue().size()));
+    LOK_ASSERT_EQUAL(std::string("callback all 13 12474, 205748"), payloadAsString(queue.get()));
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(TileQueueTests);
diff --git a/test/UnitAdmin.cpp b/test/UnitAdmin.cpp
index 92d2d6c34..65a4fccd0 100644
--- a/test/UnitAdmin.cpp
+++ b/test/UnitAdmin.cpp
@@ -95,9 +95,9 @@ private:
         response.getCookies(cookies);
 
         // For now we only set one cookie
-        CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(cookies.size()));
+        LOK_ASSERT_EQUAL(1, static_cast<int>(cookies.size()));
         // and it is jwt=
-        CPPUNIT_ASSERT_EQUAL(std::string("jwt"), cookies[0].getName());
+        LOK_ASSERT_EQUAL(std::string("jwt"), cookies[0].getName());
 
         // Check cookie properties
         std::string cookiePath = cookies[0].getPath();
diff --git a/test/UnitBadDocLoad.cpp b/test/UnitBadDocLoad.cpp
index 470d8ad09..3f4110dfc 100644
--- a/test/UnitBadDocLoad.cpp
+++ b/test/UnitBadDocLoad.cpp
@@ -15,7 +15,7 @@
 #include <Poco/Exception.h>
 #include <Poco/RegularExpression.h>
 #include <Poco/URI.h>
-#include <cppunit/TestAssert.h>
+#include <test/lokassert.hpp>
 
 #include <Png.hpp>
 #include <Unit.hpp>
@@ -58,18 +58,18 @@ UnitBase::TestResult UnitBadDocLoad::testBadDocLoadFail()
 
         const auto response = helpers::getResponseString(socket, "error:", testname);
         StringVector tokens(LOOLProtocol::tokenize(response, ' '));
-        CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(3), tokens.size());
+        LOK_ASSERT_EQUAL(static_cast<size_t>(3), tokens.size());
 
         std::string errorCommand;
         std::string errorKind;
         LOOLProtocol::getTokenString(tokens[1], "cmd", errorCommand);
         LOOLProtocol::getTokenString(tokens[2], "kind", errorKind);
-        CPPUNIT_ASSERT_EQUAL(std::string("load"), errorCommand);
-        CPPUNIT_ASSERT_EQUAL(std::string("faileddocloading"), errorKind);
+        LOK_ASSERT_EQUAL(std::string("load"), errorCommand);
+        LOK_ASSERT_EQUAL(std::string("faileddocloading"), errorKind);
     }
     catch (const Poco::Exception& exc)
     {
-        CPPUNIT_FAIL(exc.displayText());
+        LOK_ASSERT_FAIL(exc.displayText());
     }
     return TestResult::Ok;
 }
@@ -119,14 +119,14 @@ UnitBase::TestResult UnitBadDocLoad::testMaxDocuments()
 
         std::string message;
         const int statusCode = helpers::getErrorCode(socket, message, testname);
-        CPPUNIT_ASSERT_EQUAL(static_cast<int>(Poco::Net::WebSocket::WS_POLICY_VIOLATION),
+        LOK_ASSERT_EQUAL(static_cast<int>(Poco::Net::WebSocket::WS_POLICY_VIOLATION),
                              statusCode);
 
         socket->shutdown();
     }
     catch (const Poco::Exception& exc)
     {
-        CPPUNIT_FAIL(exc.displayText());
+        LOK_ASSERT_FAIL(exc.displayText());
     }
     return TestResult::Ok;
 }
@@ -181,14 +181,14 @@ UnitBase::TestResult UnitBadDocLoad::testMaxConnections()
 
         std::string message;
         const int statusCode = helpers::getErrorCode(socketN, message, testname);
-        CPPUNIT_ASSERT_EQUAL(static_cast<int>(Poco::Net::WebSocket::WS_POLICY_VIOLATION),
+        LOK_ASSERT_EQUAL(static_cast<int>(Poco::Net::WebSocket::WS_POLICY_VIOLATION),
                              statusCode);
 
         socketN->shutdown();
     }
     catch (const Poco::Exception& exc)
     {
-        CPPUNIT_FAIL(exc.displayText());
+        LOK_ASSERT_FAIL(exc.displayText());
     }
     return TestResult::Ok;
 }
@@ -239,12 +239,12 @@ UnitBase::TestResult UnitBadDocLoad::testMaxViews()
 
         std::string message;
         const int statusCode = helpers::getErrorCode(socketN, message, testname);
-        CPPUNIT_ASSERT_EQUAL(static_cast<int>(Poco::Net::WebSocket::WS_POLICY_VIOLATION),
+        LOK_ASSERT_EQUAL(static_cast<int>(Poco::Net::WebSocket::WS_POLICY_VIOLATION),
                              statusCode);
     }
     catch (const Poco::Exception& exc)
     {
-        CPPUNIT_FAIL(exc.displayText());
+        LOK_ASSERT_FAIL(exc.displayText());
     }
     return TestResult::Ok;
 }
diff --git a/test/UnitCalc.cpp b/test/UnitCalc.cpp
index b874fa352..d8c8f0bb8 100644
--- a/test/UnitCalc.cpp
+++ b/test/UnitCalc.cpp
@@ -15,7 +15,7 @@
 #include <Poco/Exception.h>
 #include <Poco/RegularExpression.h>
 #include <Poco/URI.h>
-#include <cppunit/TestAssert.h>
+#include <test/lokassert.hpp>
 
 #include <Png.hpp>
 #include <Unit.hpp>
@@ -32,16 +32,16 @@ double getColRowSize(const std::string& property, const std::string& message, in
     const auto& command = result.extract<Poco::JSON::Object::Ptr>();
     std::string text = command->get("commandName").toString();
 
-    CPPUNIT_ASSERT_EQUAL(std::string(".uno:ViewRowColumnHeaders"), text);
-    CPPUNIT_ASSERT(command->isArray(property));
+    LOK_ASSERT_EQUAL(std::string(".uno:ViewRowColumnHeaders"), text);
+    LOK_ASSERT(command->isArray(property));
 
     Poco::JSON::Array::Ptr array = command->getArray(property);
 
-    CPPUNIT_ASSERT(array->isObject(index));
+    LOK_ASSERT(array->isObject(index));
 
     Poco::SharedPtr<Poco::JSON::Object> item = array->getObject(index);
 
-    CPPUNIT_ASSERT(item->has("size"));
+    LOK_ASSERT(item->has("size"));
 
     return item->getValue<double>("size");
 }
@@ -51,7 +51,7 @@ double getColRowSize(const std::shared_ptr<LOOLWebSocket>& socket, const std::st
 {
     std::vector<char> response;
     response = helpers::getResponseMessage(socket, "commandvalues:", testname);
-    CPPUNIT_ASSERT_MESSAGE("did not receive a commandvalues: message as expected",
+    LOK_ASSERT_MESSAGE("did not receive a commandvalues: message as expected",
                            !response.empty());
     std::vector<char> json(response.begin() + std::string("commandvalues:").length(),
                            response.end());
@@ -124,9 +124,9 @@ UnitBase::TestResult UnitCalc::testCalcEditRendering()
     png_uint_32 rowBytesExp = 0;
     std::vector<png_bytep> rowsExp = Png::decodePNG(streamExp, heightExp, widthExp, rowBytesExp);
 
-    CPPUNIT_ASSERT_EQUAL(heightExp, height);
-    CPPUNIT_ASSERT_EQUAL(widthExp, width);
-    CPPUNIT_ASSERT_EQUAL(rowBytesExp, rowBytes);
+    LOK_ASSERT_EQUAL(heightExp, height);
+    LOK_ASSERT_EQUAL(widthExp, width);
+    LOK_ASSERT_EQUAL(rowBytesExp, rowBytes);
 
     for (png_uint_32 itRow = 0; itRow < height; ++itRow)
     {
@@ -135,7 +135,7 @@ UnitBase::TestResult UnitCalc::testCalcEditRendering()
         {
             // This is a very strict test that breaks often/easily due to slight rendering
             // differences. So for now just keep it informative only.
-            //CPPUNIT_ASSERT_MESSAGE("Tile not rendered as expected @ row #" + std::to_string(itRow), eq);
+            //LOK_ASSERT_MESSAGE("Tile not rendered as expected @ row #" + std::to_string(itRow), eq);
             TST_LOG("\nFAILURE: Tile not rendered as expected @ row #" << itRow);
             break;
         }
@@ -198,7 +198,7 @@ UnitBase::TestResult UnitCalc::testCalcRenderAfterNewView51()
     const std::vector<char> tile2
         = helpers::getTileAndSave(socket, req, "/tmp/calc_render_51_sec.png", testname);
 
-    CPPUNIT_ASSERT(tile1 == tile2);
+    LOK_ASSERT(tile1 == tile2);
     return TestResult::Ok;
 }
 
@@ -246,7 +246,7 @@ UnitBase::TestResult UnitCalc::testCalcRenderAfterNewView53()
     const std::vector<char> tile2
         = helpers::getTileAndSave(socket, req, "/tmp/calc_render_53_sec.png", testname);
 
-    CPPUNIT_ASSERT(tile1 == tile2);
+    LOK_ASSERT(tile1 == tile2);
 
     // Don't let them go out of scope and disconnect.
     socket2->shutdown();
@@ -271,7 +271,7 @@ UnitBase::TestResult UnitCalc::testColumnRowResize()
         const std::string commandValues = "commandvalues command=.uno:ViewRowColumnHeaders";
         helpers::sendTextFrame(socket, commandValues);
         response = helpers::getResponseMessage(socket, "commandvalues:", testname);
-        CPPUNIT_ASSERT_MESSAGE("did not receive a commandvalues: message as expected",
+        LOK_ASSERT_MESSAGE("did not receive a commandvalues: message as expected",
                                !response.empty());
         {
             std::vector<char> json(response.begin() + std::string("commandvalues:").length(),
@@ -304,13 +304,13 @@ UnitBase::TestResult UnitCalc::testColumnRowResize()
             helpers::sendTextFrame(socket, "uno .uno:ColumnWidth " + oss.str(), testname);
             helpers::sendTextFrame(socket, commandValues, testname);
             response = helpers::getResponseMessage(socket, "commandvalues:", testname);
-            CPPUNIT_ASSERT_MESSAGE("did not receive a commandvalues: message as expected",
+            LOK_ASSERT_MESSAGE("did not receive a commandvalues: message as expected",
                                    !response.empty());
             std::vector<char> json(response.begin() + std::string("commandvalues:").length(),
                                    response.end());
             json.push_back(0);
             newWidth = getColRowSize("columns", json.data(), 1);
-            CPPUNIT_ASSERT(newWidth > oldWidth);
+            LOK_ASSERT(newWidth > oldWidth);
         }
 
         // send row height
@@ -333,18 +333,18 @@ UnitBase::TestResult UnitCalc::testColumnRowResize()
             helpers::sendTextFrame(socket, "uno .uno:RowHeight " + oss.str(), testname);
             helpers::sendTextFrame(socket, commandValues, testname);
             response = helpers::getResponseMessage(socket, "commandvalues:", testname);
-            CPPUNIT_ASSERT_MESSAGE("did not receive a commandvalues: message as expected",
+            LOK_ASSERT_MESSAGE("did not receive a commandvalues: message as expected",
                                    !response.empty());
             std::vector<char> json(response.begin() + std::string("commandvalues:").length(),
                                    response.end());
             json.push_back(0);
             newHeight = getColRowSize("rows", json.data(), 1);
-            CPPUNIT_ASSERT(newHeight > oldHeight);
+            LOK_ASSERT(newHeight > oldHeight);
         }
     }
     catch (const Poco::Exception& exc)
     {
-        CPPUNIT_FAIL(exc.displayText());
+        LOK_ASSERT_FAIL(exc.displayText());
     }
     return TestResult::Ok;
 }
@@ -419,7 +419,7 @@ UnitBase::TestResult UnitCalc::testOptimalResize()
             helpers::sendTextFrame(socket, "uno .uno:SetOptimalColumnWidthDirect", testname);
             helpers::sendTextFrame(socket, commandValues, testname);
             optimalWidth = getColRowSize(socket, "columns", 0, testname);
-            CPPUNIT_ASSERT(optimalWidth < newWidth);
+            LOK_ASSERT(optimalWidth < newWidth);
         }
 
         // send optimal row height
@@ -446,12 +446,12 @@ UnitBase::TestResult UnitCalc::testOptimalResize()
 
             helpers::sendTextFrame(socket, commandValues, testname);
             optimalHeight = getColRowSize(socket, "rows", 0, testname);
-            CPPUNIT_ASSERT(optimalHeight < newHeight);
+            LOK_ASSERT(optimalHeight < newHeight);
         }
     }
     catch (const Poco::Exception& exc)
     {
-        CPPUNIT_FAIL(exc.displayText());
+        LOK_ASSERT_FAIL(exc.displayText());
     }
     return TestResult::Ok;
 }
diff --git a/test/UnitClose.cpp b/test/UnitClose.cpp
index 3da8b4e00..bfacf6b8e 100644
--- a/test/UnitClose.cpp
+++ b/test/UnitClose.cpp
@@ -15,7 +15,7 @@
 #include <Poco/Exception.h>
 #include <Poco/RegularExpression.h>
 #include <Poco/URI.h>
-#include <cppunit/TestAssert.h>
+#include <test/lokassert.hpp>
 
 #include <Png.hpp>
 #include <Unit.hpp>
@@ -34,7 +34,7 @@ std::string getFontList(const std::string& message)
     const Poco::Dynamic::Var result = parser.parse(message);
     const auto& command = result.extract<Poco::JSON::Object::Ptr>();
     std::string text = command->get("commandName").toString();
-    CPPUNIT_ASSERT_EQUAL(std::string(".uno:CharFontName"), text);
+    LOK_ASSERT_EQUAL(std::string(".uno:CharFontName"), text);
     text = command->get("commandValues").toString();
     return text;
 }
@@ -90,8 +90,8 @@ UnitBase::TestResult UnitClose::testCloseAfterClose()
             // no more messages is received.
             bytes = socket->receiveFrame(buffer, sizeof(buffer), flags);
             TST_LOG("Received " << bytes << " bytes, flags: " << std::hex << flags << std::dec);
-            CPPUNIT_ASSERT_EQUAL(0, bytes);
-            CPPUNIT_ASSERT_EQUAL(0, flags);
+            LOK_ASSERT_EQUAL(0, bytes);
+            LOK_ASSERT_EQUAL(0, flags);
         }
         catch (const Poco::Exception& exc)
         {
@@ -103,7 +103,7 @@ UnitBase::TestResult UnitClose::testCloseAfterClose()
     }
     catch (const Poco::Exception& exc)
     {
-        CPPUNIT_FAIL(exc.displayText());
+        LOK_ASSERT_FAIL(exc.displayText());
     }
     return TestResult::Ok;
 }
@@ -121,17 +121,17 @@ UnitBase::TestResult UnitClose::testFontList()
         helpers::sendTextFrame(socket, "commandvalues command=.uno:CharFontName", testname);
         const std::vector<char> response
             = helpers::getResponseMessage(socket, "commandvalues:", testname);
-        CPPUNIT_ASSERT_MESSAGE("did not receive a commandvalues: message as expected",
+        LOK_ASSERT_MESSAGE("did not receive a commandvalues: message as expected",
                                !response.empty());
 
         std::stringstream streamResponse;
         std::copy(response.begin() + std::string("commandvalues:").length() + 1, response.end(),
                   std::ostream_iterator<char>(streamResponse));
-        CPPUNIT_ASSERT(!getFontList(streamResponse.str()).empty());
+        LOK_ASSERT(!getFontList(streamResponse.str()).empty());
     }
     catch (const Poco::Exception& exc)
     {
-        CPPUNIT_FAIL(exc.displayText());
+        LOK_ASSERT_FAIL(exc.displayText());
     }
     return TestResult::Ok;
 }
@@ -162,12 +162,12 @@ UnitBase::TestResult UnitClose::testGraphicInvalidate()
             socket, "mouse type=buttonup x=1035 y=450 count=1 buttons=1 modifier=0", testname);
 
         const auto message = helpers::getResponseString(socket, "invalidatetiles:", testname);
-        CPPUNIT_ASSERT_MESSAGE("Drag & Drop graphic invalidate all tiles",
+        LOK_ASSERT_MESSAGE("Drag & Drop graphic invalidate all tiles",
                                message.find("EMPTY") == std::string::npos);
     }
     catch (const Poco::Exception& exc)
     {
-        CPPUNIT_FAIL(exc.displayText());
+        LOK_ASSERT_FAIL(exc.displayText());
     }
     return TestResult::Ok;
 }
@@ -197,15 +197,15 @@ UnitBase::TestResult UnitClose::testAlertAllUsers()
             StringVector tokens(LOOLProtocol::tokenize(response.substr(6), ' '));
             std::string cmd;
             LOOLProtocol::getTokenString(tokens, "cmd", cmd);
-            CPPUNIT_ASSERT_EQUAL(std::string("internal"), cmd);
+            LOK_ASSERT_EQUAL(std::string("internal"), cmd);
             std::string kind;
             LOOLProtocol::getTokenString(tokens, "kind", kind);
-            CPPUNIT_ASSERT_EQUAL(std::string("diskfull"), kind);
+            LOK_ASSERT_EQUAL(std::string("diskfull"), kind);
         }
     }
     catch (const Poco::Exception& exc)
     {
-        CPPUNIT_FAIL(exc.displayText());
+        LOK_ASSERT_FAIL(exc.displayText());
     }
     return TestResult::Ok;
 }
diff --git a/test/UnitCursor.cpp b/test/UnitCursor.cpp
index 1aac1b011..36a9512b2 100644
--- a/test/UnitCursor.cpp
+++ b/test/UnitCursor.cpp
@@ -15,7 +15,7 @@
 #include <Poco/Exception.h>
 #include <Poco/RegularExpression.h>
 #include <Poco/URI.h>
-#include <cppunit/TestAssert.h>
+#include <test/lokassert.hpp>
 
 #include <Unit.hpp>
 #include <helpers.hpp>
@@ -31,18 +31,18 @@ void getCursor(const std::string& message, int& cursorX, int& cursorY, int& curs
     const Poco::Dynamic::Var result = parser.parse(message);
     const auto& command = result.extract<Poco::JSON::Object::Ptr>();
     std::string text = command->get("commandName").toString();
-    CPPUNIT_ASSERT_EQUAL(std::string(".uno:CellCursor"), text);
+    LOK_ASSERT_EQUAL(std::string(".uno:CellCursor"), text);
     text = command->get("commandValues").toString();
-    CPPUNIT_ASSERT(!text.empty());
+    LOK_ASSERT(!text.empty());
     StringVector position(LOOLProtocol::tokenize(text, ','));
     cursorX = std::stoi(position[0]);
     cursorY = std::stoi(position[1]);
     cursorWidth = std::stoi(position[2]);
     cursorHeight = std::stoi(position[3]);
-    CPPUNIT_ASSERT(cursorX >= 0);
-    CPPUNIT_ASSERT(cursorY >= 0);
-    CPPUNIT_ASSERT(cursorWidth >= 0);
-    CPPUNIT_ASSERT(cursorHeight >= 0);
+    LOK_ASSERT(cursorX >= 0);
+    LOK_ASSERT(cursorY >= 0);
+    LOK_ASSERT(cursorWidth >= 0);
+    LOK_ASSERT(cursorHeight >= 0);
 }
 
 void limitCursor(const std::function<void(const std::shared_ptr<LOOLWebSocket>& socket, int cursorX,
@@ -99,8 +99,8 @@ void limitCursor(const std::function<void(const std::shared_ptr<LOOLWebSocket>&
     helpers::parseDocSize(response.substr(7), "spreadsheet", newSheet, newSheets, newWidth,
                           newHeight, docViewId);
 
-    CPPUNIT_ASSERT_EQUAL(docSheets, newSheets);
-    CPPUNIT_ASSERT_EQUAL(docSheet, newSheet);
+    LOK_ASSERT_EQUAL(docSheets, newSheets);
+    LOK_ASSERT_EQUAL(docSheet, newSheet);
 
     // check new document size
     checkhandler(docWidth, docHeight, newWidth, newHeight);
@@ -128,12 +128,12 @@ UnitBase::TestResult UnitCursor::testMaxColumn()
             // move cursor to last column
             [](const std::shared_ptr<LOOLWebSocket>& socket, int cursorX, int cursorY,
                int cursorWidth, int cursorHeight, int docWidth, int docHeight) {
-                CPPUNIT_ASSERT(cursorX >= 0);
-                CPPUNIT_ASSERT(cursorY >= 0);
-                CPPUNIT_ASSERT(cursorWidth >= 0);
-                CPPUNIT_ASSERT(cursorHeight >= 0);
-                CPPUNIT_ASSERT(docWidth >= 0);
-                CPPUNIT_ASSERT(docHeight >= 0);
+                LOK_ASSERT(cursorX >= 0);
+                LOK_ASSERT(cursorY >= 0);
+                LOK_ASSERT(cursorWidth >= 0);
+                LOK_ASSERT(cursorHeight >= 0);
+                LOK_ASSERT(docWidth >= 0);
+                LOK_ASSERT(docHeight >= 0);
 
                 const std::string text = "key type=input char=0 key=1027";
                 while (cursorX <= docWidth)
@@ -144,14 +144,14 @@ UnitBase::TestResult UnitCursor::testMaxColumn()
             },
             // check new document width
             [](int docWidth, int docHeight, int newWidth, int newHeight) {
-                CPPUNIT_ASSERT_EQUAL(docHeight, newHeight);
-                CPPUNIT_ASSERT(newWidth > docWidth);
+                LOK_ASSERT_EQUAL(docHeight, newHeight);
+                LOK_ASSERT(newWidth > docWidth);
             },
             "maxColumn");
     }
     catch (const Poco::Exception& exc)
     {
-        CPPUNIT_FAIL(exc.displayText());
+        LOK_ASSERT_FAIL(exc.displayText());
     }
     return TestResult::Ok;
 }
@@ -164,12 +164,12 @@ UnitBase::TestResult UnitCursor::testMaxRow()
             // move cursor to last row
             [](const std::shared_ptr<LOOLWebSocket>& socket, int cursorX, int cursorY,
                int cursorWidth, int cursorHeight, int docWidth, int docHeight) {
-                CPPUNIT_ASSERT(cursorX >= 0);
-                CPPUNIT_ASSERT(cursorY >= 0);
-                CPPUNIT_ASSERT(cursorWidth >= 0);
-                CPPUNIT_ASSERT(cursorHeight >= 0);
-                CPPUNIT_ASSERT(docWidth >= 0);
-                CPPUNIT_ASSERT(docHeight >= 0);
+                LOK_ASSERT(cursorX >= 0);
+                LOK_ASSERT(cursorY >= 0);
+                LOK_ASSERT(cursorWidth >= 0);
+                LOK_ASSERT(cursorHeight >= 0);
+                LOK_ASSERT(docWidth >= 0);
+                LOK_ASSERT(docHeight >= 0);
 
                 const std::string text = "key type=input char=0 key=1024";
                 while (cursorY <= docHeight)
@@ -180,14 +180,14 @@ UnitBase::TestResult UnitCursor::testMaxRow()
             },
             // check new document height
             [](int docWidth, int docHeight, int newWidth, int newHeight) {
-                CPPUNIT_ASSERT_EQUAL(docWidth, newWidth);
-                CPPUNIT_ASSERT(newHeight > docHeight);
+                LOK_ASSERT_EQUAL(docWidth, newWidth);
+                LOK_ASSERT(newHeight > docHeight);
             },
             "maxRow");
     }
     catch (const Poco::Exception& exc)
     {
-        CPPUNIT_FAIL(exc.displayText());
+        LOK_ASSERT_FAIL(exc.displayText());
     }
     return TestResult::Ok;
 }
@@ -214,12 +214,12 @@ UnitBase::TestResult UnitCursor::testInsertAnnotationWriter()
 
     // Read it back.
     std::string res = helpers::getAllText(socket, testname);
-    CPPUNIT_ASSERT_EQUAL(std::string("textselectioncontent: xxx yyy zzzz"), res);
+    LOK_ASSERT_EQUAL(std::string("textselectioncontent: xxx yyy zzzz"), res);
     // Can we edit the comment?
     helpers::sendTextFrame(socket, "paste mimetype=text/plain;charset=utf-8\naaa bbb ccc",
                            testname);
     res = helpers::getAllText(socket, testname);
-    CPPUNIT_ASSERT_EQUAL(std::string("textselectioncontent: aaa bbb ccc"), res);
+    LOK_ASSERT_EQUAL(std::string("textselectioncontent: aaa bbb ccc"), res);
 
     // Confirm that the text is in the comment and not doc body.
     // Click in the body.
@@ -229,7 +229,7 @@ UnitBase::TestResult UnitCursor::testInsertAnnotationWriter()
                            testname);
     // Read body text.
     res = helpers::getAllText(socket, testname);
-    CPPUNIT_ASSERT_EQUAL(std::string("textselectioncontent: Hello world"), res);
+    LOK_ASSERT_EQUAL(std::string("textselectioncontent: Hello world"), res);
 
     // Confirm that the comment is still intact.
     helpers::sendTextFrame(
@@ -237,7 +237,7 @@ UnitBase::TestResult UnitCursor::testInsertAnnotationWriter()
     helpers::sendTextFrame(
         socket, "mouse type=buttonup x=13855 y=1893 count=1 buttons=1 modifier=0", testname);
     res = helpers::getAllText(socket, testname);
-    CPPUNIT_ASSERT_EQUAL(std::string("textselectioncontent: aaa bbb ccc"), res);
+    LOK_ASSERT_EQUAL(std::string("textselectioncontent: aaa bbb ccc"), res);
 
     // Can we still edit the comment?
     helpers::sendTextFrame(
@@ -245,7 +245,7 @@ UnitBase::TestResult UnitCursor::testInsertAnnotationWriter()
         "paste mimetype=text/plain;charset=utf-8\nand now for something completely different",
         testname);
     res = helpers::getAllText(socket, testname);
-    CPPUNIT_ASSERT_EQUAL(
+    LOK_ASSERT_EQUAL(
         std::string("textselectioncontent: and now for something completely different"), res);
 
     // Close and reopen the same document and test again.
@@ -265,7 +265,7 @@ UnitBase::TestResult UnitCursor::testInsertAnnotationWriter()
                            testname);
     // Read body text.
     res = helpers::getAllText(socket, testname);
-    CPPUNIT_ASSERT_EQUAL(std::string("textselectioncontent: Hello world"), res);
+    LOK_ASSERT_EQUAL(std::string("textselectioncontent: Hello world"), res);
 
     // Confirm that the comment is still intact.
     helpers::sendTextFrame(
@@ -273,14 +273,14 @@ UnitBase::TestResult UnitCursor::testInsertAnnotationWriter()
     helpers::sendTextFrame(
         socket, "mouse type=buttonup x=13855 y=1893 count=1 buttons=1 modifier=0", testname);
     res = helpers::getAllText(socket, testname);
-    CPPUNIT_ASSERT_EQUAL(
+    LOK_ASSERT_EQUAL(
         std::string("textselectioncontent: and now for something completely different"), res);
 
     // Can we still edit the comment?
     helpers::sendTextFrame(socket, "paste mimetype=text/plain;charset=utf-8\nblah blah xyz",
                            testname);
     res = helpers::getAllText(socket, testname);
-    CPPUNIT_ASSERT_EQUAL(std::string("textselectioncontent: blah blah xyz"), res);
+    LOK_ASSERT_EQUAL(std::string("textselectioncontent: blah blah xyz"), res);
     return TestResult::Ok;
 }
 
@@ -302,7 +302,7 @@ UnitBase::TestResult UnitCursor::testEditAnnotationWriter()
                            testname);
     // Read body text.
     std::string res = helpers::getAllText(socket, testname);
-    CPPUNIT_ASSERT_EQUAL(std::string("textselectioncontent: Hello world"), res);
+    LOK_ASSERT_EQUAL(std::string("textselectioncontent: Hello world"), res);
 
     // Confirm that the comment is intact.
     helpers::sendTextFrame(
@@ -310,7 +310,7 @@ UnitBase::TestResult UnitCursor::testEditAnnotationWriter()
     helpers::sendTextFrame(
         socket, "mouse type=buttonup x=13855 y=1893 count=1 buttons=1 modifier=0", testname);
     res = helpers::getAllText(socket, testname);
-    CPPUNIT_ASSERT_EQUAL(std::string("textselectioncontent: blah blah xyz"), res);
+    LOK_ASSERT_EQUAL(std::string("textselectioncontent: blah blah xyz"), res);
 
     // Can we still edit the comment?
     helpers::sendTextFrame(
@@ -318,7 +318,7 @@ UnitBase::TestResult UnitCursor::testEditAnnotationWriter()
         "paste mimetype=text/plain;charset=utf-8\nand now for something completely different",
         testname);
     res = helpers::getAllText(socket, testname);
-    CPPUNIT_ASSERT_EQUAL(
+    LOK_ASSERT_EQUAL(
         std::string("textselectioncontent: and now for something completely different"), res);
 
     // const int kitcount = getLoolKitProcessCount();
@@ -341,7 +341,7 @@ UnitBase::TestResult UnitCursor::testEditAnnotationWriter()
                            testname);
     // Read body text.
     res = helpers::getAllText(socket, testname);
-    CPPUNIT_ASSERT_EQUAL(std::string("textselectioncontent: Hello world"), res);
+    LOK_ASSERT_EQUAL(std::string("textselectioncontent: Hello world"), res);
 
     // Confirm that the comment is still intact.
     helpers::sendTextFrame(
@@ -349,14 +349,14 @@ UnitBase::TestResult UnitCursor::testEditAnnotationWriter()
     helpers::sendTextFrame(
         socket, "mouse type=buttonup x=13855 y=1893 count=1 buttons=1 modifier=0", testname);
     res = helpers::getAllText(socket, testname);
-    CPPUNIT_ASSERT_EQUAL(
+    LOK_ASSERT_EQUAL(
         std::string("textselectioncontent: and now for something completely different"), res);
 
     // Can we still edit the comment?
     helpers::sendTextFrame(socket, "paste mimetype=text/plain;charset=utf-8\nnew text different",
                            testname);
     res = helpers::getAllText(socket, testname);
-    CPPUNIT_ASSERT_EQUAL(std::string("textselectioncontent: new text different"), res);
+    LOK_ASSERT_EQUAL(std::string("textselectioncontent: new text different"), res);
     return TestResult::Ok;
 }
 
@@ -376,7 +376,7 @@ UnitBase::TestResult UnitCursor::testInsertAnnotationCalc()
 
     // Read it back.
     std::string res = helpers::getAllText(socket, testname);
-    CPPUNIT_ASSERT_EQUAL(std::string("textselectioncontent: aaa bbb ccc"), res);
+    LOK_ASSERT_EQUAL(std::string("textselectioncontent: aaa bbb ccc"), res);
     return TestResult::Ok;
 }
 
diff --git a/test/UnitEachView.cpp b/test/UnitEachView.cpp
index 793407f30..5501f28f3 100644
--- a/test/UnitEachView.cpp
+++ b/test/UnitEachView.cpp
@@ -11,7 +11,7 @@
 #include <string>
 
 #include <Poco/URI.h>
-#include <cppunit/TestAssert.h>
+#include <test/lokassert.hpp>
 
 #include <Unit.hpp>
 #include <Util.hpp>
@@ -65,7 +65,7 @@ void testEachView(const std::string& doc, const std::string& type, const std::st
         // Double of the default.
         size_t timeoutMs = 20000;
         response = helpers::getResponseString(socket, protocol, Poco::format(view, itView), timeoutMs);
-        CPPUNIT_ASSERT_MESSAGE(Poco::format(error, itView, protocol), !response.empty());
+        LOK_ASSERT_MESSAGE(Poco::format(error, itView, protocol), !response.empty());
 
         // Connect and load 0..N Views, where N<=limit
         std::vector<std::shared_ptr<LOOLWebSocket>> views;
@@ -82,18 +82,18 @@ void testEachView(const std::string& doc, const std::string& type, const std::st
         for (const auto& socketView : views)
         {
             helpers::getResponseString(socket, protocolView, Poco::format(view, itView), timeoutMs);
-            CPPUNIT_ASSERT_MESSAGE(Poco::format(error, itView, protocolView), !response.empty());
+            LOK_ASSERT_MESSAGE(Poco::format(error, itView, protocolView), !response.empty());
             ++itView;
             (void)socketView;
         }
     }
     catch (const Poco::Exception& exc)
     {
-        CPPUNIT_FAIL(exc.displayText());
+        LOK_ASSERT_FAIL(exc.displayText());
     }
     catch (const std::exception& exc)
     {
-        CPPUNIT_FAIL(exc.what());
+        LOK_ASSERT_FAIL(exc.what());
     }
 }
 }
diff --git a/test/UnitHTTP.cpp b/test/UnitHTTP.cpp
index bbc2d516d..3fa10c6c0 100644
--- a/test/UnitHTTP.cpp
+++ b/test/UnitHTTP.cpp
@@ -94,7 +94,7 @@ public:
     {
         std::vector<char> buffer(str.size() + 64);
         const int got = socket->receiveBytes(buffer.data(), str.size());
-        CPPUNIT_ASSERT_EQUAL(str, std::string(buffer.data(), got));
+        LOK_ASSERT_EQUAL(str, std::string(buffer.data(), got));
 
         if (got != (int)str.size() ||
             strncmp(buffer.data(), str.c_str(), got))
@@ -173,7 +173,7 @@ public:
         static const std::string start =
             "HTTP/1.0 200 OK\r\n"
             "Content-Disposition: attachment; filename=\"test.txt\"\r\n";
-        CPPUNIT_ASSERT(Util::startsWith(std::string(buffer), start));
+        LOK_ASSERT(Util::startsWith(std::string(buffer), start));
 
         if (strncmp(buffer, start.c_str(), start.size()))
         {
@@ -185,7 +185,7 @@ public:
         // TODO: check content-length etc.
 
         const char *ptr = strstr(buffer, "\r\n\r\n");
-        CPPUNIT_ASSERT_MESSAGE("Missing separator, got " + std::string(buffer), ptr);
+        LOK_ASSERT_MESSAGE("Missing separator, got " + std::string(buffer), ptr);
         if (!ptr)
         {
             std::cerr << "missing separator " << got << " '" << buffer << "\n";
@@ -201,7 +201,7 @@ public:
 
         // Oddly we need another read to get the content.
         got = socket->receiveBytes(buffer, 4096);
-        CPPUNIT_ASSERT_MESSAGE("No content returned.", got >= 0);
+        LOK_ASSERT_MESSAGE("No content returned.", got >= 0);
         if (got >=0 )
             buffer[got] = '\0';
         else
diff --git a/test/UnitHosting.cpp b/test/UnitHosting.cpp
index 9c3825727..18af0319a 100644
--- a/test/UnitHosting.cpp
+++ b/test/UnitHosting.cpp
@@ -19,7 +19,7 @@
 #include <Poco/Exception.h>
 #include <Poco/RegularExpression.h>
 #include <Poco/URI.h>
-#include <cppunit/TestAssert.h>
+#include <test/lokassert.hpp>
 
 #include <Png.hpp>
 #include <Unit.hpp>
@@ -50,16 +50,16 @@ UnitBase::TestResult UnitHosting::testDiscovery()
 
     Poco::Net::HTTPResponse response;
     session->receiveResponse(response);
-    CPPUNIT_ASSERT_EQUAL(Poco::Net::HTTPResponse::HTTP_OK, response.getStatus());
-    CPPUNIT_ASSERT_EQUAL(std::string("text/xml"), response.getContentType());
+    LOK_ASSERT_EQUAL(Poco::Net::HTTPResponse::HTTP_OK, response.getStatus());
+    LOK_ASSERT_EQUAL(std::string("text/xml"), response.getContentType());
 
     Poco::Net::HTTPRequest request2(Poco::Net::HTTPRequest::HTTP_GET, "/hosting/discovery/");
     session->sendRequest(request2);
 
     Poco::Net::HTTPResponse response2;
     session->receiveResponse(response2);
-    CPPUNIT_ASSERT_EQUAL(Poco::Net::HTTPResponse::HTTP_OK, response2.getStatus());
-    CPPUNIT_ASSERT_EQUAL(std::string("text/xml"), response2.getContentType());
+    LOK_ASSERT_EQUAL(Poco::Net::HTTPResponse::HTTP_OK, response2.getStatus());
+    LOK_ASSERT_EQUAL(std::string("text/xml"), response2.getContentType());
     return TestResult::Ok;
 }
 
@@ -76,8 +76,8 @@ UnitBase::TestResult UnitHosting::testCapabilities()
 
         Poco::Net::HTTPResponse response;
         std::istream& rs = session->receiveResponse(response);
-        CPPUNIT_ASSERT_EQUAL(Poco::Net::HTTPResponse::HTTP_OK, response.getStatus());
-        CPPUNIT_ASSERT_EQUAL(std::string("text/xml"), response.getContentType());
+        LOK_ASSERT_EQUAL(Poco::Net::HTTPResponse::HTTP_OK, response.getStatus());
+        LOK_ASSERT_EQUAL(std::string("text/xml"), response.getContentType());
 
         std::string discoveryXML;
         Poco::StreamCopier::copyToString(rs, discoveryXML);
@@ -100,8 +100,8 @@ UnitBase::TestResult UnitHosting::testCapabilities()
             }
         }
 
-        CPPUNIT_ASSERT(foundCapabilities);
-        CPPUNIT_ASSERT_EQUAL(uri.toString() + CAPABILITIES_END_POINT, capabilitiesURI);
+        LOK_ASSERT(foundCapabilities);
+        LOK_ASSERT_EQUAL(uri.toString() + CAPABILITIES_END_POINT, capabilitiesURI);
     }
 
     // Then get the capabilities json
@@ -111,8 +111,8 @@ UnitBase::TestResult UnitHosting::testCapabilities()
 
         Poco::Net::HTTPResponse response;
         std::istream& rs = session->receiveResponse(response);
-        CPPUNIT_ASSERT_EQUAL(Poco::Net::HTTPResponse::HTTP_OK, response.getStatus());
-        CPPUNIT_ASSERT_EQUAL(std::string("application/json"), response.getContentType());
+        LOK_ASSERT_EQUAL(Poco::Net::HTTPResponse::HTTP_OK, response.getStatus());
+        LOK_ASSERT_EQUAL(std::string("application/json"), response.getContentType());
 
         std::ostringstream oss;
         Poco::StreamCopier::copyStream(rs, oss);
@@ -121,13 +121,13 @@ UnitBase::TestResult UnitHosting::testCapabilities()
         Poco::JSON::Parser parser;
         Poco::Dynamic::Var jsonFile = parser.parse(responseString);
         Poco::JSON::Object::Ptr features = jsonFile.extract<Poco::JSON::Object::Ptr>();
-        CPPUNIT_ASSERT(features);
-        CPPUNIT_ASSERT(features->has("convert-to"));
+        LOK_ASSERT(features);
+        LOK_ASSERT(features->has("convert-to"));
 
         Poco::JSON::Object::Ptr convert_to
             = features->get("convert-to").extract<Poco::JSON::Object::Ptr>();
-        CPPUNIT_ASSERT(convert_to->has("available"));
-        CPPUNIT_ASSERT(convert_to->get("available"));
+        LOK_ASSERT(convert_to->has("available"));
+        LOK_ASSERT(convert_to->get("available"));
     }
     return TestResult::Ok;
 }
diff --git a/test/UnitInsertDelete.cpp b/test/UnitInsertDelete.cpp
index 4c2606eea..e5b3bc6d8 100644
--- a/test/UnitInsertDelete.cpp
+++ b/test/UnitInsertDelete.cpp
@@ -15,7 +15,7 @@
 #include <Poco/Exception.h>
 #include <Poco/RegularExpression.h>
 #include <Poco/URI.h>
-#include <cppunit/TestAssert.h>
+#include <test/lokassert.hpp>
 
 #include <Png.hpp>
 #include <Unit.hpp>
@@ -39,11 +39,11 @@ void getPartHashCodes(const std::string& testname, const std::string& response,
 #if defined CPPUNIT_ASSERT_GREATEREQUAL
     CPPUNIT_ASSERT_GREATEREQUAL(static_cast<size_t>(7), tokens.size());
 #else
-    CPPUNIT_ASSERT_MESSAGE("Expected at least 7 tokens.", static_cast<size_t>(7) <= tokens.size());
+    LOK_ASSERT_MESSAGE("Expected at least 7 tokens.", static_cast<size_t>(7) <= tokens.size());
 #endif
 
     const std::string type = tokens[0].substr(std::string("type=").size());
-    CPPUNIT_ASSERT_MESSAGE("Expected presentation or spreadsheet type to read part names/codes.",
+    LOK_ASSERT_MESSAGE("Expected presentation or spreadsheet type to read part names/codes.",
                            type == "presentation" || type == "spreadsheet");
 
     const int totalParts = std::stoi(tokens[1].substr(std::string("parts=").size()));
@@ -57,7 +57,7 @@ void getPartHashCodes(const std::string& testname, const std::string& response,
     parts.clear();
     while (endLine.match(response, offset, matches) > 0)
     {
-        CPPUNIT_ASSERT_EQUAL(1, (int)matches.size());
+        LOK_ASSERT_EQUAL(1, (int)matches.size());
         const std::string str = response.substr(matches[0].offset, matches[0].length);
         if (number.match(str, 0))
         {
@@ -70,7 +70,7 @@ void getPartHashCodes(const std::string& testname, const std::string& response,
     TST_LOG("Found " << parts.size() << " part names/codes.");
 
     // Validate that Core is internally consistent when emitting status messages.
-    CPPUNIT_ASSERT_EQUAL(totalParts, (int)parts.size());
+    LOK_ASSERT_EQUAL(totalParts, (int)parts.size());
 }
 }
 
@@ -105,16 +105,16 @@ UnitBase::TestResult UnitInsertDelete::testInsertDelete()
             = helpers::connectLOKit(uri, request, httpResponse, testname);
 
         helpers::sendTextFrame(socket, "load url=" + documentURL);
-        CPPUNIT_ASSERT_MESSAGE("cannot load the document " + documentURL,
+        LOK_ASSERT_MESSAGE("cannot load the document " + documentURL,
                                helpers::isDocumentLoaded(socket, testname));
 
         // check total slides 1
         TST_LOG("Expecting 1 slide.");
         helpers::sendTextFrame(socket, "status");
         response = helpers::getResponseString(socket, "status:", testname);
-        CPPUNIT_ASSERT_MESSAGE("did not receive a status: message as expected", !response.empty());
+        LOK_ASSERT_MESSAGE("did not receive a status: message as expected", !response.empty());
         getPartHashCodes(testname, response.substr(7), parts);
-        CPPUNIT_ASSERT_EQUAL(1, (int)parts.size());
+        LOK_ASSERT_EQUAL(1, (int)parts.size());
 
         const std::string slide1Hash = parts[0];
 
@@ -124,13 +124,13 @@ UnitBase::TestResult UnitInsertDelete::testInsertDelete()
         {
             helpers::sendTextFrame(socket, "uno .uno:InsertPage");
             response = helpers::getResponseString(socket, "status:", testname);
-            CPPUNIT_ASSERT_MESSAGE("did not receive a status: message as expected",
+            LOK_ASSERT_MESSAGE("did not receive a status: message as expected",
                                    !response.empty());
             getPartHashCodes(testname, response.substr(7), parts);
-            CPPUNIT_ASSERT_EQUAL(it + 1, parts.size());
+            LOK_ASSERT_EQUAL(it + 1, parts.size());
         }
 
-        CPPUNIT_ASSERT_MESSAGE("Hash code of slide #1 changed after inserting extra slides.",
+        LOK_ASSERT_MESSAGE("Hash code of slide #1 changed after inserting extra slides.",
                                parts[0] == slide1Hash);
         const std::vector<std::string> parts_after_insert(parts.begin(), parts.end());
 
@@ -142,13 +142,13 @@ UnitBase::TestResult UnitInsertDelete::testInsertDelete()
             helpers::sendTextFrame(socket, "setclientpart part=" + std::to_string(it));
             helpers::sendTextFrame(socket, "uno .uno:DeletePage");
             response = helpers::getResponseString(socket, "status:", testname);
-            CPPUNIT_ASSERT_MESSAGE("did not receive a status: message as expected",
+            LOK_ASSERT_MESSAGE("did not receive a status: message as expected",
                                    !response.empty());
             getPartHashCodes(testname, response.substr(7), parts);
-            CPPUNIT_ASSERT_EQUAL(11 - it, parts.size());
+            LOK_ASSERT_EQUAL(11 - it, parts.size());
         }
 
-        CPPUNIT_ASSERT_MESSAGE("Hash code of slide #1 changed after deleting extra slides.",
+        LOK_ASSERT_MESSAGE("Hash code of slide #1 changed after deleting extra slides.",
                                parts[0] == slide1Hash);
 
         // undo delete slides
@@ -157,16 +157,16 @@ UnitBase::TestResult UnitInsertDelete::testInsertDelete()
         {
             helpers::sendTextFrame(socket, "uno .uno:Undo");
             response = helpers::getResponseString(socket, "status:", testname);
-            CPPUNIT_ASSERT_MESSAGE("did not receive a status: message as expected",
+            LOK_ASSERT_MESSAGE("did not receive a status: message as expected",
                                    !response.empty());
             getPartHashCodes(testname, response.substr(7), parts);
-            CPPUNIT_ASSERT_EQUAL(it + 1, parts.size());
+            LOK_ASSERT_EQUAL(it + 1, parts.size());
         }
 
-        CPPUNIT_ASSERT_MESSAGE("Hash code of slide #1 changed after undoing slide delete.",
+        LOK_ASSERT_MESSAGE("Hash code of slide #1 changed after undoing slide delete.",
                                parts[0] == slide1Hash);
         const std::vector<std::string> parts_after_undo(parts.begin(), parts.end());
-        CPPUNIT_ASSERT_MESSAGE("Hash codes changed between deleting and undo.",
+        LOK_ASSERT_MESSAGE("Hash codes changed between deleting and undo.",
                                parts_after_insert == parts_after_undo);
 
         // redo inserted slides
@@ -175,26 +175,26 @@ UnitBase::TestResult UnitInsertDelete::testInsertDelete()
         {
             helpers::sendTextFrame(socket, "uno .uno:Redo");
             response = helpers::getResponseString(socket, "status:", testname);
-            CPPUNIT_ASSERT_MESSAGE("did not receive a status: message as expected",
+            LOK_ASSERT_MESSAGE("did not receive a status: message as expected",
                                    !response.empty());
             getPartHashCodes(testname, response.substr(7), parts);
-            CPPUNIT_ASSERT_EQUAL(11 - it, parts.size());
+            LOK_ASSERT_EQUAL(11 - it, parts.size());
         }
 
-        CPPUNIT_ASSERT_MESSAGE("Hash code of slide #1 changed after redoing slide delete.",
+        LOK_ASSERT_MESSAGE("Hash code of slide #1 changed after redoing slide delete.",
                                parts[0] == slide1Hash);
 
         // check total slides 1
         TST_LOG("Expecting 1 slide.");
         helpers::sendTextFrame(socket, "status");
         response = helpers::getResponseString(socket, "status:", testname);
-        CPPUNIT_ASSERT_MESSAGE("did not receive a status: message as expected", !response.empty());
+        LOK_ASSERT_MESSAGE("did not receive a status: message as expected", !response.empty());
         getPartHashCodes(testname, response.substr(7), parts);
-        CPPUNIT_ASSERT_EQUAL(1, (int)parts.size());
+        LOK_ASSERT_EQUAL(1, (int)parts.size());
     }
     catch (const Poco::Exception& exc)
     {
-        CPPUNIT_FAIL(exc.displayText());
+        LOK_ASSERT_FAIL(exc.displayText());
     }
     return TestResult::Ok;
 }
@@ -216,11 +216,11 @@ UnitBase::TestResult UnitInsertDelete::testPasteBlank()
 
         // Check if the document contains the pasted text.
         const std::string selection = helpers::getAllText(socket, testname);
-        CPPUNIT_ASSERT_EQUAL(std::string("textselectioncontent: "), selection);
+        LOK_ASSERT_EQUAL(std::string("textselectioncontent: "), selection);
     }
     catch (const Poco::Exception& exc)
     {
-        CPPUNIT_FAIL(exc.displayText());
+        LOK_ASSERT_FAIL(exc.displayText());
     }
     return TestResult::Ok;
 }
@@ -241,11 +241,11 @@ UnitBase::TestResult UnitInsertDelete::testGetTextSelection()
 
         static const std::string expected = "Hello world";
         const std::string selection = helpers::getAllText(socket, testname, expected);
-        CPPUNIT_ASSERT_EQUAL("textselectioncontent: " + expected, selection);
+        LOK_ASSERT_EQUAL("textselectioncontent: " + expected, selection);
     }
     catch (const Poco::Exception& exc)
     {
-        CPPUNIT_FAIL(exc.displayText());
+        LOK_ASSERT_FAIL(exc.displayText());
     }
     return TestResult::Ok;
 }
@@ -272,11 +272,11 @@ UnitBase::TestResult UnitInsertDelete::testCursorPosition()
         Poco::JSON::Parser parser0;
         const Poco::Dynamic::Var result0 = parser0.parse(response.substr(17));
         const auto& command0 = result0.extract<Poco::JSON::Object::Ptr>();
-        CPPUNIT_ASSERT_MESSAGE("missing property rectangle", command0->has("rectangle"));
+        LOK_ASSERT_MESSAGE("missing property rectangle", command0->has("rectangle"));
 
         StringVector cursorTokens(
             LOOLProtocol::tokenize(command0->get("rectangle").toString(), ','));
-        CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(4), cursorTokens.size());
+        LOK_ASSERT_EQUAL(static_cast<size_t>(4), cursorTokens.size());
 
         // Create second view
         std::shared_ptr<LOOLWebSocket> socket1
@@ -288,21 +288,21 @@ UnitBase::TestResult UnitInsertDelete::testCursorPosition()
         Poco::JSON::Parser parser;
         const Poco::Dynamic::Var result = parser.parse(response.substr(21));
         const auto& command = result.extract<Poco::JSON::Object::Ptr>();
-        CPPUNIT_ASSERT_MESSAGE("missing property rectangle", command->has("rectangle"));
+        LOK_ASSERT_MESSAGE("missing property rectangle", command->has("rectangle"));
 
         StringVector viewTokens(
             LOOLProtocol::tokenize(command->get("rectangle").toString(), ','));
-        CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(4), viewTokens.size());
+        LOK_ASSERT_EQUAL(static_cast<size_t>(4), viewTokens.size());
 
         // check both cursor should be equal
-        CPPUNIT_ASSERT_EQUAL(cursorTokens[0], viewTokens[0]);
-        CPPUNIT_ASSERT_EQUAL(cursorTokens[1], viewTokens[1]);
-        CPPUNIT_ASSERT_EQUAL(cursorTokens[2], viewTokens[2]);
-        CPPUNIT_ASSERT_EQUAL(cursorTokens[3], viewTokens[3]);
+        LOK_ASSERT_EQUAL(cursorTokens[0], viewTokens[0]);
+        LOK_ASSERT_EQUAL(cursorTokens[1], viewTokens[1]);
+        LOK_ASSERT_EQUAL(cursorTokens[2], viewTokens[2]);
+        LOK_ASSERT_EQUAL(cursorTokens[3], viewTokens[3]);
     }
     catch (const Poco::Exception& exc)
     {
-        CPPUNIT_FAIL(exc.displayText());
+        LOK_ASSERT_FAIL(exc.displayText());
     }
     return TestResult::Ok;
 }
diff --git a/test/UnitLargePaste.cpp b/test/UnitLargePaste.cpp
index a0251a99e..f39755022 100644
--- a/test/UnitLargePaste.cpp
+++ b/test/UnitLargePaste.cpp
@@ -11,7 +11,7 @@
 #include <string>
 
 #include <Poco/URI.h>
-#include <cppunit/TestAssert.h>
+#include <test/lokassert.hpp>
 
 #include <Unit.hpp>
 #include <Util.hpp>
@@ -60,8 +60,8 @@ void UnitLargePaste::invokeTest()
     helpers::sendTextFrame(socket, "uno .uno:SelectAll", testname);
     helpers::sendTextFrame(socket, "gettextselection mimetype=text/plain;charset=utf-8", testname);
     const auto selection = helpers::assertResponseString(socket, "textselectioncontent:", testname);
-    CPPUNIT_ASSERT_EQUAL_MESSAGE("Pasted text was either corrupted or couldn't be read back",
-                                 "textselectioncontent: " + documentContents, selection);
+    LOK_ASSERT_EQUAL_MESSAGE("Pasted text was either corrupted or couldn't be read back",
+                             "textselectioncontent: " + documentContents, selection);
 
     exitTest(TestResult::Ok);
 }
diff --git a/test/UnitLoad.cpp b/test/UnitLoad.cpp
index e05b47f06..175697487 100644
--- a/test/UnitLoad.cpp
+++ b/test/UnitLoad.cpp
@@ -15,7 +15,7 @@
 #include <Poco/Exception.h>
 #include <Poco/RegularExpression.h>
 #include <Poco/URI.h>
-#include <cppunit/TestAssert.h>
+#include <test/lokassert.hpp>
 
 #include <Unit.hpp>
 #include <helpers.hpp>
@@ -41,7 +41,7 @@ void loadDoc(const std::string& documentURL, const std::string& testname)
     }
     catch (const Poco::Exception& exc)
     {
-        CPPUNIT_FAIL(exc.displayText());
+        LOK_ASSERT_FAIL(exc.displayText());
     }
 }
 }
@@ -75,7 +75,7 @@ UnitBase::TestResult UnitLoad::testConnectNoLoad()
     Poco::URI uri(helpers::getTestServerURI());
     std::shared_ptr<LOOLWebSocket> socket
         = helpers::connectLOKit(uri, request, response, testname1);
-    CPPUNIT_ASSERT_MESSAGE("Failed to connect.", socket);
+    LOK_ASSERT_MESSAGE("Failed to connect.", socket);
     TST_LOG_NAME(testname1, "Disconnecting first.");
     socket.reset();
 
@@ -85,16 +85,16 @@ UnitBase::TestResult UnitLoad::testConnectNoLoad()
     TST_LOG_NAME(testname2, "Connecting second to load first view.");
     std::shared_ptr<LOOLWebSocket> socket1
         = helpers::connectLOKit(uri, request, response, testname2);
-    CPPUNIT_ASSERT_MESSAGE("Failed to connect.", socket1);
+    LOK_ASSERT_MESSAGE("Failed to connect.", socket1);
     helpers::sendTextFrame(socket1, "load url=" + documentURL, testname2);
-    CPPUNIT_ASSERT_MESSAGE("cannot load the document " + documentURL,
+    LOK_ASSERT_MESSAGE("cannot load the document " + documentURL,
                            helpers::isDocumentLoaded(socket1, testname2));
 
     // Connect but don't load second view.
     TST_LOG_NAME(testname3, "Connecting third to disconnect without loading.");
     std::shared_ptr<LOOLWebSocket> socket2
         = helpers::connectLOKit(uri, request, response, testname3);
-    CPPUNIT_ASSERT_MESSAGE("Failed to connect.", socket2);
+    LOK_ASSERT_MESSAGE("Failed to connect.", socket2);
     TST_LOG_NAME(testname3, "Disconnecting third.");
     socket2.reset();
 
@@ -136,11 +136,11 @@ UnitBase::TestResult UnitLoad::testBadLoad()
         helpers::sendTextFrame(socket, "status");
 

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list