diff --git a/libc/test/src/setjmp/setjmp_test.cpp b/libc/test/src/setjmp/setjmp_test.cpp index 27113cd6e0631..d13bb8d55d46a 100644 --- a/libc/test/src/setjmp/setjmp_test.cpp +++ b/libc/test/src/setjmp/setjmp_test.cpp @@ -10,6 +10,8 @@ #include "src/setjmp/setjmp_impl.h" #include "test/UnitTest/Test.h" +namespace { + constexpr int MAX_LOOP = 123; int longjmp_called = 0; @@ -45,3 +47,5 @@ TEST(LlvmLibcSetJmpTest, SetAndJumpBackValOne) { ASSERT_EQ(longjmp_called, 1); ASSERT_EQ(val, 1); } + +} // namespace diff --git a/libc/test/src/stdio/printf_core/writer_test.cpp b/libc/test/src/stdio/printf_core/writer_test.cpp index 8611caa2dfa58..d036341be7981 100644 --- a/libc/test/src/stdio/printf_core/writer_test.cpp +++ b/libc/test/src/stdio/printf_core/writer_test.cpp @@ -6,13 +6,14 @@ // //===----------------------------------------------------------------------===// -#include "src/__support/CPP/string_view.h" #include "src/stdio/printf_core/writer.h" +#include "src/__support/CPP/string_view.h" #include "src/string/memory_utils/inline_memcpy.h" - #include "test/UnitTest/Test.h" +namespace { + using LIBC_NAMESPACE::cpp::string_view; using LIBC_NAMESPACE::printf_core::WriteBuffer; using LIBC_NAMESPACE::printf_core::WriteMode; @@ -314,3 +315,5 @@ TEST(LlvmLibcPrintfWriterTest, NullStringWithZeroMaxLengthWithCallback) { ASSERT_EQ(writer.get_chars_written(), 12); ASSERT_STREQ("aaaDEF111456", str); } + +} // namespace diff --git a/libc/test/src/stdlib/quick_sort_test.cpp b/libc/test/src/stdlib/quick_sort_test.cpp index 2832c855370bc..6d132428743b6 100644 --- a/libc/test/src/stdlib/quick_sort_test.cpp +++ b/libc/test/src/stdlib/quick_sort_test.cpp @@ -9,6 +9,8 @@ #include "SortingTest.h" #include "src/stdlib/qsort_util.h" +namespace { + void quick_sort(void *array, size_t array_size, size_t elem_size, int (*compare)(const void *, const void *)) { constexpr bool USE_QUICKSORT = true; @@ -23,3 +25,5 @@ void quick_sort(void *array, size_t array_size, size_t elem_size, } LIST_SORTING_TESTS(Qsort, quick_sort); + +} // namespace diff --git a/libc/test/src/string/memchr_test.cpp b/libc/test/src/string/memchr_test.cpp index 4a7c88bfe6e1a..ede841118fe03 100644 --- a/libc/test/src/string/memchr_test.cpp +++ b/libc/test/src/string/memchr_test.cpp @@ -6,11 +6,15 @@ // //===----------------------------------------------------------------------===// -#include "hdr/signal_macros.h" #include "src/string/memchr.h" -#include "test/UnitTest/Test.h" + #include +#include "hdr/signal_macros.h" +#include "test/UnitTest/Test.h" + +namespace { + // A helper function that calls memchr and abstracts away the explicit cast for // readability purposes. const char *call_memchr(const void *src, int c, size_t size) { @@ -130,3 +134,5 @@ TEST(LlvmLibcMemChrTest, CrashOnNullPtr) { } #endif // defined(LIBC_ADD_NULL_CHECKS) + +} // namespace diff --git a/libc/test/src/string/memrchr_test.cpp b/libc/test/src/string/memrchr_test.cpp index 140395b3046f6..e92dd3ad9c919 100644 --- a/libc/test/src/string/memrchr_test.cpp +++ b/libc/test/src/string/memrchr_test.cpp @@ -6,11 +6,15 @@ // //===----------------------------------------------------------------------===// -#include "hdr/signal_macros.h" #include "src/string/memrchr.h" -#include "test/UnitTest/Test.h" + #include +#include "hdr/signal_macros.h" +#include "test/UnitTest/Test.h" + +namespace { + // A helper function that calls memrchr and abstracts away the explicit cast for // readability purposes. const char *call_memrchr(const void *src, int c, size_t size) { @@ -122,3 +126,5 @@ TEST(LlvmLibcMemRChrTest, CrashOnNullPtr) { } #endif // defined(LIBC_ADD_NULL_CHECKS) + +} // namespace