From c22c1900c0e4cb9d1e55b920854ad9e68b2422f4 Mon Sep 17 00:00:00 2001 From: Michel Hermier Date: Fri, 17 Dec 2021 18:16:06 +0100 Subject: [PATCH] Tests: Add test for `raise` --- Tests/LibC/CMakeLists.txt | 1 + Tests/LibC/TestRaise.cpp | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 Tests/LibC/TestRaise.cpp diff --git a/Tests/LibC/CMakeLists.txt b/Tests/LibC/CMakeLists.txt index ba28c56ba5..47980a90e2 100644 --- a/Tests/LibC/CMakeLists.txt +++ b/Tests/LibC/CMakeLists.txt @@ -11,6 +11,7 @@ set(TEST_SOURCES TestLibCTime.cpp TestMemmem.cpp TestQsort.cpp + TestRaise.cpp TestRealpath.cpp TestScanf.cpp TestSearch.cpp diff --git a/Tests/LibC/TestRaise.cpp b/Tests/LibC/TestRaise.cpp new file mode 100644 index 0000000000..7957ab4562 --- /dev/null +++ b/Tests/LibC/TestRaise.cpp @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2021, the SerenityOS developers. + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#include + +#include + +TEST_CASE(raise) +{ + EXPECT_CRASH("This should raise a SIGUSR1 signal", [] { + raise(SIGUSR1); + return Test::Crash::Failure::DidNotCrash; + }); +}