brintos

brintos / llvm-project-archived public Read only

0
0
Text · 929 B · c15f26f Raw
26 lines · cpp
1//===-- Unittests for waitpid ---------------------------------------------===//2//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-exception6//7//===----------------------------------------------------------------------===//8 9#include "src/sys/wait/waitpid.h"10#include "test/UnitTest/ErrnoCheckingTest.h"11#include "test/UnitTest/ErrnoSetterMatcher.h"12#include "test/UnitTest/Test.h"13 14#include <sys/wait.h>15 16using namespace LIBC_NAMESPACE::testing::ErrnoSetterMatcher;17using LlvmLibcWaitPidTest = LIBC_NAMESPACE::testing::ErrnoCheckingTest;18 19// The test here is a simpl test for WNOHANG functionality. For a more20// involved test, look at fork_test.21 22TEST_F(LlvmLibcWaitPidTest, NoHangTest) {23  int status;24  ASSERT_THAT(LIBC_NAMESPACE::waitpid(-1, &status, WNOHANG), Fails(ECHILD));25}26