path: root/tests/data/test-abidiff/test-enum0-report.txt
diff options
authorDodji Seketeli <>2022-01-14 10:11:41 +0100
committerDodji Seketeli <>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)
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 <> Date: Mon Jun 7 16:07:50 2021 +0200 rhbz1951526 - SELF CHECK FAILED for 'gimp-2.10' This is a fix for bug 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/ (compute_diff): In the overload for enum_type_decl, stop using binary-only-equality for enums. * src/ (read_context::compare_before_canonicalisation): Likewise. * src/ (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/ Likewise. * tests/data/test-annotate/ Likewise. * tests/data/test-diff-dwarf/PR25058-liblttng-ctl-report-1.txt: Likewise. * tests/data/test-read-dwarf/ Likewise. * tests/data/test-read-dwarf/ Likewise. * tests/data/test-read-dwarf/ Likewise. Signed-off-by: Dodji Seketeli <>
Diffstat (limited to 'tests/data/test-abidiff/test-enum0-report.txt')
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