blob: 0229520825f9c325e9428616368ddf805ccf97de [file] [edit]
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
///
/// \file
/// Unittests for unshare.
///
//===----------------------------------------------------------------------===//
#include "hdr/errno_macros.h"
#include "src/sched/unshare.h"
#include "test/UnitTest/ErrnoCheckingTest.h"
#include "test/UnitTest/ErrnoSetterMatcher.h"
#include "test/UnitTest/Test.h"
using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::any_of;
using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Fails;
using LlvmLibcUnshareTest = LIBC_NAMESPACE::testing::ErrnoCheckingTest;
TEST_F(LlvmLibcUnshareTest, InvalidFlags) {
ASSERT_THAT(LIBC_NAMESPACE::unshare(-1),
Fails(any_of(EINVAL, EPERM, ENOSYS)));
}