mirror of
git://sourceware.org/git/libabigail.git
synced 2024-12-15 14:34:38 +00:00
53d10a789d
An abi-corpus might be part of the representation, but might (due to filters like whitelisting) not contain actual symbols to be considered. In that case, `abidw` produces an empty abi-corpus node. Valid ways of representing this in XML are - <abi-corpus path='vmlinux' architecture='elf-arm-aarch64'/> - <abi-corpus path='vmlinux' architecture='elf-arm-aarch64'></abi-corpus> - <abi-corpus path='vmlinux' architecture='elf-arm-aarch64'> </abi-corpus> abg-reader could currently only handle the last format and crashed upon processing the first two ones. The crash happened due to the XMLNode having no children, but that was assumed. The last case succeeded so far as this form actually contains a text node (with the newline character) as a child. Fix this by handling the case of a node not having children by exiting early with an empty node. * src/abg-reader.cc (read_corpus_from_input): when assigning a corpus node, assure the node actually has children. * tests/test-abidiff.cc (main): Add test for variants of empty xml nodes to the test harness. * tests/data/test-abidiff/test-empty-corpus-0.xml: Test input containing an empty xml node that closes immediately. * tests/data/test-abidiff/test-empty-corpus-0.xml: Test input containing an empty xml node that closes immediately with a tag. * tests/data/test-abidiff/test-empty-corpus-0.xml: Test input containing an empty xml node that closes with a tag on a new line. * tests/data/test-abidiff/test-empty-corpus-report.txt: Expected test output (empty abidiff) for diffing xml with itself. * tests/data/Makefile.am: Add the new test input material above to source distribution. Reviewed-by: Dodji Seketeli <dodji@seketeli.org> Signed-off-by: Matthias Maennich <maennich@google.com> |
||
---|---|---|
.. | ||
data | ||
.gitignore | ||
Makefile.am | ||
mockfedabipkgdiff.in | ||
print-diff-tree.cc | ||
runtestcanonicalizetypes.sh.in | ||
runtestdefaultsupprs.py.in | ||
runtestdefaultsupprspy3.sh.in | ||
runtestfedabipkgdiff.py.in | ||
runtestfedabipkgdiffpy3.sh.in | ||
test-abicompat.cc | ||
test-abidiff-exit.cc | ||
test-abidiff.cc | ||
test-alt-dwarf-file.cc | ||
test-annotate.cc | ||
test-core-diff.cc | ||
test-diff2.cc | ||
test-diff-dwarf-abixml.cc | ||
test-diff-dwarf.cc | ||
test-diff-filter.cc | ||
test-diff-pkg.cc | ||
test-diff-suppr.cc | ||
test-dot.cc | ||
test-ini.cc | ||
test-ir-walker.cc | ||
test-lookup-syms.cc | ||
test-read-dwarf.cc | ||
test-read-write.cc | ||
test-svg.cc | ||
test-tools-utils.cc | ||
test-types-stability.cc | ||
test-utils.cc | ||
test-utils.h | ||
test-valgrind-suppressions.supp | ||
test-write-read-archive.cc | ||
update-test-output.py |