Skip to content

Commit

Permalink
Refs #9445. Added profile function check to PoldiPeakCollection
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Wedel committed May 22, 2014
1 parent 90e6ea4 commit 7ef6c6f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
Expand Up @@ -62,6 +62,7 @@ class MANTID_SINQ_DLL PoldiPeakCollection

void setProfileFunctionName(std::string newProfileFunction);
std::string getProfileFunctionName() const;
bool hasProfileFunctionName() const;

TableWorkspace_sptr asTableWorkspace();

Expand Down
Expand Up @@ -63,6 +63,11 @@ std::string PoldiPeakCollection::getProfileFunctionName() const
return m_profileFunctionName;
}

bool PoldiPeakCollection::hasProfileFunctionName() const
{
return !m_profileFunctionName.empty();
}

TableWorkspace_sptr PoldiPeakCollection::asTableWorkspace()
{
TableWorkspace_sptr peaks = boost::dynamic_pointer_cast<TableWorkspace>(WorkspaceFactory::Instance().createTable());
Expand Down
2 changes: 2 additions & 0 deletions Code/Mantid/Framework/SINQ/test/PoldiPeakCollectionTest.h
Expand Up @@ -112,11 +112,13 @@ class PoldiPeakCollectionTest : public CxxTest::TestSuite
TestablePoldiPeakCollection other(table);

TS_ASSERT_EQUALS(other.getProfileFunctionName(), "Gaussian");
TS_ASSERT(other.hasProfileFunctionName());
}

void testMissingProfileFunction()
{
TestablePoldiPeakCollection collection(m_dummyData);
TS_ASSERT(!collection.hasProfileFunctionName());
TS_ASSERT(collection.getProfileFunctionName().empty());
}

Expand Down

0 comments on commit 7ef6c6f

Please sign in to comment.