aboutsummaryrefslogtreecommitdiff
path: root/tests/abi.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-04-17 09:38:43 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-04-17 09:38:43 +0200
commit15250710c63a2c3d230304e46a03532f787759fb (patch)
tree9fda47ad94248d133b7b48c67eba20d357c6694e /tests/abi.c
parent6b3e6d299d5298a5936dbba57f67cdfc4a406789 (diff)
tests: improve diagnostics output & make "release builds" work
This commit adds a few macros and helper functions for the unit test programs. Those are used instead of asserts to provide more fine grained diagnostics on the one hand and on the other hand because they also work if NDEBUG is defined, unlike asserts that get eliminated in that case. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'tests/abi.c')
-rw-r--r--tests/abi.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/tests/abi.c b/tests/abi.c
index 1601e0a..ce1a9aa 100644
--- a/tests/abi.c
+++ b/tests/abi.c
@@ -7,19 +7,17 @@
#include "config.h"
#include "sqfs/compressor.h"
-
-#include <assert.h>
-#include <stdlib.h>
+#include "test.h"
int main(void)
{
sqfs_compressor_config_t cfg;
- assert(sizeof(cfg.opt.gzip) == sizeof(cfg.opt));
- assert(sizeof(cfg.opt.zstd) == sizeof(cfg.opt));
- assert(sizeof(cfg.opt.lzo) == sizeof(cfg.opt));
- assert(sizeof(cfg.opt.xz) == sizeof(cfg.opt));
- assert(sizeof(cfg.opt.padd0) == sizeof(cfg.opt));
+ TEST_EQUAL_UI(sizeof(cfg.opt.gzip), sizeof(cfg.opt));
+ TEST_EQUAL_UI(sizeof(cfg.opt.zstd), sizeof(cfg.opt));
+ TEST_EQUAL_UI(sizeof(cfg.opt.lzo), sizeof(cfg.opt));
+ TEST_EQUAL_UI(sizeof(cfg.opt.xz), sizeof(cfg.opt));
+ TEST_EQUAL_UI(sizeof(cfg.opt.padd0), sizeof(cfg.opt));
return EXIT_SUCCESS;
}