Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix extra comma in cnetstats output #4398

Merged
merged 1 commit into from
Apr 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions isis/src/control/objs/ControlNetFilter/ControlNetFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ namespace Isis {
* @author Sharmila Prasad (8/31/2010)
*/
void ControlNetFilter::CubeStatsHeader(void) {
mOstm << "FileName, SerialNumber, ImageTotalPoints, ImagePointsIgnored, ImagePointsEditLocked, ImagePointsFixed, ImagePointsConstrained, ImagePointsFree, ImageConvexHullRatio,";
mOstm << "FileName, SerialNumber, ImageTotalPoints, ImagePointsIgnored, ImagePointsEditLocked, ImagePointsFixed, ImagePointsConstrained, ImagePointsFree, ImageConvexHullRatio";
}

/**
Expand Down Expand Up @@ -198,7 +198,7 @@ namespace Isis {
}

if (pbLastFilter) {
mOstm << "PointID, PointType, PointIgnored, PointEditLocked, FileName, SerialNumber, PixelShift, MeasureType, MeasureIgnored, MeasureEditLocked, Reference, ";
mOstm << "PointID, PointType, PointIgnored, PointEditLocked, FileName, SerialNumber, PixelShift, MeasureType, MeasureIgnored, MeasureEditLocked, Reference";
mOstm << endl;
}

Expand Down Expand Up @@ -386,7 +386,7 @@ namespace Isis {
}

if (pbLastFilter) {
mOstm << "PointID, PointType, PointIgnored, PointEditLocked, FileName, SerialNumber, ResidualMagnitude, MeasureType, MeasureIgnored, MeasureEditLocked, Reference, ";
mOstm << "PointID, PointType, PointIgnored, PointEditLocked, FileName, SerialNumber, ResidualMagnitude, MeasureType, MeasureIgnored, MeasureEditLocked, Reference";
mOstm << endl;
}

Expand Down Expand Up @@ -1037,7 +1037,7 @@ namespace Isis {
if (pbLastFilter) {
PointStatsHeader();
CubeStatsHeader();
mOstm << "ImageMeasureIgnored, ImageMeasureEditLocked, ";
mOstm << ", ImageMeasureIgnored, ImageMeasureEditLocked";
mOstm << endl;
}

Expand Down Expand Up @@ -1314,7 +1314,7 @@ namespace Isis {

if (pbLastFilter) {
CubeStatsHeader();
mOstm << "Distance_PointIDs >>, " << endl;
mOstm << ", Distance_PointIDs >>, " << endl;
}

int iNumCubes = mSerialNumFilter.size();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ namespace Isis {
throw IException(IException::Io, msg, _FILEINFO_);
}

ostm << " PointId, PointType, PointIgnore, PointEditLock, TotalMeasures, MeasuresValid, MeasuresIgnore, MeasuresEditLock," << endl;
ostm << " PointId, PointType, PointIgnore, PointEditLock, TotalMeasures, MeasuresValid, MeasuresIgnore, MeasuresEditLock" << endl;

int iNumPoints = mCNet->GetNumPoints();

Expand Down
8 changes: 2 additions & 6 deletions isis/tests/FunctionalTestsCnetstats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,7 @@ TEST_F(ThreeImageNetwork, FunctionalTestCnetstatsPointStats) {
QStringList values = line.split(",");

if(lineNumber == 0) {
// The output adds a comma at the end of the first line, increasing the size by 1.
// This is a bug in ControlNetStatistics. Once that is fixed, this test wil fail.
Comment on lines -112 to -113
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

XD

ASSERT_DOUBLE_EQ(values.size() - 1, 8);
ASSERT_DOUBLE_EQ(values.size() - 1, 7);
}
else {
ASSERT_DOUBLE_EQ(values.size(), 8);
Expand Down Expand Up @@ -151,9 +149,7 @@ TEST_F(ThreeImageNetwork, FunctionalTestCnetstatsCubeFilter) {
QStringList values = line.split(",");

if(lineNumber == 0) {
// The output adds a comma at the end of the first line, increasing the size by 1.
// This is a bug in ControlNetFilter. Once that is fixed, this test wil fail.
ASSERT_DOUBLE_EQ(values.size() - 1, 9);
ASSERT_DOUBLE_EQ(values.size() - 1, 8);
}
else {
ASSERT_DOUBLE_EQ(values.size(), 9);
Expand Down