mirror of
https://github.com/pocoproject/poco.git
synced 2025-04-16 06:56:41 +02:00
fix(CppUnit): TestCase::run(): check if callback is non-empty before calling it
This commit is contained in:
parent
e732c50f96
commit
0930a0db3b
@ -123,7 +123,10 @@ void TestCase::run(TestResult *result, const Test::Callback& callback)
|
|||||||
catch (std::exception& e)
|
catch (std::exception& e)
|
||||||
{
|
{
|
||||||
std::string msg(TestResult::demangle(typeid(e).name()));
|
std::string msg(TestResult::demangle(typeid(e).name()));
|
||||||
msg.append(":\n").append(callback(e));
|
if (callback)
|
||||||
|
{
|
||||||
|
msg.append(": ").append(callback(e));
|
||||||
|
}
|
||||||
result->addError(this, new CppUnitException(msg));
|
result->addError(this, new CppUnitException(msg));
|
||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user