summaryrefslogtreecommitdiff
path: root/test/UnitPaste.cpp
diff options
context:
space:
mode:
authorAshod Nakashian <ashod.nakashian@collabora.co.uk>2020-01-20 11:45:53 -0500
committerMichael Meeks <michael.meeks@collabora.com>2020-03-14 15:45:00 +0100
commit82560d9657234f4c5358695de4804a5e5a0f1032 (patch)
tree4a5fa5ab50b97a9c09ba3973633175337fe2e3da /test/UnitPaste.cpp
parent1339b36575b28468ab5ef293a381c5f91eb15b76 (diff)
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@gmail.com> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'test/UnitPaste.cpp')
-rw-r--r--test/UnitPaste.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/UnitPaste.cpp b/test/UnitPaste.cpp
index 4bf89361f..db71dd839 100644
--- a/test/UnitPaste.cpp
+++ b/test/UnitPaste.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>
@@ -54,7 +54,7 @@ void UnitPaste::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(expected, selection);
+ LOK_ASSERT_EQUAL(expected, selection);
}
exitTest(TestResult::Ok);