Skip to content

Commit

Permalink
LoadEventNexus test updated Re #3878
Browse files Browse the repository at this point in the history
  • Loading branch information
raquelalvarezbanos committed Oct 16, 2014
1 parent 23a2ef2 commit 327d989
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions Code/Mantid/Framework/DataHandling/test/LoadEventNexusTest.h
Expand Up @@ -221,19 +221,20 @@ class LoadEventNexusTest : public CxxTest::TestSuite
void test_partial_spectra_loading()
{
const std::string wsName = "test_partial_loading";
const int spectrumMin = 30000;
const int spectrumMax = 40000;
std::vector<int> spectrumList;
spectrumList.push_back(20);
spectrumList.push_back(1049);
spectrumList.push_back(5093);
spectrumList.push_back(11044);
//const int spectrumMin = 30000;
//const int spectrumMax = 40000;
std::vector<int32_t> spectrumList;
spectrumList.push_back(2);
spectrumList.push_back(5493);
spectrumList.push_back(6937);
spectrumList.push_back(8895);


LoadEventNexus ld;
ld.initialize();
ld.setPropertyValue("OutputWorkspace", wsName);
ld.setPropertyValue("Filename","CNCS_7860_event.nxs");
// ld.setProperty("SpectrumMin",spectrumMin);
//ld.setProperty("SpectrumMin",spectrumMin);
//ld.setProperty("SpectrumMax",spectrumMax);
ld.setProperty("SpectrumList",spectrumList);
ld.setProperty<bool>("LoadLogs", false); // Time-saver
Expand All @@ -245,7 +246,10 @@ class LoadEventNexusTest : public CxxTest::TestSuite
auto numberSpectra = outWs->getNumberHistograms();
// TSM_ASSERT("The number of spectra in the workspace should be equal to the number of spectra loaded", numberSpectra == spectrumMax-spectrumMin+1);
TSM_ASSERT("The number of spectra in the workspace should be equal to the number of spectra loaded", numberSpectra == spectrumList.size());

TSM_ASSERT("Some spectra were not found in the workspace",outWs->getSpectrum(0)->getSpectrumNo()==spectrumList[0]);
TSM_ASSERT("Some spectra were not found in the workspace",outWs->getSpectrum(1)->getSpectrumNo()==spectrumList[1]);
TSM_ASSERT("Some spectra were not found in the workspace",outWs->getSpectrum(2)->getSpectrumNo()==spectrumList[2]);
TSM_ASSERT("Some spectra were not found in the workspace",outWs->getSpectrum(3)->getSpectrumNo()==spectrumList[3]);
}

void test_Load_And_CompressEvents()
Expand Down

0 comments on commit 327d989

Please sign in to comment.