Changeset 542:fc6c7aab4b8d in lemon-main for test
- Timestamp:
- 03/04/09 14:43:05 (16 years ago)
- Branch:
- default
- Parents:
- 541:89e29e22d479 (diff), 538:ba124394367a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - Phase:
- public
- Location:
- test
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
test/lp_test.cc
r538 r542 198 198 check(const_cast<const LpSolver::Expr&>(e)[p2]==0, buf.str()); 199 199 200 //Test for clone/new 201 LP* lpnew = lp.newSolver(); 202 LP* lpclone = lp.cloneSolver(); 203 delete lpnew; 204 delete lpclone; 200 205 201 206 } … … 248 253 if (stat == LpSolver::OPTIMAL) { 249 254 std::ostringstream sbuf; 250 sbuf << "Wrong optimal value: the right optimum is " << exp_opt; 255 sbuf << "Wrong optimal value (" << lp.primal() <<") with " 256 << lp.solverName() <<"\n the right optimum is " << exp_opt; 251 257 check(std::abs(lp.primal()-exp_opt) < 1e-3, sbuf.str()); 252 258 } … … 356 362 } 357 363 364 template<class LP> 365 void cloneTest() 366 { 367 //Test for clone/new 368 369 LP* lp = new LP(); 370 LP* lpnew = lp->newSolver(); 371 LP* lpclone = lp->cloneSolver(); 372 delete lp; 373 delete lpnew; 374 delete lpclone; 375 } 376 358 377 int main() 359 378 { … … 366 385 lpTest(lp_glpk1); 367 386 aTest(lp_glpk2); 387 cloneTest<GlpkLp>(); 368 388 } 369 389 #endif … … 382 402 #endif 383 403 } 404 cloneTest<CplexLp>(); 384 405 #endif 385 406 … … 389 410 lpTest(lp_soplex1); 390 411 aTest(lp_soplex2); 412 cloneTest<SoplexLp>(); 391 413 } 392 414 #endif … … 397 419 lpTest(lp_clp1); 398 420 aTest(lp_clp2); 421 cloneTest<ClpLp>(); 399 422 } 400 423 #endif -
test/mip_test.cc
r538 r542 107 107 } 108 108 109 template<class MIP> 110 void cloneTest() 111 { 112 113 MIP* mip = new MIP(); 114 MIP* mipnew = mip->newSolver(); 115 MIP* mipclone = mip->cloneSolver(); 116 delete mip; 117 delete mipnew; 118 delete mipclone; 119 } 109 120 110 121 int main() … … 115 126 GlpkMip mip1; 116 127 aTest(mip1); 128 cloneTest<GlpkMip>(); 117 129 } 118 130 #endif … … 130 142 #endif 131 143 } 144 cloneTest<CplexMip>(); 132 145 #endif 133 146
Note: See TracChangeset
for help on using the changeset viewer.