[PPL-devel] [GIT] ppl/ppl(devel): Corrected expected result for test06().
Enea Zaffanella
zaffanella at cs.unipr.it
Thu Nov 19 12:39:16 CET 2015
Module: ppl/ppl
Branch: devel
Commit: fd92d113b4b3a646573fbaa26d35f62701e3ac12
URL: http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=fd92d113b4b3a646573fbaa26d35f62701e3ac12
Author: Enea Zaffanella <zaffanella at cs.unipr.it>
Date: Thu Nov 19 11:57:02 2015 +0100
Corrected expected result for test06().
Added a new testcase as test11().
The two tests show a bug in current implementation of method
Pointset_Powerset<PSET>::relation_with(const Constraint& c) const
---
tests/Powerset/relationwith1.cc | 29 +++++++++++++++++++++++++++--
1 files changed, 27 insertions(+), 2 deletions(-)
diff --git a/tests/Powerset/relationwith1.cc b/tests/Powerset/relationwith1.cc
index bff7e5b..a76856c 100644
--- a/tests/Powerset/relationwith1.cc
+++ b/tests/Powerset/relationwith1.cc
@@ -147,15 +147,15 @@ test06() {
C_Polyhedron ph2(1);
ph2.add_constraint(x == 2);
- Pointset_Powerset<C_Polyhedron> ps(1, EMPTY);
+ Pointset_Powerset<C_Polyhedron> ps(1, EMPTY);
ps.add_disjunct(ph1);
ps.add_disjunct(ph2);
Constraint c(x == 1);
Poly_Con_Relation rel = ps.relation_with(c);
- Poly_Con_Relation known_rel = Poly_Con_Relation::saturates();
+ Poly_Con_Relation known_rel = Poly_Con_Relation::strictly_intersects();
bool ok = (rel == known_rel);
@@ -262,6 +262,30 @@ test10() {
return ok && ps.OK();
}
+bool
+test11() {
+ Variable x(0);
+
+ C_Polyhedron ph1(1);
+ ph1.add_constraint(x <= 0);
+
+ C_Polyhedron ph2(1);
+ ph2.add_constraint(x >= 2);
+
+ Pointset_Powerset<C_Polyhedron> ps(1, EMPTY);
+ ps.add_disjunct(ph1);
+ ps.add_disjunct(ph2);
+
+ Constraint c(x >= 2);
+ Poly_Con_Relation rel = ps.relation_with(c);
+
+ Poly_Con_Relation known_rel = Poly_Con_Relation::strictly_intersects();
+
+ bool ok = (rel == known_rel);
+
+ return ok && ps.OK();
+}
+
} // namespace
BEGIN_MAIN
@@ -275,4 +299,5 @@ BEGIN_MAIN
DO_TEST(test08);
DO_TEST(test09);
DO_TEST(test10);
+ DO_TEST(test11);
END_MAIN
More information about the PPL-devel
mailing list