diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/test_bitvec.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/test_bitvec.cpp b/test/test_bitvec.cpp index 74c2e02..78a8272 100644 --- a/test/test_bitvec.cpp +++ b/test/test_bitvec.cpp @@ -248,6 +248,27 @@ test_comparison(Context&) template <class T, size_t N> void +test_iteration(Context&) +{ + T v = make_zero_bitvec<T, N>(); + size_t count = 0; + for (const auto bit : v) { + assert(!bit); + ++count; + } + // assert(count == N); + + v.flip(); + count = 0; + for (const auto bit : v) { + assert(bit); + ++count; + } + // assert(count == N); +} + +template <class T, size_t N> +void test(Context& ctx) { test_and<T, N>(ctx); @@ -265,6 +286,7 @@ test(Context& ctx) test_find_first<T, N>(ctx); test_gray_code<T, N>(ctx); test_comparison<T, N>(ctx); + test_iteration<T, N>(ctx); } int |