Changeset 1231 for trunk


Ignore:
Timestamp:
Mar 14, 2008, 1:33:26 PM (14 years ago)
Author:
Peter
Message:

refs #223 - alignment_test

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/alignment_test.cc

    r1210 r1231  
    2222  02111-1307, USA.
    2323*/
     24
     25#include "Suite.h"
    2426
    2527#include "yat/utility/Alignment.h"
     
    9092
    9193
    92 int main(const int argc,const char* argv[])
     94int main(int argc, char* argv[])
    9395{
    94   bool ok=true;
    95   std::ostream* error;
    96   if (argc>1 && argv[1]==std::string("-v"))
    97     error = &std::cerr;
    98   else {
    99     error = new std::ofstream("/dev/null");
    100     if (argc>1)
    101       std::cout << "alignment_test -v : for printing extra " 
    102                 << "information\n";
    103   }
     96  test::Suite suite(argc, argv);
    10497
    10598  std::ifstream s(std::string("data/isoform.peaks").c_str());
     
    122115  double score=utility::SmithWaterman(m, 100, 100);
    123116  if (score!=21)
    124     ok=false;
     117    suite.ok(false);
    125118
    126119  // testing ssearch
    127120  if (utility::ssearch("Hello", "Hll", 0.0, 1.0)!=2){
    128     *error << "aligning 'Hello' and 'Hll' gives score "
    129            << utility::ssearch("Hello", "Hll", 0.0, 1.0)
    130            << " expected " << 2 << std::endl;
    131     ok=false;
     121    suite.err() << "aligning 'Hello' and 'Hll' gives score "
     122                << utility::ssearch("Hello", "Hll", 0.0, 1.0)
     123                << " expected " << 2 << std::endl;
     124    suite.ok(false);
    132125  }
    133126  if (utility::ssearch("Hello", "Peter said you can't say 'allo", 1, 1)!=3)
    134     ok=false;
     127    suite.ok(false);
    135128
    136   if (ok)
    137     *error << "Test is ok." << std::endl;
    138   else
    139     *error << "Test fails." << std::endl;
    140    
    141   if (error!=&std::cerr)
    142     delete error;
    143 
    144   if (ok) {
    145     return 0;
    146   }
    147   return -1;
    148 
     129  return suite.return_value();
    149130}
Note: See TracChangeset for help on using the changeset viewer.