fix teleport test

possible failed with no teleportation
This commit is contained in:
Lingjie Zhu 2018-11-28 11:44:32 +08:00
parent 7e4add3b28
commit 936d42aca8
1 changed files with 22 additions and 18 deletions

View File

@ -33,7 +33,7 @@ bool check_strict_ordering(const std::vector<FT> &error)
{ {
if (error.empty()) { if (error.empty()) {
std::cout << "Empty error sequence." << std::endl; std::cout << "Empty error sequence." << std::endl;
return false; return true;
} }
FT pre = error.front(); FT pre = error.front();
@ -67,6 +67,9 @@ int main()
std::cout << "Random seeding by number." << std::endl; std::cout << "Random seeding by number." << std::endl;
std::srand(static_cast<unsigned int>(std::time(0))); std::srand(static_cast<unsigned int>(std::time(0)));
std::size_t count = 0;
while (!count) {
approx.initialize_seeds(CGAL::parameters::seeding_method(CGAL::Surface_mesh_approximation::RANDOM) approx.initialize_seeds(CGAL::parameters::seeding_method(CGAL::Surface_mesh_approximation::RANDOM)
.max_number_of_proxies(50)); .max_number_of_proxies(50));
if (approx.number_of_proxies() != 50) if (approx.number_of_proxies() != 50)
@ -75,7 +78,7 @@ int main()
std::cout << "Teleport until merge test failed." << std::endl; std::cout << "Teleport until merge test failed." << std::endl;
std::vector<FT> error; std::vector<FT> error;
std::size_t count = 0; count = 0;
while(approx.teleport_proxies(1) == 1) { while(approx.teleport_proxies(1) == 1) {
FT sum_err(0); FT sum_err(0);
approx.run(10); approx.run(10);
@ -89,6 +92,7 @@ int main()
std::cout << "Failed: teleportation error decrease inconsistent." << std::endl; std::cout << "Failed: teleportation error decrease inconsistent." << std::endl;
return EXIT_FAILURE; return EXIT_FAILURE;
} }
}
// test partition placement // test partition placement
std::cout << "Test partition placement." << std::endl; std::cout << "Test partition placement." << std::endl;