Ignore:
Timestamp:
Jun 13, 2011 11:09:24 AM (10 years ago)
Author:
stefan
Message:

remove now redundant counting of test failures; a bit more cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cbc/test/OsiCbcSolverInterfaceTest.cpp

    r1666 r1667  
    5656//--------------------------------------------------------------------------
    5757// test solution methods.
    58 int
    59 OsiCbcSolverInterfaceUnitTest(const std::string & mpsDir, const std::string & netlibDir)
     58void OsiCbcSolverInterfaceUnitTest(const std::string & mpsDir, const std::string & netlibDir)
    6059{
    6160  {   
     
    156155      const double * rl = cbcSi.getRowLower();
    157156      const double * ru = cbcSi.getRowUpper();
    158       OSIUNITTEST_ASSERT_ERROR(nc == 8, return 1, "cbc", "read and copy exmip1");
    159       OSIUNITTEST_ASSERT_ERROR(nr == 5, return 1, "cbc", "read and copy exmip1");
     157      OSIUNITTEST_ASSERT_ERROR(nc == 8, return, "cbc", "read and copy exmip1");
     158      OSIUNITTEST_ASSERT_ERROR(nr == 5, return, "cbc", "read and copy exmip1");
    160159      OSIUNITTEST_ASSERT_ERROR(eq(cl[0],2.5), {}, "cbc", "read and copy exmip1");
    161160      OSIUNITTEST_ASSERT_ERROR(eq(cl[1],0.0), {}, "cbc", "read and copy exmip1");
     
    198197      const CoinPackedMatrix * smP = si.getMatrixByRow();
    199198
    200       OSIUNITTEST_ASSERT_ERROR(smP->getMajorDim()    ==  5, return 1, "cbc", "getMatrixByRow: major dim");
    201       OSIUNITTEST_ASSERT_ERROR(smP->getMinorDim()    ==  8, return 1, "cbc", "getMatrixByRow: major dim");
    202       OSIUNITTEST_ASSERT_ERROR(smP->getNumElements() == 14, return 1, "cbc", "getMatrixByRow: num elements");
    203       OSIUNITTEST_ASSERT_ERROR(smP->getSizeVectorStarts() == 6, return 1, "cbc", "getMatrixByRow: num elements");
     199      OSIUNITTEST_ASSERT_ERROR(smP->getMajorDim()    ==  5, return, "cbc", "getMatrixByRow: major dim");
     200      OSIUNITTEST_ASSERT_ERROR(smP->getMinorDim()    ==  8, return, "cbc", "getMatrixByRow: major dim");
     201      OSIUNITTEST_ASSERT_ERROR(smP->getNumElements() == 14, return, "cbc", "getMatrixByRow: num elements");
     202      OSIUNITTEST_ASSERT_ERROR(smP->getSizeVectorStarts() == 6, return, "cbc", "getMatrixByRow: num elements");
    204203
    205204#ifdef OSICBC_TEST_MTX_STRUCTURE
     
    316315      const CoinPackedMatrix * smP = si.getMatrixByCol();
    317316
    318       OSIUNITTEST_ASSERT_ERROR(smP->getMajorDim()    ==  8, return 1, "cbc", "getMatrixByCol: major dim");
    319       OSIUNITTEST_ASSERT_ERROR(smP->getMinorDim()    ==  5, return 1, "cbc", "getMatrixByCol: minor dim");
    320       OSIUNITTEST_ASSERT_ERROR(smP->getNumElements() == 14, return 1, "cbc", "getMatrixByCol: number of elements");
    321       OSIUNITTEST_ASSERT_ERROR(smP->getSizeVectorStarts() == 9, return 1, "cbc", "getMatrixByCol: vector starts size");
     317      OSIUNITTEST_ASSERT_ERROR(smP->getMajorDim()    ==  8, return, "cbc", "getMatrixByCol: major dim");
     318      OSIUNITTEST_ASSERT_ERROR(smP->getMinorDim()    ==  5, return, "cbc", "getMatrixByCol: minor dim");
     319      OSIUNITTEST_ASSERT_ERROR(smP->getNumElements() == 14, return, "cbc", "getMatrixByCol: number of elements");
     320      OSIUNITTEST_ASSERT_ERROR(smP->getSizeVectorStarts() == 9, return, "cbc", "getMatrixByCol: vector starts size");
    322321
    323322#ifdef OSICBC_TEST_MTX_STRUCTURE
     
    402401        const CoinPackedMatrix * siC1mbr = siC1.getMatrixByRow();
    403402        OSIUNITTEST_ASSERT_ERROR(siC1mbr != NULL, {}, "cbc", "matrix by row");
    404         OSIUNITTEST_ASSERT_ERROR(siC1mbr->getMajorDim()    ==  5, return 1, "cbc", "matrix by row: major dim");
    405         OSIUNITTEST_ASSERT_ERROR(siC1mbr->getMinorDim()    ==  8, return 1, "cbc", "matrix by row: major dim");
    406         OSIUNITTEST_ASSERT_ERROR(siC1mbr->getNumElements() == 14, return 1, "cbc", "matrix by row: num elements");
    407         OSIUNITTEST_ASSERT_ERROR(siC1mbr->getSizeVectorStarts() == 6, return 1, "cbc", "matrix by row: num elements");
     403        OSIUNITTEST_ASSERT_ERROR(siC1mbr->getMajorDim()    ==  5, return, "cbc", "matrix by row: major dim");
     404        OSIUNITTEST_ASSERT_ERROR(siC1mbr->getMinorDim()    ==  8, return, "cbc", "matrix by row: major dim");
     405        OSIUNITTEST_ASSERT_ERROR(siC1mbr->getNumElements() == 14, return, "cbc", "matrix by row: num elements");
     406        OSIUNITTEST_ASSERT_ERROR(siC1mbr->getSizeVectorStarts() == 6, return, "cbc", "matrix by row: num elements");
    408407
    409408#ifdef OSICBC_TEST_MTX_STRUCTURE
     
    520519      const CoinPackedMatrix * lhsmbr = lhs.getMatrixByRow();
    521520      OSIUNITTEST_ASSERT_ERROR(lhsmbr != NULL, {}, "cbc", "matrix by row after assignment");
    522       OSIUNITTEST_ASSERT_ERROR(lhsmbr->getMajorDim()    ==  6, return 1, "cbc", "matrix by row after assignment: major dim");
    523       OSIUNITTEST_ASSERT_ERROR(lhsmbr->getNumElements() == 14, return 1, "cbc", "matrix by row after assignment: num elements");
     521      OSIUNITTEST_ASSERT_ERROR(lhsmbr->getMajorDim()    ==  6, return, "cbc", "matrix by row after assignment: major dim");
     522      OSIUNITTEST_ASSERT_ERROR(lhsmbr->getNumElements() == 14, return, "cbc", "matrix by row after assignment: num elements");
    524523
    525524
     
    784783    OsiSolverInterfaceCommonUnitTest(&m, mpsDir,netlibDir);
    785784  }
    786 
    787   return 0;
    788785}
Note: See TracChangeset for help on using the changeset viewer.