nucleo_f446re_playground/components/etl/test/UnitTest++/ExceptionMacros.h
Attila Body 11c24647ea
git subrepo clone --branch=20.41.6 git@github.com:ETLCPP/etl.git components/etl
subrepo:
  subdir:   "components/etl"
  merged:   "be5537ec"
upstream:
  origin:   "git@github.com:ETLCPP/etl.git"
  branch:   "20.41.6"
  commit:   "be5537ec"
git-subrepo:
  version:  "0.4.9"
  origin:   "???"
  commit:   "???"
2025-06-11 11:25:49 +02: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