After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 478595 - atk_state_set_or_sets returns an empty set rather than NULL
atk_state_set_or_sets returns an empty set rather than NULL
Status: RESOLVED FIXED
Product: atk
Classification: Platform
Component: atk
1.9.x
Other Windows
: High normal
: ---
Assigned To: Li Yuan
Li Yuan
Depends on:
Blocks:
 
 
Reported: 2007-09-20 13:33 UTC by Andrey Tsyvarev
Modified: 2008-11-11 07:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (480 bytes, patch)
2008-11-10 10:45 UTC, Li Yuan
committed Details | Review

Description Andrey Tsyvarev 2007-09-20 13:33:18 UTC
atk_state_set_or_sets returns an empty set when called for empty sets. 

The documentation requires that atk_state_set_or_sets returns NULL if the union of the sets is empty.

The detailed bug description can be found at: 

http://linuxtesting.org/results/report?num=S0574
Comment 1 Li Yuan 2008-11-07 08:12:41 UTC
The function will return NULL if anyone of the stateset is NULL. And if AtkState is 0, it means ATK_STATE_INVALID, not empty.
Comment 2 Andrey Tsyvarev 2008-11-07 10:01:47 UTC
> And if AtkState is 0, it means ATK_STATE_INVALID, not empty.
I mean atk_state_set_new(), which, according to the documentation, creates empty stateset.
This stateset is really empty, because atk_state_set_and_sets() returns NULL, if its both arguments are atk_state_set_new().

But for the same arguments atk_state_set_or_sets() returns not NULL, that is strange.

Comment 3 Li Yuan 2008-11-07 12:34:39 UTC
Right, I will see what to do.
Comment 4 Li Yuan 2008-11-10 10:45:02 UTC
Created attachment 122316 [details] [review]
patch
Comment 5 Li Yuan 2008-11-11 07:23:05 UTC
2008-11-10  Li Yuan  <li.yuan@sun.com>

        * atk/atkobject.c: (atk_object_remove_relationship):
        Bug #477708. Only remove the target, not the relation if
        there are still are targets.
        * atk/atkrelation.c: (atk_relation_remove_target):
        * atk/atkrelation.h: New API.
        * atk/atkrelationset.c: (atk_relation_set_add),
        (atk_relation_set_remove):
        Add/remove the new relation's targets to/from the existed
        relation if there has been a relation with the same type.
        * atk/atkstateset.c: (atk_state_set_or_sets):
        Bug #478595. Return NULL if sets are empty.