[libc-commits] [PATCH] D136865: [libc] Improve testing of mem functions

Guillaume Chatelet via Phabricator via libc-commits libc-commits at lists.llvm.org
Thu Oct 27 10:08:00 PDT 2022


gchatelet created this revision.
Herald added subscribers: libc-commits, ecnelises, tschuett.
Herald added projects: libc-project, All.
gchatelet requested review of this revision.

This patch extracts the testing logic from `op_tests.cpp` into
`memory_check_utils.h` so we can reuse it for mem* function integration
tests.

This makes testing consistent and thorough.
For instance this catches a bug that got unnoticed during submission of
D136595 <https://reviews.llvm.org/D136595> and D135134 <https://reviews.llvm.org/D135134>. Integration test for memcmp was only testing a
single size.

This also leverages ASAN to make sure that data is not read / written
outside permitted boundaries


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D136865

Files:
  libc/test/src/string/bcmp_test.cpp
  libc/test/src/string/bzero_test.cpp
  libc/test/src/string/memcmp_test.cpp
  libc/test/src/string/memcpy_test.cpp
  libc/test/src/string/memory_utils/memory_check_utils.h
  libc/test/src/string/memory_utils/op_tests.cpp
  libc/test/src/string/memset_test.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D136865.471208.patch
Type: text/x-patch
Size: 30242 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20221027/c389e426/attachment-0001.bin>


More information about the libc-commits mailing list