aboutsummaryrefslogtreecommitdiff
path: root/libc/test/src/sched/yield_test.cpp
blob: 1cd30abb88513a798c1761aebc2e4e324f09074b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
//===-- Unittests for sched_yield -----------------------------------------===//
//
// 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
//
//===----------------------------------------------------------------------===//

#include "src/sched/sched_yield.h"
#include "test/UnitTest/ErrnoCheckingTest.h"
#include "test/UnitTest/Test.h"

using LlvmLibcSchedYieldTest = LIBC_NAMESPACE::testing::ErrnoCheckingTest;

TEST_F(LlvmLibcSchedYieldTest, SmokeTest) {
  // sched_yield() always succeeds, just do a basic test that errno/ret are
  // properly 0.
  ASSERT_EQ(LIBC_NAMESPACE::sched_yield(), 0);
  ASSERT_ERRNO_SUCCESS();
}