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 order they appear in the test cases (and get inserted into the session in that order). With older glib version, the five users being inserted into the user table hash table by the tests happened to retain the order. With latest glib, due to a minor tweak in hashing strategy, the order of iteration is different from the order of insertion failing the 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 sorts the keys during iteration of users in the user table. Closes: gobby#22. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
- Loading branch information