summaryrefslogtreecommitdiff
path: root/test/UnitLoad.cpp
AgeCommit message (Collapse)AuthorFilesLines
2020-06-02wsd: move LOOLProtocol::tokenize to Util::tokenizeAshod Nakashian1-1/+1
The tokenizer(s) are more generic than the protocol logic, and are used from contexts that don't involve the protocol as such. Change-Id: Ie8c256bf11a91e466bff794021f41603c9596a7f
2020-03-14wsd: test assertion macrosAshod Nakashian1-10/+10
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-02-28Rework LOOLProtocol::tokenize() to return a StringVector objectMiklos Vajna1-1/+1
The bulk of this commit just changes std::vector<std::string> to StringVector when we deal with tokens from a websocket message. The less boring part of it is the new StringVector class, which is a wrapper around std::vector<std::string>, and provides the same API, except that operator[] returns a string, not a string&, and this allows returning an empty string in case that prevents reading past the end of the underlying array. This means in case client code forgets to check size() before invoking operator[], we don't crash. (See the ~3 previous commits which fixed such crashes.) Later the ctor could be changed to take a single underlying string to avoid lots of tiny allocations, that's not yet done in this commit. Change-Id: I8a6082143a8ac0b65824f574b32104d7889c184f Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89687 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-12-06wsd: fix a typoMiklos Vajna1-0/+3
And disable a test that passes for me locally but fails on Jenkins. Change-Id: Ifcdcedbac259247d784ce66185f95bfbe634381f Reviewed-on: https://gerrit.libreoffice.org/84603 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-12-06Convert some Calc tests to a new-style oneMiklos Vajna1-9/+1
So that they are in-process, which means it's easier to debug when they fail. Also, in UnitLoad, give up on trying to avoid the sleep after disconnecting, it seems the old condition was not reliable. Change-Id: I972a3319887a70eeea2585104ed1e762830ca505
2019-12-05test: fix UnitLoad::testConnectNoLoad()Miklos Vajna1-0/+10
Depending on timing, this failed with the following error: wsd-14400-14411 [ docbroker_001 ] WRN Will not load document marked to destroy. DocKey: [/tmp/connectNoLoad_27c61e41_hello.odt].| wsd/DocumentBroker.cpp:520 Make sure we don't try to load the same document again when the cleanup for the previous session is not done yet. Change-Id: I354999fa934df665b48dca314d2b77ab95c84ec0
2019-11-22Convert doc load tests to a new-style oneMiklos Vajna1-0/+211
So that they are in-process, which means it's easier to debug when they fail. Change-Id: I2dcef46ec76e1f971172d1c29adf09103cfeaa7b