diff options
Diffstat (limited to '')
-rw-r--r-- | src/stable/exceptionindexoutofbounds.cpp | 14 | ||||
-rw-r--r-- | src/stable/exceptionindexoutofbounds.h | 18 | ||||
-rw-r--r-- | src/stable/unitsuite.h | 10 |
3 files changed, 42 insertions, 0 deletions
diff --git a/src/stable/exceptionindexoutofbounds.cpp b/src/stable/exceptionindexoutofbounds.cpp new file mode 100644 index 0000000..eb6d589 --- /dev/null +++ b/src/stable/exceptionindexoutofbounds.cpp | |||
@@ -0,0 +1,14 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2007-2019 Xagasoft, All rights reserved. | ||
3 | * | ||
4 | * This file is part of the libbu++ library and is released under the | ||
5 | * terms of the license contained in the file LICENSE. | ||
6 | */ | ||
7 | |||
8 | #include "exceptionindexoutofbounds.h" | ||
9 | |||
10 | namespace Bu | ||
11 | { | ||
12 | subExceptionDef( ExceptionIndexOutOfBounds ); | ||
13 | } | ||
14 | |||
diff --git a/src/stable/exceptionindexoutofbounds.h b/src/stable/exceptionindexoutofbounds.h new file mode 100644 index 0000000..fbb2a04 --- /dev/null +++ b/src/stable/exceptionindexoutofbounds.h | |||
@@ -0,0 +1,18 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2007-2019 Xagasoft, All rights reserved. | ||
3 | * | ||
4 | * This file is part of the libbu++ library and is released under the | ||
5 | * terms of the license contained in the file LICENSE. | ||
6 | */ | ||
7 | |||
8 | #ifndef BU_EXCEPTION_INDEX_OUT_OF_BOUNDS_H | ||
9 | #define BU_EXCEPTION_INDEX_OUT_OF_BOUNDS_H | ||
10 | |||
11 | #include "bu/exceptionbase.h" | ||
12 | |||
13 | namespace Bu | ||
14 | { | ||
15 | subExceptionDecl( ExceptionIndexOutOfBounds ); | ||
16 | } | ||
17 | |||
18 | #endif | ||
diff --git a/src/stable/unitsuite.h b/src/stable/unitsuite.h index 85060c0..5f84058 100644 --- a/src/stable/unitsuite.h +++ b/src/stable/unitsuite.h | |||
@@ -138,6 +138,16 @@ Bu::Formatter &operator<<( Bu::Formatter &f, const Bu::UnitSuite::Expect &e ); | |||
138 | { \ | 138 | { \ |
139 | throw Bu::UnitSuite::Failed( #tst, __FILE__, __LINE__ ); \ | 139 | throw Bu::UnitSuite::Failed( #tst, __FILE__, __LINE__ ); \ |
140 | } else (void)0 | 140 | } else (void)0 |
141 | |||
142 | #define unitTestCatch( tst, exception ) try \ | ||
143 | { \ | ||
144 | tst; \ | ||
145 | throw Bu::UnitSuite::Failed( #tst, __FILE__, __LINE__ ); \ | ||
146 | } catch( exception & ) { } \ | ||
147 | catch(...) { \ | ||
148 | throw Bu::UnitSuite::Failed( #tst, __FILE__, __LINE__ ); \ | ||
149 | } (void)0 | ||
150 | |||
141 | #define unitFailed( msg ) throw Bu::UnitSuite::Failed(msg, __FILE__, __LINE__) | 151 | #define unitFailed( msg ) throw Bu::UnitSuite::Failed(msg, __FILE__, __LINE__) |
142 | 152 | ||
143 | #endif | 153 | #endif |