-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Iterate user table in a sorted way, fix tests with latest glib
This is primarily to help test cases which assume that the adopted algorithm prioritizes the users in the exact reverse order they appear in the test cases (and get inserted into the session in reverse order). With older glib version, the five users being inserted happened to return the order expected by the tests. With latest glib, due to a minor tweak in hashing strategy, the insertion leads to unsorted list leading to failed tests. In addition, GHashTable makes no guarantees about the stability of items when iterating multiple times. Since the algorithm is sensitive to order of users, it is best to return users in an order that is consistent over multiple calls and stable over insert/remove operations. This patch maintains a sorted list of user ids and uses it for iteration. Closes: #22. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
- Loading branch information
1 parent
e09c5b7
commit bd546d0
Showing
1 changed file
with
28 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters