aboutsummaryrefslogtreecommitdiff
path: root/support/check.h
AgeCommit message (Collapse)AuthorFilesLines
2018-05-16support: Add TEST_COMPARE_BLOB, support_quote_blobFlorian Weimer1-0/+22
The declaration of support_test_compare_blob uses unsigned long int, to avoid including <stddef.h>. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2018-01-08support: Increase usability of TEST_COMPAREFlorian Weimer1-24/+11
The previous implementation of the TEST_COMPARE macro would fail to compile code like this: int ret = res_send (query, sizeof (query), buf, sizeof (buf)); TEST_COMPARE (ret, sizeof (query) + 2 /* Compression reference. */ + 2 + 2 + 4 + 2 /* Type, class, TTL, RDATA length. */ + 1 /* Pascal-style string length. */ + strlen (expected_name)); This resulted in a failed static assertion, "integer conversions may alter sign of operands". A user of the TEST_COMPARE would have to add a cast to fix this. This patch reverts to the original proposed solution of a run-time check, making TEST_COMPARE usable for comparisons of numbers with types with different signedness in more contexts.
2018-01-08support: Define support_static_assert for use with C and C++Florian Weimer1-9/+16
And update TEST_COMPARE to use it, to make it usable from C++.
2018-01-01Update copyright dates with scripts/update-copyrights.Joseph Myers1-1/+1
* All files with FSF copyright notices: Update copyright dates using scripts/update-copyrights. * locale/programs/charmap-kw.h: Regenerated. * locale/programs/locfile-kw.h: Likewise.
2017-12-04support: Add TEST_COMPARE macroFlorian Weimer1-0/+61
2017-06-09support: Expose TEST_VERIFY_EXIT behavior to GCC optimizersFlorian Weimer1-3/+7
Previously, the implementation would conditionally exit based on the status argument, which GCC did not know about. This leads to false uninitialized variable warnings when data is accessed after a TEST_VERIFY_EXIT failure (from code which would never execute).
2017-01-01Update copyright dates with scripts/update-copyrights.Joseph Myers1-1/+1
2016-12-31support: Use support_record_failure consistentlyFlorian Weimer1-3/+7
This causes more test programs to link in the support_record_failure function, which triggers an early call to mmap from an ELF constructor, but this should not have side effects intefering with the functionality actually under test (unlike, say, a call to malloc).
2016-12-28Add SYSV message queue testAdhemerval Zanella1-0/+5
This patch adds a simple SYSV message queue test to check for correct argument passing on kernel. The idea is neither to be an extensive testing nor to check for any specific Linux test. * sysvipc/Makefile (tests): Add test-sysvmsg. * sysvipc/test-sysvmsg.c: New file. * test-skeleton.c (FAIL_UNSUPPORTED): New define.
2016-12-28support: Add support for delayed test failure reportingFlorian Weimer1-1/+37
The new functions support_record_failure records a test failure, but does not terminate the process. The macros TEST_VERIFY and TEST_VERIFY_EXIT check that a condition is true.
2016-12-09support: Introduce new subdirectory for test infrastructureFlorian Weimer1-0/+49
The new test driver in <support/test-driver.c> has feature parity with the old one. The main difference is that its hooking mechanism is based on functions and function pointers instead of macros. This commit also implements a new environment variable, TEST_COREDUMPS, which disables the code which disables coredumps (that is, it enables them if the invocation environment has not disabled them). <test-skeleton.c> defines wrapper functions so that it is possible to use existing macros with the new-style hook functionality. This commit changes only a few test cases to the new test driver, to make sure that it works as expected.