Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions libc/test/src/setjmp/setjmp_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -45,3 +47,5 @@ TEST(LlvmLibcSetJmpTest, SetAndJumpBackValOne) {
ASSERT_EQ(longjmp_called, 1);
ASSERT_EQ(val, 1);
}

} // namespace
7 changes: 5 additions & 2 deletions libc/test/src/stdio/printf_core/writer_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -314,3 +315,5 @@ TEST(LlvmLibcPrintfWriterTest, NullStringWithZeroMaxLengthWithCallback) {
ASSERT_EQ(writer.get_chars_written(), 12);
ASSERT_STREQ("aaaDEF111456", str);
}

} // namespace
4 changes: 4 additions & 0 deletions libc/test/src/stdlib/quick_sort_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -23,3 +25,5 @@ void quick_sort(void *array, size_t array_size, size_t elem_size,
}

LIST_SORTING_TESTS(Qsort, quick_sort);

} // namespace
10 changes: 8 additions & 2 deletions libc/test/src/string/memchr_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@
//
//===----------------------------------------------------------------------===//

#include "hdr/signal_macros.h"
#include "src/string/memchr.h"
#include "test/UnitTest/Test.h"

#include <stddef.h>

#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) {
Expand Down Expand Up @@ -130,3 +134,5 @@ TEST(LlvmLibcMemChrTest, CrashOnNullPtr) {
}

#endif // defined(LIBC_ADD_NULL_CHECKS)

} // namespace
10 changes: 8 additions & 2 deletions libc/test/src/string/memrchr_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@
//
//===----------------------------------------------------------------------===//

#include "hdr/signal_macros.h"
#include "src/string/memrchr.h"
#include "test/UnitTest/Test.h"

#include <stddef.h>

#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) {
Expand Down Expand Up @@ -122,3 +126,5 @@ TEST(LlvmLibcMemRChrTest, CrashOnNullPtr) {
}

#endif // defined(LIBC_ADD_NULL_CHECKS)

} // namespace
Loading