diff --git a/libc/test/src/string/bzero_test.cpp b/libc/test/src/string/bzero_test.cpp --- a/libc/test/src/string/bzero_test.cpp +++ b/libc/test/src/string/bzero_test.cpp @@ -15,7 +15,6 @@ // Adapt CheckMemset signature to op implementation signatures. template void BzeroAdaptor(cpp::span p1, uint8_t value, size_t size) { - assert(value == 0); FnImpl(p1.begin(), size); } diff --git a/libc/test/src/string/memory_utils/memory_check_utils.h b/libc/test/src/string/memory_utils/memory_check_utils.h --- a/libc/test/src/string/memory_utils/memory_check_utils.h +++ b/libc/test/src/string/memory_utils/memory_check_utils.h @@ -12,7 +12,6 @@ #include "src/__support/CPP/span.h" #include "src/__support/macros/sanitizer.h" #include "src/string/memory_utils/utils.h" -#include // assert #include // size_t #include // uintxx_t #include // malloc/free @@ -24,7 +23,6 @@ // This is a utility class to be used by Buffer below, do not use directly. struct PoisonedBuffer { PoisonedBuffer(size_t size) : ptr((char *)malloc(size)) { - assert(ptr); ASAN_POISON_MEMORY_REGION(ptr, size); } ~PoisonedBuffer() { free(ptr); } @@ -45,11 +43,8 @@ : PoisonedBuffer(size + kLeeway), size(size) { offset_ptr = ptr; offset_ptr += distance_to_next_aligned(ptr); - assert((uintptr_t)(offset_ptr) % kAlign == 0); if (aligned == Aligned::NO) ++offset_ptr; - assert(offset_ptr > ptr); - assert((offset_ptr + size) < (ptr + size + kLeeway)); ASAN_UNPOISON_MEMORY_REGION(offset_ptr, size); } cpp::span span() { return cpp::span(offset_ptr, size); } @@ -77,7 +72,6 @@ // Copy one span to another. static inline void ReferenceCopy(cpp::span dst, const cpp::span src) { - assert(dst.size() == src.size()); for (size_t i = 0; i < dst.size(); ++i) dst[i] = src[i]; } @@ -85,8 +79,6 @@ // Checks that FnImpl implements the memcpy semantic. template bool CheckMemcpy(cpp::span dst, cpp::span src, size_t size) { - assert(dst.size() == src.size()); - assert(dst.size() == size); Randomize(dst); FnImpl(dst, src, size); for (size_t i = 0; i < size; ++i) @@ -109,7 +101,6 @@ // Checks that FnImpl implements the bcmp semantic. template bool CheckBcmp(cpp::span span1, cpp::span span2, size_t size) { - assert(span1.size() == span2.size()); ReferenceCopy(span2, span1); // Compare equal if (int cmp = FnImpl(span1, span2, size); cmp != 0) @@ -129,7 +120,6 @@ // Checks that FnImpl implements the memcmp semantic. template bool CheckMemcmp(cpp::span span1, cpp::span span2, size_t size) { - assert(span1.size() == span2.size()); ReferenceCopy(span2, span1); // Compare equal if (int cmp = FnImpl(span1, span2, size); cmp != 0) diff --git a/libc/test/src/string/memory_utils/op_tests.cpp b/libc/test/src/string/memory_utils/op_tests.cpp --- a/libc/test/src/string/memory_utils/op_tests.cpp +++ b/libc/test/src/string/memory_utils/op_tests.cpp @@ -13,8 +13,6 @@ #include "src/string/memory_utils/op_x86.h" #include "test/UnitTest/Test.h" -#include - #if defined(LIBC_TARGET_ARCH_IS_X86_64) || defined(LIBC_TARGET_ARCH_IS_AARCH64) #define LLVM_LIBC_HAS_UINT64 #endif @@ -75,7 +73,6 @@ } template void CopyBlockAdaptor(cpp::span dst, cpp::span src, size_t size) { - assert(size == Size); FnImpl(as_byte(dst), as_byte(src)); } @@ -157,7 +154,6 @@ } template void SetBlockAdaptor(cpp::span dst, uint8_t value, size_t size) { - assert(size == Size); FnImpl(as_byte(dst), value); } @@ -235,7 +231,6 @@ } template int CmpBlockAdaptor(cpp::span p1, cpp::span p2, size_t size) { - assert(size == Size); return (int)FnImpl(as_byte(p1), as_byte(p2)); }