From 442e15b8e920cd3636861914cbb7546e75ee4487 Mon Sep 17 00:00:00 2001 From: Paul Fd Date: Tue, 14 Apr 2020 23:08:28 +0200 Subject: [PATCH] Adapted the tests --- tests/EventEnvelopesT.cpp | 31 +++++++++---------------------- 1 file changed, 9 insertions(+), 22 deletions(-) diff --git a/tests/EventEnvelopesT.cpp b/tests/EventEnvelopesT.cpp index 8c7e2d55..64bcb7e4 100644 --- a/tests/EventEnvelopesT.cpp +++ b/tests/EventEnvelopesT.cpp @@ -224,9 +224,9 @@ TEST_CASE("[MultiplicativeEnvelope] 2 events, far") TEST_CASE("[MultiplicativeEnvelope] Get quantized with 2 steps") { sfz::EventVector events { - { 0, 1.0f }, - { 2, 2.0f }, - { 6, 4.0f } + { 0, 1.3f }, + { 2, 2.1f }, + { 6, 4.2f } }; std::array output; std::array expected { 1.0f, 1.0f, 2.0f, 2.0f, 2.0f, 2.0f, 4.0f, 4.0f }; @@ -237,9 +237,9 @@ TEST_CASE("[MultiplicativeEnvelope] Get quantized with 2 steps") TEST_CASE("[MultiplicativeEnvelope] Get quantized with an unquantized out of range step") { sfz::EventVector events { - { 0, 1.0f }, - { 2, 2.0f }, - { 6, 4.0f }, + { 0, 1.3f }, + { 2, 2.1f }, + { 6, 4.1f }, { 10, 8.2f } }; std::array output; @@ -251,9 +251,9 @@ TEST_CASE("[MultiplicativeEnvelope] Get quantized with an unquantized out of ran TEST_CASE("[MultiplicativeEnvelope] Going down quantized with 2 steps") { sfz::EventVector events { - { 0, 4.0f }, - { 2, 2.0f }, - { 6, 0.5f } + { 0, 4.1f }, + { 2, 2.2f }, + { 6, 0.4f } }; std::array output; std::array expected { 4.0f, 4.0f, 2.0f, 2.0f, 1.0f, 1.0f, 0.5f, 0.5f }; @@ -261,19 +261,6 @@ TEST_CASE("[MultiplicativeEnvelope] Going down quantized with 2 steps") REQUIRE(approxEqual(output, expected)); } -TEST_CASE("[MultiplicativeEnvelope] Get quantized with unclean events") -{ - sfz::EventVector events { - { 0, 1.0f }, - { 2, 1.2f }, - { 6, 2.5f } - }; - std::array output; - std::array expected { 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 2.0f, 2.0f }; - multiplicativeEnvelope(events, absl::MakeSpan(output), idModifier, 2.0f); - REQUIRE(approxEqual(output, expected)); -} - TEST_CASE("[linearModifiers] Compare with envelopes") { sfz::Resources resources;