unittest-cpp/UnitTest++/ExceptionMacros.h
Patrick Johnmeyer c96bf52613 Replace UT_ macro prefix with UNITTEST_IMPL_
The UT_ prefix was primarily for "internal" macros. This commit seeks
to more consistently "namespace" UnitTest++ macros with the UNITTEST_
prefix, while also marking these particular macros as "private"
implementation details with the IMPL_ wart.
2016-05-06 23:57:59 -05:00

20 lines
724 B
C

#ifndef UNITTEST_EXCEPTIONMACROS_H
#define UNITTEST_EXCEPTIONMACROS_H
#include "Config.h"
#ifndef UNITTEST_NO_EXCEPTIONS
#define UNITTEST_IMPL_TRY(x) try x
#define UNITTEST_IMPL_THROW(x) throw x
#define UNITTEST_IMPL_RETHROW(ExceptionType) catch(ExceptionType&) { throw; }
#define UNITTEST_IMPL_CATCH(ExceptionType, ExceptionName, CatchBody) catch(ExceptionType& ExceptionName) CatchBody
#define UNITTEST_IMPL_CATCH_ALL(CatchBody) catch(...) CatchBody
#else
#define UNITTEST_IMPL_TRY(x) x
#define UNITTEST_IMPL_THROW(x)
#define UNITTEST_IMPL_RETHROW(ExceptionType)
#define UNITTEST_IMPL_CATCH(ExceptionType, ExceptionName, CatchBody)
#define UNITTEST_IMPL_CATCH_ALL(CatchBody)
#endif
#endif