mirror of
https://github.com/yuzu-emu/breakpad.git
synced 2024-12-23 06:05:44 +00:00
Add tests for section headers in synth_elf unittest
A=Mike Hommey <mh@glandium.org> R=ted at https://breakpad.appspot.com/542003/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1137 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
parent
8de2cd2d22
commit
704c13e7ab
|
@ -234,6 +234,30 @@ TYPED_TEST(BasicElf, EmptyLE) {
|
|||
EXPECT_EQ(sizeof(Shdr), header->e_shentsize);
|
||||
EXPECT_EQ(2, header->e_shnum);
|
||||
EXPECT_EQ(1, header->e_shstrndx);
|
||||
|
||||
const Shdr* shdr =
|
||||
reinterpret_cast<const Shdr*>(contents.data() + header->e_shoff);
|
||||
EXPECT_EQ(0U, shdr[0].sh_name);
|
||||
EXPECT_EQ(static_cast<unsigned int>(SHT_NULL), shdr[0].sh_type);
|
||||
EXPECT_EQ(0U, shdr[0].sh_flags);
|
||||
EXPECT_EQ(0U, shdr[0].sh_addr);
|
||||
EXPECT_EQ(0U, shdr[0].sh_offset);
|
||||
EXPECT_EQ(0U, shdr[0].sh_size);
|
||||
EXPECT_EQ(0U, shdr[0].sh_link);
|
||||
EXPECT_EQ(0U, shdr[0].sh_info);
|
||||
EXPECT_EQ(0U, shdr[0].sh_addralign);
|
||||
EXPECT_EQ(0U, shdr[0].sh_entsize);
|
||||
|
||||
EXPECT_EQ(1U, shdr[1].sh_name);
|
||||
EXPECT_EQ(static_cast<unsigned int>(SHT_STRTAB), shdr[1].sh_type);
|
||||
EXPECT_EQ(0U, shdr[1].sh_flags);
|
||||
EXPECT_EQ(0U, shdr[1].sh_addr);
|
||||
EXPECT_EQ(sizeof(Ehdr), shdr[1].sh_offset);
|
||||
EXPECT_EQ(kStringTableSize, shdr[1].sh_size);
|
||||
EXPECT_EQ(0U, shdr[1].sh_link);
|
||||
EXPECT_EQ(0U, shdr[1].sh_info);
|
||||
EXPECT_EQ(0U, shdr[1].sh_addralign);
|
||||
EXPECT_EQ(0U, shdr[1].sh_entsize);
|
||||
}
|
||||
|
||||
#endif // defined(__i386__) || defined(__x86_64__)
|
||||
|
|
Loading…
Reference in a new issue