Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refs #10904. IntegratePeaksMD algorithms done.
IntegratePeaksMD v1 and v2 write out integrated peak info in the form of PeakShape PeakShapeSpherical adapted to write out background outer radius and background inner radius as well as the peak radius. Factories also updated for this, unit tests added to and updated for this. I got a little worried that someone may change the integer values agaist the enum entries of SpecialCoordinateSystem. So I put in place a unit test to sanity check those.
- Loading branch information
1 parent
44f167b
commit 4427109
Showing
13 changed files
with
367 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
Code/Mantid/Framework/API/test/SpecialCoordinateSystemTest.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#ifndef MANTID_API_SPECIALCOORDINATESYSTEMTEST | ||
#define MANTID_API_SPECIALCOORDINATESYSTEMTEST | ||
|
||
#include <cxxtest/TestSuite.h> | ||
#include "MantidAPI/SpecialCoordinateSystem.h" | ||
|
||
using namespace Mantid::API; | ||
|
||
/* | ||
* We are testing the enum because the order of the elements in the enum is critical. There are various places in the codebase where the | ||
* enum integer values are assumed to be constant. A proper fix for this would be a type replacment enum->object, but while that has not been done, | ||
* a santiy check (these tests) on the enum ordering will prevent unintentional reordering. | ||
*/ | ||
class SpecialCoordinateSystemTest : public CxxTest::TestSuite | ||
{ | ||
public: | ||
// This pair of boilerplate methods prevent the suite being created statically | ||
// This means the constructor (& destructor) isn't called when running other tests | ||
static SpecialCoordinateSystemTest *createSuite() { return new SpecialCoordinateSystemTest(); } | ||
static void destroySuite( SpecialCoordinateSystemTest *suite ) { delete suite; } | ||
|
||
void test_none() | ||
{ | ||
// Do not change | ||
SpecialCoordinateSystem none = None; | ||
TS_ASSERT_EQUALS(0, none); | ||
} | ||
|
||
void test_qLab() | ||
{ | ||
// Do not change | ||
SpecialCoordinateSystem qlab = QLab; | ||
TS_ASSERT_EQUALS(1, qlab); | ||
} | ||
|
||
void test_qSample() | ||
{ | ||
// Do not change | ||
SpecialCoordinateSystem qSample = QSample; | ||
TS_ASSERT_EQUALS(2, qSample); | ||
} | ||
|
||
void test_HKL() | ||
{ | ||
// Do not change | ||
SpecialCoordinateSystem hkl = HKL; | ||
TS_ASSERT_EQUALS(3, hkl); | ||
} | ||
|
||
|
||
}; | ||
|
||
#endif | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.