[PATCH] D121851: [scudo][tests] Ensure test assertions have matching type

Vitaly Buka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 24 12:06:50 PDT 2022


vitalybuka added inline comments.


================
Comment at: compiler-rt/lib/scudo/standalone/tests/combined_test.cpp:142
   for (scudo::uptr I = 0; I < sizeof(StackBuffer); I++)
-    EXPECT_EQ(StackBuffer[I], 0x42U);
+    EXPECT_EQ(StackBuffer[I], static_cast<scudo::u8>(0x42U));
 }
----------------
code looks less readable with unnecessary casts like this


================
Comment at: compiler-rt/lib/scudo/standalone/tests/list_test.cpp:96
   L.push_front(Z);
-  EXPECT_EQ(L.size(), 3U);
+  EXPECT_EQ(L.size(), 3UL);
   EXPECT_EQ(L.front(), Z);
----------------
Are we going to have mismatch 32/64 here?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121851



More information about the llvm-commits mailing list