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
01bd9097
Commit
01bd9097
authored
9 years ago
by
Lamar Moore
Browse files
Options
Downloads
Patches
Plain Diff
Re #15360 fix PeakColumn::getReadOnly and added unit test
parent
341b5642
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/DataObjects/src/PeakColumn.cpp
+1
-1
1 addition, 1 deletion
Framework/DataObjects/src/PeakColumn.cpp
Framework/DataObjects/test/PeakColumnTest.h
+10
-0
10 additions, 0 deletions
Framework/DataObjects/test/PeakColumnTest.h
with
11 additions
and
1 deletion
Framework/DataObjects/src/PeakColumn.cpp
+
1
−
1
View file @
01bd9097
...
@@ -206,7 +206,7 @@ void PeakColumn::read(size_t index, const std::string &text) {
...
@@ -206,7 +206,7 @@ void PeakColumn::read(size_t index, const std::string &text) {
//-------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------
/** @return true if the column is read-only */
/** @return true if the column is read-only */
bool
PeakColumn
::
getReadOnly
()
const
{
bool
PeakColumn
::
getReadOnly
()
const
{
return
((
m_name
==
"h"
)
||
(
m_name
==
"k"
)
||
(
m_name
==
"l"
)
||
return
!
((
m_name
==
"h"
)
||
(
m_name
==
"k"
)
||
(
m_name
==
"l"
)
||
(
m_name
==
"RunNumber"
));
(
m_name
==
"RunNumber"
));
}
}
...
...
This diff is collapsed.
Click to expand it.
Framework/DataObjects/test/PeakColumnTest.h
+
10
−
0
View file @
01bd9097
...
@@ -106,6 +106,16 @@ public:
...
@@ -106,6 +106,16 @@ public:
TS_ASSERT_EQUALS
(
qlab1
,
m_peaks
[
1
].
getQLabFrame
());
TS_ASSERT_EQUALS
(
qlab1
,
m_peaks
[
1
].
getQLabFrame
());
}
}
void
test_get_read_only_returns_correct_value
()
{
PeakColumn
pc1
(
m_peaks
,
"h"
);
auto
readOnly
=
pc1
.
getReadOnly
();
TS_ASSERT
(
!
readOnly
);
PeakColumn
pc2
(
m_peaks
,
"DetID"
);
readOnly
=
pc2
.
getReadOnly
();
TS_ASSERT
(
readOnly
);
}
private
:
private
:
Mantid
::
Geometry
::
Instrument_sptr
m_inst
;
Mantid
::
Geometry
::
Instrument_sptr
m_inst
;
std
::
vector
<
Peak
>
m_peaks
;
std
::
vector
<
Peak
>
m_peaks
;
...
...
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