1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-07 09:56:51 +03:00
Commit Graph

8 Commits

Author SHA1 Message Date
Tom Gundersen
61c8175021 test: hashmap-plain - make coverity happy
Check return value of hashmap_ensure_allocated().

CID#1250807.
2014-11-05 16:54:22 +01:00
Michal Schmidt
e80afdb3e4 test: use assert_se in test_hashmap_move 2014-11-04 17:05:01 +01:00
Michal Schmidt
e1323fbfbe test: test a corner case in hashmap_remove_and_replace() 2014-10-30 19:50:51 +01:00
Michal Schmidt
ce79279bff test: adjust max load factor in test_hashmap_many()
A reimplementation of hashmaps will follow and it will use 0.8.
2014-10-30 19:50:51 +01:00
Michal Schmidt
7ad63f57b6 hashmap: allow hashmap_move() to fail
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-23 17:38:02 +02:00
Michal Schmidt
8f88aed740 test: add test for hashmap_reserve() 2014-10-23 17:38:02 +02:00
Michal Schmidt
9ba81d5a61 test: add and improve hashmap tests
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-23 17:38:02 +02:00
Michal Schmidt
32a4456cc2 test: generate tests for OrderedHashmap from Hashmap tests
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-23 17:38:02 +02:00