12 #include <sys/socket.h>
13 #include <netinet/in.h>
14 #include <arpa/inet.h>
17 static void test_nwrap_gethostent(void **state)
22 (void)state; /* unused */
26 for (he = gethostent(); he != NULL; he = gethostent()) {
27 assert_non_null(he->h_addr_list);
28 assert_non_null(he->h_aliases);
30 for (i = 0; he->h_addr_list[i] != NULL; i++) {
31 char buf[INET6_ADDRSTRLEN];
35 ip = inet_ntop(he->h_addrtype,
40 printf("ip: %s\n", ip);
42 for (j = 0; he->h_aliases[j] != NULL; j++) {
43 printf("alias: %s\n", he->h_aliases[j]);
54 const struct CMUnitTest tests[] = {
55 cmocka_unit_test(test_nwrap_gethostent),
58 rc = cmocka_run_group_tests(tests, NULL, NULL);