Commit graph

19 commits

Author SHA1 Message Date
Andras Timar
f07ff8c7e0 rename: remaining lool->cool changes
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: Ib7d4e804bebe52dead8d53b0e0bbaed0f08bf3d0
2021-11-18 14:14:11 +01:00
Ashod Nakashian
15b6ddccd0 wsd: test: move inherited filterSendMessage to onFilterSendMessage
This allows the UnitBase class to handle the messages
and dispatch to convenient handlers. This simplifies
the implementation of unit-tests and makes the
parsing more centralized than it is now.

Change-Id: Ice8f169ecfd12d49ee7cbd4fb9021a163b14f4ba
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-01-13 08:07:06 -05:00
Ashod Nakashian
96c9e03b88 wsd: test: catch and fail WSD tests when exceptions are thrown
Change-Id: Ifaabb6387d86c5a80e00cd5de34093520a1e9d66
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2020-12-28 12:04:53 -04:00
Ashod Nakashian
3b4add03ef wsd: test: store the current test name in UnitBase
Change-Id: Iaf521f6a99dcd6e6465769aed7f3757332e04f7d
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2020-12-28 12:04:53 -04:00
Ashod Nakashian
cb4beaca34 wsd: avoid the using keyword and use C++ size_t
size_t in C and in C++ are not necessarily the same
type. The C++ size_t is in the std namespace. Since
we do include many C headers, and indeed some C++
runtime headers do define size_t for backwards
compatibility, it's easy to mix and match the two
types.

Also, 'using std::size_t;' isn't a great practice,
so removed.

This is not exhaustive, just some low-hanging cases.

Change-Id: I85a36b6fd1acd204274b1869de9bcb94c8b3cf13
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2020-11-15 15:41:41 -05:00
Andras Timar
0002fdfd6c fix license headers
Change-Id: I8623770b32d278a45357dc7f757fabfadd2b4af7
2020-10-01 11:56:43 +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
19a7f1d288 test: better fix for UnitWOPISaveAs test
Don't check the full URL, but just test some parts of it.

Change-Id: I5367bf4f41dc26f311e03de7ce06349f744d0b85
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/90428
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
2020-03-12 17:47:35 +01:00
Ashod Nakashian
d8a9e11ad9 wsd: fix UnitWOPISaveAs test
Change-Id: I63da82da727e2902fdb35ff31b29df8c77976793
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/90355
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
2020-03-12 13:19:38 +01:00
Eduard Ardeleanu
d87146d3fa fix: saveAs breaks when '%' character is used within the filename
Change-Id: I2df059abd67be88acae8bd44ae2c74be7778a595
Reviewed-on: https://gerrit.libreoffice.org/69424
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2019-03-19 18:31:15 +01:00
Miklos Vajna
b773f11bdb WopiTestServer: make members private
Change-Id: If042fab5b69faf7c7dff975a95810cb96d8f02b0
2018-12-13 08:49:09 +01:00
Ashod Nakashian
0bf78a3ce7 wsd: fix saveas test
It didn't expect the trailing xfilename which
is used for anonymization.

Change-Id: I169253c567583f43ce870bbf5dfcebee9c94cd1d
2018-10-17 19:29:08 -04:00
Pranav Kant
f63858433b loplugin:includeform
Change-Id: Ib62a7aa61062f00698aa3e8a144438de5c57e53d
2017-12-20 21:21:05 +05:30
Jan Holesovsky
b20faa8bdc Save As: Advertise the correct size when uploading the new file.
Change-Id: I9b20c4bdb7ddc848437edceae1a77ddb49d55133
Reviewed-on: https://gerrit.libreoffice.org/44357
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
2017-11-10 11:08:53 +01:00
Jan Holesovsky
d3bf2638ea SaveAs: Fix unit test when used without ssl.
Change-Id: Ic48908c9e7449fc13458d9211fa743310834bd6b
2017-10-26 13:21:18 +03:00
Jan Holesovsky
343c5bc690 tdf#99744 SaveAs: Extend test to check that the Save As result was sent.
Change-Id: I3788b87d2599c01000af97f496ee2b840c0cae3e
2017-10-26 11:11:38 +02:00
Jan Holesovsky
6745464c70 tdf#99744 SaveAs: Report back to loleaflet that the saveas succeeded.
Change-Id: I670c8b4503c1a4c0a88001a1343f6dec2974e044
2017-10-26 11:11:38 +02:00
Jan Holesovsky
6fe4484395 tdf#99744 SaveAs: Use X-WOPI-SuggestedTarget instead of X-WOPI-RelativeTarget.
And the correct encoding - UTF-7 (huh).

Change-Id: I6634fedb598c620128cc25a3e8fdc46e4096a756
2017-10-26 11:11:38 +02:00
Jan Holesovsky
7ff432a370 tdf#99744 SaveAs: Reimplementation of the PutRelativeFile going through Kit.
This is necessary so that changing of the file type works.

Includes a unit test.

Change-Id: Id01d44e555b6bac1002ff950de461fd330602f63
2017-10-26 11:11:38 +02:00