1 /* 2 * Copyright (c) Sylvestre Gallon <ccna.syl@gmail.com> 3 * 4 * Permission to use, copy, modify, and distribute this software for any 5 * purpose with or without fee is hereby granted, provided that the above 6 * copyright notice and this permission notice appear in all copies. 7 * 8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 */ 16 17 #include <string.h> 18 #include <fuse_opt.h> 19 20 int 21 main(int ac, char **av) 22 { 23 char *opt = NULL; 24 char *opt2; 25 26 opt2 = strdup("-a,--bc,01234,-56789,-o test1"); 27 if (opt2 == NULL) 28 return (0); 29 30 if (fuse_opt_add_opt(&opt2, "test") != 0) 31 return (1); 32 33 if (fuse_opt_add_opt(&opt, "-a") != 0) 34 return (1); 35 if (fuse_opt_add_opt(&opt, "--bc") != 0) 36 return (1); 37 if (fuse_opt_add_opt(&opt, "01234") != 0) 38 return (1); 39 if (fuse_opt_add_opt(&opt, "-56789") != 0) 40 return (1); 41 if (fuse_opt_add_opt(&opt, "-o test1") != 0) 42 return (1); 43 if (fuse_opt_add_opt(&opt, "test") != 0) 44 return (1); 45 46 if (fuse_opt_add_opt(&opt, NULL) != -1) 47 return (1); 48 if (fuse_opt_add_opt(&opt, "") != -1) 49 return (1); 50 51 return (strcmp(opt, opt2)); 52 } 53 54