summaryrefslogtreecommitdiffstats
path: root/tests/data/test-abidiff/test-enum0-report.txt
diff options
context:
space:
mode:
authorDodji Seketeli <dodji@redhat.com>2022-01-14 10:11:41 +0100
committerDodji Seketeli <dodji@redhat.com>2022-01-14 10:45:29 +0100
commit85694917418060370ed012954e7cce9b3109a260 (patch)
treeee084bd77b483ed7d4c4dc2ae00fe34be8110ee8 /tests/data/test-abidiff/test-enum0-report.txt
parentHandle several variants of Python 'imp', 'importlib' modules (diff)
downloadlibabigail-85694917418060370ed012954e7cce9b3109a260.tar.gz
libabigail-85694917418060370ed012954e7cce9b3109a260.tar.bz2
libabigail-85694917418060370ed012954e7cce9b3109a260.tar.xz
Bug 28319 - re-fix of rhbz1951526 - SELF CHECK FAILED for 'gimp-2.10'
This commit re-visit the commit below: commit 1cfbff1b3037d1049bdff7e86de27c3a86af23b3 Author: Dodji Seketeli <dodji@redhat.com> Date: Mon Jun 7 16:07:50 2021 +0200 rhbz1951526 - SELF CHECK FAILED for 'gimp-2.10' This is a fix for bug https://bugzilla.redhat.com/show_bug.cgi?id=1951526. Basically, this commits makes is so that two enums below are considered equal by libabigail: enum foo // This is foo #1 { e0 = 0; e1 = 1; e2 = 2; }; enum foo // This is foo #2 { e0 = 0; e1 = 1; e2 = 2; e_added = 1; // This enumerator is considered redundant // with the enumerator e1 because their values // are the same. }; With this patch, foo #1 and foo #2 are considered equal, just like in the original commit 1cfbff1b. In the original commit however, this was achieved by comparing the enums without considering their enumerator names. This was named "binary-only enum comparison". In reality, that approach was too big of a hammer and was causing the issues raised in the bug. Namely, type canonicalization would conflate anonymous enums that were unrelated (precisely because their enumerator names were different), leading to spurious type change reports when comparing abixml files pre-dating commit 1cfbff1b with posterior abixml files. If I refer to the example above with foo #1 and #2, this patch detects that the value of the enumerator 'e_added' is redundant with the value of the enumerator e1. As such, the two foo #1 and #2 are considered equal. Enumerator names are now fully taken into account. With this precise approach, it now seems we can do away with the careful dance of using "binary-only enum comparison" at some precise times of the libabigail pipeline. Now, we can just use the new enum comparison scheme all the time. Leading to less (complicated) code and a hopefully accurate representation. * include/abg-ir.h (environment::use_enum_binary_only_equality): Remove. * src/abg-comparison.cc (compute_diff): In the overload for enum_type_decl, stop using binary-only-equality for enums. * src/abg-dwarf-reader.cc (read_context::compare_before_canonicalisation): Likewise. * src/abg-ir.cc (environment::use_enum_binary_only_equality): Remove. (enumerators_values_are_equal) (is_enumerator_value_present_in_enum) (is_enumerator_value_redundant): Define new static functions. (equals): In the overload for enum_type_decl, use the new is_enumerator_value_redundant to detect if two enums are equal modulo a redundant enumerator value. In that case, consider they are equal. * tests/data/test-abidiff/test-enum0-report.txt: Adjust. * tests/data/test-annotate/test-anonymous-members-0.o.abi: Likewise. * tests/data/test-annotate/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Likewise. * tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi: Likewise. * tests/data/test-diff-dwarf/PR25058-liblttng-ctl-report-1.txt: Likewise. * tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Likewise. * tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi: Likewise. * tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi: Likewise. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
Diffstat (limited to 'tests/data/test-abidiff/test-enum0-report.txt')
-rw-r--r--tests/data/test-abidiff/test-enum0-report.txt11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/data/test-abidiff/test-enum0-report.txt b/tests/data/test-abidiff/test-enum0-report.txt
index e69de29b..e6aad7aa 100644
--- a/tests/data/test-abidiff/test-enum0-report.txt
+++ b/tests/data/test-abidiff/test-enum0-report.txt
@@ -0,0 +1,11 @@
11 changed type:
2 'enum E' changed:
3 type size hasn't changed
4 1 enumerator deletion:
5 'E::e2' value '1'
6 1 enumerator insertion:
7 'E::e1' value '1'
81 changed declaration:
9 'function void foo(E)' was changed to 'function void foo(E)':
10 parameter 1 of type 'enum E' has sub-type changes:
11 enum type 'enum E' changed, as reported earlier