diff options
| author | Faraz Vahedi <kfv@FreeBSD.org> | 2026-08-04 16:31:37 +0000 |
|---|---|---|
| committer | Faraz Vahedi <kfv@FreeBSD.org> | 2026-08-13 09:41:41 +0000 |
| commit | b54dcb897a5fa66ff1013d0ea403ed8894e34b8a (patch) | |
| tree | d6d03fd76a8d555af6b34a72ab2b88da7036ba07 | |
| parent | ca1c1eceb38c57ce7439786008f7c6f37c9a62d3 (diff) | |
libc/tests: Add assertions for BOOL_WIDTH, BOOL_MAX, and BITINT_MAXWIDTH
Reviewed by: fuz
Approved by: fuz (mentor)
MFC after: 1 month
Pull Request: https://github.com/freebsd/freebsd-src/pull/2352
| -rw-r--r-- | lib/libc/tests/gen/limits_test.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/libc/tests/gen/limits_test.c b/lib/libc/tests/gen/limits_test.c index 7324ef74319e..b6f6fb78fab8 100644 --- a/lib/libc/tests/gen/limits_test.c +++ b/lib/libc/tests/gen/limits_test.c @@ -27,6 +27,9 @@ __XSTRING(TYPE) "_MAX wrongly defined"); /* primitive types */ +static_assert(BOOL_WIDTH == 1, "BOOL_WIDTH wrongly defined"); +static_assert(BOOL_MAX == 1, "BOOL_MAX wrongly defined"); + #ifdef __CHAR_UNSIGNED__ CHECK_UTYPE(char, CHAR); #else @@ -92,6 +95,9 @@ CHECK_UTYPE(uintmax_t, UINTMAX); CHECK_UTYPE(uintptr_t, UINTPTR); CHECK_UTYPE(size_t, SIZE); +static_assert(BITINT_MAXWIDTH >= ULLONG_WIDTH, + "BITINT_MAXWIDTH wrongly defined"); + /* dummy */ ATF_TC_WITHOUT_HEAD(dummy); ATF_TC_BODY(dummy, tc) {} |
