[PPL-devel] [GIT] ppl/ppl(floating_point): Refactoring of test files into test/ Floating_Point_Expression.

Roberto Amadini r.amadini at virgilio.it
Tue Sep 22 14:03:27 CEST 2009


Module: ppl/ppl
Branch: floating_point
Commit: 4e2e5ca265d96893834be726b5f359255e506aaa
URL:    http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=4e2e5ca265d96893834be726b5f359255e506aaa

Author: Roberto Amadini <r.amadini at virgilio.it>
Date:   Tue Sep 22 14:02:34 2009 +0200

Refactoring of test files into test/Floating_Point_Expression.

---

 tests/Floating_Point_Expression/Makefile.am        |   12 ++++---
 .../linearform1.cc                                 |   30 ++++++++++++++-----
 .../{affineimage3.cc => octagonalshape1.cc}        |    0
 .../{refinelf1.cc => octagonalshape2.cc}           |    0
 tests/Polyhedron/Makefile.am                       |    3 --
 5 files changed, 29 insertions(+), 16 deletions(-)

diff --git a/tests/Floating_Point_Expression/Makefile.am b/tests/Floating_Point_Expression/Makefile.am
index baaf213..1c10370 100755
--- a/tests/Floating_Point_Expression/Makefile.am
+++ b/tests/Floating_Point_Expression/Makefile.am
@@ -49,9 +49,10 @@ $(top_builddir)/tests/libppl_tests.a \
 $(top_builddir)/src/libppl.la \
 @extra_libraries@
 
-TESTS = floatingpointexpr1 \
-affineimage3 \
-refinelf1 \
+TESTS = linearform1 \
+floatingpointexpr1 \
+octagonalshape1 \
+octagonalshape2 \
 bdshape1
 
 XFAIL_TESTS =
@@ -62,9 +63,10 @@ BUGS =
 # Sources for the tests
 #
 
+linearform1_SOURCES = linearform1.cc
 floatingpointexpr1_SOURCES = floatingpointexpr1.cc
-affineimage3_SOURCES = affineimage3.cc
-refinelf1_SOURCES = refinelf1.cc
+octagonalshape1_SOURCES = octagonalshape1.cc
+octagonalshape2_SOURCES = octagonalshape2.cc
 bdshape1_SOURCES = bdshape1.cc
 
 check_PROGRAMS = \
diff --git a/tests/Polyhedron/linearform1.cc b/tests/Floating_Point_Expression/linearform1.cc
similarity index 94%
rename from tests/Polyhedron/linearform1.cc
rename to tests/Floating_Point_Expression/linearform1.cc
index c6ba2ab..3f3f42a 100644
--- a/tests/Polyhedron/linearform1.cc
+++ b/tests/Floating_Point_Expression/linearform1.cc
@@ -1,4 +1,4 @@
-/* Testing Linear_Expression.
+/* Testing Linear_Form on floating point intervals.
    Copyright (C) 2001-2009 Roberto Bagnara <bagnara at cs.unipr.it>
 
 This file is part of the Parma Polyhedra Library (PPL).
@@ -243,38 +243,52 @@ test08() {
       ok2 = true;
   }
 
-  Linear_Form<db_r_oc> g;
   bool ok3 = false;
   try {
-    g = f - A;
+    f -= A;
   }
   catch(std::length_error e) {
-      nout << "Overflow in operator-(Linear_Form<C>& f, const Variable v)."
+      nout << "Overflow in operator-=(Linear_Form<C>& f, const Variable v)."
            << endl;
+      Variable B(1);
+      Variable C(2);
+      Linear_Form<db_r_oc> g(B);
+      g -= C;
       ok3 = true;
   }
 
+  Linear_Form<db_r_oc> g;
   bool ok4 = false;
   try {
-    g = A - f;
+    g = f - A;
   }
   catch(std::length_error e) {
-      nout << "Overflow in operator-(const Variable v, Linear_Form<C>& f)."
+      nout << "Overflow in operator-(Linear_Form<C>& f, const Variable v)."
            << endl;
       ok4 = true;
   }
 
   bool ok5 = false;
   try {
+    g = A - f;
+  }
+  catch(std::length_error e) {
+      nout << "Overflow in operator-(const Variable v, Linear_Form<C>& f)."
+           << endl;
+      ok5 = true;
+  }
+
+  bool ok6 = false;
+  try {
     g = A + f;
   }
   catch(std::length_error e) {
       nout << "Overflow in operator+(const Variable v, Linear_Form<C>& f)."
            << endl;
-      ok5 = true;
+      ok6 = true;
   }
 
-  return ok1 && ok2 && ok3 && ok4 && ok5;
+  return ok1 && ok2 && ok3 && ok4 && ok5 && ok6;
 }
 
 } // namespace
diff --git a/tests/Floating_Point_Expression/affineimage3.cc b/tests/Floating_Point_Expression/octagonalshape1.cc
similarity index 100%
rename from tests/Floating_Point_Expression/affineimage3.cc
rename to tests/Floating_Point_Expression/octagonalshape1.cc
diff --git a/tests/Floating_Point_Expression/refinelf1.cc b/tests/Floating_Point_Expression/octagonalshape2.cc
similarity index 100%
rename from tests/Floating_Point_Expression/refinelf1.cc
rename to tests/Floating_Point_Expression/octagonalshape2.cc
diff --git a/tests/Polyhedron/Makefile.am b/tests/Polyhedron/Makefile.am
index 2c7db48..fa094e5 100644
--- a/tests/Polyhedron/Makefile.am
+++ b/tests/Polyhedron/Makefile.am
@@ -101,7 +101,6 @@ limitedbhrz03extrapolation1 \
 limitedh79extrapolation1 \
 linearpartition1 \
 linearexpression1 \
-linearform1 \
 linearsystem1 \
 mapspacedims1 \
 matrix1 \
@@ -335,8 +334,6 @@ linearpartition1_SOURCES = linearpartition1.cc
 
 linearexpression1_SOURCES = linearexpression1.cc
 
-linearform1_SOURCES = linearform1.cc
-
 linearsystem1_SOURCES = linearsystem1.cc
 
 mapspacedims1_SOURCES = mapspacedims1.cc




More information about the PPL-devel mailing list