27 lines · cpp
1//===-- Unittests for poll ------------------------------------------------===//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 "hdr/limits_macros.h" // UINT_MAX10#include "src/poll/poll.h"11#include "test/UnitTest/ErrnoCheckingTest.h"12#include "test/UnitTest/Test.h"13 14using LlvmLibcPollTest = LIBC_NAMESPACE::testing::ErrnoCheckingTest;15 16TEST_F(LlvmLibcPollTest, SmokeTest) {17 int ret = LIBC_NAMESPACE::poll(nullptr, 0, 0);18 ASSERT_ERRNO_SUCCESS();19 ASSERT_EQ(0, ret);20}21 22TEST_F(LlvmLibcPollTest, SmokeFailureTest) {23 int ret = LIBC_NAMESPACE::poll(nullptr, UINT_MAX, 0);24 ASSERT_ERRNO_EQ(EINVAL);25 ASSERT_EQ(-1, ret);26}27