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:
Evan Wilde
2020-12-10 16:02:33 -08:00
parent 88efaacd79
commit 6dac520b66
2 changed files with 13 additions and 13 deletions

View File

@@ -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);
}