chiark / gitweb /
document new choose screen properly
[disorder] / lib / t-addr.c
index 8b7314d091642e87eaa2e32f9a907c4e5ffffdee..0e495d8158a561242b012764910ca8c6440980b4 100644 (file)
@@ -19,7 +19,7 @@
  */
 #include "test.h"
 
-void test_addr(void) {
+static void test_addr(void) {
   struct stringlist a;
   const char *s[3];
   struct addrinfo *ai;
@@ -29,14 +29,9 @@ void test_addr(void) {
   struct sockaddr_un su;
 
   static const struct addrinfo pref = {
-    AI_PASSIVE,
-    PF_INET,
-    SOCK_STREAM,
-    0,
-    0,
-    0,
-    0,
-    0
+    .ai_flags = AI_PASSIVE,
+    .ai_family = PF_INET,
+    .ai_socktype = SOCK_STREAM,
   };
 
   struct sockaddr_in a1 = {
@@ -63,8 +58,6 @@ void test_addr(void) {
     .ai_addr = (struct sockaddr *)&a2,
   };
 
-  printf("test_addr\n");
-
   insist(addrinfocmp(&p1, &p2) < 0);
 
   a.n = 1;
@@ -137,6 +130,8 @@ void test_addr(void) {
   check_integer(multicast((struct sockaddr *)&su), 0);
 }
 
+TEST(addr);
+
 /*
 Local Variables:
 c-basic-offset:2