|
|
|
@ -3,9 +3,6 @@
|
|
|
|
|
#include <exception>
|
|
|
|
|
|
|
|
|
|
using namespace pEp::PityTest11;
|
|
|
|
|
|
|
|
|
|
using TestUnit = PityUnit<>;
|
|
|
|
|
|
|
|
|
|
void not_throwing() {}
|
|
|
|
|
|
|
|
|
|
void throwing()
|
|
|
|
@ -15,18 +12,18 @@ void throwing()
|
|
|
|
|
|
|
|
|
|
int main(int argc, char* argv[])
|
|
|
|
|
{
|
|
|
|
|
TestUnit asserts {"test_asserts"};
|
|
|
|
|
asserts.add("nfdsg", []() {
|
|
|
|
|
PITYASSERT(true, "thats wrong");
|
|
|
|
|
try {
|
|
|
|
|
PITYASSERT(false, "thats correct");
|
|
|
|
|
throw std::runtime_error("PITYASSERT(false) does not throw");
|
|
|
|
|
} catch (const PityAssertException& pae) {
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
PITYASSERT(true, "thats wrong");
|
|
|
|
|
try {
|
|
|
|
|
PITYASSERT(false, "thats correct");
|
|
|
|
|
throw std::runtime_error("PITYASSERT(false) does not throw");
|
|
|
|
|
} catch (const PityAssertException& pae) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PITYASSERT(true, "thats wrong");
|
|
|
|
|
|
|
|
|
|
PITYASSERT_THROWS(throwing(), "is actually throwing ");
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
PITYASSERT_THROWS(not_throwing(), "is actually not throwing");
|
|
|
|
|
throw std::runtime_error("PITYASSERT(false) does not throw");
|
|
|
|
|