aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/test_bitvec.cpp2
-rw-r--r--test/test_utils.hpp2
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;
}