-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add instanciation test for clap::helpers::Host
- Loading branch information
Showing
2 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <type_traits> | ||
|
||
#include <catch2/catch_all.hpp> | ||
|
||
struct test_host : clap::helpers::Host<clap::helpers::MisbehaviourHandler::Terminate, | ||
clap::helpers::CheckingLevel::Maximal> | ||
{ | ||
test_host() : clap::helpers::Host<clap::helpers::MisbehaviourHandler::Terminate, | ||
clap::helpers::CheckingLevel::Maximal>( | ||
"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<test_host>::value); | ||
} | ||
} |