diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2023-05-18 16:44:30 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2023-05-18 16:46:13 -0400 |
commit | 526133c11eb9a26a4cffb20bcd10bcbb36d940de (patch) | |
tree | 26787e3cc22df2c44837f72f6ff919ab7808a8f6 /tests/bfstd.c | |
parent | 63a52b1bfc99c58f0a944174282da79aab5bde3a (diff) | |
download | bfs-526133c11eb9a26a4cffb20bcd10bcbb36d940de.tar.xz |
Switch from assert() to bfs_assert()/bfs_verify()
Diffstat (limited to 'tests/bfstd.c')
-rw-r--r-- | tests/bfstd.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/tests/bfstd.c b/tests/bfstd.c index a986a23..1812a00 100644 --- a/tests/bfstd.c +++ b/tests/bfstd.c @@ -1,10 +1,9 @@ // Copyright © Tavian Barnes <tavianator@tavianator.com> // SPDX-License-Identifier: 0BSD -#undef NDEBUG #include "../src/bfstd.h" #include "../src/config.h" -#include <assert.h> +#include "../src/diag.h" #include <stdio.h> #include <stdint.h> #include <stdlib.h> @@ -39,11 +38,11 @@ int main(void) { alignas(64) int foo; int bar[]; }; - assert(flex_sizeof(struct flexible, bar, 0) >= sizeof(struct flexible)); - assert(flex_sizeof(struct flexible, bar, 16) % alignof(struct flexible) == 0); - assert(flex_sizeof(struct flexible, bar, SIZE_MAX / sizeof(int) + 1) - == align_floor(alignof(struct flexible), SIZE_MAX)); - assert(flex_sizeof_impl(8, 16, 4, 4, 1) == 16); + bfs_verify(flex_sizeof(struct flexible, bar, 0) >= sizeof(struct flexible)); + bfs_verify(flex_sizeof(struct flexible, bar, 16) % alignof(struct flexible) == 0); + bfs_verify(flex_sizeof(struct flexible, bar, SIZE_MAX / sizeof(int) + 1) + == align_floor(alignof(struct flexible), SIZE_MAX)); + bfs_verify(flex_sizeof_impl(8, 16, 4, 4, 1) == 16); // From man 3p basename check_base_dir("usr", ".", "usr"); |