Changeset 1667 for trunk/Cbc/test


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

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

Location:
trunk/Cbc/test
Files:
2 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}
  • trunk/Cbc/test/osiUnitTest.cpp

    r1666 r1667  
    66#include "CoinPragma.hpp"
    77
    8 #include <cstdio>
    98#include <iostream>
    109
    1110#include "OsiUnitTests.hpp"
    12 #include "OsiRowCutDebugger.hpp"
    13 #include "OsiRowCut.hpp"
    14 #include "OsiColCut.hpp"
    15 
    16 #include "CoinError.hpp"
    17 
    1811#include "OsiCbcSolverInterface.hpp"
    1912
     
    2922  Start off with various bits of initialisation that don't really belong
    3023  anywhere else.
    31  */
    32   outcomes.clear();
    33 /*
     24
    3425  Synchronise C++ stream i/o with C stdio. This makes debugging
    3526  output a bit more comprehensible. It still suffers from interleave of cout
Note: See TracChangeset for help on using the changeset viewer.