[Lldb-commits] [PATCH] D66345: [lldb][NFC] Allow for-range iterating over StringList
Pavel Labath via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Fri Aug 16 07:01:53 PDT 2019
labath accepted this revision.
labath added a comment.
This revision is now accepted and ready to land.
Definitely an improvement, though one day, i'd like to get rid of the StringList class (and various other XXXList classes) completely :)
================
Comment at: lldb/unittests/Utility/StringListTest.cpp:522-525
+ EXPECT_EQ(3U, recorded.size());
+ EXPECT_EQ("a", recorded.at(0));
+ EXPECT_EQ("b", recorded.at(1));
+ EXPECT_EQ("c", recorded.at(2));
----------------
maybe `EXPECT_THAT(recorded, testing::ElementsAre("a", "b", "c"))` ?
(The advantages are that it's shorter, produces better error messages, and doesn't cause the subsequent checks to invoke UB if recorded.size happens to be less than 3).
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D66345/new/
https://reviews.llvm.org/D66345
More information about the lldb-commits
mailing list