Browse Source

Test: PityTest - fix PITYASSERT_THROWS()

LIB-11
heck 4 years ago
parent
commit
cf71349c56
  1. 27
      test/pitytest11/src/PityTest.hh

27
test/pitytest11/src/PityTest.hh

@ -10,24 +10,23 @@
#include "PityPerspective.hh"
#ifndef PITYASSERT
#define PITYASSERT(condition, msg) \
#define PITYASSERT(condition, msg) \
do { \
if (!(condition)) { \
throw PityAssertException(msg); \
} \
} while (0)
#endif
#ifndef PITYASSERT_THROWS
#define PITYASSERT_THROWS(func, msg) \
do { \
try { \
(func); \
PITYASSERT(false, msg); \
} catch (const std::exception& e) { \
} catch (...) { \
} \
} while (0)
} while (0);
#endif
#define PITYASSERT_THROWS(func, msg) \
do { \
try { \
(func); \
PITYASSERT(false, msg); \
} catch (const PityAssertException& pae) { \
throw(pae); \
} catch (const std::exception& e) { \
} catch (...) { \
} \
} while (0);
#endif
Loading…
Cancel
Save