-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
51 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#ifndef MANTID_MDWS_DESCRIPTION_H_ | ||
#define MANTID_MDWS_DESCRIPTION_H_ | ||
|
||
#include <cxxtest/TestSuite.h> | ||
#include "MantidMDEvents/MDWSDescription.h" | ||
|
||
|
||
using namespace Mantid::MDEvents; | ||
using namespace Mantid::Kernel; | ||
|
||
class MDWSDescriptionTest : public CxxTest::TestSuite | ||
{ | ||
MDWSDescription descr; | ||
public: | ||
// This pair of boilerplate methods prevent the suite being created statically | ||
// This means the constructor isn't called when running other tests | ||
static MDWSDescriptionTest *createSuite() { return new MDWSDescriptionTest(); } | ||
static void destroySuite( MDWSDescriptionTest *suite ) { delete suite; } | ||
|
||
void test_name() | ||
{ | ||
V3D dir1(1,0,0); | ||
std::string name; | ||
|
||
TS_ASSERT_THROWS_NOTHING(name=makeAxisName(dir1,descr.defailt_qNames)); | ||
TS_ASSERT_EQUALS("[Qh,0,0]",name); | ||
|
||
TS_ASSERT_THROWS_NOTHING(name=makeAxisName(V3D(-1,0.99,-1.001),descr.defailt_qNames)); | ||
TS_ASSERT_EQUALS("[-Qh,0.99Qk,-Ql]",name); | ||
|
||
TS_ASSERT_THROWS_NOTHING(name=makeAxisName(V3D(-1,0.9999,-1.001),descr.defailt_qNames)); | ||
TS_ASSERT_EQUALS("[-Qh,Qk,-Ql]",name); | ||
|
||
TS_ASSERT_THROWS_NOTHING(name=makeAxisName(V3D(-1,0.999,-1.01),descr.defailt_qNames)); | ||
TS_ASSERT_EQUALS("[-Qh,0.999Qk,-1.01Ql]",name); | ||
|
||
TS_ASSERT_THROWS_NOTHING(name=makeAxisName(V3D(2.01,0.9,-1.01),descr.defailt_qNames)); | ||
TS_ASSERT_EQUALS("[2.01Qh,0.9Qk,-1.01Ql]",name); | ||
|
||
|
||
|
||
} | ||
|
||
MDWSDescriptionTest::MDWSDescriptionTest():descr(5) | ||
{ | ||
} | ||
|
||
}; | ||
|
||
|
||
#endif |