git: f699d8aa02a6 - stable/15 - bitstring_test: fix bit_nclear/bit_nset tests for last iteration
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 28 Oct 2025 09:49:44 UTC
The branch stable/15 has been updated by rlibby:
URL: https://cgit.FreeBSD.org/src/commit/?id=f699d8aa02a6845417e8a193165fe99f8e4c6f77
commit f699d8aa02a6845417e8a193165fe99f8e4c6f77
Author: Ryan Libby <rlibby@FreeBSD.org>
AuthorDate: 2025-10-02 16:40:16 +0000
Commit: Ryan Libby <rlibby@FreeBSD.org>
CommitDate: 2025-10-28 09:20:35 +0000
bitstring_test: fix bit_nclear/bit_nset tests for last iteration
Also convert nearby ATF_REQUIRE_MSG to ATF_REQUIRE_INTEQ_MSG.
Reported by: GCC -Wint-in-bool-context
Reviewed by: asomers, des
Differential Revision: https://reviews.freebsd.org/D45893
(cherry picked from commit 54b24b9da8be70192b7baaeae8fc26fda6581222)
---
tests/sys/sys/bitstring_test.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/tests/sys/sys/bitstring_test.c b/tests/sys/sys/bitstring_test.c
index a48042a4a063..bf436040c00f 100644
--- a/tests/sys/sys/bitstring_test.c
+++ b/tests/sys/sys/bitstring_test.c
@@ -559,14 +559,13 @@ BITSTRING_TC_DEFINE(bit_nclear)
bit_nclear(bitstr, i, j);
bit_ffc(bitstr, nbits, &found_clear_bit);
- ATF_REQUIRE_MSG(
- found_clear_bit == i,
+ ATF_REQUIRE_INTEQ_MSG(i, found_clear_bit,
"bit_nclear_%d_%d_%d%s: Failed with result %d",
nbits, i, j, memloc, found_clear_bit);
bit_ffs_at(bitstr, i, nbits, &found_set_bit);
- ATF_REQUIRE_MSG(
- (j + 1 < nbits) ? found_set_bit == j + 1 : -1,
+ ATF_REQUIRE_INTEQ_MSG((j + 1 < nbits) ? j + 1 : -1,
+ found_set_bit,
"bit_nset_%d_%d_%d%s: Failed with result %d",
nbits, i, j, memloc, found_set_bit);
}
@@ -586,14 +585,13 @@ BITSTRING_TC_DEFINE(bit_nset)
bit_nset(bitstr, i, j);
bit_ffs(bitstr, nbits, &found_set_bit);
- ATF_REQUIRE_MSG(
- found_set_bit == i,
+ ATF_REQUIRE_INTEQ_MSG(i, found_set_bit,
"bit_nset_%d_%d_%d%s: Failed with result %d",
nbits, i, j, memloc, found_set_bit);
bit_ffc_at(bitstr, i, nbits, &found_clear_bit);
- ATF_REQUIRE_MSG(
- (j + 1 < nbits) ? found_clear_bit == j + 1 : -1,
+ ATF_REQUIRE_INTEQ_MSG((j + 1 < nbits) ? j + 1 : -1,
+ found_clear_bit,
"bit_nset_%d_%d_%d%s: Failed with result %d",
nbits, i, j, memloc, found_clear_bit);
}