klao@489: #include klao@489: ladanyi@542: #include alpar@727: #include "test_tools.h" klao@489: using namespace hugo; klao@489: using std::cout; klao@489: using std::endl; klao@489: klao@489: void faulty_fn() { klao@489: fault("This is a fault message"); klao@489: } klao@489: klao@489: void exception_fn() { klao@489: throw Exception("This is a fn throwing excpt with some args: ") klao@489: << 5 << ", " << 18; klao@489: } klao@489: klao@489: void unfinished_fn() { klao@489: FIXME("unfinished_fn() is unfinished!"); klao@489: } klao@489: klao@489: klao@489: int main() { klao@489: try { klao@489: faulty_fn(); alpar@727: check(false, "A faulty function did not fail."); klao@489: } klao@489: catch(const Exception &e) { alpar@727: cout << "Exeption = \"" << e.what() << "\" (Right behaviour)" << endl; klao@489: } klao@489: klao@489: try { klao@489: exception_fn(); alpar@727: check(false, "The function did not throw Exception."); klao@489: } klao@489: catch(const Exception &e) { alpar@727: cout << "Exeption = \"" << e.what() << "\" (Right behaviour)" << endl; klao@489: } klao@489: klao@489: try { klao@489: unfinished_fn(); alpar@727: check(false, "FIXME macro does not work."); klao@489: } klao@489: catch(const Exception &e) { alpar@727: cout << "Exeption = \"" << e.what() << "\" (Right behaviour)" << endl; klao@489: } klao@489: alpar@727: return 0; klao@489: }