Ignore:
Timestamp:
Mar 15, 2008, 5:58:34 PM (14 years ago)
Author:
Peter
Message:

working on #223

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/inputranker_test.cc

    r1121 r1237  
    2424*/
    2525
     26#include "Suite.h"
     27
    2628#include "yat/classifier/InputRanker.h"
    2729#include "yat/statistics/AUC.h"
     
    3436#include <iostream>
    3537
    36 
    37 
    38 int main(const int argc,const char* argv[])
     38int main(int argc, char* argv[])
    3939{
    4040  using namespace theplu::yat;
    41   std::ostream* error;
    42   if (argc>1 && argv[1]==std::string("-v"))
    43     error = &std::cerr;
    44   else {
    45     error = new std::ofstream("/dev/null");
    46     if (argc>1)
    47       std::cout << "inputranker_test -v : for printing extra information\n";
    48   }
    49   *error << "testing inputranker" << std::endl;
    50   bool ok = true;
     41  test::Suite suite(argc, argv);
     42  suite.err() << "testing inputranker" << std::endl;
    5143
    5244  std::ifstream is("data/rank_data.txt");
     
    6254  classifier::InputRanker ir(data,target,roc);
    6355  if (ir.id()[0]!=2 || ir.id()[1]!=0 || ir.id()[2]!=1){
    64     *error << "wrong id" << std::endl;
    65     ok=false;
     56    suite.err() << "wrong id" << std::endl;
     57    suite.add(false);
    6658  }
    6759 
    6860  if (ir.rank()[0]!=1 || ir.rank()[1]!=2 || ir.rank()[2]!=0){
    69     *error << "wrong rank" << std::endl;
    70     ok=false;
     61    suite.err() << "wrong rank" << std::endl;
     62    suite.add(false);
    7163  }
    72  
    73   if (error!=&std::cerr)
    74     delete error;
    75 
    76   return (ok ? 0 : -1);
    77 
     64  return suite.return_value();
    7865}
Note: See TracChangeset for help on using the changeset viewer.