oxen-mq/tests
Jason Rhinelander 90701e5d62 Make lokimq::is_hex check for size being a multiple of 2
`is_hex()` is a bit misleading as `from_hex()` requires an even-length
hex string, but `is_hex()` also allows odd-length hex strings, which
means currently callers should be doing `if (lokimq::is_hex(str) &&
str.size() % 2 == 0)`, but probably aren't.

Since the main point of `lokimq/hex.h` is for byte<->hex conversions it
doesn't make much sense to allow `is_hex()` to return true for something
that can't be validly decoded via `from_hex()`, thus this PR changes it
to return false.

If someone *really* wants to test for an odd-length hex string (though
I'm skeptical that there is a need for this), this also exposes
`is_hex_digit` so that they could use:

    bool all_hex = std::all_of(str.begin(), str.end(), lokimq::is_hex_digit<char>)
2020-12-12 20:25:01 -04:00
..
Catch2@b3b07215d1 Add initial test suite with some batch job tests 2020-02-06 18:10:26 -04:00
CMakeLists.txt Allow injecting tasks into lokimq job queue 2020-06-30 18:44:11 -03:00
common.h Test suite: use different ports for each test 2020-10-15 16:55:33 -03:00
main.cpp Add initial test suite with some batch job tests 2020-02-06 18:10:26 -04:00
test_address.cpp Add address parsing/generating class 2020-05-08 21:42:16 -03:00
test_batch.cpp Add more locks around assertions 2020-03-21 12:56:13 -03:00
test_bt.cpp macOS 10.12 compatibility 2020-10-15 16:55:33 -03:00
test_commands.cpp Test suite: use different ports for each test 2020-10-15 16:55:33 -03:00
test_connect.cpp Test suite: use different ports for each test 2020-10-15 16:55:33 -03:00
test_encoding.cpp Make lokimq::is_hex check for size being a multiple of 2 2020-12-12 20:25:01 -04:00
test_failures.cpp Test suite: use different ports for each test 2020-10-15 16:55:33 -03:00
test_inject.cpp Test suite: use different ports for each test 2020-10-15 16:55:33 -03:00
test_requests.cpp Test suite: use different ports for each test 2020-10-15 16:55:33 -03:00
test_tagged_threads.cpp Add test that destruction doesn't throw 2020-07-10 17:54:45 -03:00