test: add Boundary test case

This commit is contained in:
Max Lübke 2023-09-14 12:11:37 +02:00
parent 8af03777b8
commit 3106c2b8d5
2 changed files with 3 additions and 3 deletions

View File

@ -11,11 +11,11 @@ if(NOT DOCTEST_LIB)
FetchContent_MakeAvailable(DocTest) FetchContent_MakeAvailable(DocTest)
endif() endif()
add_executable(testTug setup.cpp testSimulation.cpp testGrid.cpp testFTCS.cpp) add_executable(testTug setup.cpp testSimulation.cpp testGrid.cpp testFTCS.cpp testBoundary.cpp)
target_link_libraries(testTug doctest tug) target_link_libraries(testTug doctest tug)
# get relative path of the CSV file # get relative path of the CSV file
get_filename_component(testSimulationCSV "FTCS_11_11_7000.csv" REALPATH CACHE) get_filename_component(testSimulationCSV "FTCS_11_11_7000.csv" REALPATH)
# set relative path in header file # set relative path in header file
configure_file(testSimulation.hpp.in testSimulation.hpp) configure_file(testSimulation.hpp.in testSimulation.hpp)
# include test directory with generated header file from above # include test directory with generated header file from above

View File

@ -13,7 +13,7 @@ TEST_CASE("BoundaryElement") {
BoundaryElement boundaryElementClosed = BoundaryElement(); BoundaryElement boundaryElementClosed = BoundaryElement();
CHECK_NOTHROW(BoundaryElement()); CHECK_NOTHROW(BoundaryElement());
CHECK_EQ(boundaryElementClosed.getType(), BC_TYPE_CLOSED); CHECK_EQ(boundaryElementClosed.getType(), BC_TYPE_CLOSED);
CHECK_EQ(isnan(boundaryElementClosed.getValue()), isnan(NAN)); CHECK_EQ(boundaryElementClosed.getValue(), -1);
CHECK_THROWS(boundaryElementClosed.setValue(0.2)); CHECK_THROWS(boundaryElementClosed.setValue(0.2));
} }