Changeset 727:aada518af30f in lemon-0.x for src/test/error_test.cc
- Timestamp:
- 07/22/04 16:21:46 (19 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@982
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/test/error_test.cc
r542 r727 2 2 3 3 #include <hugo/error.h> 4 4 #include "test_tools.h" 5 5 using namespace hugo; 6 6 using std::cout; … … 22 22 23 23 int main() { 24 bool no_errors = false;25 26 24 try { 27 cout << "Trying a faulty function\n";28 25 faulty_fn(); 29 no_errors = true; 30 cout << "FAILED!\n"; 26 check(false, "A faulty function did not fail."); 31 27 } 32 28 catch(const Exception &e) { 33 cout << "E : " << e.what()<< endl;29 cout << "Exeption = \"" << e.what() << "\" (Right behaviour)" << endl; 34 30 } 35 31 36 32 try { 37 cout << "Trying a function throwing Exception\n";38 33 exception_fn(); 39 no_errors = true; 40 cout << "FAILED!\n"; 34 check(false, "The function did not throw Exception."); 41 35 } 42 36 catch(const Exception &e) { 43 cout << "E : " << e.what()<< endl;37 cout << "Exeption = \"" << e.what() << "\" (Right behaviour)" << endl; 44 38 } 45 39 46 40 try { 47 cout << "Trying a function using FIXME\n";48 41 unfinished_fn(); 49 no_errors = true; 50 cout << "FAILED!\n"; 42 check(false, "FIXME macro does not work."); 51 43 } 52 44 catch(const Exception &e) { 53 cout << "E : " << e.what()<< endl;45 cout << "Exeption = \"" << e.what() << "\" (Right behaviour)" << endl; 54 46 } 55 47 56 return no_errors ? 1 :0;48 return 0; 57 49 }
Note: See TracChangeset
for help on using the changeset viewer.