Skip to content
Snippets Groups Projects
Commit a6f6b05f authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Add CI tests for EmbeddedData

parent a08fb463
No related branches found
No related tags found
1 merge request!37Feature/language
......@@ -53,6 +53,7 @@ add_executable (unit_tests
test_CRSMatrix.cpp
test_DataVariant.cpp
test_DoWhileProcessor.cpp
test_EmbeddedData.cpp
test_ExecutionPolicy.cpp
test_FakeProcessor.cpp
test_ForProcessor.cpp
......
#include <catch2/catch.hpp>
#include <language/utils/DataHandler.hpp>
#include <language/utils/EmbeddedData.hpp>
#include <sstream>
// clazy:excludeall=non-pod-global-static
TEST_CASE("EmbeddedData", "[language]")
{
REQUIRE_NOTHROW(EmbeddedData{});
EmbeddedData e;
{
EmbeddedData f{std::make_shared<DataHandler<double>>(std::make_shared<double>(1.3))};
REQUIRE_NOTHROW(e = std::move(f));
}
REQUIRE(*dynamic_cast<const DataHandler<double>&>(e.get()).data_ptr() == 1.3);
{
EmbeddedData f{std::make_shared<DataHandler<double>>(std::make_shared<double>(2.3))};
REQUIRE_NOTHROW(e = f);
}
REQUIRE(*dynamic_cast<const DataHandler<double>&>(e.get()).data_ptr() == 2.3);
std::ostringstream fout;
fout << e;
REQUIRE(fout.str() == "embedded_data");
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment