Skip to content

Commit

Permalink
Complete the implementation. Refs #6737.
Browse files Browse the repository at this point in the history
  • Loading branch information
wdzhou committed Apr 9, 2013
1 parent 88e69f5 commit 7ecaece
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ namespace Algorithms
setProperty("OutputWorkspace", outWS);

string filename = getProperty("OutputFilename");
g_log.information() << "Output file name is " << filename << ".\n";
if (filename.size() > 0)
{
writeCorrectionToFile(filename);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
#include "MantidDataHandling/LoadInstrument.h"
#include "MantidAPI/TableRow.h"

#include <fstream>
#include <sstream>
#include <Poco/File.h>

using Mantid::Algorithms::CreateLogTimeCorrection;

using namespace Mantid;
Expand Down Expand Up @@ -70,6 +74,28 @@ class CreateLogTimeCorrectionTest : public CxxTest::TestSuite
TS_ASSERT_DELTA(correction*(l1+l2)/l1, 1.0, 0.0001);
}

// check output file
ifstream ifile;
ifile.open("VucanCorrection.dat");
TS_ASSERT(ifile.is_open());
size_t numrowsinfile = 0;
char line[256];
while(!ifile.eof())
{
ifile.getline(line, 256);
string templine(line);
if (templine.size() > 0)
++ numrowsinfile;
}
TS_ASSERT_EQUALS(numrowsinfile, 7392);

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

Poco::File file("VucanCorrection.dat");
file.remove(false);

return;
}

Expand Down

0 comments on commit 7ecaece

Please sign in to comment.