Skip to content

Commit

Permalink
Refs #9473 Fix failing unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
Harry Jeffery committed Sep 23, 2014
1 parent 28929ed commit b8f1d1a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 18 deletions.
Expand Up @@ -38,6 +38,7 @@ class ReflLoadedMainViewPresenterTest : public CxxTest::TestSuite
auto colDqq = ws->addColumn("str","dq/q");
auto colScale = ws->addColumn("str","Scale");
auto colStitch = ws->addColumn("int","StitchGroup");
auto colOptions = ws->addColumn("str","Options");

colRuns->setPlotType(0);
colTheta->setPlotType(0);
Expand All @@ -47,6 +48,7 @@ class ReflLoadedMainViewPresenterTest : public CxxTest::TestSuite
colDqq->setPlotType(0);
colScale->setPlotType(0);
colStitch->setPlotType(0);
colOptions->setPlotType(0);

if(wsName.length() > 0)
AnalysisDataService::Instance().addOrReplace(wsName, ws);
Expand All @@ -59,13 +61,13 @@ class ReflLoadedMainViewPresenterTest : public CxxTest::TestSuite
auto ws = createWorkspace(wsName);

TableRow row = ws->appendRow();
row << "13460" << "0.7" << "13463,13464" << "0.01" << "0.06" << "0.04" << "1" << 3;
row << "13460" << "0.7" << "13463,13464" << "0.01" << "0.06" << "0.04" << "1" << 3 << "";
row = ws->appendRow();
row << "13462" << "2.3" << "13463,13464" << "0.035" << "0.3" << "0.04" << "1" << 3;
row << "13462" << "2.3" << "13463,13464" << "0.035" << "0.3" << "0.04" << "1" << 3 << "";
row = ws->appendRow();
row << "13469" << "0.7" << "13463,13464" << "0.01" << "0.06" << "0.04" << "1" << 1;
row << "13469" << "0.7" << "13463,13464" << "0.01" << "0.06" << "0.04" << "1" << 1 << "";
row = ws->appendRow();
row << "13470" << "2.3" << "13463,13464" << "0.035" << "0.3" << "0.04" << "1" << 1;
row << "13470" << "2.3" << "13463,13464" << "0.035" << "0.3" << "0.04" << "1" << 1 << "";
return ws;
}

Expand All @@ -74,7 +76,7 @@ class ReflLoadedMainViewPresenterTest : public CxxTest::TestSuite
ITableWorkspace_sptr ws = createWorkspace();

TableRow row = ws->appendRow();
row << "13460" << "0.7" << "13463" << "0.01" << "0.06" << "0.04" << "2" << "1";
row << "13460" << "0.7" << "13463" << "0.01" << "0.06" << "0.04" << "2" << "1" << "";

return ws;
}
Expand All @@ -86,7 +88,7 @@ class ReflLoadedMainViewPresenterTest : public CxxTest::TestSuite
if(longer)
ws->addColumn("str","extracolumn");
else
ws->removeColumn("StitchGroup");
ws->removeColumn("Options");

return ws;
}
Expand Down
Expand Up @@ -17,14 +17,15 @@ const int DeleteRowFlag = ReflMainView::DeleteRowFlag;
const int GroupRowsFlag = ReflMainView::GroupRowsFlag;

//Clean column ids for use within tests
const int RunCol = ReflMainViewPresenter::COL_RUNS;
const int ThetaCol = ReflMainViewPresenter::COL_ANGLE;
const int TransCol = ReflMainViewPresenter::COL_TRANSMISSION;
const int QMinCol = ReflMainViewPresenter::COL_QMIN;
const int QMaxCol = ReflMainViewPresenter::COL_QMAX;
const int DQQCol = ReflMainViewPresenter::COL_DQQ;
const int ScaleCol = ReflMainViewPresenter::COL_SCALE;
const int GroupCol = ReflMainViewPresenter::COL_GROUP;
const int RunCol = ReflMainViewPresenter::COL_RUNS;
const int ThetaCol = ReflMainViewPresenter::COL_ANGLE;
const int TransCol = ReflMainViewPresenter::COL_TRANSMISSION;
const int QMinCol = ReflMainViewPresenter::COL_QMIN;
const int QMaxCol = ReflMainViewPresenter::COL_QMAX;
const int DQQCol = ReflMainViewPresenter::COL_DQQ;
const int ScaleCol = ReflMainViewPresenter::COL_SCALE;
const int GroupCol = ReflMainViewPresenter::COL_GROUP;
const int OptionsCol = ReflMainViewPresenter::COL_OPTIONS;

class MockView : public ReflMainView
{
Expand All @@ -45,13 +46,13 @@ class MockView : public ReflMainView
void addDataForTest()
{
TableRow row = m_model->appendRow();
row << "13460" << "0.7" << "13463,13464" << "0.01" << "0.06" << "0.04" << "1" << 3;
row << "13460" << "0.7" << "13463,13464" << "0.01" << "0.06" << "0.04" << "1" << 3 << "";
row = m_model->appendRow();
row << "13462" << "2.3" << "13463,13464" << "0.035" << "0.3" << "0.04" << "1" << 3;
row << "13462" << "2.3" << "13463,13464" << "0.035" << "0.3" << "0.04" << "1" << 3 << "";
row = m_model->appendRow();
row << "13469" << "0.7" << "13463,13464" << "0.01" << "0.06" << "0.04" << "1" << 1;
row << "13469" << "0.7" << "13463,13464" << "0.01" << "0.06" << "0.04" << "1" << 1 << "";
row = m_model->appendRow();
row << "13470" << "2.3" << "13463,13464" << "0.035" << "0.3" << "0.04" << "1" << 1;
row << "13470" << "2.3" << "13463,13464" << "0.035" << "0.3" << "0.04" << "1" << 1 << "";
m_model->removeRow(0);
}
private:
Expand Down

0 comments on commit b8f1d1a

Please sign in to comment.