libabigail/tests
Giuliano Procida 9cf76b1175 abg-ir.cc: Improve types_have_similar_structure.
This function is used to determine whether or not type differences are
"local" and is primarily used in --leaf-changes-only mode. The logic
has some issues which are addressed by this patch:

    - Any number of points-to (*) and refers-to (& and &&) components
      are peeled off the types being compared, rather than checking
      these match in number and kind.
    - This peeling is done with peel_typedef_pointer_or_reference_type
      which also peels any number of CV qualifiers (OK) and
      array-of ([N]) type components (not OK).
    - The function sets a state variable (was_indirect_type) to modify
      the behaviour of downstream comparisons, but this cannot be
      passed through recursive calls.

The effect of the indirect_type flag is to switch to comparisons by
name: identically named structs don't get introspected. Arguably, a
more useful behaviour for --leaf-changes-only mode would be to treat
any change to a named type as non-local, except in the context of the
definition of that type itself. This would be a more significant
change in behaviour.

	* include/abg-fwd.h (types_have_similar_structure): In both
	overloads, add an indirect_type argument, defaulting to
	false.
	* src/abg-ir.cc (reference_type_def constructor): Tabify.
	(types_have_similar_structure): In both overloads, add an
	indirect_type argument and update documentation text. In the
	type_base_sptr overload, pass indirect_type in the tail
	call. In the type_base* overload, replace was_indirect_type
	with indirect_type; peel CV qualifiers and typedefs without
	testing as the peel function does this; replace the
	indiscriminate peeling of qualifier/pointer/reference/array
	type components with code that checks the same
	pointer/reference/array type component is used on each side
	and makes recursive calls with indirect_type set to true; pass
	the indirect_type argument recursively when comparing other
	subtypes; move the typeid check earlier, document its purpose
	and remove unneccessary checks after later dynamic casts;
	remove an always-true conditional; add a TODO for comparing
	array types more accurately.
	* tests/data/Makefile.am: Add new test case files.
	* tests/data/test-abidiff-exit/test-leaf-peeling-v0.cc: New
	test case.
	* tests/data/test-abidiff-exit/test-leaf-peeling-v1.cc: Ditto.
	* tests/data/test-abidiff-exit/test-leaf-peeling-report.txt:
	Ditto.
	* tests/test-abidiff-exit.cc: Run new test case.

Signed-off-by: Giuliano Procida <gprocida@google.com>
2020-03-26 11:45:03 +01:00
..
data abg-ir.cc: Improve types_have_similar_structure. 2020-03-26 11:45:03 +01:00
lib Testing: add Catch Unit test framework 2020-01-28 17:16:56 +00:00
.gitignore Testing: add Catch Unit test framework 2020-01-28 17:16:56 +00:00
Makefile.am Testing: add Catch Unit test framework 2020-01-28 17:16:56 +00:00
mockfedabipkgdiff.in
print-diff-tree.cc Update copyright year to 2020 2020-02-21 17:05:01 +01:00
runtestcanonicalizetypes.sh.in
runtestdefaultsupprs.py.in
runtestdefaultsupprspy3.sh.in
runtestfedabipkgdiff.py.in
runtestfedabipkgdiffpy3.sh.in
test-abicompat.cc Update copyright year to 2020 2020-02-21 17:05:01 +01:00
test-abidiff-exit.cc abg-ir.cc: Improve types_have_similar_structure. 2020-03-26 11:45:03 +01:00
test-abidiff.cc Update copyright year to 2020 2020-02-21 17:05:01 +01:00
test-alt-dwarf-file.cc Update copyright year to 2020 2020-02-21 17:05:01 +01:00
test-annotate.cc
test-core-diff.cc Update copyright year to 2020 2020-02-21 17:05:01 +01:00
test-diff2.cc Update copyright year to 2020 2020-02-21 17:05:01 +01:00
test-diff-dwarf-abixml.cc Update copyright year to 2020 2020-02-21 17:05:01 +01:00
test-diff-dwarf.cc Update copyright year to 2020 2020-02-21 17:05:01 +01:00
test-diff-filter.cc Update copyright year to 2020 2020-02-21 17:05:01 +01:00
test-diff-pkg.cc Update copyright year to 2020 2020-02-21 17:05:01 +01:00
test-diff-suppr.cc Update copyright year to 2020 2020-02-21 17:05:01 +01:00
test-dot.cc Update copyright year to 2020 2020-02-21 17:05:01 +01:00
test-ini.cc Update copyright year to 2020 2020-02-21 17:05:01 +01:00
test-ir-walker.cc Update copyright year to 2020 2020-02-21 17:05:01 +01:00
test-kmi-whitelist.cc Testing: add Catch Unit test framework 2020-01-28 17:16:56 +00:00
test-lookup-syms.cc dwarf-reader: Fix bloom filter access in GNU_HASH section 2020-03-20 13:35:00 +01:00
test-read-dwarf.cc dwarf-reader: remove superfluous ABG_ASSERT 2020-03-18 23:10:14 +01:00
test-read-write.cc Update copyright year to 2020 2020-02-21 17:05:01 +01:00
test-svg.cc Update copyright year to 2020 2020-02-21 17:05:01 +01:00
test-tools-utils.cc Update copyright year to 2020 2020-02-21 17:05:01 +01:00
test-types-stability.cc Update copyright year to 2020 2020-02-21 17:05:01 +01:00
test-utils.cc Update copyright year to 2020 2020-02-21 17:05:01 +01:00
test-utils.h Update copyright year to 2020 2020-02-21 17:05:01 +01:00
test-valgrind-suppressions.supp
test-write-read-archive.cc Update copyright year to 2020 2020-02-21 17:05:01 +01:00
update-test-output.py