1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 04:17:35 +00:00

LibTest: Add EXPECT_CRASH_WITH_SIGNAL

This commit is contained in:
Michel Hermier 2021-12-17 18:12:47 +01:00 committed by Brian Gianforcaro
parent b1b94692e6
commit 4c6e826c05
6 changed files with 52 additions and 8 deletions

View file

@ -7,6 +7,7 @@
#include <LibTest/TestCase.h>
#include <assert.h>
#include <signal.h>
TEST_CASE(assert)
{
@ -14,4 +15,8 @@ TEST_CASE(assert)
assert(!"This should assert");
return Test::Crash::Failure::DidNotCrash;
});
EXPECT_CRASH_WITH_SIGNAL("This should assert with SIGABRT signal", SIGABRT, [] {
assert(!"This should assert");
return Test::Crash::Failure::DidNotCrash;
});
}