Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mantid
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mantidproject
mantid
Commits
0ad91266
Commit
0ad91266
authored
6 years ago
by
Matthew Andrew
Browse files
Options
Downloads
Patches
Plain Diff
Added consts Re #23395
parent
3cc22c37
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Framework/Kernel/src/ErrorReporter.cpp
+12
-12
12 additions, 12 deletions
Framework/Kernel/src/ErrorReporter.cpp
Framework/Kernel/test/ErrorReporterTest.h
+16
-16
16 additions, 16 deletions
Framework/Kernel/test/ErrorReporterTest.h
with
28 additions
and
28 deletions
Framework/Kernel/src/ErrorReporter.cpp
+
12
−
12
View file @
0ad91266
...
...
@@ -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
)
{
...
...
This diff is collapsed.
Click to expand it.
Framework/Kernel/test/ErrorReporterTest.h
+
16
−
16
View file @
0ad91266
...
...
@@ -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"
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment