aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-12-18 11:33:52 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-12-18 12:04:04 +0100
commit32ca29115e20c9ec772570bda3b326cacafacc52 (patch)
treeaaf6846c9f435bde655040cfde45bad197bb48f1 /src/test/test-hashmap.c
parenthashmap: use ternary op to shorten code (diff)
downloadsystemd-32ca29115e20c9ec772570bda3b326cacafacc52.tar.gz
systemd-32ca29115e20c9ec772570bda3b326cacafacc52.tar.bz2
systemd-32ca29115e20c9ec772570bda3b326cacafacc52.zip
test-hashmap: use the usual function headers and print timing stats
This makes it slightly easier to watch for performance changes.
Diffstat (limited to 'src/test/test-hashmap.c')
-rw-r--r--src/test/test-hashmap.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/test/test-hashmap.c b/src/test/test-hashmap.c
index d525ba770..6f29266d6 100644
--- a/src/test/test-hashmap.c
+++ b/src/test/test-hashmap.c
@@ -10,6 +10,8 @@ static void test_ordered_hashmap_next(void) {
_cleanup_ordered_hashmap_free_ OrderedHashmap *m = NULL;
int i;
+ log_info("/* %s */", __func__);
+
assert_se(m = ordered_hashmap_new(NULL));
for (i = -2; i <= 2; i++)
assert_se(ordered_hashmap_put(m, INT_TO_PTR(i), INT_TO_PTR(i+10)) == 1);
@@ -32,6 +34,8 @@ static void test_hashmap_free_with_destructor(void) {
struct Item items[4] = {};
unsigned i;
+ log_info("/* %s */", __func__);
+
assert_se(m = hashmap_new(NULL));
for (i = 0; i < ELEMENTSOF(items) - 1; i++)
assert_se(hashmap_put(m, INT_TO_PTR(i), items + i) == 1);
@@ -87,6 +91,8 @@ static void test_iterated_cache(void) {
Hashmap *m;
IteratedCache *c;
+ log_info("/* %s */", __func__);
+
assert_se(m = hashmap_new(NULL));
assert_se(c = hashmap_iterated_cache_new(m));
compare_cache(m, c);
@@ -122,6 +128,8 @@ static void test_iterated_cache(void) {
static void test_path_hashmap(void) {
_cleanup_hashmap_free_ Hashmap *h = NULL;
+ log_info("/* %s */", __func__);
+
assert_se(h = hashmap_new(&path_hash_ops));
assert_se(hashmap_put(h, "foo", INT_TO_PTR(1)) >= 0);