[DWARFYAML][unittest] Use parseDWARFYAML() in unit test. NFC.

This commit is contained in:
Xing GUO 2020-07-03 22:34:27 +08:00
parent 0f03b2bfda
commit 6f779f35f5
1 changed files with 6 additions and 6 deletions

View File

@ -45,8 +45,8 @@ debug_addr:
Length: 0x1234
Version: 5
)";
auto SectionsOrErr = DWARFYAML::emitDebugSections(Yaml);
EXPECT_THAT_EXPECTED(SectionsOrErr, Succeeded());
auto DWARFOrErr = parseDWARFYAML(Yaml);
EXPECT_THAT_EXPECTED(DWARFOrErr, Succeeded());
}
TEST(DebugAddrSection, TestMissingVersion) {
@ -55,8 +55,8 @@ debug_addr:
- Format: DWARF64
Length: 0x1234
)";
auto SectionsOrErr = DWARFYAML::emitDebugSections(Yaml);
EXPECT_THAT_ERROR(SectionsOrErr.takeError(),
auto DWARFOrErr = parseDWARFYAML(Yaml);
EXPECT_THAT_ERROR(DWARFOrErr.takeError(),
FailedWithMessage("missing required key 'Version'"));
}
@ -68,8 +68,8 @@ debug_addr:
Version: 5
Blah: unexpected
)";
auto SectionsOrErr = DWARFYAML::emitDebugSections(Yaml);
EXPECT_THAT_ERROR(SectionsOrErr.takeError(),
auto DWARFOrErr = parseDWARFYAML(Yaml);
EXPECT_THAT_ERROR(DWARFOrErr.takeError(),
FailedWithMessage("unknown key 'Blah'"));
}