Skip to content

Commit

Permalink
update ErrorReporterTest
Browse files Browse the repository at this point in the history
  • Loading branch information
jhaigh0 committed Jan 14, 2025
1 parent 1da02fa commit e3ba601
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions Framework/Kernel/test/ErrorReporterTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class ErrorReporterTest : public CxxTest::TestSuite {
const std::string appName = "My testing application name";
const Mantid::Types::Core::time_duration upTime(5, 0, 7, 0);
const std::string stackTrace = "File \" C :\\file\\path\\file.py\", line 194, in broken_function";
TestableErrorReporter reporter(appName, upTime, "0", true, "name", "email", "textBox", stackTrace);
TestableErrorReporter reporter(appName, upTime, "0", true, "name", "email", "textBox", stackTrace, "");
const std::string message = reporter.generateErrorMessage();

::Json::Value root;
Expand Down Expand Up @@ -102,7 +102,7 @@ class ErrorReporterTest : public CxxTest::TestSuite {
void test_errorMessageWithShareAndRecoveryFileHash() {
const std::string name = "My testing application name";
const Mantid::Types::Core::time_duration upTime(5, 0, 7, 0);
TestableErrorReporter errorService(name, upTime, "0", true, "name", "email", "textBox", "stacktrace");
TestableErrorReporter errorService(name, upTime, "0", true, "name", "email", "textBox", "stacktrace", "cppTraces");
const std::string message = errorService.generateErrorMessage();

::Json::Value root;
Expand All @@ -111,7 +111,7 @@ class ErrorReporterTest : public CxxTest::TestSuite {
const std::vector<std::string> expectedMembers{
"ParaView", "application", "host", "mantidSha1", "mantidVersion", "osArch",
"osName", "osReadable", "osVersion", "uid", "facility", "upTime",
"exitCode", "textBox", "name", "email", "stacktrace"};
"exitCode", "textBox", "name", "email", "stacktrace", "cppCompressedTraces"};
for (auto expectedMember : expectedMembers) {
TSM_ASSERT(expectedMember + " not found",
std::find(members.begin(), members.end(), expectedMember) != members.end());
Expand All @@ -124,12 +124,13 @@ class ErrorReporterTest : public CxxTest::TestSuite {
TS_ASSERT_EQUALS(root["email"].asString(), "email");
TS_ASSERT_EQUALS(root["textBox"].asString(), "textBox");
TS_ASSERT_EQUALS(root["stacktrace"].asString(), "stacktrace");
TS_ASSERT_EQUALS(root["cppCompressedTraces"].asString(), "cppTraces");
}

void test_errorMessageWithNoShareAndRecoveryFileHash() {
const std::string name = "My testing application name";
const Mantid::Types::Core::time_duration upTime(5, 0, 7, 0);
TestableErrorReporter errorService(name, upTime, "0", false, "name", "email", "textBox", "stacktrace");
TestableErrorReporter errorService(name, upTime, "0", false, "name", "email", "textBox", "stacktrace", "cppTraces");
const std::string message = errorService.generateErrorMessage();

::Json::Value root;
Expand All @@ -138,7 +139,8 @@ class ErrorReporterTest : public CxxTest::TestSuite {
const std::vector<std::string> expectedMembers{
"ParaView", "application", "host", "mantidSha1", "mantidVersion", "osArch",
"osName", "osReadable", "osVersion", "uid", "facility", "upTime",
"exitCode", "textBox", "name", "email", "stacktrace"};
"exitCode", "textBox", "name", "email", "stacktrace", "upTime",
"exitCode", "textBox", "name", "email", "stacktrace", "cppCompressedTraces"};
for (auto expectedMember : expectedMembers) {
TSM_ASSERT(expectedMember + " not found",
std::find(members.begin(), members.end(), expectedMember) != members.end());
Expand All @@ -151,5 +153,6 @@ class ErrorReporterTest : public CxxTest::TestSuite {
TS_ASSERT_EQUALS(root["email"].asString(), "");
TS_ASSERT_EQUALS(root["textBox"].asString(), "textBox");
TS_ASSERT_EQUALS(root["stacktrace"].asString(), "");
TS_ASSERT_EQUALS(root["cppCompressedTraces"].asString(), "");
}
};

0 comments on commit e3ba601

Please sign in to comment.