Skip to content
Snippets Groups Projects
Commit 0ad91266 authored by Matthew Andrew's avatar Matthew Andrew
Browse files

Added consts Re #23395

parent 3cc22c37
No related branches found
No related tags found
No related merge requests found
......@@ -30,25 +30,25 @@ Logger g_log("ErrorReporter");
// Constructor for ErrorReporter
/** Constructor
*/
ErrorReporter::ErrorReporter(std::string application,
Types::Core::time_duration upTime,
std::string exitCode, bool share)
ErrorReporter::ErrorReporter(const std::string application,
const Types::Core::time_duration upTime,
const std::string exitCode, const bool share)
: ErrorReporter(application, upTime, exitCode, share, "", "", "", "") {}
/** Constructor
*/
ErrorReporter::ErrorReporter(std::string application,
Types::Core::time_duration upTime,
std::string exitCode, bool share, std::string name,
std::string email, std::string textBox)
ErrorReporter::ErrorReporter(const std::string application,
const Types::Core::time_duration upTime,
const std::string exitCode, const bool share, const std::string name,
const std::string email, const std::string textBox)
: ErrorReporter(application, upTime, exitCode, share, name, email, textBox,
"") {}
ErrorReporter::ErrorReporter(std::string application,
Types::Core::time_duration upTime,
std::string exitCode, bool share, std::string name,
std::string email, std::string textBox,
std::string recoveryFile)
ErrorReporter::ErrorReporter(const std::string application,
const Types::Core::time_duration upTime,
const std::string exitCode, const bool share, const std::string name,
const std::string email, const std::string textBox,
const std::string recoveryFile)
: m_application(application), m_exitCode(exitCode), m_upTime(upTime),
m_share(share), m_name(name), m_email(email), m_textbox(textBox),
m_recoveryFile(recoveryFile) {
......
......@@ -42,16 +42,16 @@ public:
static void destroySuite(ErrorReporterTest *suite) { delete suite; }
void test_errorMessage() {
std::string name = "My testing application name";
Mantid::Types::Core::time_duration upTime(5, 0, 7, 0);
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);
std::string message = errorService.generateErrorMessage();
const std::string message = errorService.generateErrorMessage();
::Json::Reader reader;
::Json::Value root;
reader.parse(message, root);
auto members = root.getMemberNames();
std::vector<std::string> expectedMembers{
const std::vector<std::string> expectedMembers{
"ParaView", "application", "host", "mantidSha1", "mantidVersion",
"osArch", "osName", "osReadable", "osVersion", "uid",
"facility", "upTime", "exitCode"};
......@@ -67,17 +67,17 @@ public:
}
void test_errorMessageWithShare() {
std::string name = "My testing application name";
Mantid::Types::Core::time_duration upTime(5, 0, 7, 0);
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");
std::string message = errorService.generateErrorMessage();
const std::string message = errorService.generateErrorMessage();
::Json::Reader reader;
::Json::Value root;
reader.parse(message, root);
auto members = root.getMemberNames();
std::vector<std::string> expectedMembers{
const std::vector<std::string> expectedMembers{
"ParaView", "application", "host", "mantidSha1",
"mantidVersion", "osArch", "osName", "osReadable",
"osVersion", "uid", "facility", "upTime",
......@@ -97,17 +97,17 @@ public:
}
void test_errorMessageWithShareAndRecoveryFileHash() {
std::string name = "My testing application name";
Mantid::Types::Core::time_duration upTime(5, 0, 7, 0);
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", "fileHash");
std::string message = errorService.generateErrorMessage();
const std::string message = errorService.generateErrorMessage();
::Json::Reader reader;
::Json::Value root;
reader.parse(message, root);
auto members = root.getMemberNames();
std::vector<std::string> expectedMembers{
const std::vector<std::string> expectedMembers{
"ParaView", "application", "host", "mantidSha1", "mantidVersion",
"osArch", "osName", "osReadable", "osVersion", "uid",
"facility", "upTime", "exitCode", "textBox", "name",
......@@ -128,17 +128,17 @@ public:
}
void test_errorMessageWithNoShareAndRecoveryFileHash() {
std::string name = "My testing application name";
Mantid::Types::Core::time_duration upTime(5, 0, 7, 0);
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", "fileHash");
std::string message = errorService.generateErrorMessage();
const std::string message = errorService.generateErrorMessage();
::Json::Reader reader;
::Json::Value root;
reader.parse(message, root);
auto members = root.getMemberNames();
std::vector<std::string> expectedMembers{
const std::vector<std::string> expectedMembers{
"ParaView", "application", "host", "mantidSha1", "mantidVersion",
"osArch", "osName", "osReadable", "osVersion", "uid",
"facility", "upTime", "exitCode", "textBox", "name",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment