From 6a252b6f60435dd125dc8a8ecd1e7023e9e8aa0d Mon Sep 17 00:00:00 2001 From: enh-google <53129816+enh-google@users.noreply.github.com> Date: Tue, 29 Apr 2025 10:41:21 -0400 Subject: [PATCH 1/3] lfind_test.cpp: put helpers in an anonymous namespace. This matches other tests and allows the tests to be built together (as Android is doing). --- libc/test/src/search/lfind_test.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libc/test/src/search/lfind_test.cpp b/libc/test/src/search/lfind_test.cpp index 00384f7eec14e..8c67bd4aefe1c 100644 --- a/libc/test/src/search/lfind_test.cpp +++ b/libc/test/src/search/lfind_test.cpp @@ -9,10 +9,14 @@ #include "src/search/lfind.h" #include "test/UnitTest/Test.h" +namespace { + int compar(const void *a, const void *b) { return *reinterpret_cast(a) != *reinterpret_cast(b); } +}; + TEST(LlvmLibcLfindTest, SearchHead) { int list[3] = {1, 2, 3}; size_t len = 3; From 979445f64d77ce4495ebf31cf0a7523b3e9b40a2 Mon Sep 17 00:00:00 2001 From: enh-google <53129816+enh-google@users.noreply.github.com> Date: Tue, 29 Apr 2025 11:22:02 -0400 Subject: [PATCH 2/3] Update lfind_test.cpp --- libc/test/src/search/lfind_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libc/test/src/search/lfind_test.cpp b/libc/test/src/search/lfind_test.cpp index 8c67bd4aefe1c..e6cb02d3ac007 100644 --- a/libc/test/src/search/lfind_test.cpp +++ b/libc/test/src/search/lfind_test.cpp @@ -15,7 +15,7 @@ int compar(const void *a, const void *b) { return *reinterpret_cast(a) != *reinterpret_cast(b); } -}; +} TEST(LlvmLibcLfindTest, SearchHead) { int list[3] = {1, 2, 3}; From a05528fe3065e46ace9c33fe0881adc85241bce7 Mon Sep 17 00:00:00 2001 From: enh-google Date: Tue, 29 Apr 2025 11:27:46 -0400 Subject: [PATCH 3/3] // namespace --- libc/test/src/search/lfind_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libc/test/src/search/lfind_test.cpp b/libc/test/src/search/lfind_test.cpp index e6cb02d3ac007..21f810a8a3acc 100644 --- a/libc/test/src/search/lfind_test.cpp +++ b/libc/test/src/search/lfind_test.cpp @@ -15,7 +15,7 @@ int compar(const void *a, const void *b) { return *reinterpret_cast(a) != *reinterpret_cast(b); } -} +} // namespace TEST(LlvmLibcLfindTest, SearchHead) { int list[3] = {1, 2, 3};