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