From dcd688dbe56129cac55f268a5b2f08b7db9b4289 Mon Sep 17 00:00:00 2001 From: Paul Ferrand Date: Fri, 27 Mar 2020 18:17:15 +0100 Subject: [PATCH] Add oscillator phase tests --- tests/RegionT.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/RegionT.cpp b/tests/RegionT.cpp index 354cd06b..81af69bb 100644 --- a/tests/RegionT.cpp +++ b/tests/RegionT.cpp @@ -1392,6 +1392,19 @@ TEST_CASE("[Region] Parsing opcodes") region.parseOpcode({ "effect3", "-50.65" }); REQUIRE(region.gainToEffect[3] == 0.0f); } + + SECTION("Wavetable phase") + { + REQUIRE(region.oscillatorPhase == 0.0f); + region.parseOpcode({ "oscillator_phase", "45" }); + REQUIRE(region.oscillatorPhase == 45.0f); + region.parseOpcode({ "oscillator_phase", "45.32" }); + REQUIRE(region.oscillatorPhase == 45.32_a); + region.parseOpcode({ "oscillator_phase", "-1" }); + REQUIRE(region.oscillatorPhase == -1.0f); + region.parseOpcode({ "oscillator_phase", "361" }); + REQUIRE(region.oscillatorPhase == 360.0f); + } } // Specific region bugs