From f4c20290509d7ed3a8fd5304577e7a4cc0b9d974 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Tue, 3 Apr 2007 03:49:53 +0000 Subject: Ok, no code is left in src, it's all in src/old. We'll gradually move code back into src as it's fixed and re-org'd. This includes tests, which, I may write a unit test system into libbu++ just to make my life easier. --- src/old/tests/exception.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/old/tests/exception.cpp (limited to 'src/old/tests/exception.cpp') diff --git a/src/old/tests/exception.cpp b/src/old/tests/exception.cpp new file mode 100644 index 0000000..6417692 --- /dev/null +++ b/src/old/tests/exception.cpp @@ -0,0 +1,16 @@ +#include +#include "exceptions.h" + +int main() +{ + try + { + throw ExceptionBase( 42, "There was an error on line: %d", __LINE__ ); + } + catch( ExceptionBase &e ) + { + std::cout << "Error "<< e.getErrorCode() << ": " << e.what() << "\n"; + } + + throw ExceptionBase( 112, "This exception wasn't caught!"); +} -- cgit v1.2.3