diff options
-rw-r--r-- | test/test_bitvec.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/test/test_bitvec.cpp b/test/test_bitvec.cpp index 581b74e..4928282 100644 --- a/test/test_bitvec.cpp +++ b/test/test_bitvec.cpp @@ -176,13 +176,13 @@ test_left_shift(Context& ctx) T r = v; assert((v << s) == (r <<= s)); - for (size_t i = s; i < N - s; ++i) { - assert(r.test(i + s) == v.test(i)); - } - for (size_t i = 0; i < s; ++i) { assert(!r.test(i)); } + + for (size_t i = s; i < N; ++i) { + assert(r.test(i) == v.test(i - s)); + } } } @@ -195,13 +195,13 @@ test_right_shift(Context& ctx) T r = v; assert((v >> s) == (r >>= s)); - for (size_t i = s; i < N - s; ++i) { - assert(r.test(i - s) == v.test(i)); - } - for (size_t i = N - 1; i > N - s - 1; --i) { assert(!r.test(i)); } + + for (size_t i = 0; i <= N - s - 1; ++i) { + assert(r.test(i) == v.test(i + s)); + } } } |