Commit graph

9 commits

Author SHA1 Message Date
Ashod Nakashian
fac6c01725 wsd: replace strrchr with constexpr
This avoids the runtime overhead of strrchr used
in logged filenames on iOS, which is unnecessary
on string literals, and adds unit-tests.

We also strip leading './' and '../' in other builds.

Change-Id: I56ec722d1400fad9165eb046d1bd8d4438241ca3
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-04-26 11:13:44 +03:00
Ashod Nakashian
1d37371944 wsd: minor improvements to logging and macros
This primarily combines the string-literals
that form the filename and line number to
reduce four calls to operator<< to only one.

Also fix LOK_ASSERT_STATE to use its argument.

Change-Id: I5e8eeb4f862fe8679b1e1f7a57412dc84dc30e92
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-04-06 18:33:45 -04:00
Ashod Nakashian
52f2600cf9 wsd: test: embue all tests with a name and unify logs
Now the remaining tests that didn't have a name
get one and the logs are unified between old-
and new-style tests. Mostly.

This makes sure that all logs and assertions
properly log the test name and make test
failures easier to debug and fix.

Change-Id: Id159ffacc81642a6ec594c5143498408adab67cf
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-02-17 18:52:48 -05:00
Ashod Nakashian
3d04a857bd wsd: test: improved and simplify test logging
Build-time unit-test output is now only
displayed when the test fails. This is to
reduce noise while building when not helpful.

Change-Id: I273d97dae192a24e9a1ae9f662b0fcd7ff555b75
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-02-17 18:52:48 -05:00
Ashod Nakashian
05dc8a0f84 test: improved state-machine helpers
Change-Id: I10c561ae4cf5e4471f1f9eafc9ffbb77badc7284
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-02-04 10:26:49 -05:00
Ashod Nakashian
aad22ee83c wsd: test: better logging
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
(cherry picked from commit ec3613ba2df43cffe6baafafa41e5337a43070aa)

Change-Id: I5e245d0ac5c185943586d6aec651f606f8e23bb8
2022-01-11 09:28:03 +01:00
Ashod Nakashian
7972ded44f wsd: test: log test assertions
Change-Id: Ibf9274b1812f70f54ccd4e7be991b08a11f36c86
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2020-12-28 12:04:53 -04:00
Ashod Nakashian
64251966d5 wsd: test: use LOG_TST in new-style tests
Change-Id: I0d4558d44bc6cb92ba820ae8471d7ed2528277fc
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2020-12-28 12:04:53 -04:00
Ashod Nakashian
9bbd273e91 wsd: test: leverage the log system in TST_LOG
This moves the test log macros into a new home,
test/testlog.hpp, to avoid cycling dependencies.

Change-Id: Iacb80e813a64ff830fa18f63ec4de2535ee702b7
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2020-12-28 12:04:53 -04:00