diff options
author | Mike Buland <eichlan@xagasoft.com> | 2006-10-11 15:54:09 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2006-10-11 15:54:09 +0000 |
commit | a77e41eee42b99282c05d268479ba5ebb11dc095 (patch) | |
tree | d211c2e3978ba6ed6c91b8b430a85d59d50079f9 /src/tests/exception.cpp | |
parent | 745875139b5ee46e469927d410364bfeeedb2995 (diff) | |
download | libbu++-a77e41eee42b99282c05d268479ba5ebb11dc095.tar.gz libbu++-a77e41eee42b99282c05d268479ba5ebb11dc095.tar.bz2 libbu++-a77e41eee42b99282c05d268479ba5ebb11dc095.tar.xz libbu++-a77e41eee42b99282c05d268479ba5ebb11dc095.zip |
Rearranged the tests, now it's like the old style, which I like more for some
reason.
Diffstat (limited to 'src/tests/exception.cpp')
-rw-r--r-- | src/tests/exception.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/tests/exception.cpp b/src/tests/exception.cpp new file mode 100644 index 0000000..6417692 --- /dev/null +++ b/src/tests/exception.cpp | |||
@@ -0,0 +1,16 @@ | |||
1 | #include <iostream> | ||
2 | #include "exceptions.h" | ||
3 | |||
4 | int main() | ||
5 | { | ||
6 | try | ||
7 | { | ||
8 | throw ExceptionBase( 42, "There was an error on line: %d", __LINE__ ); | ||
9 | } | ||
10 | catch( ExceptionBase &e ) | ||
11 | { | ||
12 | std::cout << "Error "<< e.getErrorCode() << ": " << e.what() << "\n"; | ||
13 | } | ||
14 | |||
15 | throw ExceptionBase( 112, "This exception wasn't caught!"); | ||
16 | } | ||