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
548a3c73
Commit
548a3c73
authored
5 years ago
by
Matthew Andrew
Browse files
Options
Downloads
Patches
Plain Diff
Updated IndirectFitOutputTest Re #28057
parent
d6d1dd80
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
qt/scientific_interfaces/Indirect/test/IndirectFitOutputTest.h
+13
-17
13 additions, 17 deletions
...ientific_interfaces/Indirect/test/IndirectFitOutputTest.h
with
13 additions
and
17 deletions
qt/scientific_interfaces/Indirect/test/IndirectFitOutputTest.h
+
13
−
17
View file @
548a3c73
...
...
@@ -8,7 +8,7 @@
#include
<cxxtest/TestSuite.h>
#include
"IndirectFitOutput
Legacy
.h"
#include
"IndirectFitOutput.h"
#include
"MantidAPI/AlgorithmManager.h"
#include
"MantidAPI/FrameworkManager.h"
#include
"MantidAPI/ITableWorkspace.h"
...
...
@@ -54,11 +54,10 @@ MatrixWorkspace_sptr createPopulatedworkspace(int const &numberOfSpectra) {
verticalAxisNames
);
}
IndirectFitData
Legacy
getIndirectFitData
(
int
const
&
numberOfSpectra
)
{
IndirectFitData
getIndirectFitData
(
int
const
&
numberOfSpectra
)
{
auto
const
workspace
=
createWorkspace
(
numberOfSpectra
);
SpectraLegacy
const
spec
=
std
::
make_pair
(
0u
,
workspace
->
getNumberHistograms
()
-
1
);
IndirectFitDataLegacy
data
(
workspace
,
spec
);
Spectra
const
spec
=
Spectra
(
0
,
workspace
->
getNumberHistograms
()
-
1
);
IndirectFitData
data
(
workspace
,
spec
);
return
data
;
}
...
...
@@ -87,12 +86,12 @@ WorkspaceGroup_sptr getPopulatedGroup(std::size_t const &size) {
return
group
;
}
std
::
unique_ptr
<
IndirectFitOutput
Legacy
>
std
::
unique_ptr
<
IndirectFitOutput
>
createFitOutput
(
const
WorkspaceGroup_sptr
&
resultGroup
,
const
ITableWorkspace_sptr
&
parameterTable
,
const
WorkspaceGroup_sptr
&
resultWorkspace
,
IndirectFitDataLegacy
*
fitData
,
std
::
size_t
spectrum
)
{
return
std
::
make_unique
<
IndirectFitOutput
Legacy
>
(
return
std
::
make_unique
<
IndirectFitOutput
>
(
resultGroup
,
parameterTable
,
resultWorkspace
,
fitData
,
spectrum
);
}
...
...
@@ -122,7 +121,7 @@ public:
m_workspacesGroup
=
getPopulatedGroup
(
2
);
m_parameterTable
=
getPopulatedTable
(
2
);
m_fitData
=
std
::
make_unique
<
IndirectFitData
Legacy
>
(
getIndirectFitData
(
5
));
m_fitData
=
std
::
make_unique
<
IndirectFitData
>
(
getIndirectFitData
(
5
));
storeWorkspacesInADS
(
m_resultGroup
,
m_workspacesGroup
,
m_parameterTable
);
}
...
...
@@ -254,8 +253,7 @@ public:
test_that_addOutput_will_add_new_fitData_without_overwriting_existing_data
()
{
auto
const
output
=
createFitOutput
(
m_workspacesGroup
,
m_parameterTable
,
m_resultGroup
,
m_fitData
.
get
(),
0
);
auto
const
data2
=
std
::
make_unique
<
IndirectFitDataLegacy
>
(
getIndirectFitData
(
2
));
auto
const
data2
=
std
::
make_unique
<
IndirectFitData
>
(
getIndirectFitData
(
2
));
output
->
addOutput
(
m_workspacesGroup
,
m_parameterTable
,
m_resultGroup
,
data2
.
get
(),
0
);
...
...
@@ -277,8 +275,7 @@ public:
void
test_that_removeOutput_will_not_delete_fitData_which_is_not_specified
()
{
auto
const
output
=
createFitOutput
(
m_workspacesGroup
,
m_parameterTable
,
m_resultGroup
,
m_fitData
.
get
(),
0
);
auto
const
data2
=
std
::
make_unique
<
IndirectFitDataLegacy
>
(
getIndirectFitData
(
2
));
auto
const
data2
=
std
::
make_unique
<
IndirectFitData
>
(
getIndirectFitData
(
2
));
output
->
addOutput
(
m_workspacesGroup
,
m_parameterTable
,
m_resultGroup
,
data2
.
get
(),
0
);
...
...
@@ -292,8 +289,7 @@ public:
test_that_removeOutput_does_not_throw_when_provided_fitData_which_does_not_exist
()
{
auto
const
output
=
createFitOutput
(
m_workspacesGroup
,
m_parameterTable
,
m_resultGroup
,
m_fitData
.
get
(),
0
);
auto
const
data2
=
std
::
make_unique
<
IndirectFitDataLegacy
>
(
getIndirectFitData
(
2
));
auto
const
data2
=
std
::
make_unique
<
IndirectFitData
>
(
getIndirectFitData
(
2
));
TS_ASSERT_THROWS_NOTHING
(
output
->
removeOutput
(
data2
.
get
()));
}
...
...
@@ -312,12 +308,12 @@ public:
void
test_that_the_resultworkspace_is_renamed_to_have_the_correct_name_after_a_fit_is_executed_with_multiple_data
()
{
(
void
)
getFitOutputData
();
TS_ASSERT
(
m_ads
->
doesExist
(
"MultiConvFit_1L_Workspaces_1__s0
_to_
4_Result"
));
TS_ASSERT
(
m_ads
->
doesExist
(
"MultiConvFit_1L_Workspaces_1__s0
-
4_Result"
));
}
private
:
/// This will return fit output with workspaces still stored in the ADS
std
::
unique_ptr
<
IndirectFitOutput
Legacy
>
getFitOutputData
()
{
std
::
unique_ptr
<
IndirectFitOutput
>
getFitOutputData
()
{
storeWorkspacesInADS
(
m_workspacesGroup
,
m_resultGroup
,
m_parameterTable
);
return
createFitOutput
(
m_workspacesGroup
,
m_parameterTable
,
m_resultGroup
,
m_fitData
.
get
(),
0
);
...
...
@@ -337,6 +333,6 @@ private:
WorkspaceGroup_sptr
m_resultGroup
;
WorkspaceGroup_sptr
m_workspacesGroup
;
ITableWorkspace_sptr
m_parameterTable
;
std
::
unique_ptr
<
IndirectFitData
Legacy
>
m_fitData
;
std
::
unique_ptr
<
IndirectFitData
>
m_fitData
;
std
::
unique_ptr
<
SetUpADSWithWorkspace
>
m_ads
;
};
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