aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2006-07-12 02:44:29 +0000
committerMike Buland <eichlan@xagasoft.com>2006-07-12 02:44:29 +0000
commitb962c402b461e3249a1ee726ab3a33f019baecbf (patch)
tree8adaa27f9f8c6c9fb4be58c0a2004d9397ad9fc6 /src
parent6c36406a5dba3d390e2c98bd48c01bb1db86a985 (diff)
downloadlibbu++-b962c402b461e3249a1ee726ab3a33f019baecbf.tar.gz
libbu++-b962c402b461e3249a1ee726ab3a33f019baecbf.tar.bz2
libbu++-b962c402b461e3249a1ee726ab3a33f019baecbf.tar.xz
libbu++-b962c402b461e3249a1ee726ab3a33f019baecbf.zip
Added exception tests.
Diffstat (limited to 'src')
-rw-r--r--src/test/exception/exception.cpp16
1 files changed, 16 insertions, 0 deletions
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 @@
1#include <iostream>
2#include "exception.h"
3
4int main()
5{
6 try
7 {
8 throw Exception( 42, "There was an error on line: %d", __LINE__ );
9 }
10 catch( Exception &e )
11 {
12 std::cout << "Error "<< e.getErrorCode() << ": " << e.what() << "\n";
13 }
14
15 throw Exception( 112, "This exception wasn't caught!");
16}