diff options
author | David Robillard <d@drobilla.net> | 2022-09-16 16:27:19 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2022-09-16 22:31:06 -0400 |
commit | 8697e134aeac0318e6686d785113f0763cbc3c1c (patch) | |
tree | 86897017d682939a1faf586b5bb61a15f814387a /test | |
parent | 49dab5622b31421eb6af84eae376d73fae1cd4a0 (diff) | |
download | chilbert-8697e134aeac0318e6686d785113f0763cbc3c1c.tar.gz chilbert-8697e134aeac0318e6686d785113f0763cbc3c1c.tar.bz2 chilbert-8697e134aeac0318e6686d785113f0763cbc3c1c.zip |
Fix signed bitwise operator operands
Diffstat (limited to 'test')
-rw-r--r-- | test/test_bitvec.cpp | 2 | ||||
-rw-r--r-- | test/test_utils.hpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/test/test_bitvec.cpp b/test/test_bitvec.cpp index a0e8b5b..c123212 100644 --- a/test/test_bitvec.cpp +++ b/test/test_bitvec.cpp @@ -251,7 +251,7 @@ test_find_first(Context&) v.reset(); v.set(i); for (size_t j = i + 1; j < N; ++j) { - v.set(j, rand() & 1); + v.set(j, rand() % 2); } assert(size_t(v.find_first()) == i + 1); } diff --git a/test/test_utils.hpp b/test/test_utils.hpp index 8c95fb4..3388552 100644 --- a/test/test_utils.hpp +++ b/test/test_utils.hpp @@ -49,7 +49,7 @@ make_random_bitvec(Context& ctx) { T v(N); for (size_t i = 0; i < N; ++i) { - v.set(i, ctx.dist(ctx.rng) & 1); + v.set(i, ctx.dist(ctx.rng) & 1U); } return v; } |