Skip to content

Commit

Permalink
Additional test case
Browse files Browse the repository at this point in the history
  • Loading branch information
eidelen committed Oct 11, 2024
1 parent a9bf81f commit d167d1f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dicom2mesh/src/dicom2mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ bool Dicom2Mesh::parseCmdLineParameters(const int &argc, const char **argv, Dico
return false;
}
}
if( cArg.compare("-ipng") == 0 )
else if( cArg.compare("-ipng") == 0 )
{
param.inputImageFiles = {};
}
Expand Down
13 changes: 12 additions & 1 deletion dicom2mesh/test/t_parsing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ TEST(ArgumentParser, ThresholdRange)
ASSERT_TRUE(Dicom2Mesh::parseCmdLineParameters(nInput, input, parsedInput));

ASSERT_EQ(parsedInput.isoValue, 405);
ASSERT_EQ(parsedInput.upperIsoValue.value(), 501);
ASSERT_TRUE(parsedInput.upperIsoValue.has_value());
ASSERT_EQ(parsedInput.upperIsoValue.value(), 501);
}

TEST(ArgumentParser, ThresholdNegative)
Expand Down Expand Up @@ -266,3 +266,14 @@ TEST(ArgumentParser, ParseBinaryExportOff)

ASSERT_FALSE(parsedInput.useBinaryExport);
}

TEST(ArgumentParser, PolygonLimitEnable)
{
const char *input[6] = {"-i", "inputDir", "-p", "12345"};

Dicom2Mesh::Dicom2MeshParameters parsedInput;
ASSERT_TRUE(Dicom2Mesh::parseCmdLineParameters(4, input, parsedInput));

ASSERT_TRUE(parsedInput.polygonLimit.has_value());
ASSERT_EQ(parsedInput.polygonLimit, 12345);
}

0 comments on commit d167d1f

Please sign in to comment.