[libc-commits] [PATCH] D108659: [libc] Fix too long number in strtoul_test

Michael Jones via Phabricator via libc-commits libc-commits at lists.llvm.org
Tue Aug 24 13:07:59 PDT 2021


michaelrj created this revision.
michaelrj added a reviewer: sivachandra.
Herald added subscribers: libc-commits, ecnelises, tschuett.
Herald added a project: libc-project.
michaelrj requested review of this revision.

I think this is the last windows type conversion fix, the rest of the
build seems to be okay.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D108659

Files:
  libc/test/src/stdlib/strtoul_test.cpp


Index: libc/test/src/stdlib/strtoul_test.cpp
===================================================================
--- libc/test/src/stdlib/strtoul_test.cpp
+++ libc/test/src/stdlib/strtoul_test.cpp
@@ -45,11 +45,11 @@
   ASSERT_EQ(errno, 0);
   EXPECT_EQ(str_end - negative, ptrdiff_t(4));
 
-  const char *big_number = "123456789012345";
+  const char *big_number = "1234567890";
   errno = 0;
-  ASSERT_EQ(__llvm_libc::strtoul(big_number, &str_end, 10), 123456789012345ul);
+  ASSERT_EQ(__llvm_libc::strtoul(big_number, &str_end, 10), 1234567890ul);
   ASSERT_EQ(errno, 0);
-  EXPECT_EQ(str_end - big_number, ptrdiff_t(15));
+  EXPECT_EQ(str_end - big_number, ptrdiff_t(10));
 
   const char *too_big_number = "123456789012345678901";
   errno = 0;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D108659.368441.patch
Type: text/x-patch
Size: 750 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20210824/7e5e880a/attachment.bin>


More information about the libc-commits mailing list