Tests: Add test for raise

This commit is contained in:
Michel Hermier 2021-12-17 18:16:06 +01:00 committed by Brian Gianforcaro
parent 0ec35d6d81
commit c22c1900c0
2 changed files with 18 additions and 0 deletions

View file

@ -11,6 +11,7 @@ set(TEST_SOURCES
TestLibCTime.cpp
TestMemmem.cpp
TestQsort.cpp
TestRaise.cpp
TestRealpath.cpp
TestScanf.cpp
TestSearch.cpp

17
Tests/LibC/TestRaise.cpp Normal file
View file

@ -0,0 +1,17 @@
/*
* Copyright (c) 2021, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibTest/TestCase.h>
#include <signal.h>
TEST_CASE(raise)
{
EXPECT_CRASH("This should raise a SIGUSR1 signal", [] {
raise(SIGUSR1);
return Test::Crash::Failure::DidNotCrash;
});
}