From c4c34c1bfe568b653399cb5349ce54b5ee1c519b Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Sat, 25 May 2019 15:47:58 -0700 Subject: Augmented UnitSuite, added more to Blob, and added tests. --- src/stable/unitsuite.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/stable/unitsuite.h') 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 ); { \ throw Bu::UnitSuite::Failed( #tst, __FILE__, __LINE__ ); \ } else (void)0 + +#define unitTestCatch( tst, exception ) try \ +{ \ + tst; \ + throw Bu::UnitSuite::Failed( #tst, __FILE__, __LINE__ ); \ +} catch( exception & ) { } \ +catch(...) { \ + throw Bu::UnitSuite::Failed( #tst, __FILE__, __LINE__ ); \ +} (void)0 + #define unitFailed( msg ) throw Bu::UnitSuite::Failed(msg, __FILE__, __LINE__) #endif -- cgit v1.2.3