Changeset 925 for branches


Ignore:
Timestamp:
Dec 2, 2009, 2:24:41 AM (14 years ago)
Author:
Peter Johansson
Message:

refs #417 extending tests of Configuration and using Suite class in test

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/0.7-stable/test/config_test.cc

    r847 r925  
    2121*/
    2222
     23#include "Suite.h"
     24
    2325#include "Configuration.h"
    2426
    2527namespace theplu{
    2628namespace svndigest{
    27   bool test_codon(void);
     29  void test_codon(test::Suite&);
    2830}} // end of namespace svndigest and theplu
    2931
     
    3234{
    3335  using namespace theplu::svndigest;
    34   bool ok=true;
     36  test::Suite suite(argc, argv, false);
    3537
    36   ok &= test_codon();
     38  test_codon(suite);
    3739                                                                               
    38   if (ok)
     40  if (suite.ok()) {
     41    suite.out() << "Test is Ok!" << std::endl;
    3942    return 0;
    40   return 1;
     43  }
     44  suite.out() << "Test failed." << std::endl;
     45  return 1;
    4146}
    4247
     
    4550namespace svndigest{
    4651
    47   bool test_codon(void)
     52  void test_codon(test::Suite& suite)
    4853  {
    4954    const Configuration& c(Configuration::instance());
    50     bool ok =true;
    5155    if (!c.codon("foo.h")){
    52       std::cerr << "No codon for foo.h\n";
    53       ok = false;
     56      suite.out() << "No codon for foo.h\n";
     57      suite.add(false);
    5458    }
    5559    if (!c.codon("../dir/test.cc")){
    56       std::cerr << "No codon for test.cc\n";
    57       ok = false;
     60      suite.out() << "No codon for test.cc\n";
     61      suite.add(false);
    5862    }
    59 
    60     return ok;
     63    if (!c.codon("bootstrap")){
     64      suite.out() << "No codon for bootstrap\n";
     65      suite.add(false);
     66    }
    6167  }
    6268 
Note: See TracChangeset for help on using the changeset viewer.