[PATCH] D64281: [Object] Create MutableELFObject Class for Doing Mutations on ELFObjectFiles [Part 1]

Pavel Labath via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 25 00:05:57 PDT 2019


labath added a comment.

Sorry to barge in here, but I couldn't resist to not spread the knowledge of more advanced googletest features. EXPECT_EQ is perfectly safe to use with StringRefs as it just defers to their operator==, and (as I mentioned in the other review), we have better facilities for checking the state of Expected and Error values.



================
Comment at: llvm/unittests/Object/MutableObjectTest.cpp:97
+  // Might not always be 0 after StringRef's data so EXPECT_STREQ isn't safe.
+  EXPECT_FALSE(::strncmp(Contents->data(), "\xDE\xAD\xBE\xEF", 4));
+  EXPECT_EQ(FirstSec->getSize(), 4U);
----------------
EXPECT_EQ (not STREQ) ought to work here (`EXPECT_EQ("...", Contents)`)


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

https://reviews.llvm.org/D64281





More information about the llvm-commits mailing list