Skip to content

Commit

Permalink
Add tests for CLAP preset discovery
Browse files Browse the repository at this point in the history
  • Loading branch information
jatinchowdhury18 committed Sep 5, 2024
1 parent b60ec36 commit 5ff3c7e
Show file tree
Hide file tree
Showing 8 changed files with 380 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#pragma once

// LCOV_EXCL_START

namespace chowdsp::ParamUtils
{
/** Mixin for parameters that recognize some form of modulation. */
Expand All @@ -18,3 +20,5 @@ struct ModParameterMixin : public clap_juce_extensions::clap_juce_parameter_capa
}
};
} // namespace chowdsp::ParamUtils

// LCOV_EXCL_END
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#pragma once

// LCOV_EXCL_START

namespace chowdsp::CLAPExtensions
{
/** Interface for clap_juce_extensions::clap_properties */
Expand All @@ -18,3 +20,5 @@ struct CLAPInfoExtensions : public clap_juce_extensions::clap_properties
}
};
} // namespace chowdsp::CLAPExtensions

// LCOV_EXCL_END
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ EmbeddedPresetsProvider::EmbeddedPresetsProvider (const clap_universal_plugin_id
jassert (discoveryLocation.location == nullptr);
}

std::vector<Preset> EmbeddedPresetsProvider::getPresets() { return {}; }
std::vector<Preset> EmbeddedPresetsProvider::getPresets() { return {}; } // LCOV_EXCL_LINE

bool EmbeddedPresetsProvider::init() noexcept
{
Expand Down

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions tests/plugin_tests/chowdsp_presets_v2_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,7 @@ target_sources(chowdsp_presets_v2_test
MenuInterfaceTest.cpp
FileInterfaceTest.cpp

CLAPPresetsDiscoveryTest.cpp

TestPresetBinaryData.cpp
)
2 changes: 1 addition & 1 deletion tests/plugin_tests/chowdsp_presets_v2_test/PresetTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ TEST_CASE ("Preset Test", "[plugin][presets]")

REQUIRE_MESSAGE (testPreset.getName() == "Name", "BinaryData preset name is incorrect!");
REQUIRE_MESSAGE (testPreset.getVendor() == "Vendor", "BinaryData preset vendor is incorrect!");
REQUIRE_MESSAGE (testPreset.getCategory() == "", "Preset category incorrect!");
REQUIRE_MESSAGE (testPreset.getCategory() == "DRUM", "Preset category incorrect!");
REQUIRE_MESSAGE (testPreset.getState()["tag"] == 0.0f, "Preset state incorrect!");
REQUIRE_MESSAGE (testPreset.getVersion().getVersionString() == JucePlugin_VersionString, "Preset version incorrect!");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace BinaryData
//================== test_preset.preset ==================
static const unsigned char temp_binary_data_0[] =
"{\n"
" \"category\": \"\",\n"
" \"category\": \"DRUM\",\n"
" \"extra_info\": null,\n"
" \"name\": \"Name\",\n"
" \"plugin\": \"TestPlugin\",\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
namespace BinaryData
{
extern const char* test_preset_preset;
const int test_preset_presetSize = 246;
const int test_preset_presetSize = 250;

// Number of elements in the namedResourceList and originalFileNames arrays.
const int namedResourceListSize = 1;
Expand Down

0 comments on commit 5ff3c7e

Please sign in to comment.