aboutsummaryrefslogtreecommitdiff
path: root/lib/mlibc/tests/posix/if_indextoname.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/mlibc/tests/posix/if_indextoname.c')
-rw-r--r--lib/mlibc/tests/posix/if_indextoname.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/mlibc/tests/posix/if_indextoname.c b/lib/mlibc/tests/posix/if_indextoname.c
new file mode 100644
index 0000000..15dc12a
--- /dev/null
+++ b/lib/mlibc/tests/posix/if_indextoname.c
@@ -0,0 +1,11 @@
+#include <assert.h>
+#include <net/if.h>
+#include <stdio.h>
+
+int main() {
+ char name[IF_NAMESIZE];
+
+ assert(name == if_indextoname(1, name));
+ printf("test: name '%s'\n", name);
+ assert(1 == if_nametoindex(name));
+}