Mild decrufting in resolv code.
[glibc.git] / misc / tst-mntent2.c
blob6c25e0127c9e7d20155b1a4b3a688e03a8a6d6a4
1 #include <mntent.h>
2 #include <stdio.h>
3 #include <string.h>
6 int
7 main (void)
9 int result = 0;
10 struct mntent mef;
12 mef.mnt_fsname = strdupa ("/dev/sdf6");
13 mef.mnt_dir = strdupa ("/some dir");
14 mef.mnt_type = strdupa ("ext3");
15 mef.mnt_opts = strdupa ("opt1,opt2,noopt=6,rw,norw,brw");
16 mef.mnt_freq = 1;
17 mef.mnt_passno = 2;
19 #define TEST(opt, found) \
20 if (!!hasmntopt (&mef, (opt)) != (found)) \
21 { \
22 printf ("Option %s was %sfound\n", (opt), (found) ? "not " : ""); \
23 result = 1; \
26 TEST ("opt1", 1)
27 TEST ("opt2", 1)
28 TEST ("noopt", 1)
29 TEST ("rw", 1)
30 TEST ("norw", 1)
31 TEST ("brw", 1)
32 TEST ("opt", 0)
33 TEST ("oopt", 0)
34 TEST ("w", 0)
35 TEST ("r", 0)
36 TEST ("br", 0)
37 TEST ("nor", 0)
38 TEST ("or", 0)
40 return result;