diff options
author | dzwdz | 2022-03-06 17:59:02 +0100 |
---|---|---|
committer | dzwdz | 2022-03-06 17:59:02 +0100 |
commit | 34f4a68a41c27ff2d40c7fd6b168d40aa3481250 (patch) | |
tree | 615bc7dd96b1f354466fdc259f96897fe074b0eb /src/kernel/tests/util.c | |
parent | 970b5b7c6a7778579a4398cdb8d0bfb6bcd33da1 (diff) |
shared: add strcmp() testcases, fix invalid implementation
Diffstat (limited to 'src/kernel/tests/util.c')
-rw-r--r-- | src/kernel/tests/util.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/kernel/tests/util.c b/src/kernel/tests/util.c index 05bba24..e7dcb82 100644 --- a/src/kernel/tests/util.c +++ b/src/kernel/tests/util.c @@ -22,6 +22,15 @@ TEST(memcmp) { TEST_COND(0 < memcmp("654", "555", 3)); } +TEST(strcmp) { + TEST_COND(0 == strcmp("string", "string")); + TEST_COND(0 > strcmp("str", "string")); + TEST_COND(0 < strcmp("string", "str")); + + TEST_COND(0 != strcmp("stress", "string")); +} + void tests_utils(void) { TEST_RUN(memcmp); + TEST_RUN(strcmp); } |