From 278ad9dcbc11b98a206548057268466052f1bec3 Mon Sep 17 00:00:00 2001 From: Paul Walker Date: Mon, 22 Jan 2024 08:33:21 -0500 Subject: [PATCH] Context Menu Builder still referred to draft/ location The context menu still refered to context-menu include with a draft and our test suite didn't exercise it, so the code doens't build against 1.2.0 Fix both the include and add a test --- CMakeLists.txt | 1 + include/clap/helpers/context-menu-builder.hh | 2 +- tests/context-menu-builder-compiles.cc | 24 ++++++++++++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 tests/context-menu-builder-compiles.cc diff --git a/CMakeLists.txt b/CMakeLists.txt index 3f666df..9b190ca 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -55,6 +55,7 @@ if (${CLAP_HELPERS_BUILD_TESTS}) endif() add_executable(${PROJECT_NAME}-tests EXCLUDE_FROM_ALL + tests/context-menu-builder-compiles.cc tests/create-an-actual-host.cc tests/create-an-actual-plugin.cc tests/hex-encoder.cc diff --git a/include/clap/helpers/context-menu-builder.hh b/include/clap/helpers/context-menu-builder.hh index 6b68a7c..e375ab5 100644 --- a/include/clap/helpers/context-menu-builder.hh +++ b/include/clap/helpers/context-menu-builder.hh @@ -1,6 +1,6 @@ #pragma once -#include +#include namespace clap { namespace helpers { diff --git a/tests/context-menu-builder-compiles.cc b/tests/context-menu-builder-compiles.cc new file mode 100644 index 0000000..1f79454 --- /dev/null +++ b/tests/context-menu-builder-compiles.cc @@ -0,0 +1,24 @@ +#include + +#include +#include + +namespace { + + struct TestBuilder : clap::helpers::ContextMenuBuilder { + TestBuilder() {} + bool addItem(clap_context_menu_item_kind_t item_kind, const void *item_data) override + { + return false; + } + bool supports(clap_context_menu_item_kind_t item_kind) const noexcept override + { + return false; + } + }; + + CATCH_TEST_CASE("Context Menu Builder exists") { + CATCH_REQUIRE(std::is_constructible::value); + } + +} // namespace