1.1 --- a/src/work/klao/error_test.cc Thu Feb 03 16:08:56 2005 +0000
1.2 +++ b/src/work/klao/error_test.cc Thu Feb 03 19:24:42 2005 +0000
1.3 @@ -15,8 +15,8 @@
1.4 parse_line();
1.5 }
1.6 catch(lemon::DataFormatError &e) {
1.7 - e.set_file(fn);
1.8 - e.set_line(5);
1.9 + e.file(fn);
1.10 + e.line(5);
1.11 throw;
1.12 }
1.13 }
1.14 @@ -27,26 +27,47 @@
1.15 try {
1.16 parse_file("input.txt");
1.17 }
1.18 + catch(lemon::Exception &e) {
1.19 + cerr << "Exception '" << e.exceptionName()
1.20 + << "' caught: " << endl;
1.21 + cerr << e.what() << endl;
1.22 + }
1.23 catch(exception &e) {
1.24 cerr << "Exception caught: " << endl;
1.25 cerr << e.what() << endl;
1.26 }
1.27
1.28 try {
1.29 + throw lemon::LogicError();
1.30 + }
1.31 + catch(lemon::Exception &e) {
1.32 + cerr << "Exception '" << e.exceptionName()
1.33 + << "' caught: " << endl;
1.34 + cerr << e.what() << endl;
1.35 + }
1.36 +
1.37 + try {
1.38 fail_assert();
1.39 }
1.40 + catch(lemon::Exception &e) {
1.41 + cerr << "Exception '" << e.exceptionName()
1.42 + << "' caught: " << endl;
1.43 + cerr << e.what() << endl;
1.44 + }
1.45 catch(exception &e) {
1.46 cerr << "Exception caught: " << endl;
1.47 cerr << e.what() << endl;
1.48 }
1.49
1.50 + cerr << endl;
1.51 +
1.52 // assert(1==0);
1.53 LEMON_ASSERT(1==0, "Ellentmondas");
1.54 LEMON_FIXME("Nincs kesz");
1.55 }
1.56
1.57 #undef LEMON_ASSERT_HANDLER
1.58 -#define LEMON_ASSERT_HANDLER ::lemon::assert_fail_throw
1.59 +#define LEMON_ASSERT_EXCEPTION
1.60
1.61 #include <error.h>
1.62