[libc-commits] [PATCH] D125917: [libc][windows] fix strlcpy tests

Michael Jones via Phabricator via libc-commits libc-commits at lists.llvm.org
Wed May 18 14:12:08 PDT 2022


This revision was not accepted when it landed; it landed in state "Needs Review".
This revision was automatically updated to reflect the committed changes.
Closed by commit rG72f6dfb37875: [libc][windows] fix strlcpy tests (authored by michaelrj).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D125917

Files:
  libc/test/src/string/strlcpy_test.cpp


Index: libc/test/src/string/strlcpy_test.cpp
===================================================================
--- libc/test/src/string/strlcpy_test.cpp
+++ libc/test/src/string/strlcpy_test.cpp
@@ -13,17 +13,17 @@
 TEST(LlvmLibcStrlcpyTest, TooBig) {
   const char *str = "abc";
   char buf[2];
-  EXPECT_EQ(__llvm_libc::strlcpy(buf, str, 2), 3ul);
+  EXPECT_EQ(__llvm_libc::strlcpy(buf, str, 2), size_t(3));
   EXPECT_STREQ(buf, "a");
 
-  EXPECT_EQ(__llvm_libc::strlcpy(nullptr, str, 0), 3ul);
+  EXPECT_EQ(__llvm_libc::strlcpy(nullptr, str, 0), size_t(3));
 }
 
 TEST(LlvmLibcStrlcpyTest, Smaller) {
   const char *str = "abc";
   char buf[7]{"111111"};
 
-  EXPECT_EQ(__llvm_libc::strlcpy(buf, str, 7), 3ul);
+  EXPECT_EQ(__llvm_libc::strlcpy(buf, str, 7), size_t(3));
   EXPECT_STREQ(buf, "abc");
   for (const char *p = buf + 3; p < buf + 7; p++)
     EXPECT_EQ(*p, '\0');


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D125917.430501.patch
Type: text/x-patch
Size: 882 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20220518/2221bb2f/attachment.bin>


More information about the libc-commits mailing list