Skip to content

Commit

Permalink
adding test case for leading plus sign double conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
gangatp committed Jan 30, 2024
1 parent 4e2e76c commit 3a52ffb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion Tests/CPP_Bindings/Source/Reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,19 @@ namespace Lib3MF
}


TEST_F(Reader, IntegrationTestError) {
TEST_F(Reader, ReadVerticesCommaSeparatedValue) {
// This file N_XXX_0422_01.3mf contains vertices with comma-separated values.
// The 3MFReader should throw an error at NMR_StringUtils::fnStringToDouble when reading this file because
// comma-separated values are not allowed in 3MF files.
auto reader = model->QueryReader("3mf");
ASSERT_SPECIFIC_THROW(reader->ReadFromFile(sTestFilesPath + "/Reader/" + "N_XXX_0422_01.3mf"), ELib3MFException);
}

TEST_F(Reader, ReadVerticesWithLeadingPLUSSign) {
// This file P_XXM_0519_01.3mf contains vertices with leading + sign e.g +1E+2.
// The 3MFReader allows leading = sign at NMR_StringUtils::fnStringToDouble when reading this file.
auto reader = model->QueryReader("3mf");
reader->ReadFromFile(sTestFilesPath + "/Reader/" + "P_XXM_0519_01.3mf");
CheckReaderWarnings(Reader::reader3MF, 0);
}
}
Binary file added Tests/TestFiles/Reader/N_XXX_0422_01.3mf
Binary file not shown.
Binary file added Tests/TestFiles/Reader/P_XXM_0519_01.3mf
Binary file not shown.

0 comments on commit 3a52ffb

Please sign in to comment.