diff options
author | David Robillard <d@drobilla.net> | 2018-08-18 09:06:14 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2018-09-29 14:46:30 +0200 |
commit | fc24951cba40ab471f64f9f2825b4abe541e1283 (patch) | |
tree | 10d2fc48dcd6da29a0f3419ccebec1fa70962aa8 /test | |
parent | 1d93b32df165b1ad96b2d1b17d553eb2a37b696c (diff) | |
download | chilbert-fc24951cba40ab471f64f9f2825b4abe541e1283.tar.gz chilbert-fc24951cba40ab471f64f9f2825b4abe541e1283.tar.bz2 chilbert-fc24951cba40ab471f64f9f2825b4abe541e1283.zip |
Add NOT operators
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>(); |