aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libc/test/run-memops-test.c6
-rw-r--r--libc/test/run-memops.c4
2 files changed, 10 insertions, 0 deletions
diff --git a/libc/test/run-memops-test.c b/libc/test/run-memops-test.c
index c848a1d..41c624f 100644
--- a/libc/test/run-memops-test.c
+++ b/libc/test/run-memops-test.c
@@ -46,6 +46,7 @@
int test_memset(char* buf, int c, size_t s);
int test_memchr(const void *ptr, int c, size_t n, void* expected);
int test_memcmp(const void *ptr1, const void *ptr2, size_t n, int expected);
+int test_strcmp(const void *ptr1, const void *ptr2, int expected);
int test_memset(char* buf, int c, size_t s)
{
@@ -69,3 +70,8 @@ int test_memcmp(const void *ptr1, const void *ptr2, size_t n, int expected)
{
return(expected == memcmp(ptr1, ptr2, n));
}
+
+int test_strcmp(const void *ptr1, const void *ptr2, int expected)
+{
+ return(expected == strcmp(ptr1, ptr2));
+}
diff --git a/libc/test/run-memops.c b/libc/test/run-memops.c
index ded21ae..259c4ff 100644
--- a/libc/test/run-memops.c
+++ b/libc/test/run-memops.c
@@ -24,6 +24,7 @@
int test_memset(char* buf, int c, size_t s);
int test_memchr(const void *ptr, int c, size_t n, void* expected);
int test_memcmp(const void *ptr1, const void *ptr2, size_t n, int expected);
+int test_strcmp(const void *ptr1, const void *ptr2, int expected);
int main(void)
{
@@ -49,6 +50,9 @@ int main(void)
assert(test_memcmp(buf, "Hello World!", strlen(buf), 0));
assert(test_memcmp(buf, "Hfllow World", strlen(buf), -1));
+
+ assert(test_strcmp(buf, "Hello World!", 0));
+ assert(test_strcmp(buf, "Hfllow World", -1));
free(buf);
return 0;