summaryrefslogtreecommitdiffstats
path: root/src/tests
diff options
context:
space:
mode:
authorMichael Brown2021-05-18 12:45:24 +0200
committerMichael Brown2021-05-18 12:45:24 +0200
commit661093054bcfae16d79404304d6f8318baf1231e (patch)
treebecc12c5729556998fe5c2b19515b58d5f7e6710 /src/tests
parent[bnxt] Use hexadecimal values in PCI_ROM entries (diff)
downloadipxe-661093054bcfae16d79404304d6f8318baf1231e.tar.gz
ipxe-661093054bcfae16d79404304d6f8318baf1231e.tar.xz
ipxe-661093054bcfae16d79404304d6f8318baf1231e.zip
[libc] Add strncasecmp()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/string_test.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/tests/string_test.c b/src/tests/string_test.c
index 88a730aec..3afb8deb2 100644
--- a/src/tests/string_test.c
+++ b/src/tests/string_test.c
@@ -105,6 +105,14 @@ static void string_test_exec ( void ) {
ok ( strcasecmp ( "Uncle", "Uncle Jack" ) != 0 );
ok ( strcasecmp ( "not", "equal" ) != 0 );
+ /* Test strncasecmp() */
+ ok ( strncasecmp ( "", "", 0 ) == 0 );
+ ok ( strncasecmp ( "", "", 73 ) == 0 );
+ ok ( strncasecmp ( "Uncle Jack", "Uncle jack", 47 ) == 0 );
+ ok ( strncasecmp ( "Uncle Jack", "Uncle jake", 47 ) != 0 );
+ ok ( strncasecmp ( "Uncle Jack", "Uncle jake", 9 ) != 0 );
+ ok ( strncasecmp ( "Uncle Jack", "Uncle jake", 8 ) == 0 );
+
/* Test memcmp() */
ok ( memcmp ( "", "", 0 ) == 0 );
ok ( memcmp ( "Foo", "Foo", 3 ) == 0 );