Skip to content

Commit

Permalink
[llvm-profdata][unittest] Fix -Wsign-compare after D147740
Browse files Browse the repository at this point in the history
  • Loading branch information
MaskRay committed Jun 27, 2023
1 parent f9b14f0 commit 6d871eb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions llvm/unittests/tools/llvm-profdata/MD5CollisionTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ TEST(MD5CollisionTest, TestCollision) {
ASSERT_FALSE(Reader->read());

std::vector<StringRef> &NameTable = *Reader->getNameTable();
ASSERT_EQ(NameTable.size(), 2);
ASSERT_EQ(NameTable.size(), size_t(2));
StringRef S1 = NameTable[0];
StringRef S2 = NameTable[1];
ASSERT_NE(S1, S2);
Expand All @@ -131,7 +131,7 @@ TEST(MD5CollisionTest, TestCollision) {
ExpectedFS.addBodySamples(9, 0, 0);

SampleProfileMap &Profiles = Reader->getProfiles();
EXPECT_EQ(Profiles.size(), 1);
EXPECT_EQ(Profiles.size(), size_t(1));
if (Profiles.size()) {
auto &[Hash, FS] = *Profiles.begin();
EXPECT_EQ(Hash, ExpectedHash);
Expand All @@ -141,7 +141,7 @@ TEST(MD5CollisionTest, TestCollision) {
// Inserting S2 again should fail, returning the existing sample unchanged.
auto [It1, Inserted1] = Profiles.try_emplace(S2, FunctionSamples());
EXPECT_FALSE(Inserted1);
EXPECT_EQ(Profiles.size(), 1);
EXPECT_EQ(Profiles.size(), size_t(1));
if (Profiles.size()) {
auto &[Hash, FS] = *It1;
EXPECT_EQ(Hash, ExpectedHash);
Expand All @@ -157,7 +157,7 @@ TEST(MD5CollisionTest, TestCollision) {

auto [It2, Inserted2] = Profiles.try_emplace(S1, FS1);
EXPECT_TRUE(Inserted2);
EXPECT_EQ(Profiles.size(), 1);
EXPECT_EQ(Profiles.size(), size_t(1));
if (Profiles.size()) {
auto &[Hash, FS] = *It2;
EXPECT_EQ(Hash, ExpectedHash);
Expand Down

0 comments on commit 6d871eb

Please sign in to comment.