COIN-OR::LEMON - Graph Library

Changeset 727:aada518af30f in lemon-0.x for src/test/error_test.cc


Ignore:
Timestamp:
07/22/04 16:21:46 (20 years ago)
Author:
Alpar Juttner
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@982
Message:
  • Better Makefile.am. (I hope.)
  • Some more tests
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/test/error_test.cc

    r542 r727  
    22
    33#include <hugo/error.h>
    4 
     4#include "test_tools.h"
    55using namespace hugo;
    66using std::cout;
     
    2222
    2323int main() {
    24   bool no_errors = false;
    25 
    2624  try {
    27     cout << "Trying a faulty function\n";
    2825    faulty_fn();
    29     no_errors = true;
    30     cout << "FAILED!\n";
     26    check(false, "A faulty function did not fail.");
    3127  }
    3228  catch(const Exception &e) {
    33     cout << "E: " << e.what() << endl;
     29    cout << "Exeption = \"" << e.what() << "\" (Right behaviour)" << endl;
    3430  }
    3531
    3632  try {
    37     cout << "Trying a function throwing Exception\n";
    3833    exception_fn();
    39     no_errors = true;
    40     cout << "FAILED!\n";
     34    check(false, "The function did not throw Exception.");
    4135  }
    4236  catch(const Exception &e) {
    43     cout << "E: " << e.what() << endl;
     37    cout << "Exeption = \"" << e.what() << "\" (Right behaviour)" << endl;
    4438  }
    4539
    4640  try {
    47     cout << "Trying a function using FIXME\n";
    4841    unfinished_fn();
    49     no_errors = true;
    50     cout << "FAILED!\n";
     42    check(false, "FIXME macro does not work.");
    5143  }
    5244  catch(const Exception &e) {
    53     cout << "E: " << e.what() << endl;
     45    cout << "Exeption = \"" << e.what() << "\" (Right behaviour)" << endl;
    5446  }
    5547
    56   return no_errors ? 1 : 0;
     48  return 0;
    5749}
Note: See TracChangeset for help on using the changeset viewer.