mirror of https://github.com/CGAL/cgal
Fix test pretty much never testing envelope tests + read all formats
This commit is contained in:
parent
eb668da9ea
commit
e9de7e88ad
|
|
@ -28,7 +28,7 @@ void general_test(std::string filename)
|
||||||
std::ifstream input(filename);
|
std::ifstream input(filename);
|
||||||
|
|
||||||
Mesh mesh;
|
Mesh mesh;
|
||||||
if (!input || !(input >> mesh) || !CGAL::is_triangle_mesh(mesh)) {
|
if (!CGAL::IO::read_polygon_mesh(filename, mesh) || !CGAL::is_triangle_mesh(mesh)) {
|
||||||
std::cerr << "Not a valid input file." << std::endl;
|
std::cerr << "Not a valid input file." << std::endl;
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
@ -56,7 +56,8 @@ void test_with_envelope(std::string filename, double eps)
|
||||||
std::ifstream input(filename);
|
std::ifstream input(filename);
|
||||||
|
|
||||||
Mesh mesh, bk;
|
Mesh mesh, bk;
|
||||||
if (!input || !(input >> mesh) || !CGAL::is_triangle_mesh(mesh)) {
|
if (!CGAL::IO::read_polygon_mesh(filename, mesh) || !CGAL::is_triangle_mesh(mesh))
|
||||||
|
{
|
||||||
std::cerr << "Not a valid input file." << std::endl;
|
std::cerr << "Not a valid input file." << std::endl;
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
@ -131,7 +132,8 @@ void test_parameters_on_pig(std::string filename)
|
||||||
std::ifstream input(filename);
|
std::ifstream input(filename);
|
||||||
|
|
||||||
Mesh mesh, bk;
|
Mesh mesh, bk;
|
||||||
if (!input || !(input >> mesh) || !CGAL::is_triangle_mesh(mesh)) {
|
if (!CGAL::IO::read_polygon_mesh(filename, mesh) || !CGAL::is_triangle_mesh(mesh))
|
||||||
|
{
|
||||||
std::cerr << "Not a valid input file." << std::endl;
|
std::cerr << "Not a valid input file." << std::endl;
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
@ -164,13 +166,11 @@ void test_parameters_on_pig(std::string filename)
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
const std::string filename = (argc > 1) ? argv[1] : CGAL::data_file_path("meshes/pig.off");
|
const std::string filename = (argc > 1) ? argv[1] : CGAL::data_file_path("meshes/pig.off");
|
||||||
|
double eps = (argc > 2) ? atof(argv[2]) : 0.01;
|
||||||
|
|
||||||
general_test(filename);
|
general_test(filename);
|
||||||
if (argc==2)
|
|
||||||
test_with_envelope(filename, 0.01);
|
test_with_envelope(filename, eps);
|
||||||
else
|
|
||||||
if (argc==3)
|
|
||||||
test_with_envelope(filename, atof(argv[2]));
|
|
||||||
|
|
||||||
// only run that test with pig.off
|
// only run that test with pig.off
|
||||||
if (argc==1)
|
if (argc==1)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue