summaryrefslogtreecommitdiff
path: root/src/test/test-hashmap-plain.c
AgeCommit message (Collapse)Author
2015-06-14hashmap: fix iterators to not skip entriesDavid Herrmann
Currently, the HASHMAP iterators stop at the first NULL entry in a hashmap. This is non-obvious and breaks users like sd-device, which legitimately store NULL values in a hashmap. Fix all the iterators by taking a pointer to the value storage, instead of returning it. The iterators now return a boolean that tells whether the end of the list was reached. Current users of HASHMAP_FOREACH() are *NOT* changed to explicitly check for NULL. If it turns out, there were users that inserted NULL into hashmaps, but didn't properly check for it during iteration, then we really want to find those and fix them.
2015-05-19test-hashmap: fix an assertThomas Hindoe Paaboel Andersen
CID#1299016
2015-01-14test: hashmap_put behaviour for equal keysMartin Pitt
Check string ops hashmap_put() for keys with a different pointer but the same value.
2014-11-05test: hashmap-plain - make coverity happyTom Gundersen
Check return value of hashmap_ensure_allocated(). CID#1250807.
2014-11-04test: use assert_se in test_hashmap_moveMichal Schmidt
2014-10-30test: test a corner case in hashmap_remove_and_replace()Michal Schmidt
2014-10-30test: adjust max load factor in test_hashmap_many()Michal Schmidt
A reimplementation of hashmaps will follow and it will use 0.8.
2014-10-23hashmap: allow hashmap_move() to failMichal Schmidt
It cannot fail in the current hashmap implementation, but it may fail in alternative implementations (unless a sufficiently large reservation has been placed beforehand).
2014-10-23test: add test for hashmap_reserve()Michal Schmidt
2014-10-23test: add and improve hashmap testsMichal Schmidt
Test more corner cases and error states in several tests. Add new tests for: hashmap_move hashmap_remove hashmap_remove2 hashmap_remove_value hashmap_remove_and_replace hashmap_get2 hashmap_first In test_hashmap_many additionally test with an intentionally bad hash function.
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.