Changeset 2202


Ignore:
Timestamp:
Feb 18, 2019 7:12:38 PM (20 months ago)
Author:
stefan
Message:

add some asserts that clone() didn't return NULL

Location:
trunk/Osi/src/OsiCommonTest
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Osi/src/OsiCommonTest/OsiColCutTest.cpp

    r2195 r2202  
    186186
    187187    OsiSolverInterface *imP = baseSiP->clone();
     188    assert(imP != NULL);
    188189    std::string fn = mpsDir + "exmip1";
    189190    imP->readMps(fn.c_str(), "mps");
     
    206207    // Test consistent(IntegerModel) method.
    207208    OsiSolverInterface *imP = baseSiP->clone();
     209    assert(imP != NULL);
    208210    std::string fn = mpsDir + "exmip1";
    209211    imP->readMps(fn.c_str(), "mps");
     
    245247    // Test consistent(IntegerModel) method.
    246248    OsiSolverInterface *imP = baseSiP->clone();
     249    assert(imP != NULL);
    247250    std::string fn = mpsDir + "exmip1";
    248251    imP->readMps(fn.c_str(), "mps");
  • trunk/Osi/src/OsiCommonTest/OsiRowCutTest.cpp

    r2195 r2202  
    251251  // Test consistent
    252252  OsiSolverInterface *imP = baseSiP->clone();
     253  assert(imP != NULL);
    253254  std::string fn = mpsDir + "exmip1";
    254255  OSIUNITTEST_ASSERT_ERROR(imP->readMps(fn.c_str(), "mps") == 0, {}, "osirowcut", "read MPS");
     
    292293  // Test consistent(IntegerModel) method.
    293294  OsiSolverInterface *imP = baseSiP->clone();
     295  assert(imP != NULL);
    294296  std::string fn = mpsDir + "exmip1";
    295297  OSIUNITTEST_ASSERT_ERROR(imP->readMps(fn.c_str(), "mps") == 0, {}, "osirowcut", "read MPS");
     
    315317  //Test infeasible(im) method
    316318  OsiSolverInterface *imP = baseSiP->clone();
     319  assert(imP != NULL);
    317320  std::string fn = mpsDir + "exmip1";
    318321  OSIUNITTEST_ASSERT_ERROR(imP->readMps(fn.c_str(), "mps") == 0, {}, "osirowcut", "read MPS");
  • trunk/Osi/src/OsiCommonTest/OsiSolverInterfaceTest.cpp

    r2195 r2202  
    37783778  {
    37793779    OsiSolverInterface *si = emptySi->clone();
     3780    assert(si != NULL);
    37803781    solverName = "Unknown Solver";
    37813782    OSIUNITTEST_ASSERT_ERROR(si->getStrParam(OsiSolverName, solverName), {}, solverName, "getStrParam(OsiSolverName) supported");
     
    38123813  std::string fn = mpsDir + "exmip1";
    38133814  OsiSolverInterface *exmip1Si = emptySi->clone();
     3815  assert(exmip1Si != NULL);
    38143816  OSIUNITTEST_ASSERT_ERROR(exmip1Si->readMps(fn.c_str(), "mps") == 0, return, *exmip1Si, "read MPS file");
    38153817  /*
Note: See TracChangeset for help on using the changeset viewer.