
Module: ppl/ppl Branch: master Commit: e191bf79e2f4228ba5e1f3ace0ad1cfae3ba1674 URL: http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=e191bf79e2f42...
Author: Enea Zaffanella zaffanella@cs.unipr.it Date: Fri Feb 19 22:31:37 2010 +0100
Little code coverage improvement.
---
tests/PIP_Problem/ascii_dump_load1.cc | 32 ++++++++++++++++++++++++++++++++ tests/PIP_Problem/pipproblem2.cc | 2 +- 2 files changed, 33 insertions(+), 1 deletions(-)
diff --git a/tests/PIP_Problem/ascii_dump_load1.cc b/tests/PIP_Problem/ascii_dump_load1.cc index d0cbceb..b8cc8b1 100644 --- a/tests/PIP_Problem/ascii_dump_load1.cc +++ b/tests/PIP_Problem/ascii_dump_load1.cc @@ -245,6 +245,37 @@ test08() { return ok; }
+bool +test09() { + Variable i(0); + Variable j(1); + Variable n(2); + Variable m(3); + Variables_Set params(n, m); + + Constraint_System cs; + cs.insert(3*j >= -2*i+8); + cs.insert(j <= 4*i - 4); + cs.insert(j <= m); + cs.insert(i <= n); + + PIP_Problem pip(cs.space_dimension(), cs.begin(), cs.end(), params); + (void) pip.solve(); + + std::stringstream ss; + pip.ascii_dump(ss); + + PIP_Problem pip2; + bool ok = pip2.ascii_load(ss); + + std::stringstream ss2; + pip2.ascii_dump(ss2); + + ok &= (ss.str() == ss2.str()); + + return ok; +} + } // namespace
BEGIN_MAIN @@ -256,4 +287,5 @@ BEGIN_MAIN DO_TEST(test06); DO_TEST(test07); DO_TEST(test08); + DO_TEST(test09); END_MAIN diff --git a/tests/PIP_Problem/pipproblem2.cc b/tests/PIP_Problem/pipproblem2.cc index 5c747f5..9c16066 100644 --- a/tests/PIP_Problem/pipproblem2.cc +++ b/tests/PIP_Problem/pipproblem2.cc @@ -264,7 +264,7 @@ test14() { ok &= (ap0 == ap1) && (ap2.denominator() == 1);
using namespace IO_Operators; - nout << ap1; + nout << ap1 << endl;
ok &= (ap1.external_memory_in_bytes() < ap1.total_memory_in_bytes());