Skip to content

Commit

Permalink
Try to fix windows build. Refs #6737.
Browse files Browse the repository at this point in the history
  • Loading branch information
wdzhou committed Apr 9, 2013
1 parent 7ecaece commit e1aafdc
Showing 1 changed file with 53 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,59 @@ class CreateLogTimeCorrectionTest : public CxxTest::TestSuite

/** Test against a Vulcan run
*/
void test_Vulcan()
void test_VulcanNoFileOutput()
{
MatrixWorkspace_sptr inpws = createEmptyWorkspace("VULCAN");
AnalysisDataService::Instance().addOrReplace("Vulcan_Fake", inpws);

CreateLogTimeCorrection alg;
alg.initialize();
TS_ASSERT(alg.isInitialized());

alg.setProperty("InputWorkspace", inpws);
alg.setProperty("OutputWorkspace", "CorrectionTable");
alg.setProperty("OutputFilename", "dummpy.dat");

TS_ASSERT_THROWS_NOTHING(alg.execute());
TS_ASSERT(alg.isExecuted());

TableWorkspace_sptr outws = boost::dynamic_pointer_cast<TableWorkspace>(
AnalysisDataService::Instance().retrieve("CorrectionTable"));
TS_ASSERT(outws);

int numrows = static_cast<int>(outws->rowCount());
TS_ASSERT_EQUALS(numrows, 7392);

// get some value to check
double l1 = 43.754;

vector<size_t> checkrows;
checkrows.push_back(0);
checkrows.push_back(100);
checkrows.push_back(1000);
checkrows.push_back(5000);

for (size_t i = 0; i < checkrows.size(); ++i)
{
TableRow row = outws->getRow(i);
int detid;
double correction, l2;
row >> detid >> correction >> l2;
TS_ASSERT(detid > 0);

TS_ASSERT_DELTA(correction*(l1+l2)/l1, 1.0, 0.0001);
}

// clean workspaces and file written
AnalysisDataService::Instance().remove("Vulcan_Fake");
AnalysisDataService::Instance().remove("CorrectionTable");

return;
}

/** Test against a Vulcan run
*/
void WindowsFailed_test_VulcanFileOutput()
{
MatrixWorkspace_sptr inpws = createEmptyWorkspace("VULCAN");
AnalysisDataService::Instance().addOrReplace("Vulcan_Fake", inpws);
Expand Down

0 comments on commit e1aafdc

Please sign in to comment.