src/work/klao/error_test.cc
changeset 1365 c280de819a73
parent 1364 ee5959aa4410
child 1366 d00b85f8be45
     1.1 --- a/src/work/klao/error_test.cc	Sun Apr 17 18:57:22 2005 +0000
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,76 +0,0 @@
     1.4 -#include <iostream>
     1.5 -#include <string>
     1.6 -
     1.7 -#define LEMON_ASSERT_ABORT 0
     1.8 -#include <lemon/error.h>
     1.9 -
    1.10 -using namespace std;
    1.11 -
    1.12 -void parse_line() {
    1.13 -  throw lemon::DataFormatError("Syntax error");
    1.14 -}
    1.15 -
    1.16 -void parse_file(string fn) {
    1.17 -  try {
    1.18 -    parse_line();
    1.19 -  }
    1.20 -  catch(lemon::DataFormatError &e) {
    1.21 -    e.file(fn);
    1.22 -    e.line(5);
    1.23 -    throw;
    1.24 -  }
    1.25 -}
    1.26 -
    1.27 -void fail_assert();
    1.28 -
    1.29 -int main() {
    1.30 -  try {
    1.31 -    parse_file("input.txt");
    1.32 -  }
    1.33 -  catch(lemon::Exception &e) {
    1.34 -    cerr << "Exception '" << e.exceptionName()
    1.35 -	 << "' caught: " << endl;
    1.36 -    cerr << e.what() << endl;
    1.37 -  }
    1.38 -  catch(exception &e) {
    1.39 -    cerr << "Exception caught: " << endl;
    1.40 -    cerr << e.what() << endl;
    1.41 -  }
    1.42 -
    1.43 -  try {
    1.44 -    throw lemon::LogicError();
    1.45 -  }
    1.46 -  catch(lemon::Exception &e) {
    1.47 -    cerr << "Exception '" << e.exceptionName()
    1.48 -	 << "' caught: " << endl;
    1.49 -    cerr << e.what() << endl;
    1.50 -  }
    1.51 -
    1.52 -  try {
    1.53 -    fail_assert();
    1.54 -  }
    1.55 -  catch(lemon::Exception &e) {
    1.56 -    cerr << "Exception '" << e.exceptionName()
    1.57 -	 << "' caught: " << endl;
    1.58 -    cerr << e.what() << endl;
    1.59 -  }
    1.60 -  catch(exception &e) {
    1.61 -    cerr << "Exception caught: " << endl;
    1.62 -    cerr << e.what() << endl;
    1.63 -  }
    1.64 -
    1.65 -  cerr << endl;
    1.66 -
    1.67 -  // assert(1==0);
    1.68 -  LEMON_ASSERT(1==0, "Ellentmondas");
    1.69 -  LEMON_FIXME("Nincs kesz");
    1.70 -}
    1.71 -
    1.72 -#undef LEMON_ASSERT_HANDLER
    1.73 -#define LEMON_ASSERT_EXCEPTION
    1.74 -
    1.75 -#include <lemon/error.h>
    1.76 -
    1.77 -void fail_assert() {
    1.78 -  LEMON_ASSERT(2*2==5, "Marson vagyunk");
    1.79 -}