diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/test_bitvec.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/test_bitvec.cpp b/test/test_bitvec.cpp index e547122..61685d1 100644 --- a/test/test_bitvec.cpp +++ b/test/test_bitvec.cpp @@ -88,6 +88,18 @@ test_xor() template <class T, size_t N> void +test_not() +{ + const T v = make_random_bitvec<T, N>(); + const T r = ~v; + + for (size_t i = 0; i < N; ++i) { + assert(r.test(i) == !v.test(i)); + } +} + +template <class T, size_t N> +void test_flip_one() { T v = make_zero_bitvec<T, N>(); @@ -241,6 +253,7 @@ test() test_and<T, N>(); test_or<T, N>(); test_xor<T, N>(); + test_not<T, N>(); test_flip_one<T, N>(); test_flip_all<T, N>(); test_none<T, N>(); |