[PPL-devel] [GIT] ppl/ppl(sparse_matrices): Added test showing an assertion crashing in Linear_System:: remove_row_no_ok().
Enea Zaffanella
zaffanella at cs.unipr.it
Fri Mar 23 18:14:08 CET 2012
Module: ppl/ppl
Branch: sparse_matrices
Commit: d8ff8bceceef8f0b81358dd50fff7139a1d2fa0a
URL: http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=d8ff8bceceef8f0b81358dd50fff7139a1d2fa0a
Author: Enea Zaffanella <zaffanella at cs.unipr.it>
Date: Fri Mar 23 18:06:51 2012 +0100
Added test showing an assertion crashing in Linear_System::remove_row_no_ok().
The tests mirrors in C++ a crash originally obtained with the OCaml interface.
---
tests/Polyhedron/removespacedims2.cc | 32 ++++++++++++++++++++++++++++++++
1 files changed, 32 insertions(+), 0 deletions(-)
diff --git a/tests/Polyhedron/removespacedims2.cc b/tests/Polyhedron/removespacedims2.cc
index 68e72d0..cd38d81 100644
--- a/tests/Polyhedron/removespacedims2.cc
+++ b/tests/Polyhedron/removespacedims2.cc
@@ -60,8 +60,40 @@ test01() {
return ok;
}
+bool
+test02() {
+ Variable x(0);
+ Variable y(1);
+ Variable z(2);
+
+ NNC_Polyhedron ph(3);
+
+ ph.add_constraint(x >= 1);
+ ph.add_constraint(y >= 1);
+ ph.add_constraint(z >= 1);
+
+ print_generators(ph, "*** ph ***");
+
+ Variables_Set to_be_removed;
+ to_be_removed.insert(x);
+ to_be_removed.insert(z);
+
+ ph.remove_space_dimensions(to_be_removed);
+
+ NNC_Polyhedron known_result(1);
+ known_result.add_constraint(x >= 1);
+
+ bool ok = (ph == known_result);
+
+ print_constraints(ph, "*** ph.remove_space_dimensions() ***");
+ print_constraints(known_result, "*** known_result ***");
+
+ return ok;
+}
+
} // namespace
BEGIN_MAIN
DO_TEST(test01);
+ DO_TEST(test02);
END_MAIN
More information about the PPL-devel
mailing list