Martchus
cb5ca77658
Improve test helper for launching an app
...
* Add helper that allows to specify the exit code (in case a non-zero
exit code is actually expected)
* Use the proper macros to inspect the status returned by `waitpid()` to
print/check the exit status correctly
2023-04-29 13:06:31 +02:00
Martchus
2a123df86d
Avoid use of non-standard escape character to avoid MSVC warning about it
2023-03-26 21:49:54 +02:00
Martchus
bcd5816d23
Apply clang-format and cmake-format
2023-03-25 18:52:13 +01:00
Martchus
ec891b48f6
Use `sendfile()` to speed up copying
2023-03-19 20:02:32 +01:00
Martchus
ab298b200f
Apply clang-format
2023-03-11 17:05:08 +01:00
Martchus
169756fce4
Fix loop-condition in `iotests.cpp`
2023-02-28 21:18:15 +01:00
Martchus
30819d9e85
Improve condition for use of `pubsetbuf`
...
Using this function like this seems only be possible with `libstdc++`. The
standard lib of MSVC and Clang both don't support this (so it is not just
MSVC and thus not Windows-specific).
2023-02-28 21:17:33 +01:00
Martchus
78d57902a7
Workaround MSVC-specific issues in testsuite so tests pass with MSVC
2023-02-28 00:07:56 +01:00
Martchus
2b6f26895d
Support multiple source directories in `srcdirref` file
...
* Locate test files in all source directories specified in `srcdirref`
* Allow overriding contents of `srcdirref` so the directory of another
component (within the same repository) can be appended to share testfiles
2023-02-27 18:29:31 +01:00
Martchus
a703813b4c
Mark helper functions of `testutils.cpp` as static; they're not used elsewhere
2023-02-27 18:29:21 +01:00
Martchus
147d36a578
Improve messages of conversion tests
2023-02-05 21:21:26 +01:00
Martchus
31f369d051
Add signed versions of `swapOrder()` functions
2023-02-05 21:20:53 +01:00
Martchus
024865cc44
Fix building conversion tests with MSVC
2023-02-01 00:42:44 +01:00
Martchus
3a4d71ef5c
Avoid unqualified call to `std::move`
2023-01-28 20:20:30 +01:00
Martchus
d8c38699ba
Avoid warning about unqualified std cast
2022-11-04 16:50:13 +01:00
Martchus
5acf422f71
Add useful operators to `DateTimeExpression`
...
* Add serialization back to string, useful for implementing
`TagValue::toString()`
* Add equality comparition
2022-08-13 14:10:40 +02:00
Martchus
5fe03c23a2
Rename `DateTimeParts::Millisecond` to `…::SubSecond`
...
We're currently just tracking whether the second has a fraction so this is
more fitting.
2022-08-13 14:07:37 +02:00
Martchus
f20d596785
Add `DateTimeExpression` to keep track of parsed timestamp parts
...
The existing timestamp parsers already internally keep track what parts
have been parsed via an index variable. This change exposes this
information as it can sometimes be useful to know what parts were actually
present in the timestamp.
2022-08-12 20:45:06 +02:00
Martchus
a1aef36c83
Add `checkFlagEnum()` and tests for `flagenumclass.h`
2022-07-29 22:01:51 +02:00
Martchus
639018285d
Fix typos
2022-06-26 11:48:44 +02:00
Martchus
3c769fa242
Add greedy-flag for argument parser
...
This is useful if one needs to pass subsequent arguments as-is to another
nested argument parser.
2022-06-26 11:24:36 +02:00
Martchus
3444e4bbb1
Improve argument parser tests
...
* Use auto
* Use `CPPUNIT_ASSERT_EQUAL` with `std::string_view` instead of `strcmp`
for better error messages in case of a failure
* Avoid instantiating an `std::string` in checks using `std::string_view`
instead
2022-06-26 11:18:36 +02:00
Martchus
c931e2d928
Fix missing `#pragma GCC diagnostic push`
2022-05-21 12:13:01 +02:00
Martchus
7555e6854b
Add test helper to use std::optional via CPPUNIT_ASSERT_EQUAL
2022-05-15 02:18:07 +02:00
Martchus
c1152ca062
Ignore warning about possible null pointer dereferences appearing with GCC 12
...
Not sure why this warning is occurring but it is likely incorrect
2022-05-12 20:31:05 +02:00
Martchus
f88ca7d16d
Silence warning about type conversion in test helper
...
It is a possibly lossy conversion but good enough for a test helper.
2022-03-20 16:56:11 +01:00
Martchus
052f8d2bd2
Add helper to make native path from internal representaton
2022-03-17 22:31:11 +01:00
Martchus
77c353fb6c
Add `TickType` and integer overloads to chrono utilities
2022-02-15 23:01:25 +01:00
Martchus
a8fddad804
Add WorkingCopyMode::Cleanup
2022-01-08 23:35:01 +01:00
Martchus
f81607be82
Possibly avoid ambiguous function call in conversion tests
...
This might avoid
```
/Users/oldfaithful/Local/tageditor/cpp-utilities/tests/conversiontests.cpp:29:15: error: call to 'swapOrder' is ambiguous static_assert(swapOrder(0xABCDEF1234567890ul) == 0x9078563412EFCDABul, "swapOrder(uint64)");
```
reported by https://github.com/Martchus/cpp-utilities/issues/22
2021-12-12 22:58:01 +01:00
Martchus
3b0ed313bc
Avoid warning about using uninitialized variable
2021-12-11 23:58:51 +01:00
Martchus
15fddad46d
Log error when "srcdirref" cannot be opened
2021-08-03 14:05:33 +02:00
Martchus
b16fff4b0a
Test splitString*() with an empty input
2021-07-24 23:38:44 +02:00
Martchus
6558ff487a
Add BufferSearch (from arch-repo-manager) to use it in syncthingtray as well
2021-07-15 02:24:28 +02:00
Martchus
b3ebe5ce38
Fix typos found via `codespell --skip .git -w`
2021-07-03 19:07:49 +02:00
Martchus
95202d059a
Fix typo
2021-06-04 16:04:26 +02:00
Martchus
a116c9e790
Avoid possibility of overflow in DateTime parsing functions
...
* This is strictly undefined behavior so let's avoid it
* As a side-effect it is now possible to omit the separators in
DateTime::fromIsoString()
2021-05-24 21:27:18 +02:00
Martchus
2e93882882
Reduce redundant code in stringconversion.h
2021-05-24 19:51:49 +02:00
Martchus
3afed30760
Detect overflow in functions to convert strings to numbers
...
Otherwise these functions can strictly run into undefined behavior which
should be prevented.
2021-05-24 19:51:49 +02:00
Martchus
546b1fecb7
Fix parsing ISO timestamp with negative timezone offset and no seconds fraction
...
See https://github.com/Martchus/syncthingtray/issues/93
2021-05-21 19:40:37 +02:00
Martchus
f549285fde
Fix splitString()/splitStringSimple() for case of empty trailing part
2021-05-11 16:42:28 +02:00
Martchus
0fb533ffc5
Format attempted test file/dir lookups more nicely in the error case
2021-04-06 17:46:15 +02:00
Martchus
f30947cc75
Fix plural of parameter
2021-03-30 20:48:05 +02:00
Martchus
8c033ca243
Fix warnings
2021-03-20 21:56:45 +01:00
Martchus
1f4fabcd9f
Add operators '*' and '/' to TimeSpan
2020-10-24 22:10:25 +02:00
Martchus
dd41762b70
Add testDirPath() for finding directories with test files
...
The same as testFilePath(), just for directories.
2020-09-23 22:49:33 +02:00
Martchus
9d59ab5c29
Fix Traits::IsSpecializationOf for references
...
This check is also supposed to work for references so use the same approach
as for ignoring cv qualifiers.
2020-06-17 21:41:00 +02:00
Martchus
940593429a
Allow ArgumentParserTests to pass when working dir present within testfiles dir
2020-06-16 01:03:39 +02:00
Martchus
52722be407
Add test helper execHelperAppInSearchPath()
2020-06-10 18:42:50 +02:00
Martchus
26b0d2d97c
Avoid some test classes to show up in the documentation
2020-05-01 13:47:06 +02:00