1 //===-- Unittests for sigfillset ------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #include "src/signal/raise.h"
10 #include "src/signal/sigfillset.h"
11 #include "src/signal/sigprocmask.h"
13 #include "test/UnitTest/ErrnoSetterMatcher.h"
14 #include "test/UnitTest/Test.h"
18 TEST(LlvmLibcSigfillset
, Invalid
) {
19 using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Fails
;
20 EXPECT_THAT(LIBC_NAMESPACE::sigfillset(nullptr), Fails(EINVAL
));
23 TEST(LlvmLibcSigfillset
, BlocksAll
) {
24 using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Succeeds
;
26 EXPECT_THAT(LIBC_NAMESPACE::sigfillset(&set
), Succeeds());
27 EXPECT_THAT(LIBC_NAMESPACE::sigprocmask(SIG_SETMASK
, &set
, nullptr),
29 EXPECT_EXITS([] { LIBC_NAMESPACE::raise(SIGUSR1
); }, 0);