diff --git a/libNeonDomain/tests/unit/domain-unit-test-map/src/TestInformation.h b/libNeonDomain/tests/unit/domain-unit-test-map/src/TestInformation.h index cb96dc7d..3ac50ecd 100644 --- a/libNeonDomain/tests/unit/domain-unit-test-map/src/TestInformation.h +++ b/libNeonDomain/tests/unit/domain-unit-test-map/src/TestInformation.h @@ -2,12 +2,14 @@ namespace { struct TestInformation { - static auto prefix() -> std::string + static auto prefix() + -> std::string { return "domain-unit-test-map"; } static auto fullName(const std::string& gridName) + -> std::string { return prefix() + "-" + gridName; } diff --git a/libNeonDomain/tests/unit/domain-unit-test-staggered-grid/src/TestInformation.h b/libNeonDomain/tests/unit/domain-unit-test-staggered-grid/src/TestInformation.h new file mode 100644 index 00000000..46051bc4 --- /dev/null +++ b/libNeonDomain/tests/unit/domain-unit-test-staggered-grid/src/TestInformation.h @@ -0,0 +1,18 @@ +#pragma once +namespace { +struct TestInformation +{ + static auto prefix() + -> std::string + { + return "domain-unit-test-staggered-grid"; + } + + static auto fullName(const std::string& gridName, + const std::string& subTestName) + -> std::string + { + return prefix() + "-" +subTestName+"-"+ gridName; + } +}; +} // namespace \ No newline at end of file diff --git a/libNeonDomain/tests/unit/domain-unit-test-staggered-grid/src/staggeredGrid.cpp b/libNeonDomain/tests/unit/domain-unit-test-staggered-grid/src/staggeredGrid.cpp index bb7071d0..eac6e1e1 100644 --- a/libNeonDomain/tests/unit/domain-unit-test-staggered-grid/src/staggeredGrid.cpp +++ b/libNeonDomain/tests/unit/domain-unit-test-staggered-grid/src/staggeredGrid.cpp @@ -7,12 +7,11 @@ #include "containers.h" #include "Neon/domain/StaggeredGrid.h" +#include "TestInformation.h" #define EXECUTE_IO_TO_VTK 0 using namespace Neon::domain::tool::testing; -static const std::string testFilePrefix("domain-unit-test-staggered-grid"); - template void StaggeredGrid_Map(TestData& data) @@ -51,7 +50,8 @@ void StaggeredGrid_Map(TestData& data) temperature.updateCompute(Neon::Backend::mainStreamIdx); density.updateCompute(Neon::Backend::mainStreamIdx); - const std::string appName(testFilePrefix + "_Map_" + data.getGrid().getImplementationName()); + const std::string appName = TestInformation::fullName("_map_", data.getGrid().getImplementationName()); + if constexpr (EXECUTE_IO_TO_VTK == 1) { temperature.ioToVtk(appName + "-temperature_asVoxels", "temperature", false, Neon::IoFileType::ASCII, false); density.ioToVtk(appName + "-density_0000", "density");