Skip to content

Commit

Permalink
Revert "Save and Load GSS unit tests updated Re #5965"
Browse files Browse the repository at this point in the history
This reverts commit 6f9bb02.
  • Loading branch information
raquelalvarezbanos committed Oct 28, 2014
1 parent 6f9bb02 commit aec45e8
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 38 deletions.
67 changes: 33 additions & 34 deletions Code/Mantid/Framework/DataHandling/test/SaveFocussedXYETest.h
Expand Up @@ -219,16 +219,15 @@ class SaveFocussedXYETest : public CxxTest::TestSuite
std::string filename("SaveGSS.txt");
saveGSS.setPropertyValue("Filename", filename);
filename = saveGSS.getPropertyValue("Filename"); //absolute path
saveGSS.setProperty("Format", "RALF");
saveGSS.setProperty("SplitFiles", false);
saveGSS.setPropertyValue("Append", "0");
saveGSS.setPropertyValue("MultiplyByBinWidth", "1");

TS_ASSERT_THROWS_NOTHING( saveGSS.execute());
TS_ASSERT_THROWS_NOTHING( saveGSS.execute());
Poco::File focusfile(filename);
TS_ASSERT_EQUALS( focusfile.exists(), true );
std::ifstream filestrm(filename.c_str());

std::ifstream filestrm(filename.c_str());
std::string line;
int bin_no(1);
while( getline(filestrm, line) )
Expand All @@ -239,23 +238,23 @@ class SaveFocussedXYETest : public CxxTest::TestSuite
if(str=="BANK") continue;
double x(0.0), y(0.0), e(0.);
std::istringstream is(line);
is >> x >> y >> e;
is >> x >> y >> e;
switch( bin_no )
{
case 1:
TS_ASSERT_DELTA(x, 2.0, m_tol); // center of the bin
TS_ASSERT_DELTA(y, 8.0, m_tol); // y value (2.0) * bc4 (2.0) * xprev value (1) * bin width (2)
TS_ASSERT_DELTA(e, 5.65685425, m_tol); //error (sqrt(2) * bc4 (2.0) * xprev value (1) * bin width (2.0)
TS_ASSERT_DELTA(x, 2.0, m_tol); //center of the bin
TS_ASSERT_DELTA(y, 4.0, m_tol); // width (2.0) * value (2.0)
TS_ASSERT_DELTA(e, 1.41421356*2.0, m_tol); //error (sqrt(2) * bin width (2.0)
break;
case 2:
TS_ASSERT_DELTA(x, 4.0, m_tol); // center of the bin
TS_ASSERT_DELTA(y, 24.0, m_tol); // y value (2.0) * bc4 (2.0) * xprev value (3) * bin width (2)
TS_ASSERT_DELTA(e, 16.97056275, m_tol); //error (sqrt(2) * bc4 (2.0) * xprev value (3) * bin width (2.0)
TS_ASSERT_DELTA(x, 4.0, m_tol);
TS_ASSERT_DELTA(y, 4.0, m_tol);
TS_ASSERT_DELTA(e, 1.41421356*2.0, m_tol);
break;
case 3:
TS_ASSERT_DELTA(x, 6.0, m_tol); // center of the bin
TS_ASSERT_DELTA(y, 40.0, m_tol); // y value (2.0) * bc4 (2.0) * xprev value (5) * bin width (2)
TS_ASSERT_DELTA(e, 28.28427125, m_tol); //error (sqrt(2) * bc4 (2.0) * xprev value (5) * bin width (2.0)
TS_ASSERT_DELTA(x, 6.0, m_tol);
TS_ASSERT_DELTA(y, 4.0, m_tol);
TS_ASSERT_DELTA(e, 1.41421356*2.0, m_tol);
break;
default:
TS_ASSERT( false );
Expand Down Expand Up @@ -320,26 +319,26 @@ class SaveFocussedXYETest : public CxxTest::TestSuite
double x(0.0), y(0.0), e(0.);
std::istringstream is(line);
is >> x >> y >> e;
switch( bin_no )
{
case 1:
TS_ASSERT_DELTA(x, 2.0, m_tol); // center of the bin
TS_ASSERT_DELTA(y, 4.0, m_tol); // y value (2.0) * bc4 (2.0) * xprev value (1)
TS_ASSERT_DELTA(e, 2.82842712, m_tol); //error (sqrt(2) * bc4 (2.0) * xprev value (1)
break;
case 2:
TS_ASSERT_DELTA(x, 4.0, m_tol); // center of the bin
TS_ASSERT_DELTA(y, 12.0, m_tol); // y value (2.0) * bc4 (2.0) * xprev value (3)
TS_ASSERT_DELTA(e, 8.48528137, m_tol); //error (sqrt(2) * bc4 (2.0) * xprev value (3)
break;
case 3:
TS_ASSERT_DELTA(x, 6.0, m_tol); // center of the bin
TS_ASSERT_DELTA(y, 20.0, m_tol); // y value (2.0) * bc4 (2.0) * xprev value (5)
TS_ASSERT_DELTA(e, 14.14213562, m_tol); //error (sqrt(2) * bc4 (2.0) * xprev value (5)
break;
default:
TS_ASSERT( false );
}
switch( bin_no )
{
case 1:
TS_ASSERT_DELTA(x, 2.0, m_tol); //center of the bin
TS_ASSERT_DELTA(y, 2.0, m_tol); // width (2.0)
TS_ASSERT_DELTA(e, 1.41421356*1.0, m_tol); //error (sqrt(2)
break;
case 2:
TS_ASSERT_DELTA(x, 4.0, m_tol);
TS_ASSERT_DELTA(y, 2.0, m_tol);
TS_ASSERT_DELTA(e, 1.41421356*1.0, m_tol);
break;
case 3:
TS_ASSERT_DELTA(x, 6.0, m_tol);
TS_ASSERT_DELTA(y, 2.0, m_tol);
TS_ASSERT_DELTA(e, 1.41421356*1.0, m_tol);
break;
default:
TS_ASSERT( false );
}
++bin_no;
if(bin_no==4)
bin_no=1;
Expand Down
8 changes: 4 additions & 4 deletions Code/Mantid/Framework/DataHandling/test/SaveGSSTest.h
Expand Up @@ -175,8 +175,8 @@ class SaveGSSTest : public CxxTest::TestSuite
double x, y, e;
liness >> x >> y >> e;
TS_ASSERT_DELTA(x, 8101.43, 0.01);
TS_ASSERT_DELTA(y, 55475.77, 0.01);
TS_ASSERT_DELTA(e, 2114.7, 0.01);
TS_ASSERT_DELTA(y, 688.18, 0.01);
TS_ASSERT_DELTA(e, 26.23, 0.01);
}
else if (linenumber == 111)
{
Expand All @@ -191,8 +191,8 @@ class SaveGSSTest : public CxxTest::TestSuite
double x, y, e;
liness >> x >> y >> e;
TS_ASSERT_DELTA(x, 8949.02, 0.01);
TS_ASSERT_DELTA(y, 141782.95, 0.01);
TS_ASSERT_DELTA(e, 3553.17, 0.01);
TS_ASSERT_DELTA(y, 1592.26, 0.01);
TS_ASSERT_DELTA(e, 39.90, 0.01);
}

++ numlines;
Expand Down

0 comments on commit aec45e8

Please sign in to comment.