From 0cf7b01d6bbb030a953885b92fff105af91d8664 Mon Sep 17 00:00:00 2001 From: Paul Ferrand Date: Sun, 29 Mar 2020 17:12:41 +0200 Subject: [PATCH] update the tests for the normalized modifier --- tests/FilesT.cpp | 2 +- tests/RegionT.cpp | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/FilesT.cpp b/tests/FilesT.cpp index 497fab57..8d44b566 100644 --- a/tests/FilesT.cpp +++ b/tests/FilesT.cpp @@ -311,7 +311,7 @@ TEST_CASE("[Files] wrong (overlapping) replacement for defines") REQUIRE( synth.getRegionView(1)->keyRange.getEnd() == 57 ); REQUIRE( !synth.getRegionView(2)->amplitudeCC.empty() ); REQUIRE( synth.getRegionView(2)->amplitudeCC.contains(10) ); - REQUIRE( synth.getRegionView(2)->amplitudeCC.getWithDefault(10) == 34.0f ); + REQUIRE( synth.getRegionView(2)->amplitudeCC.getWithDefault(10) == 0.34f ); } TEST_CASE("[Files] Specific bug: relative path with backslashes") diff --git a/tests/RegionT.cpp b/tests/RegionT.cpp index c0b83dd4..1beebaa6 100644 --- a/tests/RegionT.cpp +++ b/tests/RegionT.cpp @@ -1430,6 +1430,17 @@ TEST_CASE("[Region] Parsing opcodes") region.parseOpcode({ "note_selfmask", "garbage" }); REQUIRE(region.selfMask == SfzSelfMask::dontMask); } + + SECTION("amplitude_cc") + { + REQUIRE(region.amplitudeCC.empty()); + region.parseOpcode({ "amplitude_cc1", "40" }); + REQUIRE(region.amplitudeCC.contains(1)); + REQUIRE(region.amplitudeCC[1] == 0.40_a); + region.parseOpcode({ "amplitude_oncc2", "30" }); + REQUIRE(region.amplitudeCC.contains(2)); + REQUIRE(region.amplitudeCC[2] == 0.30_a); + } } // Specific region bugs