summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/midimappertest.cc38
1 files changed, 38 insertions, 0 deletions
diff --git a/test/midimappertest.cc b/test/midimappertest.cc
index 391045a..388b51e 100644
--- a/test/midimappertest.cc
+++ b/test/midimappertest.cc
@@ -105,6 +105,32 @@ public:
uASSERT_EQUAL(1u, is.size());
uASSERT_EQUAL(4, is[0]);
}
+
+ {
+ auto is = mapper.lookupCC(64);
+ uASSERT_EQUAL(1u, is.size());
+ uASSERT_EQUAL(51, is[0]);
+ }
+
+ {
+ auto is = mapper.lookupCC(65);
+ uASSERT_EQUAL(1u, is.size());
+ uASSERT_EQUAL(52, is[0]);
+ }
+
+ {
+ auto is = mapper.lookupCC(66);
+ uASSERT_EQUAL(1u, is.size());
+ uASSERT_EQUAL(53, is[0]);
+ }
+
+ {
+ auto is = mapper.lookupCC(67);
+ uASSERT_EQUAL(2u, is.size());
+ // We don't care about the order, so just count the instances
+ uASSERT_EQUAL(1u, std::count(is.begin(), is.end(), 54));
+ uASSERT_EQUAL(1u, std::count(is.begin(), is.end(), 55));
+ }
}
void exceptional()
@@ -151,6 +177,18 @@ public:
auto is = mapper.lookup(60);
uASSERT_EQUAL(0u, is.size());
}
+
+ // no such cc id
+ {
+ auto is = mapper.lookupCC(1);
+ uASSERT_EQUAL(0u, is.size());
+ }
+
+ // no such note
+ {
+ auto is = mapper.lookupCC(-1);
+ uASSERT_EQUAL(0u, is.size());
+ }
}
};