unittest multi-line messages

This commit is contained in:
Michael Davidsaver
2019-11-27 10:21:37 -08:00
parent dd4da5d6d5
commit ceedd6bacc
+13 -6
View File
@@ -47,12 +47,19 @@ testCase& testCase::operator=(testCase&& o) noexcept
testCase::~testCase()
{
if(result==Nothing) {
// do nothing!
} else if(result==Diag) {
testDiag("%s", msg.str().c_str());
} else {
testOk(result==Pass, "%s", msg.str().c_str());
if(result==Nothing)
return;
std::istringstream strm(msg.str());
for(std::string line; std::getline(strm, line);) {
if(result==Diag) {
testDiag("%s", line.c_str());
} else {
testOk(result==Pass, "%s", line.c_str());
result=Diag;
}
}
}