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
0ee92d6f
Commit
0ee92d6f
authored
6 years ago
by
Robert Applin
Browse files
Options
Downloads
Patches
Plain Diff
Refs #24148. Review changes
parent
4d295004
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
qt/scientific_interfaces/Indirect/test/IndirectFitDataPresenterTest.h
+11
-13
11 additions, 13 deletions
...c_interfaces/Indirect/test/IndirectFitDataPresenterTest.h
with
11 additions
and
13 deletions
qt/scientific_interfaces/Indirect/test/IndirectFitDataPresenterTest.h
+
11
−
13
View file @
0ee92d6f
...
@@ -125,7 +125,7 @@ public:
...
@@ -125,7 +125,7 @@ public:
void
setUp
()
override
{
void
setUp
()
override
{
m_view
=
std
::
make_unique
<
NiceMock
<
MockIIndirectFitDataView
>>
();
m_view
=
std
::
make_unique
<
NiceMock
<
MockIIndirectFitDataView
>>
();
m_model
=
std
::
make_unique
<
NiceMock
<
MockIndirectFitDataModel
>>
();
m_model
=
std
::
make_unique
<
NiceMock
<
MockIndirectFitDataModel
>>
();
createEmptyTableWidget
(
5
,
5
);
m_table
=
createEmptyTableWidget
(
5
,
5
);
m_dataTablePresenter
=
std
::
make_unique
<
IndirectDataTablePresenter
>
(
m_dataTablePresenter
=
std
::
make_unique
<
IndirectDataTablePresenter
>
(
std
::
move
(
m_model
.
get
()),
std
::
move
(
m_table
.
get
()));
std
::
move
(
m_model
.
get
()),
std
::
move
(
m_table
.
get
()));
...
@@ -235,32 +235,29 @@ public:
...
@@ -235,32 +235,29 @@ public:
void
void
test_that_setStartX_will_alter_the_relevant_startX_column_in_the_data_table
()
{
test_that_setStartX_will_alter_the_relevant_startX_column_in_the_data_table
()
{
int
const
startXColumn
(
2
);
TableItem
const
startX
(
2.3
);
TableItem
const
startX
(
2.3
);
m_presenter
->
setStartX
(
startX
.
asDouble
(),
0
,
0
);
m_presenter
->
setStartX
(
startX
.
asDouble
(),
0
,
0
);
assertValueIsGlobal
(
startXColumn
,
startX
);
assertValueIsGlobal
(
START_X_COLUMN
,
startX
);
}
}
void
void
test_that_setEndX_will_alter_the_relevant_endX_column_in_the_data_table
()
{
test_that_setEndX_will_alter_the_relevant_endX_column_in_the_data_table
()
{
int
const
endXColumn
(
3
);
TableItem
const
endX
(
5.5
);
TableItem
const
endX
(
5.5
);
m_presenter
->
setEndX
(
endX
.
asDouble
(),
0
,
0
);
m_presenter
->
setEndX
(
endX
.
asDouble
(),
0
,
0
);
assertValueIsGlobal
(
endXColumn
,
endX
);
assertValueIsGlobal
(
END_X_COLUMN
,
endX
);
}
}
void
void
test_that_the_setExcludeRegion_slot_will_alter_the_relevant_excludeRegion_column_in_the_table
()
{
test_that_the_setExcludeRegion_slot_will_alter_the_relevant_excludeRegion_column_in_the_table
()
{
int
const
excludeRegionColumn
(
4
);
TableItem
const
excludeRegion
(
"2-3"
);
TableItem
const
excludeRegion
(
"2-3"
);
m_presenter
->
setExclude
(
excludeRegion
.
asString
(),
0
,
0
);
m_presenter
->
setExclude
(
excludeRegion
.
asString
(),
0
,
0
);
assertValueIsGlobal
(
excludeRegionColumn
,
excludeRegion
);
assertValueIsGlobal
(
EXCLUDE_REGION_COLUMN
,
excludeRegion
);
}
}
void
test_that_loadSettings_will_read_the_settings_from_the_view
()
{
void
test_that_loadSettings_will_read_the_settings_from_the_view
()
{
...
@@ -274,12 +271,13 @@ public:
...
@@ -274,12 +271,13 @@ public:
private
:
private
:
/// Used in setup
/// Used in setup
void
createEmptyTableWidget
(
int
rows
,
int
columns
)
{
std
::
unique_ptr
<
QTableWidget
>
createEmptyTableWidget
(
int
columns
,
int
rows
)
{
m_table
=
std
::
make_unique
<
QTableWidget
>
(
rows
,
columns
);
auto
table
=
std
::
make_unique
<
QTableWidget
>
(
columns
,
rows
);
for
(
auto
column
=
0
;
column
<
rows
;
++
column
)
for
(
auto
column
=
0
;
column
<
columns
;
++
column
)
for
(
auto
row
=
0
;
row
<
columns
;
++
row
)
for
(
auto
row
=
0
;
row
<
rows
;
++
row
)
m_table
->
setItem
(
row
,
column
,
new
QTableWidgetItem
(
"item"
));
table
->
setItem
(
row
,
column
,
new
QTableWidgetItem
(
"item"
));
}
return
table
;
}
void
deleteSetup
()
{
void
deleteSetup
()
{
m_presenter
.
reset
();
m_presenter
.
reset
();
...
...
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