From 7d5af223cf884116423a24a287755c43e74b6f37 Mon Sep 17 00:00:00 2001 From: Gediminas Jakutis Date: Mon, 21 Oct 2019 17:11:43 +0300 Subject: test: rin_warn is now covered. Signed-off-by: Gediminas Jakutis --- test/diagnostic.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/diagnostic.c b/test/diagnostic.c index 8f2659e..dbd583a 100644 --- a/test/diagnostic.c +++ b/test/diagnostic.c @@ -84,7 +84,19 @@ static int err_test(void) static int warn_test(void) { - return 77; + size_t i; + int usearg; + int ret; + + static const char *in[] = {"", "test", "test number is %zu", "%zu tests ran"}; + static const char *expected[] = {"warning:\n", "warning:test\n", "warning:test number is 3\n", "warning:4 tests ran\n"}; + + for (i = 0; i < arrlen(in); ++i) { + usearg = i < (arrlen(in) / 2) ? 0 : 1; + ret = test_default_channels(in[i], expected[i], i, usearg, rin_warn); + } + + return ret; } static int fixme_test(void) -- cgit v1.2.3