[PPL-devel] [GIT] ppl/ppl(master): Weightwatch test fixed so as to behave properly under arithmetic overflows .

Enea Zaffanella zaffanella at cs.unipr.it
Mon Jul 13 09:44:32 CEST 2009


Module: ppl/ppl
Branch: master
Commit: 62c817602e25fe567b1685f0b86cbc2266247d45
URL:    http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=62c817602e25fe567b1685f0b86cbc2266247d45

Author: Enea Zaffanella <zaffanella at cs.unipr.it>
Date:   Mon Jul 13 09:42:35 2009 +0200

Weightwatch test fixed so as to behave properly under arithmetic overflows.

---

 tests/Polyhedron/weightwatch1.cc |   30 ++++++++++++------------------
 1 files changed, 12 insertions(+), 18 deletions(-)

diff --git a/tests/Polyhedron/weightwatch1.cc b/tests/Polyhedron/weightwatch1.cc
index aeffacb..292e428 100644
--- a/tests/Polyhedron/weightwatch1.cc
+++ b/tests/Polyhedron/weightwatch1.cc
@@ -108,17 +108,15 @@ bool test01() {
     // Thanks to the blind relaxation of the strict inequality constraint,
     // polyhedron ph is easily seen to contain an integer point.
     const bool contains = ph.contains_integer_point();
-    nout << "\nph " << (contains ? "contains" : "does not contain")
+    nout << endl << "ph "
+         << (contains ? "contains" : "does not contain")
          << " an integer point" << endl;
     return contains;
   }
+  // Note: other exceptions are just propagated.
   catch (const Deterministic_Timeout& e) {
     // Unexpected timeout exception.
-    nout << e.what() << endl;
-    return false;
-  }
-  catch (...) {
-    // Unexpected exception.
+    nout << endl << e.what() << endl;
     return false;
   }
   // Should never get here.
@@ -176,19 +174,17 @@ bool test02() {
     // The branch-and-bound heuristics of the MIP solver behaves badly
     // on this particular example, causing timeout to expire.
     const bool contains = ph.contains_integer_point();
-    nout << "ph " << (contains ? "contains" : "does not contain")
+    nout << endl
+         << "ph " << (contains ? "contains" : "does not contain")
          << " an integer point" << endl;
     return false;
   }
+  // Note: other exceptions are just propagated.
   catch (const Deterministic_Timeout& e) {
     // Expected exception.
-    nout << e.what() << endl;
+    nout << endl << e.what() << endl;
     return true;
   }
-  catch (...) {
-    // Unexpected exception.
-    return false;
-  }
   // Should never get here.
   return false;
 }
@@ -216,19 +212,17 @@ bool test03() {
     // onto a lower dimensional space: the performance issue of previous
     // test does not depend on high dimension vector space.
     const bool contains = ph.contains_integer_point();
-    nout << "ph " << (contains ? "contains" : "does not contain")
+    nout << endl
+         << "ph " << (contains ? "contains" : "does not contain")
          << " an integer point" << endl;
     return false;
   }
+  // Note: other exceptions are just propagated.
   catch (const Deterministic_Timeout& e) {
     // Expected exception.
-    nout << e.what() << endl;
+    nout << endl << e.what() << endl;
     return true;
   }
-  catch (...) {
-    // Unexpected exception.
-    return false;
-  }
   // Should never get here.
   return false;
 }




More information about the PPL-devel mailing list