"...Framework/git@code.ornl.gov:mantidproject/mantid.git" did not exist on "48464bcf4f4f6880983ecb2e6ecdabc52d529174"
Newer
Older
#ifndef MANTID_MDALGORITHMS_LOGARITHMMDTEST_H_
#define MANTID_MDALGORITHMS_LOGARITHMMDTEST_H_
#include <cxxtest/TestSuite.h>
#include "MantidKernel/Timer.h"
#include "MantidKernel/System.h"
#include <iostream>
#include <iomanip>
#include "MantidMDAlgorithms/LogarithmMD.h"
#include "MantidDataObjects/MDHistoWorkspace.h"
#include "MantidTestHelpers/BinaryOperationMDTestHelper.h"
using namespace Mantid;
using namespace Mantid::MDAlgorithms;
using namespace Mantid::API;
using Mantid::DataObjects::MDHistoWorkspace_sptr;
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
class LogarithmMDTest : public CxxTest::TestSuite
{
public:
void test_Init()
{
LogarithmMD alg;
TS_ASSERT_THROWS_NOTHING( alg.initialize() )
TS_ASSERT( alg.isInitialized() )
}
void test_histo()
{
MDHistoWorkspace_sptr out;
out = UnaryOperationMDTestHelper::doTest("LogarithmMD", "histo", "out");
TS_ASSERT_DELTA( out->getSignalAt(0), std::log(2.0), 1e-5);
}
void test_histo_with_not_Natural()
{
MDHistoWorkspace_sptr out;
out = UnaryOperationMDTestHelper::doTest("LogarithmMD", "histo", "out", true, "Natural", "0");
TS_ASSERT_DELTA( out->getSignalAt(0), std::log10(2.0), 1e-5);
}
void test_event_fails()
{
UnaryOperationMDTestHelper::doTest("LogarithmMD", "event", "out", false /* fails*/);
}
};
#endif /* MANTID_MDALGORITHMS_LOGARITHMMDTEST_H_ */