4 changes: 2 additions & 2 deletions libc/test/src/sched/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ add_libc_unittest(
SRCS
affinity_test.cpp
DEPENDS
libc.include.errno
libc.include.sched
libc.include.sys_syscall
libc.src.__support.OSUtil.osutil
libc.src.errno.errno
libc.src.sched.sched_getaffinity
libc.src.sched.sched_setaffinity
libc.test.errno_setter_matcher
Expand All @@ -23,10 +23,10 @@ add_libc_unittest(
SRCS
cpu_count_test.cpp
DEPENDS
libc.include.errno
libc.include.sched
libc.include.sys_syscall
libc.src.__support.OSUtil.osutil
libc.src.errno.errno
libc.src.sched.sched_getaffinity
libc.src.sched.__sched_getcpucount
libc.test.errno_setter_matcher
Expand Down
10 changes: 5 additions & 5 deletions libc/test/src/sched/affinity_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
//===----------------------------------------------------------------------===//

#include "src/__support/OSUtil/syscall.h"
#include "src/errno/libc_errno.h"
#include "src/sched/sched_getaffinity.h"
#include "src/sched/sched_setaffinity.h"
#include "test/ErrnoSetterMatcher.h"

#include <errno.h>
#include <sched.h>
#include <sys/syscall.h>

TEST(LlvmLibcSchedAffinityTest, SmokeTest) {
cpu_set_t mask;
errno = 0;
libc_errno = 0;
using __llvm_libc::testing::ErrnoSetterMatcher::Succeeds;
pid_t tid = __llvm_libc::syscall_impl(SYS_gettid);
ASSERT_GT(tid, pid_t(0));
Expand All @@ -32,13 +32,13 @@ TEST(LlvmLibcSchedAffinityTest, BadMask) {
using __llvm_libc::testing::ErrnoSetterMatcher::Fails;
pid_t tid = __llvm_libc::syscall_impl(SYS_gettid);

errno = 0;
libc_errno = 0;
ASSERT_THAT(__llvm_libc::sched_getaffinity(tid, sizeof(cpu_set_t), nullptr),
Fails(EFAULT));

errno = 0;
libc_errno = 0;
ASSERT_THAT(__llvm_libc::sched_setaffinity(tid, sizeof(cpu_set_t), nullptr),
Fails(EFAULT));

errno = 0;
libc_errno = 0;
}
4 changes: 2 additions & 2 deletions libc/test/src/sched/cpu_count_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
//===----------------------------------------------------------------------===//

#include "src/__support/OSUtil/syscall.h"
#include "src/errno/libc_errno.h"
#include "src/sched/sched_getaffinity.h"
#include "src/sched/sched_getcpucount.h"
#include "test/ErrnoSetterMatcher.h"

#include <errno.h>
#include <sched.h>
#include <sys/syscall.h>

TEST(LlvmLibcSchedAffinityTest, SmokeTest) {
cpu_set_t mask;
errno = 0;
libc_errno = 0;
using __llvm_libc::testing::ErrnoSetterMatcher::Succeeds;
pid_t tid = __llvm_libc::syscall_impl(SYS_gettid);
ASSERT_GT(tid, pid_t(0));
Expand Down