Skip to content

Commit 5149ff0

Browse files
authored
Merge pull request #35045 from etcwilde/ewilde/fix-unittest-warnings
NFC: Fix signed unsigned comparison warnings in unittests
2 parents f7d0cff + 6dac520 commit 5149ff0

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

unittests/Basic/MultiMapCacheTest.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,23 +32,23 @@ TEST(MultiMapCache, powersTest) {
3232
for (unsigned index : range(1, 256)) {
3333
auto array = *cache.get(index);
3434
for (unsigned power : array) {
35-
EXPECT_EQ(power % index, 0);
35+
EXPECT_EQ(power % index, 0u);
3636
}
3737
}
3838
EXPECT_FALSE(cache.empty());
39-
EXPECT_EQ(cache.size(), 255);
39+
EXPECT_EQ(cache.size(), 255u);
4040
for (unsigned index : range(1, 256)) {
4141
auto array = *cache.get(index);
4242
for (unsigned power : array) {
43-
EXPECT_EQ(power % index, 0);
43+
EXPECT_EQ(power % index, 0u);
4444
}
4545
}
4646
EXPECT_FALSE(cache.empty());
47-
EXPECT_EQ(cache.size(), 255);
47+
EXPECT_EQ(cache.size(), 255u);
4848

4949
cache.clear();
5050
EXPECT_TRUE(cache.empty());
51-
EXPECT_EQ(cache.size(), 0);
51+
EXPECT_EQ(cache.size(), 0u);
5252
}
5353

5454
TEST(MultiMapCache, smallTest) {
@@ -66,21 +66,21 @@ TEST(MultiMapCache, smallTest) {
6666
for (unsigned index : range(1, 256)) {
6767
auto array = *cache.get(index);
6868
for (unsigned power : array) {
69-
EXPECT_EQ(power % index, 0);
69+
EXPECT_EQ(power % index, 0u);
7070
}
7171
}
7272
EXPECT_FALSE(cache.empty());
73-
EXPECT_EQ(cache.size(), 255);
73+
EXPECT_EQ(cache.size(), 255u);
7474
for (unsigned index : range(1, 256)) {
7575
auto array = *cache.get(index);
7676
for (unsigned power : array) {
77-
EXPECT_EQ(power % index, 0);
77+
EXPECT_EQ(power % index, 0u);
7878
}
7979
}
8080
EXPECT_FALSE(cache.empty());
81-
EXPECT_EQ(cache.size(), 255);
81+
EXPECT_EQ(cache.size(), 255u);
8282

8383
cache.clear();
8484
EXPECT_TRUE(cache.empty());
85-
EXPECT_EQ(cache.size(), 0);
85+
EXPECT_EQ(cache.size(), 0u);
8686
}

unittests/Sema/UnresolvedMemberLookupTests.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ TEST_F(SemaTest, TestLookupAlwaysLooksThroughOptionalBase) {
4141
cs.solve(solutions);
4242

4343
// We should have a solution.
44-
ASSERT_EQ(solutions.size(), 1);
44+
ASSERT_EQ(solutions.size(), 1u);
4545

4646
auto &solution = solutions[0];
4747
auto *locator = cs.getConstraintLocator(UME,
@@ -75,7 +75,7 @@ TEST_F(SemaTest, TestLookupPrefersResultsOnOptionalRatherThanBase) {
7575
cs.solve(solutions);
7676

7777
// We should have a solution.
78-
ASSERT_EQ(solutions.size(), 1);
78+
ASSERT_EQ(solutions.size(), 1u);
7979

8080
auto &solution = solutions[0];
8181
auto *locator = cs.getConstraintLocator(UME,
@@ -85,6 +85,6 @@ TEST_F(SemaTest, TestLookupPrefersResultsOnOptionalRatherThanBase) {
8585

8686
// The `test` member on `Optional` should be chosen over the member on `Int`,
8787
// even though the score is otherwise worse.
88-
ASSERT_EQ(score.Data[SK_ValueToOptional], 1);
88+
ASSERT_EQ(score.Data[SK_ValueToOptional], 1u);
8989
ASSERT_EQ(choice.getDecl(), optMember);
9090
}

0 commit comments

Comments
 (0)