-
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.
Remove empty test_Something(). Refs #5580.
- Loading branch information
Showing
1 changed file
with
61 additions
and
16 deletions.
There are no files selected for viewing
77 changes: 61 additions & 16 deletions
77
Code/Mantid/Framework/Algorithms/test/StripVanadiumPeaks2Test.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 |
---|---|---|
@@ -1,34 +1,79 @@ | ||
#ifndef MANTID_ALGORITHMS_STRIPVANADIUMPEAKS2TEST_H_ | ||
#define MANTID_ALGORITHMS_STRIPVANADIUMPEAKS2TEST_H_ | ||
#ifndef STRIPVANADIUMPEAKSTEST_H_ | ||
#define STRIPVANADIUMPEAKSTEST_H_ | ||
|
||
#include <cxxtest/TestSuite.h> | ||
#include "MantidKernel/Timer.h" | ||
#include "MantidKernel/System.h" | ||
#include <iostream> | ||
#include <iomanip> | ||
|
||
#include "MantidTestHelpers/WorkspaceCreationHelper.h" | ||
#include "MantidAlgorithms/StripVanadiumPeaks2.h" | ||
#include "MantidAPI/AnalysisDataService.h" | ||
#include "MantidAPI/FrameworkManager.h" | ||
#include "MantidKernel/UnitFactory.h" | ||
#include "MantidKernel/VectorHelper.h" | ||
|
||
using namespace Mantid; | ||
using namespace Mantid::Algorithms; | ||
using namespace Mantid::API; | ||
using namespace Mantid::Kernel::VectorHelper; | ||
using Mantid::Algorithms::StripVanadiumPeaks2; | ||
using Mantid::MantidVec; | ||
|
||
class StripVanadiumPeaks2Test : public CxxTest::TestSuite | ||
{ | ||
public: | ||
// This pair of boilerplate methods prevent the suite being created statically | ||
// This means the constructor isn't called when running other tests | ||
static StripVanadiumPeaks2Test *createSuite() { return new StripVanadiumPeaks2Test(); } | ||
static void destroySuite( StripVanadiumPeaks2Test *suite ) { delete suite; } | ||
|
||
void testTheBasics() | ||
{ | ||
StripVanadiumPeaks2 strip; | ||
TS_ASSERT_EQUALS( strip.name(), "StripVanadiumPeaks" ); | ||
TS_ASSERT_EQUALS( strip.version(), 2 ); | ||
} | ||
|
||
void test_Something() | ||
void testInit() | ||
{ | ||
StripVanadiumPeaks2 strip; | ||
TS_ASSERT_THROWS_NOTHING( strip.initialize() ); | ||
TS_ASSERT( strip.isInitialized() ); | ||
} | ||
|
||
void testExec() | ||
{ | ||
std::string inputWSName("PG3_733"); | ||
std::string outputWSName("PG3_733_stripped"); | ||
|
||
}; | ||
// Start by loading our NXS file | ||
IAlgorithm* loader = Mantid::API::FrameworkManager::Instance().createAlgorithm("LoadNexus"); | ||
loader->setPropertyValue("Filename","PG3_733.nxs"); | ||
loader->setPropertyValue("OutputWorkspace", inputWSName); | ||
loader->execute(); | ||
TS_ASSERT( loader->isExecuted()); | ||
|
||
StripVanadiumPeaks2 strip; | ||
if ( !strip.isInitialized() ) strip.initialize(); | ||
|
||
strip.setPropertyValue("InputWorkspace",inputWSName); | ||
strip.setPropertyValue("OutputWorkspace",outputWSName); | ||
strip.setPropertyValue("BackgroundType", "Linear"); | ||
strip.setPropertyValue("WorkspaceIndex", "2"); | ||
strip.execute(); | ||
TS_ASSERT( strip.isExecuted() ); | ||
|
||
MatrixWorkspace_const_sptr output; | ||
output = AnalysisDataService::Instance().retrieveWS<MatrixWorkspace>(outputWSName); | ||
|
||
//Get a spectrum | ||
MantidVec X = output->dataX(2); | ||
MantidVec Y = output->dataX(2); | ||
|
||
//Check the height at a couple of peak position | ||
int bin; | ||
bin = getBinIndex(X, 0.8113); | ||
TS_ASSERT_LESS_THAN( Y[bin], 11407); | ||
bin = getBinIndex(X, 0.8758); | ||
TS_ASSERT_LESS_THAN( Y[bin], 10850); | ||
|
||
AnalysisDataService::Instance().remove(outputWSName); | ||
AnalysisDataService::Instance().remove(inputWSName); | ||
} | ||
|
||
private: | ||
}; | ||
|
||
#endif /* MANTID_ALGORITHMS_STRIPVANADIUMPEAKS2TEST_H_ */ | ||
#endif /*STRIPVANADIUMPEAKSTEST_H_*/ | ||
|