From 13ffe87d1053a77b262e98640bc7d32e72a22242 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Thu, 22 Aug 2019 22:26:07 +0200 Subject: [PATCH] tests: Update unit test for string functions Signed-off-by: Joachim Nilsson --- tests/str.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/str.c b/tests/str.c index 26937f5..be1e512 100644 --- a/tests/str.c +++ b/tests/str.c @@ -2,18 +2,26 @@ int main(void) { + char buf[10]; int val; val = atonum("42"); if (val != 42) return 1; - + if (!string_match("eth1", "eth1234")) return 1; if (string_compare("eth1", "eth1234")) return 1; + if (!string_case_compare("somestring", "SoMeSTRING")) + return 1; + + strlcpy(buf, "tooloongstring", sizeof(buf)); + if (buf[9] == 'r') + return 1; + return 0; }