Skip to content
Snippets Groups Projects
Commit 6c36d3c2 authored by Edward Brown's avatar Edward Brown
Browse files

Re #20675: Fixed LoadTBL algorithm.

- Added missing column when creating workspace.
parent 6d918a30
No related branches found
No related tags found
No related merge requests found
...@@ -326,6 +326,7 @@ void LoadTBL::exec() { ...@@ -326,6 +326,7 @@ void LoadTBL::exec() {
auto colDqq = ws->addColumn("str", "dq/q"); auto colDqq = ws->addColumn("str", "dq/q");
auto colScale = ws->addColumn("str", "Scale"); auto colScale = ws->addColumn("str", "Scale");
auto colOptions = ws->addColumn("str", "Options"); auto colOptions = ws->addColumn("str", "Options");
auto colHiddenOptions = ws->addColumn("str", "HiddenOptions");
for (size_t i = 0; i < ws->columnCount(); i++) { for (size_t i = 0; i < ws->columnCount(); i++) {
auto col = ws->getColumn(i); auto col = ws->getColumn(i);
......
...@@ -54,7 +54,7 @@ public: ...@@ -54,7 +54,7 @@ public:
output = AnalysisDataService::Instance().retrieve(m_wsName)); output = AnalysisDataService::Instance().retrieve(m_wsName));
TableWorkspace_sptr outputWS = TableWorkspace_sptr outputWS =
boost::dynamic_pointer_cast<TableWorkspace>(output); boost::dynamic_pointer_cast<TableWorkspace>(output);
TS_ASSERT_EQUALS(outputWS->columnCount(), 9); TS_ASSERT_EQUALS(outputWS->columnCount(), 10);
TS_ASSERT_EQUALS(outputWS->rowCount(), 10); TS_ASSERT_EQUALS(outputWS->rowCount(), 10);
// test the first three rows, equivalent to the first two rows of the file. // test the first three rows, equivalent to the first two rows of the file.
...@@ -103,6 +103,7 @@ public: ...@@ -103,6 +103,7 @@ public:
0.01); 0.01);
TS_ASSERT_EQUALS(boost::lexical_cast<double>(row.cell<std::string>(0)), 2); TS_ASSERT_EQUALS(boost::lexical_cast<double>(row.cell<std::string>(0)), 2);
TS_ASSERT(outputWS->getColumn("HiddenOptions") != nullptr);
cleanupafterwards(); cleanupafterwards();
} }
...@@ -138,7 +139,7 @@ public: ...@@ -138,7 +139,7 @@ public:
output = AnalysisDataService::Instance().retrieve(m_wsName)); output = AnalysisDataService::Instance().retrieve(m_wsName));
TableWorkspace_sptr outputWS = TableWorkspace_sptr outputWS =
boost::dynamic_pointer_cast<TableWorkspace>(output); boost::dynamic_pointer_cast<TableWorkspace>(output);
TS_ASSERT_EQUALS(outputWS->columnCount(), 9); TS_ASSERT_EQUALS(outputWS->columnCount(), 10);
TS_ASSERT_EQUALS(outputWS->rowCount(), 10); TS_ASSERT_EQUALS(outputWS->rowCount(), 10);
// test the first three rows, equivalent to the first two rows of the file. // test the first three rows, equivalent to the first two rows of the file.
...@@ -217,7 +218,8 @@ public: ...@@ -217,7 +218,8 @@ public:
TS_ASSERT_THROWS_NOTHING(Poco::File(m_abspath).remove()); TS_ASSERT_THROWS_NOTHING(Poco::File(m_abspath).remove());
} }
void testManyColumns() {
void testManyColumns() {
// create a file with each line containing too many columns // create a file with each line containing too many columns
std::ofstream file(m_filename.c_str()); std::ofstream file(m_filename.c_str());
file << "13460,0.7,13463,0.01,0.06,,,,,,,,,,,0.04,2,,,,0.04,2\n"; file << "13460,0.7,13463,0.01,0.06,,,,,,,,,,,0.04,2,,,,0.04,2\n";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment