mirror of
git://sourceware.org/git/libabigail.git
synced 2024-12-25 19:22:07 +00:00
b041bc9cf0
Until now, if a diff node N has a local change, even if all of its children nodes are redundant, N is not considered as being redundant. This is an issue if the local changes of N are filtered out; in that case, N should be considered redundant. This patch fixes that. It introduces a second category bitmap on the diff node that stores the categorization of the diff node that does *NOT* take in account the categories inherited from its children nodes. That way, it's possible to know if the *local changes* of a given node have been filtered out. * include/abg-comparison.h (diff::{get_local_category, add_to_local_category, add_to_local_and_inherited_categories, remove_from_local_category, set_local_category, is_filtered_out_wrt_non_inherited_categories, has_local_changes_to_be_reported}): Declare new member functions. * src/abg-comp-filter.cc ({harmless, harmful}_filter::{visit, visit_end}): Update local category too. * src/abg-comparison.cc (diff::priv::local_category_): Add new data member. (diff::priv::priv): Initialize it. (diff::priv::is_filtered_out): Add new member function. This is factorized out of diff::is_filtered_out(). (diff::is_filtered_out): Re-write in terms of diff::priv::is_filtered_out(). (diff::{get_local_category, add_to_local_category, add_to_local_and_inherited_categories, remove_from_local_category, set_local_category, is_filtered_out_wrt_non_inherited_categories, has_local_changes_to_be_reported}): Define new member functions. (suppression_categorization_visitor::visit_begin): Update local categories too. (redundancy_marking_visitor::visit_end): If all of the children nodes of the a diff node N are redundant and if N has filtered-out local changes, then N is redundant too. * tests/data/test-diff-filter/libtest28-redundant-and-filtered-children-nodes-v{1,2}.so: New binary test inputs. * tests/data/test-diff-filter/test28-redundant-and-filtered-children-nodes-v{0,1}.cc: Source code for the binary test inputs above. * tests/data/test-diff-filter/test28-redundant-and-filtered-children-nodes-report-{0,1}.txt: New test output references. * tests/test-diff-filter.cc (in_out_specs): Add the test inputs above to the set of inputs this test harness has to run over. * tests/data/Makefile.am: Add the test materials above to the source distribution. Signed-off-by: Dodji Seketeli <dodji@redhat.com> |
||
---|---|---|
.. | ||
abg-comp-filter.h | ||
abg-comparison.h | ||
abg-config.h | ||
abg-corpus.h | ||
abg-diff-utils.h | ||
abg-dwarf-reader.h | ||
abg-fwd.h | ||
abg-hash.h | ||
abg-ini.h | ||
abg-ir.h | ||
abg-libxml-utils.h | ||
abg-libzip-utils.h | ||
abg-reader.h | ||
abg-sptr-utils.h | ||
abg-tools-utils.h | ||
abg-traverse.h | ||
abg-version.h.in | ||
abg-viz-common.h | ||
abg-viz-dot.h | ||
abg-viz-svg.h | ||
abg-writer.h | ||
Makefile.am |