diff --git a/Vates/VatesAPI/test/LoadVTKTest.h b/Vates/VatesAPI/test/LoadVTKTest.h index ee748126b01dbb86721edb632d7380dacdb89a27..f8f04bb3837d0824ea924500679b44ff9d9982bf 100644 --- a/Vates/VatesAPI/test/LoadVTKTest.h +++ b/Vates/VatesAPI/test/LoadVTKTest.h @@ -5,6 +5,7 @@ #include "MantidVatesAPI/LoadVTK.h" #include "MantidAPI/IMDHistoWorkspace.h" #include "MantidGeometry/MDGeometry/IMDDimension.h" +#include "MantidGeometry/MDGeometry/UnknownFrame.h" #include "MantidAPI/AlgorithmManager.h" using namespace Mantid::API; @@ -129,14 +130,29 @@ public: outWSName); TS_ASSERT_EQUALS(3, outWS->getNumDims()); - do_check_dimension(outWS->getDimension(0), "X", 0, 67, 68); // These numbers are expected min, max, and nbins known from the input file for dim x. - do_check_dimension(outWS->getDimension(1), "Y", 0, 67, 68); // These numbers are expected min, max, and nbins known from the input file for dim y. - do_check_dimension(outWS->getDimension(2), "Z", 0, 67, 68); // These numbers are expected min, max, and nbins known from the input file for dim z. + do_check_dimension(outWS->getDimension(0), "X", 0, 67, + 68); // These numbers are expected min, max, and nbins + // known from the input file for dim x. + do_check_dimension(outWS->getDimension(1), "Y", 0, 67, + 68); // These numbers are expected min, max, and nbins + // known from the input file for dim y. + do_check_dimension(outWS->getDimension(2), "Z", 0, 67, + 68); // These numbers are expected min, max, and nbins + // known from the input file for dim z. + + TSM_ASSERT_THROWS_NOTHING( + "Should be an UnknownFrame", + dynamic_cast<const Mantid::Geometry::UnknownFrame &>( + outWS->getDimension(0)->getMDFrame())) + TSM_ASSERT_THROWS_NOTHING( + "Should be an UnknownFrame", + dynamic_cast<const Mantid::Geometry::UnknownFrame &>( + outWS->getDimension(1)->getMDFrame())) + TSM_ASSERT_THROWS_NOTHING( + "Should be an UnknownFrame", + dynamic_cast<const Mantid::Geometry::UnknownFrame &>( + outWS->getDimension(2)->getMDFrame())) - TSM_ASSERT_THROWS_NOTHING("Should be an UnknownFrame", dynamic_cast<const Mantid::Geometry::UnknownFrame&>(outWS->getDimension(0))) - TSM_ASSERT_THROWS_NOTHING("Should be an UnknownFrame", dynamic_cast<const Mantid::Geometry::UnknownFrame&>(outWS->getDimension(1))) - TSM_ASSERT_THROWS_NOTHING("Should be an UnknownFrame", dynamic_cast<const Mantid::Geometry::UnknownFrame&>(outWS->getDimension(2))) - double topPercent = loadVTK.getProperty("KeepTopPercent"); TSM_ASSERT_EQUALS("Should default to 25%", 25, topPercent); diff --git a/Vates/VatesAPI/test/vtkDataSetToNonOrthogonalDataSetTest.h b/Vates/VatesAPI/test/vtkDataSetToNonOrthogonalDataSetTest.h index 6e2790dc311d14e6f776eeb90b445e8af0f779ff..a3061c905bee51731cefacf4af0305dc7872246f 100644 --- a/Vates/VatesAPI/test/vtkDataSetToNonOrthogonalDataSetTest.h +++ b/Vates/VatesAPI/test/vtkDataSetToNonOrthogonalDataSetTest.h @@ -10,6 +10,9 @@ #include "MantidKernel/PropertyWithValue.h" #include "MantidDataObjects/CoordTransformAffine.h" #include "MantidTestHelpers/MDEventsTestHelper.h" +#include "MantidGeometry/MDGeometry/QSample.h" +#include "MantidGeometry/MDGeometry/HKL.h" +#include "MantidKernel/MDUnit.h" #include <vtkDataArray.h> #include <vtkFieldData.h> @@ -38,15 +41,17 @@ private: // Creating an MDEventWorkspace as the content is not germain to the // information necessary for the non-orthogonal axes std::string wsName = "simpleWS"; - IMDEventWorkspace_sptr ws = makeAnyMDEW<MDEvent<4>, 4>(1, 0.0, 1.0, 1, wsName); + IMDEventWorkspace_sptr ws; // Set the coordinate system - if (!wrongCoords) - { - ws->setCoordinateSystem(Mantid::Kernel::HKL); - } - else - { - ws->setCoordinateSystem(QSample); + if (wrongCoords) { + Mantid::Geometry::QSample frame; + ws = MDEventsTestHelper::makeAnyMDEWWithFrames<MDEvent<4>, 4>( + 1, 0.0, 1.0, frame, 1, wsName); + + } else { + Mantid::Geometry::HKL frame(new Mantid::Kernel::ReciprocalLatticeUnit); + ws = MDEventsTestHelper::makeAnyMDEWWithFrames<MDEvent<4>, 4>( + 1, 0.0, 1.0, frame, 1, wsName); } // Set the UB matrix