summaryrefslogtreecommitdiffstats
path: root/tests/bit.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2024-01-12 12:01:07 -0500
committerTavian Barnes <tavianator@tavianator.com>2024-01-12 12:01:07 -0500
commita9c9fc392bf2c3803251e5f63c944cd221a1ca67 (patch)
treef6074e70120eda712b96027835c9c799a561e4a4 /tests/bit.c
parent67eebd6fd514ede9e10cd4639b8d0cce690513f4 (diff)
downloadbfs-a9c9fc392bf2c3803251e5f63c944cd221a1ca67.tar.xz
tests: Merge unit test executables into one
Diffstat (limited to 'tests/bit.c')
-rw-r--r--tests/bit.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/bit.c b/tests/bit.c
index f9071be..1c6a4de 100644
--- a/tests/bit.c
+++ b/tests/bit.c
@@ -1,6 +1,7 @@
// Copyright © Tavian Barnes <tavianator@tavianator.com>
// SPDX-License-Identifier: 0BSD
+#include "tests.h"
#include "../src/bit.h"
#include "../src/diag.h"
#include <limits.h>
@@ -54,7 +55,7 @@ bfs_static_assert(INTMAX_MAX == IWIDTH_MAX(INTMAX_WIDTH));
#define verify_eq(a, b) \
bfs_verify((a) == (b), "(0x%jX) %s != %s (0x%jX)", (uintmax_t)(a), #a, #b, (uintmax_t)(b))
-int main(void) {
+bool check_bit(void) {
verify_eq(bswap((uint8_t)0x12), 0x12);
verify_eq(bswap((uint16_t)0x1234), 0x3412);
verify_eq(bswap((uint32_t)0x12345678), 0x78563412);
@@ -121,5 +122,5 @@ int main(void) {
bfs_verify(!has_single_bit(UINT32_MAX));
bfs_verify(has_single_bit((uint32_t)1 << (UINT_WIDTH - 1)));
- return EXIT_SUCCESS;
+ return true;
}