Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jatinchowdhury18 committed Apr 2, 2024
1 parent 60859ed commit 82bf8ee
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions tests/plugin_tests/chowdsp_presets_v2_test/NextPreviousTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,12 @@ TEST_CASE ("Next/Previous Test", "[plugin][presets]")
chowdsp::presets::PresetManager presetMgr { state };
presetMgr.getPresetTree().treeInserter = &chowdsp::presets::PresetTreeInserters::vendorInserter;

presetMgr.addPresets ({ chowdsp::presets::Preset { "A", "A Vendor", { { "value", 0 } } },
chowdsp::presets::Preset { "B", "B Vendor", { { "value", 1 } } },
chowdsp::presets::Preset { "C", "C Vendor", { { "value", 2 } } } });
presetMgr.addPresets ({
chowdsp::presets::Preset { "A", "A Vendor", { { "value", 0 } } },
chowdsp::presets::Preset { "B", "B Vendor", { { "value", 1 } } },
chowdsp::presets::Preset { "C", "C Vendor", { { "value", 2 } } },
chowdsp::presets::Preset { "D", "", { { "value", 3 } } },
});

chowdsp::presets::frontend::NextPrevious nextPrev { presetMgr };
nextPrev.setShouldWrapAtEndOfList (true);
Expand All @@ -106,9 +109,15 @@ TEST_CASE ("Next/Previous Test", "[plugin][presets]")
REQUIRE (nextPrev.goToNextPreset() == true);
checkPresetIndex (presetMgr, 2);

REQUIRE (nextPrev.goToNextPreset() == true);
checkPresetIndex (presetMgr, 3);

REQUIRE (nextPrev.goToNextPreset() == true);
checkPresetIndex (presetMgr, 0);

REQUIRE (nextPrev.goToPreviousPreset() == true);
checkPresetIndex (presetMgr, 3);

REQUIRE (nextPrev.goToPreviousPreset() == true);
checkPresetIndex (presetMgr, 2);

Expand Down

0 comments on commit 82bf8ee

Please sign in to comment.