Browse Source

Test: PityTest - fix PITYASSERT_THROWS()

LIB-11
heck 11 months ago
parent
commit
cf71349c56
1 changed files with 13 additions and 14 deletions
  1. +13
    -14
      test/pitytest11/src/PityTest.hh

+ 13
- 14
test/pitytest11/src/PityTest.hh View File

@ -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