Browse Source

Test: PityTest - fix PITYASSERT_THROWS()

master
heck 4 years ago
parent
commit
e5d0d10430
  1. 9
      src/PityTest.hh

9
src/PityTest.hh

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