Changeset 399


Ignore:
Timestamp:
Oct 14, 2005, 11:31:07 AM (16 years ago)
Author:
Peter
Message:

moved test averagers to one file
changed -p flag to -v flag

Location:
trunk/test
Files:
5 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/test/Makefile.am

    r385 r399  
    33## $Id$
    44
    5 TESTS = alignment_test averagerpair_test consensus_inputranker_test \
     5TESTS = alignment_test averager_test consensus_inputranker_test \
    66  crossvalidation_test inputranker_test kernel_test matrix_test \
    77  nni_test pca_test regression_test rnd_test roc_test \
     
    1717
    1818alignment_test_SOURCES = alignment_test.cc
    19 averagerpair_test_SOURCES = averagerpair_test.cc
     19averager_test_SOURCES = averager_test.cc
    2020consensus_inputranker_test_SOURCES = consensus_inputranker_test.cc
    2121crossvalidation_test_SOURCES = crossvalidation_test.cc
  • trunk/test/README

    r302 r399  
    44no print out, returns 0 if test is succesful.
    55
    6        program_test -p
     6       program_test -v
    77
    8 for printing details about failure.
     8verbose mode for printing extra information.
    99 
  • trunk/test/averager_test.cc

    r397 r399  
    11// $Id$
    22
     3#include <c++_tools/statistics/Averager.h>
    34#include <c++_tools/statistics/AveragerPair.h>
     5#include <c++_tools/statistics/AveragerWeighted.h>
    46
    57
    68int main()
    79
     10  using namespace theplu;
     11  std::ostream* error;
     12  if (argc>1 && argv[1]==std::string("-v"))
     13    error = &std::cerr;
     14  else {
     15    error = new std::ofstream("/dev/null");
     16    if (argc>1)
     17      std::cout << "averager_test -v : for printing extra information\n";
     18  }
     19  *error << "testing averagers" << std::endl;
     20  bool ok = true;
     21
     22  theplu::statistics::Averager a;
     23  theplu::statistics::AveragerWeighted aw;
    824  theplu::statistics::AveragerPair ap;
    925  for (int i=0; i<10; i++)
    1026    ap.add(i,i);
    11   //cout << ap.correlation() << endl;
    12   //cout << "ok\n";
    13   return 0;
    1427
    1528
     29  if (error!=&std::cerr)
     30    delete error;
     31
     32  if (!ok)
     33    return -1;
     34  return 0;
    1635}
    1736
  • trunk/test/matrix_test.cc

    r393 r399  
    1010  using namespace theplu;
    1111  std::ostream* error;
    12   if (argc>1 && argv[1]==std::string("-p"))
     12  if (argc>1 && argv[1]==std::string("-v"))
    1313    error = &std::cerr;
    14   else
     14  else {
    1515    error = new std::ofstream("/dev/null");
    16 
     16    if (argc>1)
     17      std::cout << "matrix_test -v : for printing extra information\n";
     18  }
    1719  *error << "testing matrix" << std::endl;
    18 
    1920  bool ok = true;
    2021
    2122  gslapi::matrix m(3,3,9);
    22 
    2323  gslapi::matrix m2(m);
    2424  if (m2!=m)
  • trunk/test/regression_test.cc

    r392 r399  
    2323int main(const int argc,const char* argv[])
    2424{
     25  using namespace theplu;
    2526  std::ostream* error;
    26   if (argc>1 && argv[1]==std::string("-p"))
     27  if (argc>1 && argv[1]==std::string("-v"))
    2728    error = &std::cerr;
    28   else
     29  else {
    2930    error = new std::ofstream("/dev/null");
    30 
    31   *error << "regression: testing linear, local, naive, and polynomial fits"
    32          << std::endl;
    33 
    34   bool ok=true;
     31    if (argc>1)
     32      std::cout << "regression_test -v : for printing extra information\n";
     33  }
     34  *error << "testing regression" << std::endl;
     35  bool ok = true;
    3536
    3637  // test data for Linear and Naive
  • trunk/test/rnd_test.cc

    r379 r399  
    99int main(const int argc,const char* argv[])
    1010{
     11  using namespace theplu;
    1112  std::ostream* error;
    12   if (argc>1 && argv[1]==std::string("-p"))
     13  if (argc>1 && argv[1]==std::string("-v"))
    1314    error = &std::cerr;
    14   else
     15  else {
    1516    error = new std::ofstream("/dev/null");
    16  
     17    if (argc>1)
     18      std::cout << "rnd_test -v : for printing extra information\n";
     19  }
     20  *error << "testing rnd" << std::endl;
    1721  bool ok = true;
    1822
Note: See TracChangeset for help on using the changeset viewer.