1 | #ifndef CHECKWORKSPACESMATCHTEST_H_ |
---|
2 | #define CHECKWORKSPACESMATCHTEST_H_ |
---|
3 | |
---|
4 | #include <cxxtest/TestSuite.h> |
---|
5 | |
---|
6 | #include "MantidAlgorithms/CheckWorkspacesMatch.h" |
---|
7 | #include "MantidAPI/NumericAxis.h" |
---|
8 | #include "MantidKernel/UnitFactory.h" |
---|
9 | #include "MantidDataObjects/EventWorkspace.h" |
---|
10 | #include "MantidDataObjects/PeaksWorkspace.h" |
---|
11 | #include "MantidMDEvents/MDHistoWorkspace.h" |
---|
12 | #include "MantidTestHelpers/WorkspaceCreationHelper.h" |
---|
13 | #include "MantidTestHelpers/MDEventsTestHelper.h" |
---|
14 | #include "MantidDataObjects/Workspace2D.h" |
---|
15 | #include "MantidAlgorithms/CreatePeaksWorkspace.h" |
---|
16 | #include "MantidAPI/MatrixWorkspace.h" |
---|
17 | #include "MantidGeometry/Instrument.h" |
---|
18 | #include "MantidMDEvents/MDBoxBase.h" |
---|
19 | #include "MantidKernel/V3D.h" |
---|
20 | |
---|
21 | #include "MantidDataHandling/SaveNexusProcessed.h" |
---|
22 | #include "MantidDataHandling/LoadNexus.h" |
---|
23 | #include <Poco/File.h> |
---|
24 | |
---|
25 | |
---|
26 | |
---|
27 | using namespace Mantid::Algorithms; |
---|
28 | using namespace Mantid::API; |
---|
29 | using namespace Mantid::DataObjects; |
---|
30 | using namespace Mantid::Geometry; |
---|
31 | using namespace Mantid::MDEvents; |
---|
32 | using namespace Mantid::DataHandling; |
---|
33 | |
---|
34 | class CheckWorkspacesMatchTest : public CxxTest::TestSuite |
---|
35 | { |
---|
36 | public: |
---|
37 | // This pair of boilerplate methods prevent the suite being created statically |
---|
38 | // This means the constructor isn't called when running other tests |
---|
39 | static CheckWorkspacesMatchTest *createSuite() { return new CheckWorkspacesMatchTest(); } |
---|
40 | static void destroySuite( CheckWorkspacesMatchTest *suite ) { delete suite; } |
---|
41 | |
---|
42 | CheckWorkspacesMatchTest() : ws1(WorkspaceCreationHelper::Create2DWorkspace123(2,2)) |
---|
43 | { |
---|
44 | } |
---|
45 | |
---|
46 | void testName() |
---|
47 | { |
---|
48 | TS_ASSERT_EQUALS( checker.name(), "CheckWorkspacesMatch" ); |
---|
49 | } |
---|
50 | |
---|
51 | void testVersion() |
---|
52 | { |
---|
53 | TS_ASSERT_EQUALS( checker.version(), 1 ); |
---|
54 | } |
---|
55 | |
---|
56 | void testInit() |
---|
57 | { |
---|
58 | TS_ASSERT_THROWS_NOTHING( checker.initialize() ); |
---|
59 | TS_ASSERT( checker.isInitialized() ); |
---|
60 | } |
---|
61 | |
---|
62 | void testMatches() |
---|
63 | { |
---|
64 | if ( !checker.isInitialized() ) checker.initialize(); |
---|
65 | |
---|
66 | MatrixWorkspace_sptr ws = WorkspaceCreationHelper::Create2DWorkspaceBinned(10,100); |
---|
67 | // A workspace had better match itself! |
---|
68 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace1",ws) ); |
---|
69 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace2",ws) ); |
---|
70 | |
---|
71 | TS_ASSERT( checker.execute() ); |
---|
72 | TS_ASSERT_EQUALS( checker.getPropertyValue("Result"), checker.successString() ); |
---|
73 | // Same, using the Mantid::API::equals() function |
---|
74 | TS_ASSERT( Mantid::API::equals(ws, ws) ); |
---|
75 | } |
---|
76 | |
---|
77 | void testPeaks_matches() |
---|
78 | { |
---|
79 | if ( !checker.isInitialized() ) checker.initialize(); |
---|
80 | |
---|
81 | std::string outWS1Name("CreatePeaks1WorkspaceTest_OutputWS"); |
---|
82 | std::string outWS2Name("CreatePeaks2WorkspaceTest_OutputWS"); |
---|
83 | |
---|
84 | Workspace2D_sptr instws = WorkspaceCreationHelper::create2DWorkspaceWithFullInstrument(2, 10); |
---|
85 | |
---|
86 | CreatePeaksWorkspace alg; |
---|
87 | TS_ASSERT_THROWS_NOTHING( alg.initialize() ) |
---|
88 | TS_ASSERT( alg.isInitialized() ) |
---|
89 | TS_ASSERT_THROWS_NOTHING( alg.setProperty("InstrumentWorkspace", boost::dynamic_pointer_cast<MatrixWorkspace>(instws)) ); |
---|
90 | TS_ASSERT_THROWS_NOTHING( alg.setPropertyValue("OutputWorkspace", outWS1Name) ); |
---|
91 | TS_ASSERT_THROWS_NOTHING( alg.setProperty("NumberOfPeaks", 13) ); |
---|
92 | TS_ASSERT_THROWS_NOTHING( alg.execute(); ) |
---|
93 | TS_ASSERT( alg.isExecuted() ); |
---|
94 | |
---|
95 | TS_ASSERT_THROWS_NOTHING( alg.initialize() ) |
---|
96 | TS_ASSERT( alg.isInitialized() ) |
---|
97 | TS_ASSERT_THROWS_NOTHING( alg.setProperty("InstrumentWorkspace", boost::dynamic_pointer_cast<MatrixWorkspace>(instws)) ); |
---|
98 | TS_ASSERT_THROWS_NOTHING( alg.setPropertyValue("OutputWorkspace", outWS2Name) ); |
---|
99 | TS_ASSERT_THROWS_NOTHING( alg.setProperty("NumberOfPeaks", 13) ); |
---|
100 | TS_ASSERT_THROWS_NOTHING( alg.execute(); ) |
---|
101 | TS_ASSERT( alg.isExecuted() ); |
---|
102 | |
---|
103 | // Retrieve the workspace from data service. |
---|
104 | PeaksWorkspace_sptr pws1, pws2; |
---|
105 | TS_ASSERT_THROWS_NOTHING( pws1 = boost::dynamic_pointer_cast<PeaksWorkspace>( |
---|
106 | AnalysisDataService::Instance().retrieve(outWS1Name) ) ); |
---|
107 | TS_ASSERT_THROWS_NOTHING( pws2 = boost::dynamic_pointer_cast<PeaksWorkspace>( |
---|
108 | AnalysisDataService::Instance().retrieve(outWS2Name) ) ); |
---|
109 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace1",boost::dynamic_pointer_cast<Workspace>(pws1)) ); |
---|
110 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace2",boost::dynamic_pointer_cast<Workspace>(pws2)) ); |
---|
111 | TS_ASSERT( checker.execute() ); |
---|
112 | TS_ASSERT_EQUALS( checker.getPropertyValue("Result"), checker.successString() ); |
---|
113 | } |
---|
114 | |
---|
115 | void testPeaks_extrapeak() |
---|
116 | { |
---|
117 | if ( !checker.isInitialized() ) checker.initialize(); |
---|
118 | |
---|
119 | std::string outWS3Name("CreatePeaks3WorkspaceTest_OutputWS"); |
---|
120 | std::string outWS4Name("CreatePeaks4WorkspaceTest_OutputWS"); |
---|
121 | |
---|
122 | Workspace2D_sptr instws = WorkspaceCreationHelper::create2DWorkspaceWithFullInstrument(2, 10); |
---|
123 | |
---|
124 | CreatePeaksWorkspace alg; |
---|
125 | TS_ASSERT_THROWS_NOTHING( alg.initialize() ) |
---|
126 | TS_ASSERT( alg.isInitialized() ) |
---|
127 | TS_ASSERT_THROWS_NOTHING( alg.setProperty("InstrumentWorkspace", boost::dynamic_pointer_cast<MatrixWorkspace>(instws)) ); |
---|
128 | TS_ASSERT_THROWS_NOTHING( alg.setPropertyValue("OutputWorkspace", outWS3Name) ); |
---|
129 | TS_ASSERT_THROWS_NOTHING( alg.setProperty("NumberOfPeaks", 13) ); |
---|
130 | TS_ASSERT_THROWS_NOTHING( alg.execute(); ) |
---|
131 | TS_ASSERT( alg.isExecuted() ); |
---|
132 | |
---|
133 | TS_ASSERT_THROWS_NOTHING( alg.initialize() ) |
---|
134 | TS_ASSERT( alg.isInitialized() ) |
---|
135 | TS_ASSERT_THROWS_NOTHING( alg.setProperty("InstrumentWorkspace", boost::dynamic_pointer_cast<MatrixWorkspace>(instws)) ); |
---|
136 | TS_ASSERT_THROWS_NOTHING( alg.setPropertyValue("OutputWorkspace", outWS4Name) ); |
---|
137 | TS_ASSERT_THROWS_NOTHING( alg.setProperty("NumberOfPeaks", 14) ); |
---|
138 | TS_ASSERT_THROWS_NOTHING( alg.execute(); ) |
---|
139 | TS_ASSERT( alg.isExecuted() ); |
---|
140 | |
---|
141 | // Retrieve the workspace from data service. |
---|
142 | PeaksWorkspace_sptr pws1, pws2; |
---|
143 | TS_ASSERT_THROWS_NOTHING( pws1 = boost::dynamic_pointer_cast<PeaksWorkspace>( |
---|
144 | AnalysisDataService::Instance().retrieve(outWS3Name) ) ); |
---|
145 | TS_ASSERT_THROWS_NOTHING( pws2 = boost::dynamic_pointer_cast<PeaksWorkspace>( |
---|
146 | AnalysisDataService::Instance().retrieve(outWS4Name) ) ); |
---|
147 | TS_ASSERT_EQUALS(pws1->getNumberPeaks(), 13); |
---|
148 | TS_ASSERT_EQUALS(pws2->getNumberPeaks(), 14); |
---|
149 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace1",boost::dynamic_pointer_cast<Workspace>(pws1)) ); |
---|
150 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace2",boost::dynamic_pointer_cast<Workspace>(pws2)) ); |
---|
151 | TS_ASSERT( checker.execute() ); |
---|
152 | TS_ASSERT_DIFFERS( checker.getPropertyValue("Result"), checker.successString() ); |
---|
153 | } |
---|
154 | |
---|
155 | void testEvent_matches() |
---|
156 | { |
---|
157 | if ( !checker.isInitialized() ) checker.initialize(); |
---|
158 | |
---|
159 | EventWorkspace_sptr ews1 = WorkspaceCreationHelper::CreateEventWorkspace(10,20,30); |
---|
160 | EventWorkspace_sptr ews2 = WorkspaceCreationHelper::CreateEventWorkspace(10,20,30); |
---|
161 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace1",boost::dynamic_pointer_cast<MatrixWorkspace>(ews1)) ); |
---|
162 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace2",boost::dynamic_pointer_cast<MatrixWorkspace>(ews2)) ); |
---|
163 | TS_ASSERT( checker.execute() ); |
---|
164 | TS_ASSERT_EQUALS( checker.getPropertyValue("Result"), checker.successString() ); |
---|
165 | |
---|
166 | // Same, using the Mantid::API::equals() function |
---|
167 | TS_ASSERT( Mantid::API::equals(ews1, ews2) ); |
---|
168 | } |
---|
169 | |
---|
170 | void testEvent_different_type() |
---|
171 | { |
---|
172 | if ( !checker.isInitialized() ) checker.initialize(); |
---|
173 | |
---|
174 | EventWorkspace_sptr ews2 = WorkspaceCreationHelper::CreateEventWorkspace(10,20,30); |
---|
175 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace1",ws1) ); |
---|
176 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace2",boost::dynamic_pointer_cast<MatrixWorkspace>(ews2)) ); |
---|
177 | TS_ASSERT( checker.execute() ); |
---|
178 | TS_ASSERT_DIFFERS( checker.getPropertyValue("Result"), checker.successString() ); |
---|
179 | |
---|
180 | // Same, using the Mantid::API::equals() function |
---|
181 | TS_ASSERT( !Mantid::API::equals(ws1, ews2) ); |
---|
182 | |
---|
183 | } |
---|
184 | |
---|
185 | void testEvent_different_number_histograms() |
---|
186 | { |
---|
187 | if ( !checker.isInitialized() ) checker.initialize(); |
---|
188 | |
---|
189 | EventWorkspace_sptr ews1 = WorkspaceCreationHelper::CreateEventWorkspace(10,20,30); |
---|
190 | EventWorkspace_sptr ews2 = WorkspaceCreationHelper::CreateEventWorkspace(15,20,30); |
---|
191 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace1",boost::dynamic_pointer_cast<MatrixWorkspace>(ews1)) ); |
---|
192 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace2",boost::dynamic_pointer_cast<MatrixWorkspace>(ews2)) ); |
---|
193 | TS_ASSERT( checker.execute() ); |
---|
194 | TS_ASSERT_DIFFERS( checker.getPropertyValue("Result"), checker.successString() ); |
---|
195 | // Same, using the !Mantid::API::equals() function |
---|
196 | TS_ASSERT( (!Mantid::API::equals(ews1, ews2)) ); |
---|
197 | } |
---|
198 | |
---|
199 | void testEvent_differentEventLists() |
---|
200 | { |
---|
201 | if ( !checker.isInitialized() ) checker.initialize(); |
---|
202 | EventWorkspace_sptr ews1 = WorkspaceCreationHelper::CreateEventWorkspace(10,20,30); |
---|
203 | EventWorkspace_sptr ews2 = WorkspaceCreationHelper::CreateEventWorkspace(10,20,30, 0.0, 1.0, 2); |
---|
204 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace1",boost::dynamic_pointer_cast<MatrixWorkspace>(ews1)) ); |
---|
205 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace2",boost::dynamic_pointer_cast<MatrixWorkspace>(ews2)) ); |
---|
206 | TS_ASSERT( checker.execute() ); |
---|
207 | TS_ASSERT_DIFFERS( checker.getPropertyValue("Result"), checker.successString() ); |
---|
208 | // Same, using the !Mantid::API::equals() function |
---|
209 | TS_ASSERT( (!Mantid::API::equals(ews1, ews2)) ); |
---|
210 | } |
---|
211 | |
---|
212 | void testEvent_differentBinBoundaries() |
---|
213 | { |
---|
214 | if ( !checker.isInitialized() ) checker.initialize(); |
---|
215 | EventWorkspace_sptr ews1 = WorkspaceCreationHelper::CreateEventWorkspace(10,20,30, 15.0, 10.0); |
---|
216 | EventWorkspace_sptr ews2 = WorkspaceCreationHelper::CreateEventWorkspace(10,20,30, 5.0, 10.0); |
---|
217 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace1",boost::dynamic_pointer_cast<MatrixWorkspace>(ews1)) ); |
---|
218 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace2",boost::dynamic_pointer_cast<MatrixWorkspace>(ews2)) ); |
---|
219 | TS_ASSERT( checker.execute() ); |
---|
220 | TS_ASSERT_DIFFERS( checker.getPropertyValue("Result"), checker.successString() ); |
---|
221 | // Same, using the !Mantid::API::equals() function |
---|
222 | TS_ASSERT( (!Mantid::API::equals(ews1, ews2)) ); |
---|
223 | } |
---|
224 | |
---|
225 | void testMDEvents_matches() |
---|
226 | { |
---|
227 | if ( !checker.isInitialized() ) checker.initialize(); |
---|
228 | MDEventWorkspace3Lean::sptr mdews1 = MDEventsTestHelper::makeFileBackedMDEW("mdev1", false); |
---|
229 | MDEventWorkspace3Lean::sptr mdews2 = MDEventsTestHelper::makeFileBackedMDEW("mdev2", false); |
---|
230 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace1", boost::dynamic_pointer_cast<IMDWorkspace>(mdews1)) ); |
---|
231 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace2", boost::dynamic_pointer_cast<IMDWorkspace>(mdews2)) ); |
---|
232 | TS_ASSERT( checker.execute() ); |
---|
233 | TS_ASSERT_EQUALS( checker.getPropertyValue("Result"), checker.successString() ); |
---|
234 | } |
---|
235 | |
---|
236 | void testMDEvents_different_eventtypes() |
---|
237 | { |
---|
238 | if ( !checker.isInitialized() ) checker.initialize(); |
---|
239 | MDEventWorkspace3Lean::sptr mdews1 = MDEventsTestHelper::makeAnyMDEW<MDLeanEvent<3>, 3>(2, 0.0, 10.0, 1000, "A"); |
---|
240 | MDEventWorkspace3::sptr mdews2 = MDEventsTestHelper::makeAnyMDEW<MDEvent<3>, 3>(2, 0.0, 10.0, 1000, "B"); |
---|
241 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace1", boost::dynamic_pointer_cast<IMDWorkspace>(mdews1)) ); |
---|
242 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace2", boost::dynamic_pointer_cast<IMDWorkspace>(mdews2)) ); |
---|
243 | TS_ASSERT( checker.execute() ); |
---|
244 | TS_ASSERT_DIFFERS( checker.getPropertyValue("Result"), checker.successString() ); |
---|
245 | } |
---|
246 | |
---|
247 | void testMDEvents_different_dims() |
---|
248 | { |
---|
249 | if ( !checker.isInitialized() ) checker.initialize(); |
---|
250 | MDEventWorkspace4Lean::sptr mdews1 = MDEventsTestHelper::makeMDEW<4>(5, -10.0, 10.0, 1); |
---|
251 | MDEventWorkspace3Lean::sptr mdews2 = MDEventsTestHelper::makeMDEW<3>(5, -10.0, 10.0, 1); |
---|
252 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace1", boost::dynamic_pointer_cast<IMDWorkspace>(mdews1)) ); |
---|
253 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace2", boost::dynamic_pointer_cast<IMDWorkspace>(mdews2)) ); |
---|
254 | TS_ASSERT( checker.execute() ); |
---|
255 | TS_ASSERT_DIFFERS( checker.getPropertyValue("Result"), checker.successString() ); |
---|
256 | } |
---|
257 | |
---|
258 | void testMDEvents_different_dimnames() |
---|
259 | { |
---|
260 | if ( !checker.isInitialized() ) checker.initialize(); |
---|
261 | MDEventWorkspace3Lean::sptr mdews1 = MDEventsTestHelper::makeAnyMDEW<MDLeanEvent<3>, 3>(2, 0.0, 10.0, 1000, "A"); |
---|
262 | MDEventWorkspace3Lean::sptr mdews2 = MDEventsTestHelper::makeAnyMDEW<MDLeanEvent<3>, 3>(2, 0.0, 10.0, 1000, "B", "X%d"); |
---|
263 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace1", boost::dynamic_pointer_cast<IMDWorkspace>(mdews1)) ); |
---|
264 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace2", boost::dynamic_pointer_cast<IMDWorkspace>(mdews2)) ); |
---|
265 | TS_ASSERT( checker.execute() ); |
---|
266 | TS_ASSERT_DIFFERS( checker.getPropertyValue("Result"), checker.successString() ); |
---|
267 | } |
---|
268 | |
---|
269 | void testMDEvents_different_dimmin() |
---|
270 | { |
---|
271 | if ( !checker.isInitialized() ) checker.initialize(); |
---|
272 | MDEventWorkspace3Lean::sptr mdews1 = MDEventsTestHelper::makeAnyMDEW<MDLeanEvent<3>, 3>(2, 0.0, 10.0, 1000, "A"); |
---|
273 | MDEventWorkspace3Lean::sptr mdews2 = MDEventsTestHelper::makeAnyMDEW<MDLeanEvent<3>, 3>(2, 1.0, 10.0, 1000, "B"); |
---|
274 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace1", boost::dynamic_pointer_cast<IMDWorkspace>(mdews1)) ); |
---|
275 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace2", boost::dynamic_pointer_cast<IMDWorkspace>(mdews2)) ); |
---|
276 | TS_ASSERT( checker.execute() ); |
---|
277 | TS_ASSERT_DIFFERS( checker.getPropertyValue("Result"), checker.successString() ); |
---|
278 | } |
---|
279 | |
---|
280 | void testMDEvents_different_numdata() |
---|
281 | { |
---|
282 | if ( !checker.isInitialized() ) checker.initialize(); |
---|
283 | MDEventWorkspace3Lean::sptr mdews1 = MDEventsTestHelper::makeAnyMDEW<MDLeanEvent<3>, 3>(2, 0.0, 10.0, 1000, "A"); |
---|
284 | MDEventWorkspace3Lean::sptr mdews2 = MDEventsTestHelper::makeAnyMDEW<MDLeanEvent<3>, 3>(2, 0.0, 10.0, 5000, "B"); |
---|
285 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace1", boost::dynamic_pointer_cast<IMDWorkspace>(mdews1)) ); |
---|
286 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace2", boost::dynamic_pointer_cast<IMDWorkspace>(mdews2)) ); |
---|
287 | TS_ASSERT( checker.execute() ); |
---|
288 | TS_ASSERT_DIFFERS( checker.getPropertyValue("Result"), checker.successString() ); |
---|
289 | } |
---|
290 | |
---|
291 | void testMDEvents_different_data() |
---|
292 | { |
---|
293 | if ( !checker.isInitialized() ) checker.initialize(); |
---|
294 | MDEventWorkspace3Lean::sptr mdews1 = MDEventsTestHelper::makeAnyMDEW<MDLeanEvent<3>, 3>(2, 0.0, 10.0, 1000, "A"); |
---|
295 | MDEventWorkspace3Lean::sptr mdews2 = MDEventsTestHelper::makeAnyMDEW<MDLeanEvent<3>, 3>(2, 0.0, 10.0, 1000, "B"); |
---|
296 | MDBoxBase<MDLeanEvent<3>, 3> *parentBox = dynamic_cast<MDBoxBase<MDLeanEvent<3>, 3> *>(mdews2->getBox()); |
---|
297 | std::vector<IMDNode *> boxes; |
---|
298 | parentBox->getBoxes(boxes, 1000, true); |
---|
299 | MDBox<MDLeanEvent<3>, 3> *box = dynamic_cast<MDBox<MDLeanEvent<3>, 3> *>(boxes[0]); |
---|
300 | std::vector<MDLeanEvent<3> > &events = box->getEvents(); |
---|
301 | const float offset = 0.1f; |
---|
302 | events[0].setSignal(events[0].getSignal() + offset); |
---|
303 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace1", boost::dynamic_pointer_cast<IMDWorkspace>(mdews1)) ); |
---|
304 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace2", boost::dynamic_pointer_cast<IMDWorkspace>(mdews2)) ); |
---|
305 | TS_ASSERT( checker.execute() ); |
---|
306 | TS_ASSERT_DIFFERS( checker.getPropertyValue("Result"), checker.successString() ); |
---|
307 | } |
---|
308 | |
---|
309 | void testMDEvents_different_error() |
---|
310 | { |
---|
311 | if ( !checker.isInitialized() ) checker.initialize(); |
---|
312 | MDEventWorkspace3Lean::sptr mdews1 = MDEventsTestHelper::makeAnyMDEW<MDLeanEvent<3>, 3>(2, 0.0, 10.0, 1000, "A"); |
---|
313 | MDEventWorkspace3Lean::sptr mdews2 = MDEventsTestHelper::makeAnyMDEW<MDLeanEvent<3>, 3>(2, 0.0, 10.0, 1000, "B"); |
---|
314 | MDBoxBase<MDLeanEvent<3>, 3> *parentBox = dynamic_cast<MDBoxBase<MDLeanEvent<3>, 3> *>(mdews2->getBox()); |
---|
315 | std::vector<IMDNode *> boxes; |
---|
316 | parentBox->getBoxes(boxes, 1000, true); |
---|
317 | MDBox<MDLeanEvent<3>, 3> *box = dynamic_cast<MDBox<MDLeanEvent<3>, 3> *>(boxes[0]); |
---|
318 | std::vector<MDLeanEvent<3> > &events = box->getEvents(); |
---|
319 | const float offset = 0.1f; |
---|
320 | events[0].setErrorSquared(events[0].getErrorSquared() + offset); |
---|
321 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace1", boost::dynamic_pointer_cast<IMDWorkspace>(mdews1)) ); |
---|
322 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace2", boost::dynamic_pointer_cast<IMDWorkspace>(mdews2)) ); |
---|
323 | TS_ASSERT( checker.execute() ); |
---|
324 | TS_ASSERT_DIFFERS( checker.getPropertyValue("Result"), checker.successString() ); |
---|
325 | } |
---|
326 | |
---|
327 | void testMDHisto_matches() |
---|
328 | { |
---|
329 | if ( !checker.isInitialized() ) checker.initialize(); |
---|
330 | MDHistoWorkspace_sptr mdhws1 = MDEventsTestHelper::makeFakeMDHistoWorkspace(5.0, 4); |
---|
331 | MDHistoWorkspace_sptr mdhws2 = MDEventsTestHelper::makeFakeMDHistoWorkspace(5.0, 4); |
---|
332 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace1", boost::dynamic_pointer_cast<IMDWorkspace>(mdhws1)) ); |
---|
333 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace2", boost::dynamic_pointer_cast<IMDWorkspace>(mdhws2)) ); |
---|
334 | TS_ASSERT( checker.execute() ); |
---|
335 | TS_ASSERT_EQUALS( checker.getPropertyValue("Result"), checker.successString() ); |
---|
336 | } |
---|
337 | |
---|
338 | void testMDHist_different_dims() |
---|
339 | { |
---|
340 | if ( !checker.isInitialized() ) checker.initialize(); |
---|
341 | MDHistoWorkspace_sptr mdhws1 = MDEventsTestHelper::makeFakeMDHistoWorkspace(5.0, 4); |
---|
342 | MDHistoWorkspace_sptr mdhws2 = MDEventsTestHelper::makeFakeMDHistoWorkspace(5.0, 3); |
---|
343 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace1", boost::dynamic_pointer_cast<IMDWorkspace>(mdhws1)) ); |
---|
344 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace2", boost::dynamic_pointer_cast<IMDWorkspace>(mdhws2)) ); |
---|
345 | TS_ASSERT( checker.execute() ); |
---|
346 | TS_ASSERT_DIFFERS( checker.getPropertyValue("Result"), checker.successString() ); |
---|
347 | } |
---|
348 | |
---|
349 | void testMDHist_different_dimnames() |
---|
350 | { |
---|
351 | if ( !checker.isInitialized() ) checker.initialize(); |
---|
352 | MDHistoWorkspace_sptr mdhws1 = MDEventsTestHelper::makeFakeMDHistoWorkspace(5.0, 3); |
---|
353 | const int dims = 3; |
---|
354 | std::size_t numBins[dims] = {10, 10, 10}; |
---|
355 | Mantid::coord_t min[dims] = {0.0, 0.0, 0.0}; |
---|
356 | Mantid::coord_t max[dims] = {10.0, 10.0, 10.0}; |
---|
357 | std::vector<std::string> names; |
---|
358 | names.push_back("h"); |
---|
359 | names.push_back("k"); |
---|
360 | names.push_back("l"); |
---|
361 | MDHistoWorkspace_sptr mdhws2 = MDEventsTestHelper::makeFakeMDHistoWorkspaceGeneral(3, 5.0, 1.0, numBins, min, max, names); |
---|
362 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace1", boost::dynamic_pointer_cast<IMDWorkspace>(mdhws1)) ); |
---|
363 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace2", boost::dynamic_pointer_cast<IMDWorkspace>(mdhws2)) ); |
---|
364 | TS_ASSERT( checker.execute() ); |
---|
365 | TS_ASSERT_DIFFERS( checker.getPropertyValue("Result"), checker.successString() ); |
---|
366 | } |
---|
367 | |
---|
368 | void testMDHist_different_dimbins() |
---|
369 | { |
---|
370 | if ( !checker.isInitialized() ) checker.initialize(); |
---|
371 | MDHistoWorkspace_sptr mdhws1 = MDEventsTestHelper::makeFakeMDHistoWorkspace(5.0, 3); |
---|
372 | MDHistoWorkspace_sptr mdhws2 = MDEventsTestHelper::makeFakeMDHistoWorkspace(5.0, 3, 5); |
---|
373 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace1", boost::dynamic_pointer_cast<IMDWorkspace>(mdhws1)) ); |
---|
374 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace2", boost::dynamic_pointer_cast<IMDWorkspace>(mdhws2)) ); |
---|
375 | TS_ASSERT( checker.execute() ); |
---|
376 | TS_ASSERT_DIFFERS( checker.getPropertyValue("Result"), checker.successString() ); |
---|
377 | } |
---|
378 | |
---|
379 | void testMDHist_different_dimmax() |
---|
380 | { |
---|
381 | if ( !checker.isInitialized() ) checker.initialize(); |
---|
382 | MDHistoWorkspace_sptr mdhws1 = MDEventsTestHelper::makeFakeMDHistoWorkspace(5.0, 3); |
---|
383 | Mantid::coord_t max = static_cast<Mantid::coord_t>(10.1); |
---|
384 | MDHistoWorkspace_sptr mdhws2 = MDEventsTestHelper::makeFakeMDHistoWorkspace(5.0, 3, 10, max); |
---|
385 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace1", boost::dynamic_pointer_cast<IMDWorkspace>(mdhws1)) ); |
---|
386 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace2", boost::dynamic_pointer_cast<IMDWorkspace>(mdhws2)) ); |
---|
387 | TS_ASSERT( checker.execute() ); |
---|
388 | TS_ASSERT_DIFFERS( checker.getPropertyValue("Result"), checker.successString() ); |
---|
389 | } |
---|
390 | |
---|
391 | void testMDHist_different_data() |
---|
392 | { |
---|
393 | if ( !checker.isInitialized() ) checker.initialize(); |
---|
394 | MDHistoWorkspace_sptr mdhws1 = MDEventsTestHelper::makeFakeMDHistoWorkspace(5.0, 4); |
---|
395 | MDHistoWorkspace_sptr mdhws2 = MDEventsTestHelper::makeFakeMDHistoWorkspace(5.1, 4); |
---|
396 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace1", boost::dynamic_pointer_cast<IMDWorkspace>(mdhws1)) ); |
---|
397 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace2", boost::dynamic_pointer_cast<IMDWorkspace>(mdhws2)) ); |
---|
398 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Tolerance", 1.0e-5 ) ); |
---|
399 | TS_ASSERT( checker.execute() ); |
---|
400 | TS_ASSERT_DIFFERS( checker.getPropertyValue("Result"), checker.successString() ); |
---|
401 | } |
---|
402 | |
---|
403 | void testMDHist_different_error() |
---|
404 | { |
---|
405 | if ( !checker.isInitialized() ) checker.initialize(); |
---|
406 | MDHistoWorkspace_sptr mdhws1 = MDEventsTestHelper::makeFakeMDHistoWorkspace(5.0, 4); |
---|
407 | MDHistoWorkspace_sptr mdhws2 = MDEventsTestHelper::makeFakeMDHistoWorkspace(5.0, 4, 10, 10.0, 1.1); |
---|
408 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace1", boost::dynamic_pointer_cast<IMDWorkspace>(mdhws1)) ); |
---|
409 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace2", boost::dynamic_pointer_cast<IMDWorkspace>(mdhws2)) ); |
---|
410 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Tolerance", 1.0e-5 ) ); |
---|
411 | TS_ASSERT( checker.execute() ); |
---|
412 | TS_ASSERT_DIFFERS( checker.getPropertyValue("Result"), checker.successString() ); |
---|
413 | } |
---|
414 | |
---|
415 | void testDifferentSize() |
---|
416 | { |
---|
417 | if ( !checker.isInitialized() ) checker.initialize(); |
---|
418 | |
---|
419 | Mantid::API::MatrixWorkspace_sptr ws2 = WorkspaceCreationHelper::Create1DWorkspaceFib(2); |
---|
420 | |
---|
421 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace1",ws1) ); |
---|
422 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace2",ws2) ); |
---|
423 | |
---|
424 | TS_ASSERT( checker.execute() ); |
---|
425 | TS_ASSERT_EQUALS( checker.getPropertyValue("Result"), "Size mismatch" ); |
---|
426 | |
---|
427 | // Same, using the !Mantid::API::equals() function |
---|
428 | TS_ASSERT( (!Mantid::API::equals(ws1, ws2)) ); |
---|
429 | } |
---|
430 | |
---|
431 | void testHistNotHist() |
---|
432 | { |
---|
433 | if ( !checker.isInitialized() ) checker.initialize(); |
---|
434 | |
---|
435 | Mantid::API::MatrixWorkspace_sptr ws2 = WorkspaceCreationHelper::Create2DWorkspace123(2,2,true); |
---|
436 | |
---|
437 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace1",ws1) ); |
---|
438 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace2",ws2) ); |
---|
439 | |
---|
440 | TS_ASSERT( checker.execute() ); |
---|
441 | TS_ASSERT_EQUALS( checker.getPropertyValue("Result"), "Histogram/point-like mismatch" ); |
---|
442 | |
---|
443 | // Same, using the !Mantid::API::equals() function |
---|
444 | TS_ASSERT( (!Mantid::API::equals(ws1, ws2)) ); |
---|
445 | } |
---|
446 | |
---|
447 | void testDistNonDist() |
---|
448 | { |
---|
449 | if ( !checker.isInitialized() ) checker.initialize(); |
---|
450 | |
---|
451 | Mantid::API::MatrixWorkspace_sptr ws2 = WorkspaceCreationHelper::Create2DWorkspace123(2,2); |
---|
452 | ws2->isDistribution(true); |
---|
453 | |
---|
454 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace1",ws1) ); |
---|
455 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace2",ws2) ); |
---|
456 | |
---|
457 | TS_ASSERT( checker.execute() ); |
---|
458 | TS_ASSERT_EQUALS( checker.getPropertyValue("Result"), "Distribution flag mismatch" ); |
---|
459 | |
---|
460 | // Same, using the !Mantid::API::equals() function |
---|
461 | TS_ASSERT( (!Mantid::API::equals(ws1, ws2)) ); |
---|
462 | } |
---|
463 | |
---|
464 | void testDifferentAxisType() |
---|
465 | { |
---|
466 | if ( !checker.isInitialized() ) checker.initialize(); |
---|
467 | |
---|
468 | Mantid::API::MatrixWorkspace_sptr ws2 = WorkspaceCreationHelper::Create2DWorkspace123(2,2); |
---|
469 | Mantid::API::Axis* const newAxis = new Mantid::API::NumericAxis(2); |
---|
470 | ws2->replaceAxis(1,newAxis); |
---|
471 | |
---|
472 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace1",ws1) ); |
---|
473 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace2",ws2) ); |
---|
474 | |
---|
475 | TS_ASSERT( checker.execute() ) |
---|
476 | TS_ASSERT_EQUALS( checker.getPropertyValue("Result"), "Axis 1 type mismatch" ); |
---|
477 | |
---|
478 | // Same, using the !Mantid::API::equals() function |
---|
479 | TS_ASSERT( (!Mantid::API::equals(ws1, ws2)) ); |
---|
480 | } |
---|
481 | |
---|
482 | void testDifferentAxisTitles() |
---|
483 | { |
---|
484 | if ( !checker.isInitialized() ) checker.initialize(); |
---|
485 | |
---|
486 | Mantid::API::MatrixWorkspace_sptr ws2 = WorkspaceCreationHelper::Create2DWorkspace123(2,2); |
---|
487 | ws2->getAxis(0)->title() = "blah"; |
---|
488 | |
---|
489 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace1",ws1) ); |
---|
490 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace2",ws2) ); |
---|
491 | |
---|
492 | TS_ASSERT( checker.execute() ); |
---|
493 | TS_ASSERT_EQUALS( checker.getPropertyValue("Result"), "Axis 0 title mismatch" ); |
---|
494 | |
---|
495 | // Same, using the !Mantid::API::equals() function |
---|
496 | TS_ASSERT( (!Mantid::API::equals(ws1, ws2)) ); |
---|
497 | } |
---|
498 | |
---|
499 | void testDifferentAxisUnit() |
---|
500 | { |
---|
501 | if ( !checker.isInitialized() ) checker.initialize(); |
---|
502 | |
---|
503 | Mantid::API::MatrixWorkspace_sptr ws2 = WorkspaceCreationHelper::Create2DWorkspace123(2,2); |
---|
504 | ws2->getAxis(0)->unit() = Mantid::Kernel::UnitFactory::Instance().create("Wavelength"); |
---|
505 | |
---|
506 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace1",ws1) ); |
---|
507 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace2",ws2) ); |
---|
508 | |
---|
509 | TS_ASSERT( checker.execute() ); |
---|
510 | TS_ASSERT_EQUALS( checker.getPropertyValue("Result"), "Axis 0 unit mismatch" ); |
---|
511 | // Same, using the !Mantid::API::equals() function |
---|
512 | TS_ASSERT( (!Mantid::API::equals(ws1, ws2)) ); |
---|
513 | } |
---|
514 | |
---|
515 | void testDifferentAxisValues() |
---|
516 | { |
---|
517 | if ( !checker.isInitialized() ) checker.initialize(); |
---|
518 | |
---|
519 | Mantid::API::MatrixWorkspace_sptr ws1local = WorkspaceCreationHelper::Create2DWorkspace123(2,2); |
---|
520 | Mantid::API::MatrixWorkspace_sptr ws2 = WorkspaceCreationHelper::Create2DWorkspace123(2,2); |
---|
521 | // Put numeric axes on these workspaces as checkAxes won't test values on spectra axes |
---|
522 | Axis * newAxisWS1 = new NumericAxis(ws1local->getAxis(1)->length()); |
---|
523 | newAxisWS1->setValue(0,1); |
---|
524 | newAxisWS1->setValue(1,2); |
---|
525 | Axis * newAxisWS2 = new NumericAxis(ws2->getAxis(1)->length()); |
---|
526 | newAxisWS2->setValue(0,1); |
---|
527 | newAxisWS2->setValue(1,2); |
---|
528 | ws1local->replaceAxis(1, newAxisWS1); |
---|
529 | ws2->replaceAxis(1, newAxisWS2); |
---|
530 | |
---|
531 | // Check that it's all good |
---|
532 | TS_ASSERT( (Mantid::API::equals(ws1local, ws2)) ); |
---|
533 | |
---|
534 | // Now change a value in one axis |
---|
535 | ws2->getAxis(1)->setValue(1,99); |
---|
536 | |
---|
537 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace1",ws1local) ); |
---|
538 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace2",ws2) ); |
---|
539 | |
---|
540 | TS_ASSERT( checker.execute() ) |
---|
541 | TS_ASSERT_EQUALS( checker.getPropertyValue("Result"), "Axis 1 values mismatch" ) ; |
---|
542 | // Same, using the !Mantid::API::equals() function |
---|
543 | TS_ASSERT( (!Mantid::API::equals(ws1local, ws2)) ); |
---|
544 | } |
---|
545 | |
---|
546 | void testDifferentYUnit() |
---|
547 | { |
---|
548 | if ( !checker.isInitialized() ) checker.initialize(); |
---|
549 | |
---|
550 | Mantid::API::MatrixWorkspace_sptr ws2 = WorkspaceCreationHelper::Create2DWorkspace123(2,2); |
---|
551 | ws2->setYUnit("blah"); |
---|
552 | |
---|
553 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace1",ws1) ); |
---|
554 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace2",ws2) ); |
---|
555 | |
---|
556 | TS_ASSERT( checker.execute() ); |
---|
557 | TS_ASSERT_EQUALS( checker.getPropertyValue("Result"), "YUnit mismatch" ); |
---|
558 | // Same, using the !Mantid::API::equals() function |
---|
559 | TS_ASSERT( (!Mantid::API::equals(ws1, ws2)) ); |
---|
560 | } |
---|
561 | |
---|
562 | void testDifferentSpectraMap() |
---|
563 | { |
---|
564 | if ( !checker.isInitialized() ) checker.initialize(); |
---|
565 | |
---|
566 | Mantid::API::MatrixWorkspace_sptr ws2 = WorkspaceCreationHelper::Create2DWorkspace123(2,2); |
---|
567 | ws2->getSpectrum(0)->setSpectrumNo(1234); |
---|
568 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace1",ws1) ); |
---|
569 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace2",ws2) ); |
---|
570 | TS_ASSERT( checker.execute() ); |
---|
571 | TS_ASSERT_EQUALS( checker.getPropertyValue("Result"), "Spectrum number mismatch" ); |
---|
572 | |
---|
573 | ws2 = WorkspaceCreationHelper::Create2DWorkspace123(2,2); |
---|
574 | ws2->getSpectrum(0)->setDetectorID(99); |
---|
575 | ws2->getSpectrum(1)->setDetectorID(98); |
---|
576 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace1",ws1) ); |
---|
577 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace2",ws2) ); |
---|
578 | TS_ASSERT( checker.execute() ); |
---|
579 | TS_ASSERT_EQUALS( checker.getPropertyValue("Result"), "Detector IDs mismatch" ); |
---|
580 | |
---|
581 | // Same, using the !Mantid::API::equals() function |
---|
582 | TS_ASSERT( (!Mantid::API::equals(ws1, ws2)) ); |
---|
583 | } |
---|
584 | |
---|
585 | void testDifferentInstruments() |
---|
586 | { |
---|
587 | if ( !checker.isInitialized() ) checker.initialize(); |
---|
588 | |
---|
589 | Mantid::API::MatrixWorkspace_sptr ws2 = WorkspaceCreationHelper::Create2DWorkspace123(2,2); |
---|
590 | Mantid::Geometry::Instrument_sptr instrument(new Mantid::Geometry::Instrument("different")); |
---|
591 | ws2->setInstrument(instrument); |
---|
592 | |
---|
593 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace1",ws1) ); |
---|
594 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace2",ws2) ); |
---|
595 | |
---|
596 | TS_ASSERT( checker.execute() ); |
---|
597 | TS_ASSERT_EQUALS( checker.getPropertyValue("Result"), "Instrument name mismatch" ); |
---|
598 | // Same, using the !Mantid::API::equals() function |
---|
599 | TS_ASSERT( (!Mantid::API::equals(ws1, ws2)) ); |
---|
600 | } |
---|
601 | |
---|
602 | void testDifferentParameterMaps() |
---|
603 | { |
---|
604 | if ( !checker.isInitialized() ) checker.initialize(); |
---|
605 | |
---|
606 | Mantid::API::MatrixWorkspace_sptr ws2 = WorkspaceCreationHelper::Create2DWorkspace123(2,2); |
---|
607 | ws2->instrumentParameters().addBool(new Mantid::Geometry::Component, "myParam", true); |
---|
608 | |
---|
609 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace1",ws1) ); |
---|
610 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace2",ws2) ); |
---|
611 | |
---|
612 | TS_ASSERT( checker.execute() ); |
---|
613 | TS_ASSERT_EQUALS( checker.getPropertyValue("Result"), "Instrument ParameterMap mismatch (differences in ordering ignored)" ); |
---|
614 | // Same, using the !Mantid::API::equals() function |
---|
615 | TS_ASSERT( (!Mantid::API::equals(ws1, ws2)) ); |
---|
616 | } |
---|
617 | |
---|
618 | void testDifferentMasking() |
---|
619 | { |
---|
620 | if ( !checker.isInitialized() ) checker.initialize(); |
---|
621 | |
---|
622 | Mantid::API::MatrixWorkspace_sptr ws2 = WorkspaceCreationHelper::Create2DWorkspace123(2,2); |
---|
623 | ws2->maskBin(0,0); |
---|
624 | ws2->dataY(0)[0] = 2; |
---|
625 | ws2->dataE(0)[0] = 3; |
---|
626 | |
---|
627 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace1",ws1) ); |
---|
628 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace2",ws2) ); |
---|
629 | |
---|
630 | TS_ASSERT( checker.execute() ); |
---|
631 | TS_ASSERT_EQUALS( checker.getPropertyValue("Result"), "Masking mismatch" ); |
---|
632 | |
---|
633 | Mantid::API::MatrixWorkspace_sptr ws3 = WorkspaceCreationHelper::Create2DWorkspace123(2,2); |
---|
634 | ws3->maskBin(0,1); |
---|
635 | ws3->dataY(0)[1] = 2; |
---|
636 | ws3->dataE(0)[1] = 3; |
---|
637 | |
---|
638 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace1",ws3) ); |
---|
639 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace2",ws2) ); |
---|
640 | |
---|
641 | TS_ASSERT( checker.execute() ); |
---|
642 | TS_ASSERT_EQUALS( checker.getPropertyValue("Result"), "Masking mismatch" ); |
---|
643 | // Same, using the !Mantid::API::equals() function |
---|
644 | TS_ASSERT( (!Mantid::API::equals(ws1, ws2)) ); |
---|
645 | } |
---|
646 | |
---|
647 | void testDifferentSampleName() |
---|
648 | { |
---|
649 | if ( !checker.isInitialized() ) checker.initialize(); |
---|
650 | checker.setProperty("CheckSample",true); |
---|
651 | |
---|
652 | Mantid::API::MatrixWorkspace_sptr ws2 = WorkspaceCreationHelper::Create2DWorkspace123(2,2); |
---|
653 | ws2->mutableSample().setName("different"); |
---|
654 | |
---|
655 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace1",ws1) ); |
---|
656 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace2",ws2) ); |
---|
657 | |
---|
658 | TS_ASSERT( checker.execute() ); |
---|
659 | TS_ASSERT_EQUALS( checker.getPropertyValue("Result"), "Sample name mismatch" ); |
---|
660 | } |
---|
661 | |
---|
662 | void testDifferentProtonCharge() |
---|
663 | { |
---|
664 | if ( !checker.isInitialized() ) checker.initialize(); |
---|
665 | checker.setProperty("CheckSample",true); |
---|
666 | |
---|
667 | Mantid::API::MatrixWorkspace_sptr ws2 = WorkspaceCreationHelper::Create2DWorkspace123(2,2); |
---|
668 | ws2->mutableRun().setProtonCharge(99.99); |
---|
669 | |
---|
670 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace1",ws1) ); |
---|
671 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace2",ws2) ); |
---|
672 | |
---|
673 | TS_ASSERT( checker.execute() ); |
---|
674 | TS_ASSERT_EQUALS( checker.getPropertyValue("Result"), "Proton charge mismatch" ); |
---|
675 | } |
---|
676 | |
---|
677 | void testDifferentLogs() |
---|
678 | { |
---|
679 | if ( !checker.isInitialized() ) checker.initialize(); |
---|
680 | checker.setProperty("CheckSample",true); |
---|
681 | |
---|
682 | Mantid::API::MatrixWorkspace_sptr ws2 = WorkspaceCreationHelper::Create2DWorkspace123(2,2); |
---|
683 | ws2->mutableRun().addLogData(new Mantid::Kernel::PropertyWithValue<int>("Prop1",99)); |
---|
684 | |
---|
685 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace1",ws1) ); |
---|
686 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace2",ws2) ); |
---|
687 | |
---|
688 | TS_ASSERT( checker.execute() ); |
---|
689 | TS_ASSERT_EQUALS( checker.getPropertyValue("Result"), "Different numbers of logs" ); |
---|
690 | |
---|
691 | Mantid::API::MatrixWorkspace_sptr ws3 = WorkspaceCreationHelper::Create2DWorkspace123(2,2); |
---|
692 | ws3->mutableRun().addLogData(new Mantid::Kernel::PropertyWithValue<int>("Prop2",99)); |
---|
693 | |
---|
694 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace1",ws2) ); |
---|
695 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace2",ws3) ); |
---|
696 | |
---|
697 | TS_ASSERT( checker.execute() ); |
---|
698 | TS_ASSERT_EQUALS( checker.getPropertyValue("Result"), "Log name mismatch" ); |
---|
699 | |
---|
700 | Mantid::API::MatrixWorkspace_sptr ws4 = WorkspaceCreationHelper::Create2DWorkspace123(2,2); |
---|
701 | ws4->mutableRun().addLogData(new Mantid::Kernel::PropertyWithValue<int>("Prop1",100)); |
---|
702 | |
---|
703 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace1",ws2) ); |
---|
704 | TS_ASSERT_THROWS_NOTHING( checker.setProperty("Workspace2",ws4) ); |
---|
705 | |
---|
706 | TS_ASSERT( checker.execute() ); |
---|
707 | TS_ASSERT_EQUALS( checker.getPropertyValue("Result"), "Log value mismatch" ); |
---|
708 | } |
---|
709 | |
---|
710 | void test_Input_With_Two_Groups_That_Are_The_Same_Matches() |
---|
711 | { |
---|
712 | // Create a group |
---|
713 | const std::string groupName("TestGroup"); |
---|
714 | WorkspaceGroup_sptr group = WorkspaceCreationHelper::CreateWorkspaceGroup(2, 2, 2, groupName); |
---|
715 | |
---|
716 | doGroupTest(groupName, groupName, Mantid::Algorithms::CheckWorkspacesMatch::successString()); |
---|
717 | |
---|
718 | cleanupGroup(group); |
---|
719 | } |
---|
720 | |
---|
721 | void test_Input_With_Two_Groups_That_Are_Different_Sizes_Fails() |
---|
722 | { |
---|
723 | // Create a group |
---|
724 | const std::string groupOneName("TestGroupOne"); |
---|
725 | WorkspaceGroup_sptr groupOne = WorkspaceCreationHelper::CreateWorkspaceGroup(2, 2, 2, groupOneName); |
---|
726 | const std::string groupTwoName("TestGroupTwo"); |
---|
727 | WorkspaceGroup_sptr groupTwo = WorkspaceCreationHelper::CreateWorkspaceGroup(3, 2, 2, groupTwoName); |
---|
728 | |
---|
729 | doGroupTest(groupOneName, groupTwoName, "GroupWorkspaces size mismatch.", std::map<std::string,std::string>(), true); |
---|
730 | |
---|
731 | cleanupGroup(groupOne); |
---|
732 | cleanupGroup(groupTwo); |
---|
733 | } |
---|
734 | |
---|
735 | void test_Input_With_A_Group_And_A_Single_Workspace_Gives_Type_Mismatch() |
---|
736 | { |
---|
737 | const std::string groupName("CheckWorkspacesMatch_TestGroup"); |
---|
738 | WorkspaceGroup_sptr group = WorkspaceCreationHelper::CreateWorkspaceGroup(2, 2, 2, groupName); |
---|
739 | Mantid::API::MatrixWorkspace_sptr ws2 = WorkspaceCreationHelper::Create2DWorkspace123(2,2); |
---|
740 | const std::string wsName("CheckWorkspacesMatch_TestWS"); |
---|
741 | Mantid::API::AnalysisDataService::Instance().add(wsName,ws2); |
---|
742 | |
---|
743 | doGroupTest(groupName, wsName, "Type mismatch. One workspace is a group, the other is not."); |
---|
744 | |
---|
745 | // Cleanup |
---|
746 | cleanupGroup(group); |
---|
747 | Mantid::API::AnalysisDataService::Instance().remove(wsName); |
---|
748 | } |
---|
749 | |
---|
750 | void test_Input_With_Two_Groups_When_Single_Item_Checking_Is_Disabled() |
---|
751 | { |
---|
752 | Mantid::API::AnalysisDataService::Instance().clear(); |
---|
753 | // Create a group |
---|
754 | const std::string groupOneName("TestGroupOne"); |
---|
755 | WorkspaceGroup_sptr groupOne = WorkspaceCreationHelper::CreateWorkspaceGroup(2, 2, 2, groupOneName); |
---|
756 | const std::string groupTwoName("TestGroupTwo"); |
---|
757 | WorkspaceGroup_sptr groupTwo = WorkspaceCreationHelper::CreateWorkspaceGroup(2, 2, 2, groupTwoName); |
---|
758 | Mantid::API::AnalysisDataServiceImpl& dataStore = Mantid::API::AnalysisDataService::Instance(); |
---|
759 | // Extract the zeroth element of groupTwo and add a spurious log |
---|
760 | MatrixWorkspace_sptr zero = boost::dynamic_pointer_cast<MatrixWorkspace>(dataStore.retrieve(groupTwo->getNames()[0])); |
---|
761 | TS_ASSERT(zero); |
---|
762 | using Mantid::Kernel::PropertyWithValue; |
---|
763 | zero->mutableRun().addProperty(new PropertyWithValue<double>("ExtraLog", 10)); |
---|
764 | |
---|
765 | std::map<std::string,std::string> otherProps; |
---|
766 | otherProps.insert(std::make_pair("CheckSample", "1")); |
---|
767 | |
---|
768 | doGroupTest(groupOneName, groupTwoName, "Different numbers of logs. Inputs=[TestGroupOne_0,TestGroupTwo_0]", otherProps); |
---|
769 | |
---|
770 | // Cleanup |
---|
771 | cleanupGroup(groupOne); |
---|
772 | cleanupGroup(groupTwo); |
---|
773 | } |
---|
774 | |
---|
775 | void test_empty_tableworkspaces_match() |
---|
776 | { |
---|
777 | Mantid::Algorithms::CheckWorkspacesMatch alg; |
---|
778 | alg.initialize(); |
---|
779 | TS_ASSERT_THROWS_NOTHING( alg.setProperty("Workspace1", WorkspaceFactory::Instance().createTable()) ); |
---|
780 | TS_ASSERT_THROWS_NOTHING( alg.setProperty("Workspace2", WorkspaceFactory::Instance().createTable()) ); |
---|
781 | TS_ASSERT( alg.execute() ); |
---|
782 | TS_ASSERT_EQUALS( alg.getPropertyValue("Result"), "Success!" ); |
---|
783 | } |
---|
784 | |
---|
785 | void test_tableworkspace_different_number_of_columns_fails() |
---|
786 | { |
---|
787 | auto table1 = WorkspaceFactory::Instance().createTable(); |
---|
788 | auto table2 = WorkspaceFactory::Instance().createTable(); |
---|
789 | table1->addColumns("int","aColumn",2); |
---|
790 | table2->addColumns("int","aColumn",3); |
---|
791 | |
---|
792 | Mantid::Algorithms::CheckWorkspacesMatch alg; |
---|
793 | alg.initialize(); |
---|
794 | TS_ASSERT_THROWS_NOTHING( alg.setProperty("Workspace1", table1) ); |
---|
795 | TS_ASSERT_THROWS_NOTHING( alg.setProperty("Workspace2", table2) ); |
---|
796 | TS_ASSERT( alg.execute() ); |
---|
797 | TS_ASSERT_EQUALS( alg.getPropertyValue("Result"), "Number of columns mismatch" ); |
---|
798 | } |
---|
799 | |
---|
800 | void test_tableworkspace_different_number_of_rows_fails() |
---|
801 | { |
---|
802 | auto table1 = WorkspaceFactory::Instance().createTable(); |
---|
803 | auto table2 = WorkspaceFactory::Instance().createTable(); |
---|
804 | table1->addColumn("double","aColumn"); |
---|
805 | table1->appendRow(); |
---|
806 | table1->appendRow(); |
---|
807 | table2->addColumn("double","aColumn"); |
---|
808 | table2->appendRow(); |
---|
809 | |
---|
810 | Mantid::Algorithms::CheckWorkspacesMatch alg; |
---|
811 | alg.initialize(); |
---|
812 | TS_ASSERT_THROWS_NOTHING( alg.setProperty("Workspace1", table1) ); |
---|
813 | TS_ASSERT_THROWS_NOTHING( alg.setProperty("Workspace2", table2) ); |
---|
814 | TS_ASSERT( alg.execute() ); |
---|
815 | TS_ASSERT_EQUALS( alg.getPropertyValue("Result"), "Number of rows mismatch" ); |
---|
816 | } |
---|
817 | |
---|
818 | void test_tableworkspace_matches_itself() |
---|
819 | { |
---|
820 | auto table = setupTableWorkspace(); |
---|
821 | Mantid::Algorithms::CheckWorkspacesMatch alg; |
---|
822 | alg.initialize(); |
---|
823 | TS_ASSERT_THROWS_NOTHING( alg.setProperty("Workspace1", table) ); |
---|
824 | TS_ASSERT_THROWS_NOTHING( alg.setProperty("Workspace2", table) ); |
---|
825 | TS_ASSERT( alg.execute() ); |
---|
826 | TS_ASSERT_EQUALS( alg.getPropertyValue("Result"), "Success!" ); |
---|
827 | } |
---|
828 | |
---|
829 | void test_tableworkspace_different_column_names_fails() |
---|
830 | { |
---|
831 | auto table1 = setupTableWorkspace(); |
---|
832 | table1->getColumn(5)->setName("SomethingElse"); |
---|
833 | auto table2 = setupTableWorkspace(); |
---|
834 | Mantid::Algorithms::CheckWorkspacesMatch alg; |
---|
835 | alg.initialize(); |
---|
836 | TS_ASSERT_THROWS_NOTHING( alg.setProperty("Workspace1", table1) ); |
---|
837 | TS_ASSERT_THROWS_NOTHING( alg.setProperty("Workspace2", table2) ); |
---|
838 | TS_ASSERT( alg.execute() ); |
---|
839 | TS_ASSERT_EQUALS( alg.getPropertyValue("Result"), "Column name mismatch" ); |
---|
840 | } |
---|
841 | |
---|
842 | void test_tableworkspace_different_column_types_fails() |
---|
843 | { |
---|
844 | auto table1 = setupTableWorkspace(); |
---|
845 | auto table2 = setupTableWorkspace(); |
---|
846 | table2->removeColumn("V3D"); |
---|
847 | table2->addColumn("int","V3D"); |
---|
848 | Mantid::Algorithms::CheckWorkspacesMatch alg; |
---|
849 | alg.initialize(); |
---|
850 | TS_ASSERT_THROWS_NOTHING( alg.setProperty("Workspace1", table1) ); |
---|
851 | TS_ASSERT_THROWS_NOTHING( alg.setProperty("Workspace2", table2) ); |
---|
852 | TS_ASSERT( alg.execute() ); |
---|
853 | TS_ASSERT_EQUALS( alg.getPropertyValue("Result"), "Column type mismatch" ); |
---|
854 | } |
---|
855 | |
---|
856 | void test_tableworkspace_different_data_fails() |
---|
857 | { |
---|
858 | auto table1 = setupTableWorkspace(); |
---|
859 | auto table2 = setupTableWorkspace(); |
---|
860 | table2->cell<size_t>(1,3) = 123; |
---|
861 | Mantid::Algorithms::CheckWorkspacesMatch alg; |
---|
862 | alg.initialize(); |
---|
863 | TS_ASSERT_THROWS_NOTHING( alg.setProperty("Workspace1", table1) ); |
---|
864 | TS_ASSERT_THROWS_NOTHING( alg.setProperty("Workspace2", table2) ); |
---|
865 | TS_ASSERT( alg.execute() ); |
---|
866 | TS_ASSERT_EQUALS( alg.getPropertyValue("Result"), "Table data mismatch" ); |
---|
867 | |
---|
868 | table2 = setupTableWorkspace(); |
---|
869 | table1->cell<std::string>(2,7) = "?"; |
---|
870 | TS_ASSERT_THROWS_NOTHING( alg.setProperty("Workspace1", table1) ); |
---|
871 | TS_ASSERT_THROWS_NOTHING( alg.setProperty("Workspace2", table2) ); |
---|
872 | TS_ASSERT( alg.execute() ); |
---|
873 | TS_ASSERT_EQUALS( alg.getPropertyValue("Result"), "Table data mismatch" ); |
---|
874 | |
---|
875 | table1 = setupTableWorkspace(); |
---|
876 | table2->cell<Mantid::Kernel::V3D>(0,8) = Mantid::Kernel::V3D(9.9,8.8,7.7); |
---|
877 | TS_ASSERT_THROWS_NOTHING( alg.setProperty("Workspace1", table1) ); |
---|
878 | TS_ASSERT_THROWS_NOTHING( alg.setProperty("Workspace2", table2) ); |
---|
879 | TS_ASSERT( alg.execute() ); |
---|
880 | TS_ASSERT_EQUALS( alg.getPropertyValue("Result"), "Table data mismatch" ); |
---|
881 | } |
---|
882 | |
---|
883 | void test_mixing_peaks_and_table_workspaces_fails() |
---|
884 | { |
---|
885 | Mantid::Algorithms::CheckWorkspacesMatch alg; |
---|
886 | alg.initialize(); |
---|
887 | TS_ASSERT_THROWS_NOTHING( alg.setProperty("Workspace1", WorkspaceFactory::Instance().createTable()) ); |
---|
888 | TS_ASSERT_THROWS_NOTHING( alg.setProperty("Workspace2", WorkspaceFactory::Instance().createPeaks()) ); |
---|
889 | TS_ASSERT( alg.execute() ); |
---|
890 | TS_ASSERT_EQUALS( alg.getPropertyValue("Result"), "One workspace is a PeaksWorkspace and the other is not." ); |
---|
891 | } |
---|
892 | |
---|
893 | void test_mixing_matrix_and_table_workspaces_fails() |
---|
894 | { |
---|
895 | Mantid::Algorithms::CheckWorkspacesMatch alg; |
---|
896 | alg.initialize(); |
---|
897 | TS_ASSERT_THROWS_NOTHING( alg.setProperty("Workspace1", WorkspaceFactory::Instance().createTable()) ); |
---|
898 | TS_ASSERT_THROWS_NOTHING( alg.setProperty("Workspace2", WorkspaceFactory::Instance().create("Workspace2D",1,1,1)) ); |
---|
899 | TS_ASSERT( alg.execute() ); |
---|
900 | TS_ASSERT_EQUALS( alg.getPropertyValue("Result"), "One workspace is a TableWorkspace and the other is not." ); |
---|
901 | } |
---|
902 | |
---|
903 | void testSaveAndLoad() |
---|
904 | { |
---|
905 | SaveNexusProcessed alg_save; |
---|
906 | LoadNexus alg_load; |
---|
907 | CheckWorkspacesMatch checker; |
---|
908 | |
---|
909 | if ( !alg_save.isInitialized() ) alg_save.initialize(); |
---|
910 | MatrixWorkspace_sptr goodWS = WorkspaceCreationHelper::create2DWorkspaceWithRectangularInstrument (1, 5,1); |
---|
911 | |
---|
912 | goodWS->mutableSample().setName("samp"); |
---|
913 | goodWS->mutableSample().setGeometryFlag(3); |
---|
914 | |
---|
915 | // Now set it... |
---|
916 | // specify name of file to save workspace to |
---|
917 | alg_save.setProperty("InputWorkspace", goodWS); |
---|
918 | std::string outputFile = "SaveNexusProcessedTest_testExec.nxs"; |
---|
919 | TS_ASSERT_THROWS_NOTHING(alg_save.setPropertyValue("Filename", outputFile)); |
---|
920 | |
---|
921 | if( Poco::File(outputFile).exists() ) Poco::File(outputFile).remove(); |
---|
922 | |
---|
923 | TS_ASSERT_THROWS_NOTHING(alg_save.execute()); |
---|
924 | TS_ASSERT(alg_save.isExecuted()); |
---|
925 | |
---|
926 | std::string loaded = "loadedWS"; |
---|
927 | if ( !alg_load.isInitialized() ) alg_load.initialize(); |
---|
928 | alg_load.setProperty("Filename",outputFile); |
---|
929 | alg_load.setProperty("OutputWorkspace",loaded); |
---|
930 | TS_ASSERT_THROWS_NOTHING(alg_load.execute()); |
---|
931 | TS_ASSERT(alg_load.isExecuted()); |
---|
932 | MatrixWorkspace_sptr output = AnalysisDataService::Instance().retrieveWS<MatrixWorkspace>(loaded); |
---|
933 | |
---|
934 | if (! checker.isInitialized()) checker.initialize(); |
---|
935 | checker.setProperty("Workspace1",goodWS); |
---|
936 | checker.setProperty("Workspace2",output); |
---|
937 | |
---|
938 | TS_ASSERT(checker.execute()); |
---|
939 | TS_ASSERT_EQUALS(checker.getPropertyValue("Result"),"Success!" ); |
---|
940 | |
---|
941 | if( Poco::File(outputFile).exists() ) Poco::File(outputFile).remove(); |
---|
942 | Mantid::API::AnalysisDataService::Instance().remove(output->getName()); |
---|
943 | Mantid::API::AnalysisDataService::Instance().remove(goodWS->getName()); |
---|
944 | |
---|
945 | } |
---|
946 | |
---|
947 | |
---|
948 | private: |
---|
949 | |
---|
950 | ITableWorkspace_sptr setupTableWorkspace() |
---|
951 | { |
---|
952 | auto table = WorkspaceFactory::Instance().createTable(); |
---|
953 | // One column of each type |
---|
954 | table->addColumn("int","int"); |
---|
955 | table->addColumn("int32_t","int32"); |
---|
956 | table->addColumn("long64","int64"); |
---|
957 | table->addColumn("size_t","uint"); |
---|
958 | table->addColumn("float","float"); |
---|
959 | table->addColumn("double","double"); |
---|
960 | table->addColumn("bool","bool"); |
---|
961 | table->addColumn("str","string"); |
---|
962 | table->addColumn("V3D","V3D"); |
---|
963 | |
---|
964 | // A few rows |
---|
965 | TableRow row1 = table->appendRow(); |
---|
966 | row1 << -1 << static_cast<int32_t>(0) << static_cast<int64_t>(1) << static_cast<size_t>(10) |
---|
967 | << 5.5f << -9.9 << true << "Hello" << Mantid::Kernel::V3D(); |
---|
968 | TableRow row2 = table->appendRow(); |
---|
969 | row2 << 1 << static_cast<int32_t>(-2) << static_cast<int64_t>(-2) << static_cast<size_t>(100) |
---|
970 | << 0.0f << 101.0 << false << "World" << Mantid::Kernel::V3D(-1,3,4); |
---|
971 | TableRow row3 = table->appendRow(); |
---|
972 | row3 << 6 << static_cast<int32_t>(3) << static_cast<int64_t>(0) << static_cast<size_t>(0) |
---|
973 | << -99.0f << 0.0 << false << "!" << Mantid::Kernel::V3D(1,6,10); |
---|
974 | |
---|
975 | return table; |
---|
976 | } |
---|
977 | |
---|
978 | void doGroupTest(const std::string & inputWSOne, const std::string & inputWSTwo, |
---|
979 | const std::string & expectedResult, |
---|
980 | const std::map<std::string,std::string> & otherProps = std::map<std::string,std::string>(), |
---|
981 | bool expectFail = false |
---|
982 | ) |
---|
983 | { |
---|
984 | Mantid::Algorithms::CheckWorkspacesMatch matcher; |
---|
985 | matcher.initialize(); |
---|
986 | matcher.setPropertyValue("Workspace1", inputWSOne); |
---|
987 | matcher.setPropertyValue("Workspace2", inputWSTwo); |
---|
988 | std::map<std::string,std::string>::const_iterator iend = otherProps.end(); |
---|
989 | std::map<std::string,std::string>::const_iterator itr = otherProps.begin(); |
---|
990 | for(; itr != iend; ++itr) |
---|
991 | { |
---|
992 | matcher.setPropertyValue(itr->first, itr->second); |
---|
993 | } |
---|
994 | |
---|
995 | TS_ASSERT_THROWS_NOTHING(matcher.execute()); |
---|
996 | if (expectFail) |
---|
997 | { |
---|
998 | TS_ASSERT_EQUALS(matcher.isExecuted(), false); |
---|
999 | return; |
---|
1000 | } |
---|
1001 | TS_ASSERT_EQUALS(matcher.isExecuted(), true); |
---|
1002 | TS_ASSERT_EQUALS(matcher.getPropertyValue("Result"), expectedResult); |
---|
1003 | } |
---|
1004 | |
---|
1005 | void cleanupGroup(const WorkspaceGroup_sptr group) |
---|
1006 | { |
---|
1007 | //group->deepRemoveAll(); |
---|
1008 | const std::string name = group->getName(); |
---|
1009 | Mantid::API::AnalysisDataService::Instance().deepRemoveGroup(name); |
---|
1010 | } |
---|
1011 | |
---|
1012 | private: |
---|
1013 | Mantid::Algorithms::CheckWorkspacesMatch checker; |
---|
1014 | const Mantid::API::MatrixWorkspace_sptr ws1; |
---|
1015 | }; |
---|
1016 | |
---|
1017 | #endif /*CHECKWORKSPACESMATCHTEST_H_*/ |
---|