diff options
author | Nils Brederlow <62596379+dingodoppelt@users.noreply.github.com> | 2022-02-04 21:04:43 +0100 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2022-02-04 21:04:43 +0100 |
commit | 10079c5a52f4d2f6556a6aafa022d6bcd151f1da (patch) | |
tree | 96e16f678055c7094bc8a38cea14cb1d616ab9c9 /test/midimappertest.cc | |
parent | 34ea89b44eb9c4b1f45dfd1ec22381dacc5d81c0 (diff) |
Add tests for lookupCCcc-note-midimap
Diffstat (limited to 'test/midimappertest.cc')
-rw-r--r-- | test/midimappertest.cc | 38 |
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()); + } } }; |