Skip to content

Commit

Permalink
Re #11711 Fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
raquelalvarezbanos committed May 7, 2015
1 parent 6dcb305 commit f800b2b
Showing 1 changed file with 12 additions and 2 deletions.
Expand Up @@ -44,14 +44,24 @@ class ALCBaselineModellingModelTest : public CxxTest::TestSuite

void test_setData()
{
MatrixWorkspace_sptr data = WorkspaceFactory::Instance().create("Workspace2D", 1, 1, 1);
std::vector<double> y = boost::assign::list_of(100)(1)(2)(100)(100)(3)(4)(5)(100);
std::vector<double> x = boost::assign::list_of(1)(2)(3)(4)(5)(6)(7)(8)(9);

MatrixWorkspace_sptr data = WorkspaceFactory::Instance().create("Workspace2D", 1, y.size(), y.size());
data->dataY(0) = y;
data->dataX(0) = x;

QSignalSpy spy(m_model, SIGNAL(dataChanged()));

TS_ASSERT_THROWS_NOTHING(m_model->setData(data));

TS_ASSERT_EQUALS(spy.size(), 1);
TS_ASSERT_EQUALS(m_model->data(), data);

MatrixWorkspace_const_sptr modelData = m_model->data();

TS_ASSERT_EQUALS(modelData->readX(0), data->readX(0));
TS_ASSERT_EQUALS(modelData->readY(0), data->readY(0));
TS_ASSERT_EQUALS(modelData->readE(0), data->readE(0));
}

void test_fit()
Expand Down

0 comments on commit f800b2b

Please sign in to comment.