Changeset 1745 for trunk/Clp/test


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

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

Location:
trunk/Clp/test
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Clp/test/OsiClpSolverInterfaceTest.cpp

    r1740 r1745  
    55
    66#include "CoinPragma.hpp"
    7 #include "OsiConfig.h"
    87
    98//#include <cassert>
     
    1312
    1413#include "OsiClpSolverInterface.hpp"
     14#include "OsiUnitTests.hpp"
    1515#include "OsiCuts.hpp"
    1616#include "OsiRowCut.hpp"
    1717#include "OsiColCut.hpp"
    18 #include "OsiUnitTests.hpp"
    1918#include "CoinMessage.hpp"
    2019#include "ClpMessage.hpp"
     
    4847//--------------------------------------------------------------------------
    4948// test EKKsolution methods.
    50 int
     49void
    5150OsiClpSolverInterfaceUnitTest(const std::string & mpsDir, const std::string & netlibDir)
    5251{
    53 
    5452  // Test default constructor
    5553  {
     
    174172      const double * rl = clpSi.getRowLower();
    175173      const double * ru = clpSi.getRowUpper();
    176       OSIUNITTEST_ASSERT_ERROR(nc == 8, return 1, "clp", "read and copy exmip1");
    177       OSIUNITTEST_ASSERT_ERROR(nr == 5, return 1, "clp", "read and copy exmip1");
     174      OSIUNITTEST_ASSERT_ERROR(nc == 8, return, "clp", "read and copy exmip1");
     175      OSIUNITTEST_ASSERT_ERROR(nr == 5, return, "clp", "read and copy exmip1");
    178176      OSIUNITTEST_ASSERT_ERROR(eq(cl[0],2.5), {}, "clp", "read and copy exmip1");
    179177      OSIUNITTEST_ASSERT_ERROR(eq(cl[1],0.0), {}, "clp", "read and copy exmip1");
     
    215213      const CoinPackedMatrix * smP = si.getMatrixByRow();
    216214
    217       OSIUNITTEST_ASSERT_ERROR(smP->getMajorDim()    ==  5, return 1, "clp", "getMatrixByRow: major dim");
    218       OSIUNITTEST_ASSERT_ERROR(smP->getNumElements() == 14, return 1, "clp", "getMatrixByRow: num elements");
     215      OSIUNITTEST_ASSERT_ERROR(smP->getMajorDim()    ==  5, return, "clp", "getMatrixByRow: major dim");
     216      OSIUNITTEST_ASSERT_ERROR(smP->getNumElements() == 14, return, "clp", "getMatrixByRow: num elements");
    219217
    220218      CoinRelFltEq eq;
     
    338336    // Test matrixByCol method
    339337    {
    340  
    341338      const OsiClpSolverInterface si(m);
    342339      const CoinPackedMatrix * smP = si.getMatrixByCol();
    343340     
    344       OSIUNITTEST_ASSERT_ERROR(smP->getMajorDim()    ==  8, return 1, "clp", "getMatrixByCol: major dim");
    345       OSIUNITTEST_ASSERT_ERROR(smP->getMinorDim()    ==  5, return 1, "clp", "getMatrixByCol: minor dim");
    346       OSIUNITTEST_ASSERT_ERROR(smP->getNumElements() == 14, return 1, "clp", "getMatrixByCol: number of elements");
    347       OSIUNITTEST_ASSERT_ERROR(smP->getSizeVectorStarts() == 9, return 1, "clp", "getMatrixByCol: vector starts size");
     341      OSIUNITTEST_ASSERT_ERROR(smP->getMajorDim()    ==  8, return, "clp", "getMatrixByCol: major dim");
     342      OSIUNITTEST_ASSERT_ERROR(smP->getMinorDim()    ==  5, return, "clp", "getMatrixByCol: minor dim");
     343      OSIUNITTEST_ASSERT_ERROR(smP->getNumElements() == 14, return, "clp", "getMatrixByCol: number of elements");
     344      OSIUNITTEST_ASSERT_ERROR(smP->getSizeVectorStarts() == 9, return, "clp", "getMatrixByCol: vector starts size");
    348345
    349346      CoinRelFltEq eq;
     
    426423        const CoinPackedMatrix * siC1mbr = siC1.getMatrixByRow();
    427424        OSIUNITTEST_ASSERT_ERROR(siC1mbr != NULL, {}, "clp", "matrix by row");
    428         OSIUNITTEST_ASSERT_ERROR(siC1mbr->getMajorDim()    ==  5, return 1, "clp", "matrix by row: major dim");
    429         OSIUNITTEST_ASSERT_ERROR(siC1mbr->getNumElements() == 14, return 1, "clp", "matrix by row: num elements");
     425        OSIUNITTEST_ASSERT_ERROR(siC1mbr->getMajorDim()    ==  5, return, "clp", "matrix by row: major dim");
     426        OSIUNITTEST_ASSERT_ERROR(siC1mbr->getNumElements() == 14, return, "clp", "matrix by row: num elements");
    430427
    431428        const double * ev = siC1mbr->getElements();
     
    545542      const CoinPackedMatrix * lhsmbr = lhs.getMatrixByRow();
    546543      OSIUNITTEST_ASSERT_ERROR(lhsmbr != NULL, {}, "clp", "matrix by row after assignment");
    547       OSIUNITTEST_ASSERT_ERROR(lhsmbr->getMajorDim()    ==  6, return 1, "clp", "matrix by row after assignment: major dim");
    548       OSIUNITTEST_ASSERT_ERROR(lhsmbr->getNumElements() == 14, return 1, "clp", "matrix by row after assignment: num elements");
     544      OSIUNITTEST_ASSERT_ERROR(lhsmbr->getMajorDim()    ==  6, return, "clp", "matrix by row after assignment: major dim");
     545      OSIUNITTEST_ASSERT_ERROR(lhsmbr->getNumElements() == 14, return, "clp", "matrix by row after assignment: num elements");
    549546
    550547      const double * ev = lhsmbr->getElements();
     
    13971394  {
    13981395    OsiClpSolverInterface m;
    1399     return OsiSolverInterfaceCommonUnitTest(&m, mpsDir, netlibDir);
     1396    OsiSolverInterfaceCommonUnitTest(&m, mpsDir, netlibDir);
    14001397  }
    14011398}
  • trunk/Clp/test/osiUnitTest.cpp

    r1744 r1745  
    55
    66#include "CoinPragma.hpp"
    7 #include "OsiConfig.h"
    87
    9 #include <cstdio>
    108#include <iostream>
    119
    1210#include "OsiUnitTests.hpp"
    13 #include "OsiRowCutDebugger.hpp"
    14 #include "OsiRowCut.hpp"
    15 #include "OsiColCut.hpp"
    16 
    17 #include "CoinError.hpp"
    18 
    1911#include "OsiClpSolverInterface.hpp"
    2012
     
    3022  Start off with various bits of initialisation that don't really belong
    3123  anywhere else.
    32  */
    33   outcomes.clear();
    34 /*
     24
    3525  Synchronise C++ stream i/o with C stdio. This makes debugging
    3626  output a bit more comprehensible. It still suffers from interleave of cout
Note: See TracChangeset for help on using the changeset viewer.