functional: add mntent test
[libc-test.git] / src / regression / dn_expand-empty.c
blob2afe634de0e9411bdc51d0496d9b89910b54032b
1 // dn_expand should accept empty name (single \0)
2 #define _DEFAULT_SOURCE 1
3 #define _BSD_SOURCE 1
4 #include <resolv.h>
5 #include "test.h"
7 int main(void)
9 unsigned char packet[] = "";
10 char name[] = "XX";
11 int r;
13 /* empty name in packet */
14 r = dn_expand(packet, packet+1, packet, name, 1);
15 if (r!=1)
16 t_error("dn_expand(\"\", name, 1) returned %d, wanted 1\n", r);
17 if (name[0])
18 t_error("dn_expand(\"\", name, 1) failed: got \"%s\" name, wanted \"\"\n", name);
20 return t_status;