From a9d687e77059e801e956e7b7bb59637aa4708483 Mon Sep 17 00:00:00 2001 From: Andrew Clayton Date: Tue, 24 Sep 2024 14:55:04 +0100 Subject: src/test: Add an extra test case to nxt_term_parse_test.c The function nxt_term_parse() is able to take strings with trailing whitespace e.g. "1w1d ", add a test case to cover such things. Signed-off-by: Andrew Clayton --- src/test/nxt_term_parse_test.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/test') diff --git a/src/test/nxt_term_parse_test.c b/src/test/nxt_term_parse_test.c index 83ae4931..ceae3fe5 100644 --- a/src/test/nxt_term_parse_test.c +++ b/src/test/nxt_term_parse_test.c @@ -23,6 +23,7 @@ static const nxt_term_parse_test_t terms[] = { { nxt_string("1w d"), 0, -1 }, { nxt_string("w"), 0, -1 }, { nxt_string("1d 1w"), 0, -1 }, + { nxt_string("1 "), 1, 1 }, { nxt_string("25d"), 0, -2 }, { nxt_string("300"), 1, 300 }, { nxt_string("300"), 0, 300000 }, -- cgit From 9f6f48661c7fec42bb9ebeeec4d7828e37b786bd Mon Sep 17 00:00:00 2001 From: Andrew Clayton Date: Sat, 26 Oct 2024 03:34:43 +0100 Subject: src/test: Fix missing parameter to nxt_log_alert() in nxt_base64_test() nxt_log_alert() was missing the nxt_str_t parameter as required by the %V format specifier. This was found with the Unit clang-ast plugin. Fixes: 7bf625394 ("Custom implementation of Base64 decoding function.") Signed-off-by: Andrew Clayton --- src/test/nxt_base64_test.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/test') diff --git a/src/test/nxt_base64_test.c b/src/test/nxt_base64_test.c index 13a772b6..579cbf95 100644 --- a/src/test/nxt_base64_test.c +++ b/src/test/nxt_base64_test.c @@ -87,7 +87,8 @@ nxt_base64_test(nxt_thread_t *thr) ret = nxt_base64_decode(buf, tests[i].enc.start, tests[i].enc.length); if (!nxt_str_eq(&tests[i].dec, buf, (size_t) ret)) { - nxt_log_alert(thr->log, "nxt_base64_decode() test \"%V\" failed"); + nxt_log_alert(thr->log, "nxt_base64_decode() test \"%V\" failed", + &tests[i].enc); return NXT_ERROR; } } -- cgit