aboutsummaryrefslogtreecommitdiff
path: root/lib/mlibc/tests/posix/string.c
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-03-07 17:28:52 -0500
committerIan Moffett <ian@osmora.org>2024-03-07 18:24:51 -0500
commitf5e48e94a2f4d4bbd6e5628c7f2afafc6dbcc459 (patch)
tree93b156621dc0303816b37f60ba88051b702d92f6 /lib/mlibc/tests/posix/string.c
parentbd5969fc876a10b18613302db7087ef3c40f18e1 (diff)
build: Build mlibc + add distclean target
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'lib/mlibc/tests/posix/string.c')
-rw-r--r--lib/mlibc/tests/posix/string.c29
1 files changed, 0 insertions, 29 deletions
diff --git a/lib/mlibc/tests/posix/string.c b/lib/mlibc/tests/posix/string.c
deleted file mode 100644
index 9c6e036..0000000
--- a/lib/mlibc/tests/posix/string.c
+++ /dev/null
@@ -1,29 +0,0 @@
-#include <string.h>
-#include <assert.h>
-
-int main() {
- char buf[4];
-
- // stpncpy
- assert(stpncpy(buf, "", 4) == buf);
- assert(!strcmp(buf, ""));
-
- assert(stpncpy(buf, "123", 4) == buf + 3);
- assert(!strcmp(buf, "123"));
-
- assert(stpncpy(buf, "12", 4) == buf + 2);
- assert(buf[0] == '1' && buf[1] == '2' && buf[2] == '\0' && buf[3] == '\0');
-
- assert(stpncpy(buf, "123456", 4) == buf + 4);
- assert(buf[0] == '1' && buf[1] == '2' && buf[2] == '3' && buf[3] == '4');
-
- // stpcpy
- assert(stpcpy(buf, "") == buf);
- assert(!strcmp(buf, ""));
-
- assert(stpcpy(buf, "12") == buf + 2);
- assert(!strcmp(buf, "12"));
-
- assert(stpcpy(buf, "123") == buf + 3);
- assert(!strcmp(buf, "123"));
-}