Commit graph

10 commits

Author SHA1 Message Date
Ashod Nakashian
224ef08c7f wsd: single-char string literals -> char
More readable and typically more efficient.

Change-Id: I9bd5bfc91f4ac255bb8ae0987708fb8b56b398f8
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95285
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
2020-06-02 01:31:26 +02:00
Ashod Nakashian
82560d9657 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>
2020-03-14 15:45:00 +01:00
Ashod Nakashian
45a7dccbf8 wsd: test: don't leak the test listener
Change-Id: Ibc658ff68696f865071a4ef0c78e1886d8bf0d2c
Reviewed-on: https://gerrit.libreoffice.org/79353
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2019-09-22 20:25:28 +02:00
Miklos Vajna
003c98ff93 fakesockettest: respect CPPUNIT_TEST_NAME
This was running unconditionally.

Change-Id: I3de4241230d0f06f7836756e2d9b7fdf84d3477f
2019-08-02 09:57:20 +02:00
Jan Holesovsky
f76b36193d android: #if(n)def MOBILEAPP -> #if (!)MOBILEAPP for better reliability.
Change-Id: I5f9c9420b6c83601db1c8fdba4ae5a10b17b2107
2019-02-12 12:20:11 +01:00
Tor Lillqvist
f8a0fb4c32 WaE: -Werror=unused-parameter
Change-Id: Icadfcb19ce1fff2b5009d42acf33297cda6e36f2
2018-11-01 21:34:16 +02:00
Tor Lillqvist
60ee631a9e More FakeSocket tests
Actually, I should expand on this and write a test that makes sure the
FakeSocket API semantics does in fact match that of the real socket
API... A fakefakesockettest. Later.

Change-Id: I5cf885a956d6d795976a4369448be04e88837c19
2018-11-01 16:52:06 +02:00
Tor Lillqvist
781162fddd Fix my misunderstanding of Cppunit exception use
I had no idea that the CPPUNIT_ASSERT* macros work by throwing
exceptions. They do, so one should thus not catch them, but let the
Cppunit code take care of that.

Also, make the tests a bit more specific and add some
fakeSocketAvailableDataLength() checks.

Change-Id: I9291822114331c21b774bb41116e8b2ff709dae2
2018-11-01 12:53:47 +02:00
Tor Lillqvist
856965db9f Return correct exit value, 0 for success, 1 for failure
Change-Id: Ie3454cac318ce6a0e8c2c59ae9d3ae3c6658c0b8
2018-11-01 12:12:26 +02:00
Tor Lillqvist
02d3ac47ee Add a Cppunit test for the FakeSocket API
Based on Mobile/TestFakeSocket/TestFakeSocket/main.mm. Needs work,
does not really test the interesting semantic corner cases that have
been fixed only recently.

Change-Id: Ie2f3dbd2b478ab3acb4bfef0e0d3031c817d0f37
2018-11-01 11:51:34 +02:00