mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
NFC: Fix signed unsigned comparison warnings
This patch fixes the unsigned/signed comparison warnings in the unittests caused by comparing an unsigned integer with the signed integer literal. The offending signed integer literals have been replaced with unsigned integer literals.
This commit is contained in:
@@ -32,23 +32,23 @@ TEST(MultiMapCache, powersTest) {
|
||||
for (unsigned index : range(1, 256)) {
|
||||
auto array = *cache.get(index);
|
||||
for (unsigned power : array) {
|
||||
EXPECT_EQ(power % index, 0);
|
||||
EXPECT_EQ(power % index, 0u);
|
||||
}
|
||||
}
|
||||
EXPECT_FALSE(cache.empty());
|
||||
EXPECT_EQ(cache.size(), 255);
|
||||
EXPECT_EQ(cache.size(), 255u);
|
||||
for (unsigned index : range(1, 256)) {
|
||||
auto array = *cache.get(index);
|
||||
for (unsigned power : array) {
|
||||
EXPECT_EQ(power % index, 0);
|
||||
EXPECT_EQ(power % index, 0u);
|
||||
}
|
||||
}
|
||||
EXPECT_FALSE(cache.empty());
|
||||
EXPECT_EQ(cache.size(), 255);
|
||||
EXPECT_EQ(cache.size(), 255u);
|
||||
|
||||
cache.clear();
|
||||
EXPECT_TRUE(cache.empty());
|
||||
EXPECT_EQ(cache.size(), 0);
|
||||
EXPECT_EQ(cache.size(), 0u);
|
||||
}
|
||||
|
||||
TEST(MultiMapCache, smallTest) {
|
||||
@@ -66,21 +66,21 @@ TEST(MultiMapCache, smallTest) {
|
||||
for (unsigned index : range(1, 256)) {
|
||||
auto array = *cache.get(index);
|
||||
for (unsigned power : array) {
|
||||
EXPECT_EQ(power % index, 0);
|
||||
EXPECT_EQ(power % index, 0u);
|
||||
}
|
||||
}
|
||||
EXPECT_FALSE(cache.empty());
|
||||
EXPECT_EQ(cache.size(), 255);
|
||||
EXPECT_EQ(cache.size(), 255u);
|
||||
for (unsigned index : range(1, 256)) {
|
||||
auto array = *cache.get(index);
|
||||
for (unsigned power : array) {
|
||||
EXPECT_EQ(power % index, 0);
|
||||
EXPECT_EQ(power % index, 0u);
|
||||
}
|
||||
}
|
||||
EXPECT_FALSE(cache.empty());
|
||||
EXPECT_EQ(cache.size(), 255);
|
||||
EXPECT_EQ(cache.size(), 255u);
|
||||
|
||||
cache.clear();
|
||||
EXPECT_TRUE(cache.empty());
|
||||
EXPECT_EQ(cache.size(), 0);
|
||||
EXPECT_EQ(cache.size(), 0u);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user