diff options
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/linux/dump_symbols_unittest.cc | 2 | ||||
-rw-r--r-- | src/common/linux/elf_core_dump_unittest.cc | 6 | ||||
-rw-r--r-- | src/common/linux/file_id_unittest.cc | 2 | ||||
-rw-r--r-- | src/common/linux/linux_libc_support_unittest.cc | 38 | ||||
-rw-r--r-- | src/common/linux/memory_mapped_file_unittest.cc | 2 | ||||
-rw-r--r-- | src/common/linux/safe_readlink_unittest.cc | 2 | ||||
-rw-r--r-- | src/common/linux/synth_elf_unittest.cc | 24 | ||||
-rw-r--r-- | src/common/memory_range_unittest.cc | 12 |
8 files changed, 44 insertions, 44 deletions
diff --git a/src/common/linux/dump_symbols_unittest.cc b/src/common/linux/dump_symbols_unittest.cc index aec6720c..2281fc7c 100644 --- a/src/common/linux/dump_symbols_unittest.cc +++ b/src/common/linux/dump_symbols_unittest.cc @@ -67,7 +67,7 @@ class DumpSymbols : public Test { void GetElfContents(ELF& elf) { string contents; ASSERT_TRUE(elf.GetContents(&contents)); - ASSERT_LT(0, contents.size()); + ASSERT_LT(0U, contents.size()); elfdata_v.clear(); elfdata_v.insert(elfdata_v.begin(), contents.begin(), contents.end()); diff --git a/src/common/linux/elf_core_dump_unittest.cc b/src/common/linux/elf_core_dump_unittest.cc index ce0ab540..45aa5364 100644 --- a/src/common/linux/elf_core_dump_unittest.cc +++ b/src/common/linux/elf_core_dump_unittest.cc @@ -53,7 +53,7 @@ TEST(ElfCoreDumpTest, DefaultConstructor) { ElfCoreDump core; EXPECT_FALSE(core.IsValid()); EXPECT_EQ(NULL, core.GetHeader()); - EXPECT_EQ(0, core.GetProgramHeaderCount()); + EXPECT_EQ(0U, core.GetProgramHeaderCount()); EXPECT_EQ(NULL, core.GetProgramHeader(0)); EXPECT_EQ(NULL, core.GetFirstProgramHeaderOfType(PT_LOAD)); EXPECT_FALSE(core.GetFirstNote().IsValid()); @@ -74,7 +74,7 @@ TEST(ElfCoreDumpTest, TestElfHeader) { core.SetContent(mapped_core_file.content()); EXPECT_FALSE(core.IsValid()); EXPECT_EQ(NULL, core.GetHeader()); - EXPECT_EQ(0, core.GetProgramHeaderCount()); + EXPECT_EQ(0U, core.GetProgramHeaderCount()); EXPECT_EQ(NULL, core.GetProgramHeader(0)); EXPECT_EQ(NULL, core.GetFirstProgramHeaderOfType(PT_LOAD)); EXPECT_FALSE(core.GetFirstNote().IsValid()); @@ -238,7 +238,7 @@ TEST(ElfCoreDumpTest, ValidCoreFile) { } EXPECT_TRUE(expected_thread_ids == actual_thread_ids); - EXPECT_EQ(1, num_nt_prpsinfo); + EXPECT_EQ(1U, num_nt_prpsinfo); EXPECT_EQ(kNumOfThreads, num_nt_prstatus); #if defined(__i386__) || defined(__x86_64__) EXPECT_EQ(kNumOfThreads, num_nt_fpregset); diff --git a/src/common/linux/file_id_unittest.cc b/src/common/linux/file_id_unittest.cc index daef1e3f..fa3af802 100644 --- a/src/common/linux/file_id_unittest.cc +++ b/src/common/linux/file_id_unittest.cc @@ -99,7 +99,7 @@ public: void GetElfContents(ELF& elf) { string contents; ASSERT_TRUE(elf.GetContents(&contents)); - ASSERT_LT(0, contents.size()); + ASSERT_LT(0U, contents.size()); elfdata_v.clear(); elfdata_v.insert(elfdata_v.begin(), contents.begin(), contents.end()); diff --git a/src/common/linux/linux_libc_support_unittest.cc b/src/common/linux/linux_libc_support_unittest.cc index 2a9694ce..5d06d17e 100644 --- a/src/common/linux/linux_libc_support_unittest.cc +++ b/src/common/linux/linux_libc_support_unittest.cc @@ -90,17 +90,17 @@ TEST(LinuxLibcSupportTest, strtoui) { } TEST(LinuxLibcSupportTest, uint_len) { - ASSERT_EQ(my_uint_len(0), 1); - ASSERT_EQ(my_uint_len(2), 1); - ASSERT_EQ(my_uint_len(5), 1); - ASSERT_EQ(my_uint_len(9), 1); - ASSERT_EQ(my_uint_len(10), 2); - ASSERT_EQ(my_uint_len(99), 2); - ASSERT_EQ(my_uint_len(100), 3); - ASSERT_EQ(my_uint_len(101), 3); - ASSERT_EQ(my_uint_len(1000), 4); + ASSERT_EQ(my_uint_len(0), 1U); + ASSERT_EQ(my_uint_len(2), 1U); + ASSERT_EQ(my_uint_len(5), 1U); + ASSERT_EQ(my_uint_len(9), 1U); + ASSERT_EQ(my_uint_len(10), 2U); + ASSERT_EQ(my_uint_len(99), 2U); + ASSERT_EQ(my_uint_len(100), 3U); + ASSERT_EQ(my_uint_len(101), 3U); + ASSERT_EQ(my_uint_len(1000), 4U); // 0xFFFFFFFFFFFFFFFF - ASSERT_EQ(my_uint_len(18446744073709551615LLU), 20); + ASSERT_EQ(my_uint_len(18446744073709551615LLU), 20U); } TEST(LinuxLibcSupportTest, uitos) { @@ -159,23 +159,23 @@ TEST(LinuxLibcSupportTest, read_hex_ptr) { const char* last; last = my_read_hex_ptr(&result, ""); - ASSERT_EQ(result, 0); + ASSERT_EQ(result, 0U); ASSERT_EQ(*last, 0); last = my_read_hex_ptr(&result, "0"); - ASSERT_EQ(result, 0); + ASSERT_EQ(result, 0U); ASSERT_EQ(*last, 0); last = my_read_hex_ptr(&result, "0123"); - ASSERT_EQ(result, 0x123); + ASSERT_EQ(result, 0x123U); ASSERT_EQ(*last, 0); last = my_read_hex_ptr(&result, "0123a"); - ASSERT_EQ(result, 0x123a); + ASSERT_EQ(result, 0x123aU); ASSERT_EQ(*last, 0); last = my_read_hex_ptr(&result, "0123a-"); - ASSERT_EQ(result, 0x123a); + ASSERT_EQ(result, 0x123aU); ASSERT_EQ(*last, '-'); } @@ -184,18 +184,18 @@ TEST(LinuxLibcSupportTest, read_decimal_ptr) { const char* last; last = my_read_decimal_ptr(&result, "0"); - ASSERT_EQ(result, 0); + ASSERT_EQ(result, 0U); ASSERT_EQ(*last, 0); last = my_read_decimal_ptr(&result, "0123"); - ASSERT_EQ(result, 123); + ASSERT_EQ(result, 123U); ASSERT_EQ(*last, 0); last = my_read_decimal_ptr(&result, "1234"); - ASSERT_EQ(result, 1234); + ASSERT_EQ(result, 1234U); ASSERT_EQ(*last, 0); last = my_read_decimal_ptr(&result, "01234-"); - ASSERT_EQ(result, 1234); + ASSERT_EQ(result, 1234U); ASSERT_EQ(*last, '-'); } diff --git a/src/common/linux/memory_mapped_file_unittest.cc b/src/common/linux/memory_mapped_file_unittest.cc index 0c551ac2..7c34e708 100644 --- a/src/common/linux/memory_mapped_file_unittest.cc +++ b/src/common/linux/memory_mapped_file_unittest.cc @@ -54,7 +54,7 @@ class MemoryMappedFileTest : public testing::Test { void ExpectNoMappedData(const MemoryMappedFile& mapped_file) { EXPECT_TRUE(mapped_file.content().IsEmpty()); EXPECT_TRUE(mapped_file.data() == NULL); - EXPECT_EQ(0, mapped_file.size()); + EXPECT_EQ(0U, mapped_file.size()); } }; diff --git a/src/common/linux/safe_readlink_unittest.cc b/src/common/linux/safe_readlink_unittest.cc index 191fb9f1..d346b2a8 100644 --- a/src/common/linux/safe_readlink_unittest.cc +++ b/src/common/linux/safe_readlink_unittest.cc @@ -48,7 +48,7 @@ TEST(SafeReadLinkTest, BoundaryBufferSize) { char buffer[PATH_MAX]; EXPECT_TRUE(SafeReadLink("/proc/self/exe", buffer, sizeof(buffer))); size_t path_length = strlen(buffer); - EXPECT_LT(0, path_length); + EXPECT_LT(0U, path_length); EXPECT_GT(sizeof(buffer), path_length); // Buffer size equals to the expected path length plus 1 for the NULL byte. diff --git a/src/common/linux/synth_elf_unittest.cc b/src/common/linux/synth_elf_unittest.cc index 0cb7d270..34a00cab 100644 --- a/src/common/linux/synth_elf_unittest.cc +++ b/src/common/linux/synth_elf_unittest.cc @@ -55,7 +55,7 @@ public: }; TEST_F(StringTableTest, Empty) { - EXPECT_EQ(1, table.Size()); + EXPECT_EQ(1U, table.Size()); string contents; ASSERT_TRUE(table.GetContents(&contents)); const char* kExpectedContents = "\0"; @@ -63,7 +63,7 @@ TEST_F(StringTableTest, Empty) { contents.c_str(), contents.size())); ASSERT_TRUE(table.empty_string.IsKnownConstant()); - EXPECT_EQ(0, table.empty_string.Value()); + EXPECT_EQ(0U, table.empty_string.Value()); } TEST_F(StringTableTest, Basic) { @@ -84,7 +84,7 @@ TEST_F(StringTableTest, Basic) { contents.size())); // empty_string is at zero, other strings start at 1. ASSERT_TRUE(l1.IsKnownConstant()); - EXPECT_EQ(1, l1.Value()); + EXPECT_EQ(1U, l1.Value()); // Each string has an extra byte for a trailing null. EXPECT_EQ(1 + s1.length() + 1, l2.Value()); EXPECT_EQ(1 + s1.length() + 1 + s2.length() + 1, l3.Value()); @@ -105,7 +105,7 @@ TEST_F(StringTableTest, Duplicates) { EXPECT_EQ(0, memcmp(kExpectedContents, contents.c_str(), contents.size())); - EXPECT_EQ(0, table.empty_string.Value()); + EXPECT_EQ(0U, table.empty_string.Value()); EXPECT_EQ(table.empty_string.Value(), l3.Value()); EXPECT_EQ(l2.Value(), l4.Value()); } @@ -209,12 +209,12 @@ TEST_F(BasicElf, EmptyLE32) { EXPECT_EQ(0, memcmp(kIdent, header->e_ident, sizeof(kIdent))); EXPECT_EQ(ET_EXEC, header->e_type); EXPECT_EQ(EM_386, header->e_machine); - EXPECT_EQ(EV_CURRENT, header->e_version); - EXPECT_EQ(0, header->e_entry); - EXPECT_EQ(0, header->e_phoff); + EXPECT_EQ(static_cast<unsigned int>(EV_CURRENT), header->e_version); + EXPECT_EQ(0U, header->e_entry); + EXPECT_EQ(0U, header->e_phoff); EXPECT_EQ(sizeof(Elf32_Ehdr) + kStringTableSize + kStringTableAlign, header->e_shoff); - EXPECT_EQ(0, header->e_flags); + EXPECT_EQ(0U, header->e_flags); EXPECT_EQ(sizeof(Elf32_Ehdr), header->e_ehsize); EXPECT_EQ(sizeof(Elf32_Phdr), header->e_phentsize); EXPECT_EQ(0, header->e_phnum); @@ -248,12 +248,12 @@ TEST_F(BasicElf, EmptyLE64) { EXPECT_EQ(0, memcmp(kIdent, header->e_ident, sizeof(kIdent))); EXPECT_EQ(ET_EXEC, header->e_type); EXPECT_EQ(EM_X86_64, header->e_machine); - EXPECT_EQ(EV_CURRENT, header->e_version); - EXPECT_EQ(0, header->e_entry); - EXPECT_EQ(0, header->e_phoff); + EXPECT_EQ(static_cast<unsigned int>(EV_CURRENT), header->e_version); + EXPECT_EQ(0U, header->e_entry); + EXPECT_EQ(0U, header->e_phoff); EXPECT_EQ(sizeof(Elf64_Ehdr) + kStringTableSize + kStringTableAlign, header->e_shoff); - EXPECT_EQ(0, header->e_flags); + EXPECT_EQ(0U, header->e_flags); EXPECT_EQ(sizeof(Elf64_Ehdr), header->e_ehsize); EXPECT_EQ(sizeof(Elf64_Phdr), header->e_phentsize); EXPECT_EQ(0, header->e_phnum); diff --git a/src/common/memory_range_unittest.cc b/src/common/memory_range_unittest.cc index 252b037e..b13f45ca 100644 --- a/src/common/memory_range_unittest.cc +++ b/src/common/memory_range_unittest.cc @@ -94,7 +94,7 @@ const size_t kNumElements = sizeof(kElements) / sizeof(kElements[0]); TEST(MemoryRangeTest, DefaultConstructor) { MemoryRange range; EXPECT_EQ(NULL, range.data()); - EXPECT_EQ(0, range.length()); + EXPECT_EQ(0U, range.length()); } TEST(MemoryRangeTest, ConstructorWithDataAndLength) { @@ -107,7 +107,7 @@ TEST(MemoryRangeTest, Reset) { MemoryRange range; range.Reset(); EXPECT_EQ(NULL, range.data()); - EXPECT_EQ(0, range.length()); + EXPECT_EQ(0U, range.length()); range.Set(kBuffer, kBufferSize); EXPECT_EQ(kBufferPointer, range.data()); @@ -115,7 +115,7 @@ TEST(MemoryRangeTest, Reset) { range.Reset(); EXPECT_EQ(NULL, range.data()); - EXPECT_EQ(0, range.length()); + EXPECT_EQ(0U, range.length()); } TEST(MemoryRangeTest, Set) { @@ -126,14 +126,14 @@ TEST(MemoryRangeTest, Set) { range.Set(NULL, 0); EXPECT_EQ(NULL, range.data()); - EXPECT_EQ(0, range.length()); + EXPECT_EQ(0U, range.length()); } TEST(MemoryRangeTest, SubrangeOfEmptyMemoryRange) { MemoryRange range; MemoryRange subrange = range.Subrange(0, 10); EXPECT_EQ(NULL, subrange.data()); - EXPECT_EQ(0, subrange.length()); + EXPECT_EQ(0U, subrange.length()); } TEST(MemoryRangeTest, SubrangeAndGetData) { @@ -156,7 +156,7 @@ TEST(MemoryRangeTest, SubrangeAndGetData) { EXPECT_FALSE(range.Covers(sub_offset, sub_length)); EXPECT_EQ(NULL, range.GetData(sub_offset, sub_length)); EXPECT_EQ(NULL, subrange.data()); - EXPECT_EQ(0, subrange.length()); + EXPECT_EQ(0U, subrange.length()); } } } |