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
d6d1dd80
Commit
d6d1dd80
authored
5 years ago
by
Matthew Andrew
Browse files
Options
Downloads
Patches
Plain Diff
Updated IndirectFitDataTest Re #28057
parent
488cb3c2
No related branches found
Branches containing commit
Tags
SAMMY-8.2-beta2
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
qt/scientific_interfaces/Indirect/IndexTypes.h
+2
-0
2 additions, 0 deletions
qt/scientific_interfaces/Indirect/IndexTypes.h
qt/scientific_interfaces/Indirect/test/IndirectFitDataTest.h
+10
-9
10 additions, 9 deletions
qt/scientific_interfaces/Indirect/test/IndirectFitDataTest.h
with
12 additions
and
9 deletions
qt/scientific_interfaces/Indirect/IndexTypes.h
+
2
−
0
View file @
d6d1dd80
...
...
@@ -25,6 +25,8 @@ namespace IDA {
template
<
int
Class
>
struct
IndexType
{
using
IntImplementationType
=
int
;
IntImplementationType
value
=
0
;
IndexType
()
noexcept
:
value
(
0
)
{}
IndexType
(
IntImplementationType
data
)
noexcept
:
value
(
data
)
{}
IndexType
operator
+
(
IndexType
index
)
const
{
return
IndexType
{
value
+
index
.
value
};
}
...
...
This diff is collapsed.
Click to expand it.
qt/scientific_interfaces/Indirect/test/IndirectFitDataTest.h
+
10
−
9
View file @
d6d1dd80
...
...
@@ -64,7 +64,10 @@ public:
Spectra
const
spectra
=
Spectra
(
"0-5,8,10"
);
std
::
string
const
spectraString
=
"0-5,8,10"
;
std
::
vector
<
IDA
::
WorkspaceIndex
>
const
spectraVec
{
0
,
1
,
2
,
3
,
4
,
5
,
8
,
10
};
std
::
vector
<
IDA
::
WorkspaceIndex
>
const
spectraVec
{
IDA
::
WorkspaceIndex
(
0
),
IDA
::
WorkspaceIndex
(
1
),
IDA
::
WorkspaceIndex
(
2
),
IDA
::
WorkspaceIndex
(
3
),
IDA
::
WorkspaceIndex
(
4
),
IDA
::
WorkspaceIndex
(
5
),
IDA
::
WorkspaceIndex
(
8
),
IDA
::
WorkspaceIndex
(
10
)};
TS_ASSERT_EQUALS
(
spectra
.
getString
(),
spectraString
);
for
(
auto
it
=
spectra
.
begin
();
it
<
spectra
.
end
();
++
it
)
...
...
@@ -160,9 +163,7 @@ public:
void
test_that_true_is_returned_from_zeroSpectra_if_data_contains_empty_workspace
()
{
auto
workspace
=
std
::
make_shared
<
Workspace2D
>
();
Spectra
const
spec
=
Spectra
(
MantidQt
::
CustomInterfaces
::
IDA
::
WorkspaceIndex
{
0
},
MantidQt
::
CustomInterfaces
::
IDA
::
WorkspaceIndex
{
0
});
Spectra
const
spec
=
Spectra
(
""
);
IndirectFitData
const
data
(
workspace
,
spec
);
TS_ASSERT_EQUALS
(
data
.
zeroSpectra
(),
true
);
...
...
@@ -188,7 +189,8 @@ public:
void
test_that_correct_excludeRegion_is_returned_when_regions_are_in_correct_order
()
{
/// When each pair of numbers in the string are in order, then the whole
/// string is in the correct order(unordered: 10,11 9,7 ordered:10,11,7,9)
/// string is in the correct order(unordered: 10,11 9,7
/// ordered:10,11,7,9)
auto
data
=
getIndirectFitData
(
4
);
data
->
setExcludeRegionString
(
...
...
@@ -215,7 +217,8 @@ public:
void
test_that_correct_excludeRegionVector_is_returned_when_regions_are_in_correct_order
()
{
/// When each pair of numbers in the string are in order, then the whole
/// string is in the correct order(unordered: 10,11 9,7 ordered:10,11,7,9)
/// string is in the correct order(unordered: 10,11 9,7
/// ordered:10,11,7,9)
auto
data
=
getIndirectFitData
(
4
);
data
->
setExcludeRegionString
(
...
...
@@ -311,11 +314,9 @@ public:
std
::
vector
<
Spectra
>
const
spectraPairs
{
Spectra
(
MantidQt
::
CustomInterfaces
::
IDA
::
WorkspaceIndex
{
0
},
MantidQt
::
CustomInterfaces
::
IDA
::
WorkspaceIndex
{
11
}),
Spectra
(
MantidQt
::
CustomInterfaces
::
IDA
::
WorkspaceIndex
{
0
},
MantidQt
::
CustomInterfaces
::
IDA
::
WorkspaceIndex
{
1000000000
}),
Spectra
(
MantidQt
::
CustomInterfaces
::
IDA
::
WorkspaceIndex
{
10
},
MantidQt
::
CustomInterfaces
::
IDA
::
WorkspaceIndex
{
10
})};
std
::
vector
<
std
::
string
>
const
spectraStrings
{
"10"
,
"1000000000"
,
"1,5,10"
,
std
::
vector
<
std
::
string
>
const
spectraStrings
{
"10"
,
"1,5,10"
,
"1,2,3,4,5,6,22"
};
for
(
auto
i
=
0u
;
i
<
spectraPairs
.
size
();
++
i
)
...
...
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