From 0d797734a8cc96e8db8c23372f844966603c5877 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 26 Aug 2018 14:22:10 +0200 Subject: Add check for zero padding to shift tests --- test/test_bitvec.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test') diff --git a/test/test_bitvec.cpp b/test/test_bitvec.cpp index bd944b5..581b74e 100644 --- a/test/test_bitvec.cpp +++ b/test/test_bitvec.cpp @@ -179,6 +179,10 @@ test_left_shift(Context& ctx) 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)); + } } } @@ -194,6 +198,10 @@ test_right_shift(Context& ctx) 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)); + } } } -- cgit v1.2.1