clean up dn_expand-empty regression test
authorSzabolcs Nagy <nsz@port70.net>
Wed, 27 Aug 2014 12:46:42 +0000 (14:46 +0200)
committerSzabolcs Nagy <nsz@port70.net>
Wed, 27 Aug 2014 12:46:42 +0000 (14:46 +0200)
src/regression/dn_expand-empty.c

index 62c52e3..130194c 100644 (file)
@@ -1,4 +1,5 @@
 // dn_expand should accept empty name (single \0)
+#define _BSD_SOURCE
 #include <resolv.h>
 #include "test.h"
 
@@ -7,10 +8,12 @@ int main(void)
        unsigned char packet[] = "";
        char name[] = "x";
        int r;
+
        r = dn_expand(packet, packet+1, packet, name, 1);
        if (r!=1)
-               t_error("__dn_expand(\"\") returned %d, wanted 1\n", r);
-       if (*name)
-               t_error("__dn_expand(\"\") failed: got \"%s\" wanted \"\"\n", name);
+               t_error("dn_expand(\"\", name, 1) returned %d, wanted 1\n", r);
+       if (name[0])
+               t_error("dn_expand(\"\", name, 1) failed: got \"%s\" name, wanted \"\"\n", name);
+
        return t_status;
 }