[libc-commits] [libc] [libc] lfind_test.cpp: put helpers in an anonymous namespace. (PR #137821)
via libc-commits
libc-commits at lists.llvm.org
Tue Apr 29 08:22:10 PDT 2025
https://github.com/enh-google updated https://github.com/llvm/llvm-project/pull/137821
>From 6a252b6f60435dd125dc8a8ecd1e7023e9e8aa0d Mon Sep 17 00:00:00 2001
From: enh-google <53129816+enh-google at users.noreply.github.com>
Date: Tue, 29 Apr 2025 10:41:21 -0400
Subject: [PATCH 1/2] 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<const int *>(a) != *reinterpret_cast<const int *>(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 at users.noreply.github.com>
Date: Tue, 29 Apr 2025 11:22:02 -0400
Subject: [PATCH 2/2] 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<const int *>(a) != *reinterpret_cast<const int *>(b);
}
-};
+}
TEST(LlvmLibcLfindTest, SearchHead) {
int list[3] = {1, 2, 3};
More information about the libc-commits
mailing list