bump for release
[uclibc-ng.git] / test / inet / tst-res.c
blobb65f30fd63791100c5d7316711b72e218e66c042
1 #include <stdlib.h>
2 #include <assert.h>
3 #include <sys/types.h>
4 #include <netinet/in.h>
5 #include <arpa/nameser.h>
6 #include <resolv.h>
7 #include <netdb.h>
9 int main(int argc, char **argv)
11 int r;
12 struct __res_state state;
14 r = res_ninit(&state);
15 if (r) {
16 herror("ninit");
17 abort();
19 r = res_init();
20 if (r) {
21 herror("init");
22 abort();
25 #ifdef __UCLIBC_HAS_BSD_RES_CLOSE__
26 res_close();
27 #endif
28 #ifdef __UCLIBC__
29 /* assume there is at least one resolver configured */
30 assert (state._u._ext.nscount > 0);
31 #else
32 assert (state._u._ext.nscount == 0);
33 #endif
34 assert (state.options & RES_INIT);
35 res_nclose(&state);
36 #ifdef __UCLIBC__
37 /* We wipe the whole thing */
38 assert ((state.options & RES_INIT) == 0);
39 #endif
40 assert (state._u._ext.nscount == 0);
42 return 0;