diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 862e2b79e61f832311e5ae777538893b0b97b45c..e67d55b0670271cb07b48c8b737161de1dbdde02 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -58,6 +58,7 @@ add_executable (unit_tests test_CRSMatrix.cpp test_DataVariant.cpp test_Demangle.cpp + test_DiscreteFunctionDescriptorP0.cpp test_DiscreteFunctionType.cpp test_DoWhileProcessor.cpp test_EmbeddedData.cpp diff --git a/tests/test_DiscreteFunctionDescriptorP0.cpp b/tests/test_DiscreteFunctionDescriptorP0.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3cc11f7d4ab4cf9ceb5a9e76b32b86f1eb18214a --- /dev/null +++ b/tests/test_DiscreteFunctionDescriptorP0.cpp @@ -0,0 +1,25 @@ +#include <catch2/catch_test_macros.hpp> +#include <catch2/matchers/catch_matchers_all.hpp> + +#include <scheme/DiscreteFunctionDescriptorP0.hpp> + +// clazy:excludeall=non-pod-global-static + +TEST_CASE("DiscreteFunctionDescriptorP0", "[scheme]") +{ + SECTION("type") + { + DiscreteFunctionDescriptorP0 descriptor; + REQUIRE(descriptor.type() == DiscreteFunctionType::P0); + + { + auto copy = [](const DiscreteFunctionDescriptorP0& d) -> DiscreteFunctionDescriptorP0 { return d; }; + + DiscreteFunctionDescriptorP0 descriptor_copy{copy(descriptor)}; + REQUIRE(descriptor_copy.type() == DiscreteFunctionType::P0); + } + + DiscreteFunctionDescriptorP0 descriptor_move{std::move(DiscreteFunctionDescriptorP0{})}; + REQUIRE(descriptor_move.type() == DiscreteFunctionType::P0); + } +}