aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-08-18 21:49:38 +0200
committerDavid Robillard <d@drobilla.net>2018-09-29 14:47:17 +0200
commit81f652c80c086ea008a4cd325f4e73764a9aa10a (patch)
treefe83b4c4c2d8338dc3d37873662b798b960ddfea /test
parent0dc0ebb495dd2be014e705674d1acdf114eb594d (diff)
downloadchilbert-81f652c80c086ea008a4cd325f4e73764a9aa10a.tar.gz
chilbert-81f652c80c086ea008a4cd325f4e73764a9aa10a.tar.bz2
chilbert-81f652c80c086ea008a4cd325f4e73764a9aa10a.zip
Add mask interface and isolate rack details from algorithm
Diffstat (limited to 'test')
-rw-r--r--test/test_bitvec.cpp22
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