Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mantid
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mantidproject
mantid
Commits
6c36d3c2
Commit
6c36d3c2
authored
7 years ago
by
Edward Brown
Browse files
Options
Downloads
Patches
Plain Diff
Re #20675: Fixed LoadTBL algorithm.
- Added missing column when creating workspace.
parent
6d918a30
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Framework/DataHandling/src/LoadTBL.cpp
+1
-0
1 addition, 0 deletions
Framework/DataHandling/src/LoadTBL.cpp
Framework/DataHandling/test/LoadTBLTest.h
+5
-3
5 additions, 3 deletions
Framework/DataHandling/test/LoadTBLTest.h
with
6 additions
and
3 deletions
Framework/DataHandling/src/LoadTBL.cpp
+
1
−
0
View file @
6c36d3c2
...
@@ -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
);
...
...
This diff is collapsed.
Click to expand it.
Framework/DataHandling/test/LoadTBLTest.h
+
5
−
3
View file @
6c36d3c2
...
@@ -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
"
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment