[libc-commits] [libc] [libc] fix unit tests (PR #75361)

Nick Desaulniers via libc-commits libc-commits at lists.llvm.org
Wed Dec 13 09:22:34 PST 2023


https://github.com/nickdesaulniers updated https://github.com/llvm/llvm-project/pull/75361

>From bd9b1a1bad3c2e4d1e6a47e7108371a1ecf616dd Mon Sep 17 00:00:00 2001
From: Nick Desaulniers <ndesaulniers at google.com>
Date: Wed, 13 Dec 2023 09:18:51 -0800
Subject: [PATCH 1/2] [libc] fix unit tests

Fixes #75261
---
 libc/test/src/fcntl/creat_test.cpp                      | 2 ++
 libc/test/src/sys/resource/getrlimit_setrlimit_test.cpp | 1 +
 2 files changed, 3 insertions(+)

diff --git a/libc/test/src/fcntl/creat_test.cpp b/libc/test/src/fcntl/creat_test.cpp
index ca926b30e62faf..ef30d8862c45f2 100644
--- a/libc/test/src/fcntl/creat_test.cpp
+++ b/libc/test/src/fcntl/creat_test.cpp
@@ -13,6 +13,8 @@
 #include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
+#include <sys/stat.h>
+
 TEST(LlvmLibcCreatTest, CreatAndOpen) {
   using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Succeeds;
   constexpr const char *TEST_FILE = "testdata/creat.test";
diff --git a/libc/test/src/sys/resource/getrlimit_setrlimit_test.cpp b/libc/test/src/sys/resource/getrlimit_setrlimit_test.cpp
index 7e6bb0aaca9251..0870deeeb5d801 100644
--- a/libc/test/src/sys/resource/getrlimit_setrlimit_test.cpp
+++ b/libc/test/src/sys/resource/getrlimit_setrlimit_test.cpp
@@ -17,6 +17,7 @@
 #include "test/UnitTest/Test.h"
 
 #include <sys/resource.h>
+#include <sys/stat.h>
 
 TEST(LlvmLibcResourceLimitsTest, SetNoFileLimit) {
   using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Fails;

>From 48ba5ccf7ad3248fa91d794bb43e1b830242c8f7 Mon Sep 17 00:00:00 2001
From: Nick Desaulniers <ndesaulniers at google.com>
Date: Wed, 13 Dec 2023 09:22:23 -0800
Subject: [PATCH 2/2] fix another test

---
 libc/test/src/unistd/symlink_test.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libc/test/src/unistd/symlink_test.cpp b/libc/test/src/unistd/symlink_test.cpp
index 84d963b7a207ce..b25cfa4f857699 100644
--- a/libc/test/src/unistd/symlink_test.cpp
+++ b/libc/test/src/unistd/symlink_test.cpp
@@ -14,6 +14,8 @@
 #include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
+#include <sys/stat.h>
+
 TEST(LlvmLibcSymlinkTest, CreateAndUnlink) {
   using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Succeeds;
   constexpr const char *TEST_FILE_BASE = "symlink.test";



More information about the libc-commits mailing list