Commit graph

15 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
Andras Timar
33000dfded typo fixes in comments and code
Change-Id: I6f31e050aab701e31064e1abc9429dce0a50c279
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92953
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Andras Timar <andras.timar@collabora.com>
2020-04-26 23:19:52 +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
Tamás Zolnai
2e3d00130f test: fix random failure of unit-http test.
Sometimes the text content comes with the first recieve,
sometimes we need a second recieve to get that.
Don't fail when we get the content for the first recieve.

Change-Id: I3078995cae3c0cfefdd5f2b8eae8bad4003ec2fd
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89347
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
2020-02-24 15:52:27 +01:00
Miklos Vajna
24c914dda1 test: fix unit-http
There were two problems here:

- there are much more headers than the one stated in "start", and as the
name implies, that's only the start of the headers, so assert it's a
matching prefix instead of full match

- the second case got the condition wrong, assert states what is the
assumption, does not check for an error state

With these, this test passes again.

Change-Id: I39f644849fc4808d73d1f95e2cda57d9465aacbf
2019-11-26 10:51:01 +01:00
Ashod Nakashian
717d3132b2 test: improve unit-tests
Change-Id: I2fd499886616809975d769632b183354d7feb32f
Reviewed-on: https://gerrit.libreoffice.org/83046
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2019-11-25 17:05:49 +01:00
Miklos Vajna
2ce1a7f61c test: clean up not needed memset()
Use std::vector instead of a C array, where the elements are initialized
with zero values by default.

Change-Id: I3c69b588e2a2c3deba052eae35da87a3d085491e
2019-11-25 08:28:12 +01:00
Jan Holesovsky
3496b07e7e Cosmetic change in a memset invocation.
For an array, memset(array, ...) and memset(&array, ...) do the same
thing - but given that there has to be the sizeof(array), the former
is probably more readable / obvious here.

Change-Id: I7e329cb1dcabb564e26857b0c7d9f88431bb4ede
Reviewed-on: https://gerrit.libreoffice.org/82601
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Miklos Vajna <vmiklos@collabora.com>
2019-11-13 15:12:50 +01:00
Andras Timar
d1ae1b36c2 typo fixes in comments and code
Change-Id: Idd98516d30d98dea18eda9bbec8ac9777063b553
2019-10-08 11:49:45 +02:00
Andras Timar
f4dbe43c3e keep the project buildable with poco 1.7.8
Change-Id: I87957a0b928f92f02ce72b7e6a2a575f2e5bad8d
Reviewed-on: https://gerrit.libreoffice.org/75231
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
2019-07-08 21:05:46 +02:00
Miklos Vajna
79133e7af1 test: avoid unnecessary copy in expectString()
Change-Id: Ic4d45b383d32e993cada3437f8af8599506a9692
2019-06-13 08:44:05 +02:00
Miklos Vajna
4c5f3d7826 test: avoid not needed copy
Change-Id: I45561d5d3772650139ab9cc3151abb8ddd7c248c
2019-06-06 09:46:53 +02:00
Miklos Vajna
66fff0e8a9 test: avoid variable-sized object initialization
UnitHTTP.cpp:94:21: error: variable-sized object may not be initialized
        char buffer[str.size() + 64] = { 0, };
                    ^~~~~~~~~~~~~~~

Change-Id: I2e6c8b4ca123ac5bf6391aa460069d24066f728d
2019-05-22 15:23:59 +02:00
Michael Meeks
05ca302c2b tests for chunked transfer encoding parser.
Change-Id: Ic55669ab7cc55bb44e8f7a00f30231b44f10535a
2019-05-22 11:07:42 +01:00
Michael Meeks
4f804a48fe Initial HTTP Expect: 100-continue implementation.
Change-Id: Ic9aa59cac5103151d91f6eb59d12313e545c7916
2019-05-22 02:56:11 +01:00