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

Added PastisAssert unit tests

parent 7fdfe720
No related branches found
No related tags found
No related merge requests found
...@@ -3,6 +3,7 @@ include_directories("${CATCH_INCLUDE_PATH}") ...@@ -3,6 +3,7 @@ include_directories("${CATCH_INCLUDE_PATH}")
set(EXECUTABLE_OUTPUT_PATH ${PASTIS_BINARY_DIR}) set(EXECUTABLE_OUTPUT_PATH ${PASTIS_BINARY_DIR})
add_executable (unit_tests add_executable (unit_tests
test_main.cpp test_main.cpp
test_PastisAssert.cpp
test_RevisionInfo.cpp test_RevisionInfo.cpp
test_TinyMatrix.cpp test_TinyMatrix.cpp
test_TinyVector.cpp) test_TinyVector.cpp)
......
#include <catch.hpp>
#include <PastisAssert.hpp>
#include <string>
TEST_CASE("PastisAssert", "[assert]") {
SECTION("checking for assert error") {
const std::string filename = "filename";
const int line = 10;
const std::string function = "function";
const std::string message = "message";
AssertError assert_error(filename, line, function, message);
REQUIRE(Catch::Detail::stringify(assert_error) == "\n*** Assertion error ***\n at filename:10\n in function\n*** message\n");
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment