diff options
author | Marius Kintel <marius@kintel.net> | 2012-04-03 10:51:39 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2012-04-03 10:51:39 (GMT) |
commit | 1adc8aa531c799237eea0ed0144538a006763ca1 (patch) | |
tree | e9ed740c0e90b65c7b9f2d81e57caa2f6af6c343 | |
parent | 252a7443c189778ff59eb8cba77baa8f33903d95 (diff) |
Catch and report common top-level issues
-rw-r--r-- | tests/cgalstlsanitytest.cc | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/tests/cgalstlsanitytest.cc b/tests/cgalstlsanitytest.cc index d0d0077..7241482 100644 --- a/tests/cgalstlsanitytest.cc +++ b/tests/cgalstlsanitytest.cc @@ -132,17 +132,27 @@ int main(int argc, char **argv) if (!N.empty()) { std::ofstream outfile; outfile.open(outfilename); - - std::stringstream out; - export_stl(&N, out); - if (out.str().find("nan") != string::npos) { - outfile << "Error: nan found\n"; + + if (N.dim != 3) { + outfile << "Error: Current top level object is not a 3D object.\n"; retval = 2; } - if (out.str().find("inf") != string::npos) { - outfile << "Error: inf found\n"; + else if (!N.p3->is_simple()) { + outfile << "Error: Object isn't a valid 2-manifold! Modify your design.\n"; retval = 2; } + else { + std::stringstream out; + export_stl(&N, out); + if (out.str().find("nan") != string::npos) { + outfile << "Error: nan found\n"; + retval = 2; + } + if (out.str().find("inf") != string::npos) { + outfile << "Error: inf found\n"; + retval = 2; + } + } outfile.close(); } |