mirror of
https://github.com/troglobit/libite.git
synced 2026-10-02 05:42:49 +07:00
tests: Update unit test for string functions
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
+9
-1
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user