From 15d1e90af513f62318511e7896bf8e1806beee26 Mon Sep 17 00:00:00 2001 From: Michal Bloch Date: Wed, 23 Jan 2019 21:17:14 +0100 Subject: [PATCH] tests: reinstate 100% libdlog coverage Change-Id: I993a5d6d36f5ebc5fc6220cc74988eeb4de7e808 Signed-off-by: Michal Bloch --- src/tests/limiter.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/tests/limiter.c b/src/tests/limiter.c index 5649ab1..883fb7a 100644 --- a/src/tests/limiter.c +++ b/src/tests/limiter.c @@ -246,6 +246,18 @@ int main() __log_limiter_destroy(); __log_limiter_initialize(&r5); + // empty tag never gets blocked + struct rule block_all = { + .prio = '*', + .hash = util_hash_key("*", '*'), + .tag = "*", + .limit = 0, + }; + __log_limiter_destroy(); + __log_limiter_initialize(&block_all); + assert(__log_limiter_pass_log("tag", 'W') == 0); + assert(__log_limiter_pass_log("", 'W') == 1); + log_config_free(&conf); __log_limiter_destroy(); } -- 2.7.4