From b962c402b461e3249a1ee726ab3a33f019baecbf Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Wed, 12 Jul 2006 02:44:29 +0000 Subject: Added exception tests. --- src/test/exception/exception.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/test/exception/exception.cpp (limited to 'src/test/exception/exception.cpp') diff --git a/src/test/exception/exception.cpp b/src/test/exception/exception.cpp new file mode 100644 index 0000000..33dcd5e --- /dev/null +++ b/src/test/exception/exception.cpp @@ -0,0 +1,16 @@ +#include +#include "exception.h" + +int main() +{ + try + { + throw Exception( 42, "There was an error on line: %d", __LINE__ ); + } + catch( Exception &e ) + { + std::cout << "Error "<< e.getErrorCode() << ": " << e.what() << "\n"; + } + + throw Exception( 112, "This exception wasn't caught!"); +} -- cgit v1.2.3