mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 18:17:45 +00:00
LibTest: Add EXPECT_CRASH_WITH_SIGNAL
This commit is contained in:
parent
b1b94692e6
commit
4c6e826c05
6 changed files with 52 additions and 8 deletions
|
@ -7,6 +7,7 @@
|
|||
#include <LibTest/TestCase.h>
|
||||
|
||||
#include <assert.h> // FIXME: Remove when `_abort` is moved to <stdlib.h>
|
||||
#include <signal.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
TEST_CASE(_abort)
|
||||
|
@ -15,6 +16,10 @@ TEST_CASE(_abort)
|
|||
_abort();
|
||||
return Test::Crash::Failure::DidNotCrash;
|
||||
});
|
||||
EXPECT_CRASH_WITH_SIGNAL("This should _abort with SIGILL signal", SIGILL, [] {
|
||||
_abort();
|
||||
return Test::Crash::Failure::DidNotCrash;
|
||||
});
|
||||
}
|
||||
|
||||
TEST_CASE(abort)
|
||||
|
@ -23,4 +28,8 @@ TEST_CASE(abort)
|
|||
abort();
|
||||
return Test::Crash::Failure::DidNotCrash;
|
||||
});
|
||||
EXPECT_CRASH_WITH_SIGNAL("This should abort with SIGABRT signal", SIGABRT, [] {
|
||||
abort();
|
||||
return Test::Crash::Failure::DidNotCrash;
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue