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
6e93a1c1
Commit
6e93a1c1
authored
6 years ago
by
Antti Soininen
Browse files
Options
Downloads
Patches
Plain Diff
ReflectometrySumInQTest: check the result, not just if it throws.
Re #22723
parent
564c42cb
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
Framework/Algorithms/test/ReflectometrySumInQTest.h
+18
-3
18 additions, 3 deletions
Framework/Algorithms/test/ReflectometrySumInQTest.h
with
18 additions
and
3 deletions
Framework/Algorithms/test/ReflectometrySumInQTest.h
+
18
−
3
View file @
6e93a1c1
...
...
@@ -186,6 +186,11 @@ public:
const
int
spectrum2
{
static_cast
<
int
>
(
spectrumInfo
.
size
())
-
2
};
TS_ASSERT_LESS_THAN
(
spectrumInfo
.
signedTwoTheta
(
spectrum1
),
0.
)
TS_ASSERT_LESS_THAN
(
0.
,
spectrumInfo
.
signedTwoTheta
(
spectrum2
))
double
summedInLambda
{
0.
};
for
(
auto
i
:
std
::
array
<
int
,
2
>
{{
spectrum1
,
spectrum2
}})
{
const
auto
&
Ys
=
inputWS
->
y
(
i
);
summedInLambda
+=
std
::
accumulate
(
Ys
.
cbegin
(),
Ys
.
cend
(),
0.0
);
}
std
::
ostringstream
indexSetValue
;
indexSetValue
<<
spectrum1
<<
","
<<
spectrum2
;
const
std
::
array
<
bool
,
2
>
flatSampleOptions
{{
true
,
false
}};
...
...
@@ -201,8 +206,14 @@ public:
alg
.
setPropertyValue
(
"OutputWorkspace"
,
"_unused_for_child"
))
TS_ASSERT_THROWS_NOTHING
(
alg
.
setProperty
(
"BeamCentre"
,
spectrum1
))
TS_ASSERT_THROWS_NOTHING
(
alg
.
setProperty
(
"FlatSample"
,
isFlatSample
))
TS_ASSERT_THROWS_NOTHING
(
alg
.
setProperty
(
"IncludePartialBins"
,
fals
e
))
TS_ASSERT_THROWS_NOTHING
(
alg
.
setProperty
(
"IncludePartialBins"
,
tru
e
))
TS_ASSERT_THROWS_NOTHING
(
alg
.
execute
())
API
::
MatrixWorkspace_sptr
outputWS
=
alg
.
getProperty
(
"OutputWorkspace"
);
TS_ASSERT
(
outputWS
);
TS_ASSERT_EQUALS
(
outputWS
->
getNumberHistograms
(),
1
)
auto
&
Ys
=
outputWS
->
y
(
0
);
const
auto
summedInQ
=
std
::
accumulate
(
Ys
.
cbegin
(),
Ys
.
cend
(),
0.0
);
TS_ASSERT_DELTA
(
summedInQ
,
summedInLambda
,
1e-10
)
}
}
...
...
@@ -286,7 +297,9 @@ private:
const
Kernel
::
V3D
sourcePos
{
0.
,
0.
,
-
50.
};
const
Kernel
::
V3D
monitorPos
{
0.
,
0.
,
-
0.5
};
const
Kernel
::
V3D
samplePos
{
0.
,
0.
,
0.
,
0.
,
0.
,
0.
,
};
const
double
twoTheta
{
centreTwoThetaDegrees
/
180.
*
M_PI
};
constexpr
double
detectorHeight
{
0.001
};
...
...
@@ -321,7 +334,9 @@ public:
const
Kernel
::
V3D
sourcePos
{
0.
,
0.
,
-
50.
};
const
Kernel
::
V3D
monitorPos
{
0.
,
0.
,
-
0.5
};
const
Kernel
::
V3D
samplePos
{
0.
,
0.
,
0.
,
0.
,
0.
,
0.
,
};
constexpr
double
twoTheta
{
5.87
/
180.
*
M_PI
};
constexpr
double
detectorHeight
{
0.001
};
...
...
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