From 13720ea9fff1322ffd6dc6c825bc3183d62c6f68 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 19 Aug 2018 09:28:11 +0200 Subject: Fix undefined behaviour in test assertion --- test/test_bitvec.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/test_bitvec.cpp') diff --git a/test/test_bitvec.cpp b/test/test_bitvec.cpp index 178b39a..0b6e534 100644 --- a/test/test_bitvec.cpp +++ b/test/test_bitvec.cpp @@ -253,7 +253,7 @@ test_gray_code(Context& ctx) grayCode(r); if (N > 0) { - assert(r == (v ^ (v >> 1))); + assert(N == 1 || r == (v ^ (v >> 1))); T s = r; grayCodeInv(s); -- cgit v1.2.1