[PPL-devel] [GIT] ppl/ppl(pip): Do perform PIP_Problem tests first.

Enea Zaffanella zaffanella at cs.unipr.it
Fri Sep 4 09:38:48 CEST 2009


Module: ppl/ppl
Branch: pip
Commit: 56c76f2f522079257e30d4738ed32ee2b7b43287
URL:    http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=56c76f2f522079257e30d4738ed32ee2b7b43287

Author: Enea Zaffanella <zaffanella at cs.unipr.it>
Date:   Thu Sep  3 14:34:15 2009 +0200

Do perform PIP_Problem tests first.

---

 tests/Makefile.am               |    2 +-
 tests/PIP_Problem/pipproblem.cc |   13 +++++--------
 2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/tests/Makefile.am b/tests/Makefile.am
index 88addab..536a586 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -22,11 +22,11 @@
 
 SUBDIRS = \
 . \
+PIP_Problem \
 Powerset \
 Partially_Reduced_Product \
 Box \
 MIP_Problem \
-PIP_Problem \
 Octagonal_Shape \
 BD_Shape \
 Polyhedron \
diff --git a/tests/PIP_Problem/pipproblem.cc b/tests/PIP_Problem/pipproblem.cc
index 51af374..df9f96f 100644
--- a/tests/PIP_Problem/pipproblem.cc
+++ b/tests/PIP_Problem/pipproblem.cc
@@ -20,13 +20,12 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, USA.
 For the most up-to-date information see the Parma Polyhedra Library
 site: http://www.cs.unipr.it/ppl/ . */
 
-//#define NOISY 1
-
 #include "ppl_test.hh"
 
 namespace {
 
-bool test01() {
+bool
+test01() {
   Variable X1(0);
   Variable X2(1);
   Variable I0(2);
@@ -41,13 +40,11 @@ bool test01() {
   cs.insert(-X1 - I0 + N >= 0);
   cs.insert(X2 + J0 - N - 1 >= 0);
 
-  PIP_Problem pip = PIP_Problem(cs.space_dimension(), cs.begin(), cs.end(),
-      params);
+  PIP_Problem pip(cs.space_dimension(), cs.begin(), cs.end(), params);
 
-  if (pip.solve() != OPTIMIZED_PIP_PROBLEM)
-    return false;
+  bool ok = (pip.solve() == OPTIMIZED_PIP_PROBLEM);
 
-  return true;
+  return ok;
 }
 
 } // namespace




More information about the PPL-devel mailing list