diff -r 0219ee65ffcc -r a88ccf686a61 test/lp_test.cc --- a/test/lp_test.cc Thu Jul 07 15:00:04 2005 +0000 +++ b/test/lp_test.cc Thu Jul 07 15:58:19 2005 +0000 @@ -1,4 +1,5 @@ -#include +#include +#include #include "test_tools.h" @@ -184,16 +185,20 @@ } void solveAndCheck(LpSolverBase& lp, LpSolverBase::SolutionStatus stat, - double exp_opt){ + double exp_opt) { + using std::string; lp.solve(); //int decimal,sign; - std::string buf1; + std::ostringstream buf; + buf << "Primalstatus should be: " << int(stat); + // itoa(stat,buf1, 10); - check(lp.primalStatus()==stat,"Primalstatus should be "+buf1); - - if (stat == LpSolverBase::OPTIMAL){ - check(std::abs(lp.primalValue()-exp_opt)<1e-3, - "Wrong optimal value: the right optimum is "); + check(lp.primalStatus()==stat, buf.str()); + + if (stat == LpSolverBase::OPTIMAL) { + std::ostringstream buf; + buf << "Wrong optimal value: the right optimum is " << exp_opt; + check(std::abs(lp.primalValue()-exp_opt) < 1e-3, buf.str()); //+ecvt(exp_opt,2) } }