[PPL-devel] [GIT] ppl/ppl(master): Added a test showing a bug in wrap_assign when wrap_individually == false.

Enea Zaffanella zaffanella at cs.unipr.it
Mon May 18 09:02:18 CEST 2009


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

Author: Enea Zaffanella <zaffanella at cs.unipr.it>
Date:   Mon May 18 08:59:11 2009 +0200

Added a test showing a bug in wrap_assign when wrap_individually == false.
Test is test20(), temporarily marked as an expected failure.

---

 tests/Polyhedron/wrap1.cc |   34 ++++++++++++++++++++++++++++++++++
 1 files changed, 34 insertions(+), 0 deletions(-)

diff --git a/tests/Polyhedron/wrap1.cc b/tests/Polyhedron/wrap1.cc
index a36b931..edec4ba 100644
--- a/tests/Polyhedron/wrap1.cc
+++ b/tests/Polyhedron/wrap1.cc
@@ -566,6 +566,39 @@ test19() {
   return ok;
 }
 
+bool
+test20() {
+  Variable x(0);
+  Variable y(1);
+
+  C_Polyhedron ph(2);
+  ph.add_constraint(x >= 255);
+  ph.add_constraint(x <= 257);
+  ph.add_constraint(y >= 255);
+  ph.add_constraint(y <= 257);
+
+  print_constraints(ph, "*** ph ***");
+
+  Variables_Set vars(x, y);
+
+  Constraint_System cs;
+  cs.insert(x + y <= 100);
+
+  ph.wrap_assign(vars, BITS_8, UNSIGNED, OVERFLOW_WRAPS, &cs, 16, false);
+
+  C_Polyhedron known_result(2);
+  known_result.add_constraint(x >= 0);
+  known_result.add_constraint(x <= 1);
+  known_result.add_constraint(y >= 0);
+  known_result.add_constraint(y <= 1);
+
+  bool ok = (ph == known_result);
+
+  print_constraints(ph, "*** ph.wrap_assign(...) ***");
+
+  return ok;
+}
+
 } // namespace
 
 BEGIN_MAIN
@@ -588,4 +621,5 @@ BEGIN_MAIN
   DO_TEST(test17);
   DO_TEST(test18);
   DO_TEST_F8(test19);
+  DO_TEST_F(test20);
 END_MAIN




More information about the PPL-devel mailing list