[PPL-devel] [GIT] ppl/ppl(master): Added new test showing an error in Grid:: relation_with(const Constraint&).

Enea Zaffanella zaffanella at cs.unipr.it
Sat Dec 3 09:26:13 CET 2011


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

Author: Enea Zaffanella <zaffanella at cs.unipr.it>
Date:   Sat Dec  3 09:13:58 2011 +0100

Added new test showing an error in Grid::relation_with(const Constraint&).

---

 tests/Grid/relations3.cc |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/tests/Grid/relations3.cc b/tests/Grid/relations3.cc
index 05e8e60..bd0bd11 100644
--- a/tests/Grid/relations3.cc
+++ b/tests/Grid/relations3.cc
@@ -438,6 +438,29 @@ test19() {
   return ok;
 }
 
+// A variant of test06.
+bool
+test20() {
+  Variable A(0);
+  Variable B(1);
+
+  Grid gr(2, EMPTY);
+  gr.add_grid_generator(grid_point());
+  gr.add_grid_generator(grid_point(2*A + 5*B));
+  // Force minimization.
+  (void) gr.minimized_grid_generators();
+  print_generators(gr, "*** gr ***");
+
+  bool ok = (gr.relation_with(5*A - 2*B == 1)
+	     == Poly_Con_Relation::is_disjoint()
+	     && gr.relation_with(5*A - 2*B > 1)
+	     == Poly_Con_Relation::is_disjoint()
+	     && gr.relation_with(5*A - 2*B >= 1)
+	     == Poly_Con_Relation::is_disjoint());
+
+  return ok;
+}
+
 } // namespace
 
 BEGIN_MAIN
@@ -460,4 +483,5 @@ BEGIN_MAIN
   DO_TEST(test17);
   DO_TEST(test18);
   DO_TEST(test19);
+  DO_TEST(test20);
 END_MAIN




More information about the PPL-devel mailing list