INN 2.5.3 release candidate

Julien ÉLIE julien at trigofacile.com
Sat Oct 15 19:03:58 UTC 2011


> (I don't see 
> any way to do this with ok_string() but I guess we could just do the 
> string comparisons directly inside of an ok().)

I see for instance in tests/lib/hashtab-t.c that we use:
    ok(20, word != NULL && !strcmp("testing", word));

so with your suggestion, tests/lib/getnameinfo-t.c could use for STABLE:

--- getnameinfo-t.c	(révision 9381)
+++ getnameinfo-t.c	(copie de travail)
@@ -63,7 +63,8 @@
     status = test_getnameinfo(sa, sizeof(sin), NULL, 0, service,
                               sizeof(service), NI_DGRAM);
     ok_int(13, 0, status);
-    ok_string(14, "biff", service);
+    ok(14, service != NULL &&
+       (!strcmp("biff", service) || !strcmp("comsat", service)));
     status = test_getnameinfo(sa, sizeof(sin), node, sizeof(node), NULL, 0,
                               NI_NUMERICHOST);
     ok_int(15, 0, status);




For CURRENT (and in fact for rra-c-util), it could be:

--- getnameinfo-t.c	(révision 9380)
+++ getnameinfo-t.c	(copie de travail)
@@ -99,7 +99,9 @@
     if (serv == NULL)
         skip("biff service not found");
     else
-        is_string("biff", service, "...and found biff");
+        ok(service != NULL &&
+           (!strcmp("biff", service) || !strcmp("comsat", service)),
+           "...and found either biff or comsat");
     status = test_getnameinfo(sa, sizeof(sin), node, sizeof(node), NULL, 0,
                               NI_NUMERICHOST);
     is_int(0, status, "lookup with NI_NUMERICHOST");


-- 
Julien ÉLIE

« Deficiente uino, deficit omne. »



More information about the inn-workers mailing list