Ignore:
Timestamp:
Oct 12, 2007 11:55:57 AM (12 years ago)
Author:
forrest
Message:

for unit test return code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cbc/src/unitTestClp.cpp

    r819 r824  
    7676//#############################################################################
    7777
    78 void CbcClpUnitTest (const CbcModel & saveModel, std::string& dirMiplib,
     78int CbcClpUnitTest (const CbcModel & saveModel, std::string& dirMiplib,
    7979                     bool unitTestOnly)
    8080{
     
    8888  if (!doTest) {
    8989    printf("Not doing miplib run as can't find mps files - ? .gz without libz\n");
    90     return;
     90    return -1;
    9191  }
    9292  /*
     
    226226  int numProbSolved = 0;
    227227  double timeTaken=0.0;
     228  int numberFailures=0;
    228229 
    229230  /*
     
    366367        std::cout <<"cbc_clp" <<" " <<soln << " != " <<objValue[m]
    367368                  << "; error=" << fabs(objValue[m] - soln);
     369        numberFailures++;
    368370      }
    369371    } else {
     
    374376    delete model;
    375377  }
     378  int returnCode=0;
    376379  std::cout
    377380    <<"cbc_clp"
     
    379382    <<numProbSolved
    380383    <<" out of "
    381     <<objValue.size()
    382     <<" and took "
     384    <<objValue.size();
     385  int numberOnNodes = objValue.size()-numProbSolved-numberFailures;
     386  if (numberFailures||numberOnNodes) {
     387    if (numberOnNodes) {
     388      std::cout<<" ("<<numberOnNodes<<" stopped on nodes)";
     389      returnCode = numberOnNodes;
     390    }
     391    if (numberFailures) {
     392      std::cout<<" ("<<numberFailures<<" gave bad answer!)";
     393      returnCode += 100*numberFailures;
     394    }
     395  }
     396  std::cout<<" and took "
    383397    <<timeTaken
    384398    <<" seconds."
    385399    <<std::endl;
     400  return returnCode;
    386401}
Note: See TracChangeset for help on using the changeset viewer.