Skip to content

Commit

Permalink
Remove empty test_Something(). Refs #5580.
Browse files Browse the repository at this point in the history
  • Loading branch information
wdzhou committed Jul 6, 2012
1 parent 70b6ce3 commit 65a2ee8
Showing 1 changed file with 61 additions and 16 deletions.
77 changes: 61 additions & 16 deletions Code/Mantid/Framework/Algorithms/test/StripVanadiumPeaks2Test.h
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_*/

0 comments on commit 65a2ee8

Please sign in to comment.