# HG changeset patch # User athos # Date 1161952753 0 # Node ID 90c66dc93ca4f2d88031cd3e1abe618e0f9a214a # Parent 9273fe7d850c23c9753fb257b1b7875168684a55 A little test was born for Expr::simplify(). diff -r 9273fe7d850c -r 90c66dc93ca4 test/lp_test.cc --- a/test/lp_test.cc Thu Oct 26 14:20:17 2006 +0000 +++ b/test/lp_test.cc Fri Oct 27 12:39:13 2006 +0000 @@ -19,7 +19,7 @@ #include #include #include "test_tools.h" - +#include #ifdef HAVE_CONFIG_H #include @@ -175,6 +175,37 @@ lp.addRow(x[1]+x[3]<=x[5]-3); lp.addRow(-7<=x[1]+x[3]-12<=3); lp.addRow(x[1]<=x[5]); + + std::ostringstream buf; + + + //Checking the simplify function + +// //How to check the simplify function? A map gives no information +// //on the question whether a given key is or is not stored in it, or +// //it does? +// Yes, it does, using the find() function. + e=((p1+p2)+(p1-p2)); + e.simplify(); + buf << "Coeff. of p2 should be 0"; + // std::cout<0, buf.str()); + + tolerance=0.02; + e.simplify(tolerance); + buf << "Coeff. of p2 should be 0"; + check(e.find(p2)==e.end(), buf.str()); + + } {