diff --git a/.gitignore b/.gitignore index acf32bf..4ee5684 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -# Prerequisites +# Prerequisites *.d # Compiled Object files @@ -31,9 +31,10 @@ *.out *.app -#vs +# Visual Studio .vs out +.vscode #clion .idea diff --git a/CMakeLists.txt b/CMakeLists.txt index a0aee8d..671b2e3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,8 +53,10 @@ if (${CLAP_HELPERS_BUILD_TESTS}) endif() add_executable(${PROJECT_NAME}-tests EXCLUDE_FROM_ALL + tests/create-an-actual-host.cc tests/create-an-actual-plugin.cc tests/hex-encoder.cc + tests/host.cc tests/plugin.cc tests/param-queue-tests.cc tests/event-list-tests.cc diff --git a/include/clap/helpers/preset-discovery-metadata-receiver.hh b/include/clap/helpers/preset-discovery-metadata-receiver.hh index 73d337f..9fe3b80 100644 --- a/include/clap/helpers/preset-discovery-metadata-receiver.hh +++ b/include/clap/helpers/preset-discovery-metadata-receiver.hh @@ -36,7 +36,7 @@ namespace clap { namespace helpers { virtual bool beginPreset(const char *name, const char *load_key) noexcept { return false; } - virtual void addPluginId(const clap_plugin_id_t *plugin_id) noexcept {} + virtual void addPluginId(const clap_universal_plugin_id *plugin_id) noexcept {} virtual void setCollectionId(const char *collection_id) noexcept {} @@ -46,8 +46,8 @@ namespace clap { namespace helpers { virtual void setDescription(const char *description) noexcept {} - virtual void setTimestamps(clap_timestamp_t creation_time, - clap_timestamp_t modification_time) noexcept {} + virtual void setTimestamps(clap_timestamp creation_time, + clap_timestamp modification_time) noexcept {} virtual void addFeature(const char *feature) noexcept {} @@ -77,7 +77,7 @@ namespace clap { namespace helpers { static void receiverAddPluginId(const struct clap_preset_discovery_metadata_receiver *receiver, - const clap_plugin_id_t *plugin_id) noexcept; + const clap_universal_plugin_id *plugin_id) noexcept; static void receiverSetCollectionId(const struct clap_preset_discovery_metadata_receiver *receiver, @@ -95,8 +95,8 @@ namespace clap { namespace helpers { static void receiverSetTimestamps(const struct clap_preset_discovery_metadata_receiver *receiver, - clap_timestamp_t creation_time, - clap_timestamp_t modification_time) noexcept; + clap_timestamp creation_time, + clap_timestamp modification_time) noexcept; static void receiverAddFeature(const struct clap_preset_discovery_metadata_receiver *receiver, const char *feature) noexcept; diff --git a/include/clap/helpers/preset-discovery-metadata-receiver.hxx b/include/clap/helpers/preset-discovery-metadata-receiver.hxx index a9a96a3..4efca70 100644 --- a/include/clap/helpers/preset-discovery-metadata-receiver.hxx +++ b/include/clap/helpers/preset-discovery-metadata-receiver.hxx @@ -49,7 +49,7 @@ namespace clap { namespace helpers { template void PresetDiscoveryMetadataReceiver::receiverAddPluginId( const struct clap_preset_discovery_metadata_receiver *receiver, - const clap_plugin_id_t *plugin_id) noexcept { + const clap_universal_plugin_id *plugin_id) noexcept { auto &self = from(receiver); return self.addPluginId(plugin_id); } @@ -88,8 +88,8 @@ namespace clap { namespace helpers { template void PresetDiscoveryMetadataReceiver::receiverSetTimestamps( const struct clap_preset_discovery_metadata_receiver *receiver, - clap_timestamp_t creation_time, - clap_timestamp_t modification_time) noexcept { + clap_timestamp creation_time, + clap_timestamp modification_time) noexcept { auto &self = from(receiver); return self.setTimestamps(creation_time, modification_time); } diff --git a/tests/create-an-actual-host.cc b/tests/create-an-actual-host.cc new file mode 100644 index 0000000..c11196e --- /dev/null +++ b/tests/create-an-actual-host.cc @@ -0,0 +1,36 @@ +/* + * Actually use host.hh / host.hxx to create a host. Assert that it is constructable + */ + +#include "clap/helpers/host.hh" +#include "clap/helpers/host.hxx" + +#include + +#include + +struct test_host : clap::helpers::Host +{ + test_host() : clap::helpers::Host( + "Test Case Host", + "Free Audio", + "http://cleveraudio.org", + "1.0.0") {} + + bool threadCheckIsMainThread() const noexcept override { return true; }; + bool threadCheckIsAudioThread() const noexcept override { return false; }; + + void requestRestart() noexcept override {}; + void requestProcess() noexcept override {}; + void requestCallback() noexcept override {}; +}; + +CATCH_TEST_CASE("Create an Actual Host") +{ + CATCH_SECTION("Test Host is Creatable") + { + CATCH_REQUIRE(std::is_constructible::value); + } +} diff --git a/tests/host.cc b/tests/host.cc new file mode 100644 index 0000000..33f80d7 --- /dev/null +++ b/tests/host.cc @@ -0,0 +1,34 @@ +#include +#include +#include + +#include + +template class clap::helpers::Host; +template class clap::helpers::Host; +template class clap::helpers::Host; +template class clap::helpers::Host; + +template class clap::helpers::PluginProxy; +template class clap::helpers::PluginProxy; +template class clap::helpers::PluginProxy; +template class clap::helpers::PluginProxy; + +CATCH_TEST_CASE("Host - Link") { + clap::helpers::Host *h0 = nullptr; + clap::helpers::Host *h1 = nullptr; + clap::helpers::Host *h2 = nullptr; + clap::helpers::Host *h3 = nullptr; +}