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

Add tests for Exceptions

parent 420a6bae
No related branches found
No related tags found
1 merge request!63Feature/utils coverage
...@@ -61,6 +61,7 @@ add_executable (unit_tests ...@@ -61,6 +61,7 @@ add_executable (unit_tests
test_DoWhileProcessor.cpp test_DoWhileProcessor.cpp
test_EmbeddedData.cpp test_EmbeddedData.cpp
test_EscapedString.cpp test_EscapedString.cpp
test_Exceptions.cpp
test_ExecutionPolicy.cpp test_ExecutionPolicy.cpp
test_FakeProcessor.cpp test_FakeProcessor.cpp
test_ForProcessor.cpp test_ForProcessor.cpp
......
#ifndef TEST_EXCEPTIONS_HPP
#define TEST_EXCEPTIONS_HPP
#include <catch2/catch.hpp>
#include <utils/Exceptions.hpp>
// clazy:excludeall=non-pod-global-static
TEST_CASE("Exceptions", "[utils]")
{
SECTION("exceptions message")
{
RawError raw_error{"a raw error"};
REQUIRE(std::string{raw_error.what()} == "a raw error");
UnexpectedError unexpected_error{"an unexpected error"};
REQUIRE(std::string{unexpected_error.what()} == "unexpected error: an unexpected error");
NotImplementedError not_implemented_error{"not implemented error"};
REQUIRE(std::string{not_implemented_error.what()} == "not implemented yet: not implemented error");
}
}
#endif // TEST_EXCEPTIONS_HPP
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment