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
ffb76371
Commit
ffb76371
authored
11 years ago
by
Russell Taylor
Browse files
Options
Downloads
Patches
Plain Diff
Re #7391. Add tests for negative bin boundaries sum bug.
parent
2e10675a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Code/Mantid/Framework/API/CMakeLists.txt
+1
-0
1 addition, 0 deletions
Code/Mantid/Framework/API/CMakeLists.txt
Code/Mantid/Framework/API/test/WorkspaceOpOverloadsTest.h
+54
-0
54 additions, 0 deletions
Code/Mantid/Framework/API/test/WorkspaceOpOverloadsTest.h
with
55 additions
and
0 deletions
Code/Mantid/Framework/API/CMakeLists.txt
+
1
−
0
View file @
ffb76371
...
...
@@ -325,6 +325,7 @@ set ( TEST_FILES
WorkspaceFactoryTest.h
WorkspaceGroupTest.h
WorkspaceHistoryTest.h
WorkspaceOpOverloadsTest.h
WorkspacePropertyTest.h
)
...
...
This diff is collapsed.
Click to expand it.
Code/Mantid/Framework/API/test/WorkspaceOpOverloadsTest.h
0 → 100644
+
54
−
0
View file @
ffb76371
#ifndef WORKSPACEOPOVERLOADSTEST_H_
#define WORKSPACEOPOVERLOADSTEST_H_
#include
<cxxtest/TestSuite.h>
#include
"MantidAPI/WorkspaceOpOverloads.h"
#include
"MantidTestHelpers/FakeObjects.h"
using
namespace
Mantid
::
API
;
class
WorkspaceOpOverloadsTest
:
public
CxxTest
::
TestSuite
{
public:
//----------------------------------------------------------------------
// WorkspaceHelpers tests
//----------------------------------------------------------------------
void
test_commmonBoundaries_negative_sum
()
// Added in response to bug #7391
{
auto
ws
=
boost
::
make_shared
<
WorkspaceTester
>
();
ws
->
init
(
2
,
2
,
1
);
ws
->
getSpectrum
(
0
)
->
dataX
()[
0
]
=
-
2.0
;
ws
->
getSpectrum
(
0
)
->
dataX
()[
1
]
=
-
1.0
;
ws
->
getSpectrum
(
1
)
->
dataX
()[
0
]
=
-
2.5
;
ws
->
getSpectrum
(
1
)
->
dataX
()[
1
]
=
-
1.5
;
TS_ASSERT
(
!
WorkspaceHelpers
::
commonBoundaries
(
ws
)
);
}
void
test_matchingBins_negative_sum
()
// Added in response to bug #7391
{
auto
ws1
=
boost
::
make_shared
<
WorkspaceTester
>
();
ws1
->
init
(
2
,
2
,
1
);
ws1
->
getSpectrum
(
1
)
->
dataX
()[
0
]
=
-
2.5
;
ws1
->
getSpectrum
(
1
)
->
dataX
()[
1
]
=
-
1.5
;
auto
ws2
=
boost
::
make_shared
<
WorkspaceTester
>
();
ws2
->
init
(
2
,
2
,
1
);
ws2
->
getSpectrum
(
1
)
->
dataX
()[
0
]
=
-
2.7
;
ws2
->
getSpectrum
(
1
)
->
dataX
()[
1
]
=
-
1.7
;
TS_ASSERT
(
WorkspaceHelpers
::
matchingBins
(
ws1
,
ws2
,
true
)
);
TS_ASSERT
(
!
WorkspaceHelpers
::
matchingBins
(
ws1
,
ws2
)
);
ws1
->
getSpectrum
(
0
)
->
dataX
()[
0
]
=
-
2.0
;
ws1
->
getSpectrum
(
0
)
->
dataX
()[
1
]
=
-
1.0
;
ws2
->
getSpectrum
(
0
)
->
dataX
()[
0
]
=
-
3.0
;
ws2
->
getSpectrum
(
0
)
->
dataX
()[
1
]
=
-
4.0
;
TS_ASSERT
(
!
WorkspaceHelpers
::
matchingBins
(
ws1
,
ws2
,
true
)
);
}
};
#endif
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