6335b1be387359ac461b0c34087bbba98a925a49 |
|
08-Aug-2016 |
Phil Carmody <phil@dovecot.fi> |
lib: tests - give the tests names, using the new macros
The lists of test function declarations and of test functions to call was
basically the same list. Use the new test macros to squash them into one
list, and then chose to name all the tests, so that you can select which
ones to run. This can simplify the debug cycle when some of the tests are
lengthy.
e.g.:
phil@phil:~/repos/dovecot-core$ src/lib/test-lib --match crc
crc32 ................................................................ : ok
0 / 1 tests failed
src/lib is clearly the most complicated case, conversions of others where
filtering would be useful should be trivial following this example.
Signed-off-by: Phil Carmody <phil@dovecot.fi> |
ee2298ffa2c91fa156ba5ba05d45576a99d3f9ad |
|
30-Jul-2014 |
Phil Carmody <phil@dovecot.fi> |
lib: test-data-stack - add some fatal tests.
Extra caution is necessary as data-stack is such a fundamental component.
All of the brokenness that we add must be undone as soon as possible, or
there will be an endless loop of catastrophic errors. In order to avoid
that, at least try to detect some issues, and abort as quickly as possible.
Alas, due to the reliance of these tests on DEBUG code, if that's not set,
this test is a no-op.
Signed-off-by: Phil Carmody <phil@dovecot.fi> |
992a1726a41b42fa47204565ff17f7c635fcb421 |
|
28-Jul-2014 |
Phil Carmody <phil@dovecot.fi> |
lib: test-data-stack - too important a library not to be thrashed hard
OK, it's thrashed a bit by other tests such as aqueue, str, etc., but these
tests attempt to probe all corner cases given detailed knowledge of the
limits of the block/frame implementation.
At the moment, no realloc functionality is tested, as with DEBUG builds
they would fail very noisily.
Signed-off-by: Phil Carmody <phil@dovecot.fi> |
42826d96c8d0bba9eddc85b01bf70d7db571ae7f |
|
02-Jul-2014 |
Phil Carmody <phil@dovecot.fi> |
lib: test-lib - add unit tests for str_to_*() helpers
This doesn't test all the helpers, but ensures both signed and unsigned
are tested, as are 32-bit and 64-bit cases. All the other helpers fall
back onto using one of those cases. Unless uintmax_t is larger than 64
bits, in which case this needs a revisit.
NOTE: This causes the following make check errors:
test-strnum.c:35: Assert(#7) failed: ret == u64tests[i].ret
test-strnum.c:35: Assert(#10) failed: ret == u64tests[i].ret
test-strnum.c:37: Assert(#10) failed: val == u64tests[i].val
str_to_uint64 ........................................................ : FAILED
Corresponding to test cases:
[7] = INVALID(18446744073709551616),
This does not wrap-past-0 (become smaller) on multiply, but wraps-past-0 on addition.
[10]= INVALID(20496382304121724020),
This wraps-past-n (becomes larger) on multiply.
Signed-off-by: Phil Carmody <phil@dovecot.fi> |
f5982bb5b0a704e88fa2b44b0b74e365d13103b9 |
|
19-Jun-2014 |
Timo Sirainen <tss@iki.fi> |
lib: If two istreams share one parent, i_stream_get_data() may have returned corrupted data to another.
This happened only for istreams that used parent's buffer directly instead
of having their own buffer. For now at least we've solved this by truncating
the other stream's buffer so it needs to be read again. Hopefully this is
good enough.
Added also unit test to check this functionality. |