[libc-commits] [PATCH] D137586: [libc][obvious] fix tests using wrong size for string

Michael Jones via Phabricator via libc-commits libc-commits at lists.llvm.org
Mon Nov 7 14:04:51 PST 2022


This revision was not accepted when it landed; it landed in state "Needs Review".
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG430ca14af835: [libc][obvious] fix tests using wrong size for string (authored by michaelrj).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D137586/new/

https://reviews.llvm.org/D137586

Files:
  libc/test/src/stdio/scanf_core/string_reader_test.cpp


Index: libc/test/src/stdio/scanf_core/string_reader_test.cpp
===================================================================
--- libc/test/src/stdio/scanf_core/string_reader_test.cpp
+++ libc/test/src/stdio/scanf_core/string_reader_test.cpp
@@ -23,7 +23,7 @@
   __llvm_libc::scanf_core::StringReader str_reader(str);
   __llvm_libc::scanf_core::Reader reader(&str_reader);
 
-  for (size_t i = 0; i < sizeof(str); ++i) {
+  for (size_t i = 0; i < sizeof("abc"); ++i) {
     ASSERT_EQ(str[i], reader.getc());
   }
 }
@@ -60,7 +60,7 @@
   }
 
   // Check the whole string.
-  for (size_t i = 0; i < sizeof(str); ++i) {
+  for (size_t i = 0; i < sizeof("abcDEF123"); ++i) {
     ASSERT_EQ(str[i], reader.getc());
   }
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D137586.473786.patch
Type: text/x-patch
Size: 722 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20221107/006fa5e8/attachment.bin>


More information about the libc-commits mailing list