aboutsummaryrefslogtreecommitdiff
path: root/src/stable
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2019-05-25 15:47:58 -0700
committerMike Buland <eichlan@xagasoft.com>2019-05-25 15:47:58 -0700
commitc4c34c1bfe568b653399cb5349ce54b5ee1c519b (patch)
tree4650a248020f89c64fc3919618987ef4c8961cf6 /src/stable
parent00cef0e9a21e1ee07d622bb05c3a7e4e56425723 (diff)
downloadlibbu++-c4c34c1bfe568b653399cb5349ce54b5ee1c519b.tar.gz
libbu++-c4c34c1bfe568b653399cb5349ce54b5ee1c519b.tar.bz2
libbu++-c4c34c1bfe568b653399cb5349ce54b5ee1c519b.tar.xz
libbu++-c4c34c1bfe568b653399cb5349ce54b5ee1c519b.zip
Augmented UnitSuite, added more to Blob, and added tests.
Diffstat (limited to '')
-rw-r--r--src/stable/exceptionindexoutofbounds.cpp14
-rw-r--r--src/stable/exceptionindexoutofbounds.h18
-rw-r--r--src/stable/unitsuite.h10
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
10namespace 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
13namespace 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 & ) { } \
147catch(...) { \
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