Skip to content
Snippets Groups Projects

Set AssertError to inherit from std::runtime_error

Merged Stéphane Del Pino requested to merge feature/unit-tests into develop
1 file
+ 8
3
Compare changes
  • Side-by-side
  • Inline
+ 8
3
@@ -9,7 +9,7 @@
#include <string>
#include <tuple>
class AssertError
class AssertError : public std::runtime_error
{
private:
const std::string m_file;
@@ -41,7 +41,8 @@ class AssertError
const std::string& function,
const std::tuple<Args...>& tuple_args,
const std::string_view args_string)
: m_file{filename},
: std::runtime_error(""),
m_file{filename},
m_line{line},
m_function{function},
m_test{[&] {
@@ -64,7 +65,11 @@ class AssertError
}
}()}
{
;
if (m_message.empty()) {
std::runtime_error::operator=(std::runtime_error(m_test.c_str()));
} else {
std::runtime_error::operator=(std::runtime_error(m_message.c_str()));
}
}
};
Loading