summaryrefslogtreecommitdiff
path: root/src/test/test-hashmap.c
AgeCommit message (Collapse)Author
2015-11-16tree-wide: sort includesThomas Hindoe Paaboel Andersen
Sort the includes accoding to the new coding style.
2015-06-17hashmap: allow NULL key in ordered_hashmap_next()Michal Schmidt
There is no reason to require key to be non-NULL. Change test_ordered_hashmap_next() to use trivial_hash_ops in order to test NULL key too.
2015-02-24test-hashmap: fix gcc5 warningDaniel Mack
gcc5 spits out a warning about test-hashmap.c: CC src/test/test-hashmap.o src/test/test-hashmap.c: In function ‘test_string_compare_func’: src/test/test-hashmap.c:76:79: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]
2015-02-23remove unused includesThomas Hindoe Paaboel Andersen
This patch removes includes that are not used. The removals were found with include-what-you-use which checks if any of the symbols from a header is in use.
2014-10-23test: generate tests for OrderedHashmap from Hashmap testsMichal Schmidt
test-hashmap-ordered.c is generated from test-hashmap-plain.c simply by substituting "ordered_hashmap" for "hashmap" etc. In the cases where tests rely on the order of entries, a distinction between plain and ordered hashmaps is made using the ORDERED macro, which is defined only for test-hashmap-ordered.c.
2014-10-04test: only use assert_seThomas Hindoe Paaboel Andersen
The asserts used in the tests should never be allowed to be optimized away
2014-10-01tests: add tests for {hashmap,set}_steal_firstZbigniew Jędrzejewski-Szmek
Just to make sure that coverity is wrong.
2014-09-15hashmap, set: remove unused functionsMichal Schmidt
The following hashmap_* and set_* functions/macros have never had any users in systemd's history: *_iterate_backwards *_iterate_skip *_last *_FOREACH_BACKWARDS Remove this dead code.
2014-09-15hashmap: introduce hash_ops to make struct Hashmap smallerMichal Schmidt
It is redundant to store 'hash' and 'compare' function pointers in struct Hashmap separately. The functions always comprise a pair. Store a single pointer to struct hash_ops instead. systemd keeps hundreds of hashmaps, so this saves a little bit of memory.
2014-06-16tests: add tests to test-hashmapRonny Chevalier
add tests for: - hashmap_remove_and_put - hashmap_first_key - hashmap_last - hashmap_steal_first_key - hashmap_clear_free_free
2013-10-01hashmap: size hashmap bucket array dynamicallyLennart Poettering
Instead of fixing the hashmap bucket array to 127 entries dynamically size it, starting with a smaller one of 31. As soon as a fill level of 75% is reached, quadruple the size, and so on. This should siginficantly optimize the lookup time in large tables (from O(n) back to O(1)), and save memory on smaller tables (which most are).
2013-09-26test-hashmap: fix access to uninitialized memoryZbigniew Jędrzejewski-Szmek
2013-05-03test-hashmap.c: add unit-test for hashmapDaniel Buch