
9 changed files with 58 additions and 59 deletions
@ -0,0 +1,33 @@ |
|||||
|
// This file is under GNU General Public License 3.0
|
||||
|
// see LICENSE.txt
|
||||
|
|
||||
|
#ifndef PITYTEST_PITYTEST_HH |
||||
|
#define PITYTEST_PITYTEST_HH |
||||
|
|
||||
|
#include "PityUnit.hh" |
||||
|
#include "PityModel.hh" |
||||
|
#include "PitySwarm.hh" |
||||
|
#include "PityPerspective.hh" |
||||
|
|
||||
|
#ifndef PITYASSERT |
||||
|
#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) |
||||
|
#endif |
||||
|
|
||||
|
#endif |
Loading…
Reference in new issue