summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorEnea Zaffanella <enea.zaffanella@bugseng.com>2013-04-04 12:22:48 +0200
committerEnea Zaffanella <enea.zaffanella@bugseng.com>2013-04-04 12:22:48 +0200
commit9fd4b05e30baa48b4aec591539acdd14ae3fe5e3 (patch)
tree2ed974faf32488ac3f0dc16019d6135b4a753ba1 /tests
parenteaac930eb9a08b129381fc9cf96d6cfa45f57d6a (diff)
downloadppl-9fd4b05e30baa48b4aec591539acdd14ae3fe5e3.tar.gz
ppl-9fd4b05e30baa48b4aec591539acdd14ae3fe5e3.tar.bz2
ppl-9fd4b05e30baa48b4aec591539acdd14ae3fe5e3.zip
Added a testcase showing an issue in method MIP_Problem::OK().
The method checks for too strong (i.e., invlaid) invariants in the case of a MIP_Problem subject to space dimnesion additions. Modified method OK() to check those invariants on the "internal" space dimension, rather the external one. While at it, modified private method MIP_Problem::process_pending_constraints() to avoid returning a bool value (which is never checked).
Diffstat (limited to 'tests')
-rw-r--r--tests/MIP_Problem/mipproblem4.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/MIP_Problem/mipproblem4.cc b/tests/MIP_Problem/mipproblem4.cc
index 860d9d933..ead6d5e8b 100644
--- a/tests/MIP_Problem/mipproblem4.cc
+++ b/tests/MIP_Problem/mipproblem4.cc
@@ -34,8 +34,22 @@ test01() {
return true;
}
+bool
+test02() {
+ Variable A(0);
+ Variable B(1);
+ MIP_Problem mip(1);
+ Generator p1 = mip.optimizing_point();
+ bool ok1 = (p1 == point(0*A));
+ mip.add_space_dimensions_and_embed(1);
+ Generator p2 = mip.optimizing_point();
+ bool ok2 = (p2 == point(0*A + 0*B));
+ return ok1 && ok2;
+}
+
} // namespace
BEGIN_MAIN
DO_TEST(test01);
+ DO_TEST(test02);
END_MAIN