diff options
| author | Daniel Kahn Gillmor <dkg@fifthhorseman.net> | 2019-06-25 13:55:45 -0400 |
|---|---|---|
| committer | David Bremner <david@tethera.net> | 2019-06-29 21:18:15 +0200 |
| commit | bdc87f0d3ec41dd4744a89d1d19b2186d0647a56 (patch) | |
| tree | 06a7bd96d79e9a4417cb1434cf138f2dbde78534 /test/arg-test.c | |
| parent | 1959a95d2538daa2a802b74699ecb2b42d997a2d (diff) | |
test: run uncrustify
This is the result of running:
$ uncrustify --replace --config ../devel/uncrustify.cfg *.cc *.c *.h
in the test directory.
Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Diffstat (limited to 'test/arg-test.c')
| -rw-r--r-- | test/arg-test.c | 68 |
1 files changed, 35 insertions, 33 deletions
diff --git a/test/arg-test.c b/test/arg-test.c index a218f967..44477730 100644 --- a/test/arg-test.c +++ b/test/arg-test.c @@ -2,27 +2,29 @@ #include "command-line-arguments.h" -int main(int argc, char **argv){ +int +main (int argc, char **argv) +{ - int opt_index=1; + int opt_index = 1; - int kw_val=0; - int kwb_val=0; - int fl_val=0; - int int_val=0; - const char *pos_arg1=NULL; - const char *pos_arg2=NULL; - const char *string_val=NULL; + int kw_val = 0; + int kwb_val = 0; + int fl_val = 0; + int int_val = 0; + const char *pos_arg1 = NULL; + const char *pos_arg2 = NULL; + const char *string_val = NULL; bool bool_val = false; bool fl_set = false, int_set = false, bool_set = false, kwb_set = false, - kw_set = false, string_set = false, pos1_set = false, pos2_set = false; + kw_set = false, string_set = false, pos1_set = false, pos2_set = false; notmuch_opt_desc_t parent_options[] = { { .opt_flags = &fl_val, .name = "flag", .present = &fl_set, .keywords = - (notmuch_keyword_t []){ { "one", 1 << 0}, - { "two", 1 << 1 }, - { "three", 1 << 2 }, - { 0, 0 } } }, + (notmuch_keyword_t []){ { "one", 1 << 0 }, + { "two", 1 << 1 }, + { "three", 1 << 2 }, + { 0, 0 } } }, { .opt_int = &int_val, .name = "int", .present = &int_set }, { } }; @@ -30,16 +32,16 @@ int main(int argc, char **argv){ notmuch_opt_desc_t options[] = { { .opt_bool = &bool_val, .name = "boolean", .present = &bool_set }, { .opt_keyword = &kw_val, .name = "keyword", .present = &kw_set, .keywords = - (notmuch_keyword_t []){ { "zero", 0 }, - { "one", 1 }, - { "two", 2 }, - { 0, 0 } } }, + (notmuch_keyword_t []){ { "zero", 0 }, + { "one", 1 }, + { "two", 2 }, + { 0, 0 } } }, { .opt_keyword = &kwb_val, .name = "boolkeyword", .present = &kwb_set, .keyword_no_arg_value = "true", .keywords = - (notmuch_keyword_t []){ { "false", 0 }, - { "true", 1 }, - { "auto", 2 }, - { 0, 0 } } }, + (notmuch_keyword_t []){ { "false", 0 }, + { "true", 1 }, + { "auto", 2 }, + { 0, 0 } } }, { .opt_inherit = parent_options }, { .opt_string = &string_val, .name = "string", .present = &string_set }, { .opt_position = &pos_arg1, .present = &pos1_set }, @@ -47,38 +49,38 @@ int main(int argc, char **argv){ { } }; - opt_index = parse_arguments(argc, argv, options, 1); + opt_index = parse_arguments (argc, argv, options, 1); if (opt_index < 0) return 1; if (bool_set) - printf("boolean %d\n", bool_val); + printf ("boolean %d\n", bool_val); if (kw_set) - printf("keyword %d\n", kw_val); + printf ("keyword %d\n", kw_val); if (kwb_set) - printf("boolkeyword %d\n", kwb_val); + printf ("boolkeyword %d\n", kwb_val); if (fl_set) - printf("flags %d\n", fl_val); + printf ("flags %d\n", fl_val); if (int_set) - printf("int %d\n", int_val); + printf ("int %d\n", int_val); if (string_set) - printf("string %s\n", string_val); + printf ("string %s\n", string_val); if (pos1_set) - printf("positional arg 1 %s\n", pos_arg1); + printf ("positional arg 1 %s\n", pos_arg1); if (pos2_set) - printf("positional arg 2 %s\n", pos_arg2); + printf ("positional arg 2 %s\n", pos_arg2); - for ( ; opt_index < argc ; opt_index ++) { - printf("non parsed arg %d = %s\n", opt_index, argv[opt_index]); + for (; opt_index < argc; opt_index++) { + printf ("non parsed arg %d = %s\n", opt_index, argv[opt_index]); } return 0; |
