aboutsummaryrefslogtreecommitdiff
path: root/lib/mlibc/tests/posix/inet_ntop.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/inet_ntop.c
parentbd5969fc876a10b18613302db7087ef3c40f18e1 (diff)
build: Build mlibc + add distclean target
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'lib/mlibc/tests/posix/inet_ntop.c')
-rw-r--r--lib/mlibc/tests/posix/inet_ntop.c30
1 files changed, 0 insertions, 30 deletions
diff --git a/lib/mlibc/tests/posix/inet_ntop.c b/lib/mlibc/tests/posix/inet_ntop.c
deleted file mode 100644
index feca26c..0000000
--- a/lib/mlibc/tests/posix/inet_ntop.c
+++ /dev/null
@@ -1,30 +0,0 @@
-#include <arpa/inet.h>
-#include <stdio.h>
-#include <assert.h>
-#include <string.h>
-
-int main() {
- struct in_addr addr;
- addr.s_addr = (1 << 24) |
- (1 << 16) | (1 << 8) | 1;
- char buf[INET_ADDRSTRLEN];
- assert(inet_ntop(AF_INET, &addr, buf, INET_ADDRSTRLEN) != NULL);
- assert(strncmp("1.1.1.1", buf, INET_ADDRSTRLEN) == 0);
-
- struct in6_addr addr2 = { .s6_addr = {0x20, 0x1, 0xd, 0xb8, 0, 0, 0, 0, 0, 0x1, 0, 0, 0, 0, 0, 0x1} };
- char buf2[INET6_ADDRSTRLEN];
- assert(inet_ntop(AF_INET6, &addr2, buf2, INET6_ADDRSTRLEN) != NULL);
- assert(strncmp("2001:db8::1:0:0:1", buf2, INET6_ADDRSTRLEN) == 0);
-
- struct in6_addr addr3 = { .s6_addr = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1} };
- char buf3[INET6_ADDRSTRLEN];
- assert(inet_ntop(AF_INET6, &addr3, buf3, INET6_ADDRSTRLEN) != NULL);
- assert(strncmp("::1", buf3, INET6_ADDRSTRLEN) == 0);
-
- struct in6_addr addr4 = { .s6_addr = {0x20, 0x1, 0xd, 0xb8, 00, 00, 00, 0x1, 00, 0x1, 00, 0x1, 00, 0x1, 00, 0x1} };
- char buf4[INET6_ADDRSTRLEN];
- assert(inet_ntop(AF_INET6, &addr4, buf4, INET6_ADDRSTRLEN) != NULL);
- assert(strncmp("2001:db8:0:1:1:1:1:1", buf4, INET6_ADDRSTRLEN) == 0);
-
- return 0;
-}