diff --git a/joytest/x52_test.c b/joytest/x52_test.c index 2e7505c..37b20e0 100644 --- a/joytest/x52_test.c +++ b/joytest/x52_test.c @@ -195,7 +195,7 @@ const struct x52test_cmd tests[] = { { NULL, 0 } }; -int main(int argc, char **argv) +int main(int argc, const char **argv) { struct x52test_argv_result parsed; int ret = 0; diff --git a/joytest/x52_test_args.c b/joytest/x52_test_args.c index 5a73b8a..f21d5fe 100644 --- a/joytest/x52_test_args.c +++ b/joytest/x52_test_args.c @@ -9,7 +9,7 @@ #include "x52_test_args.h" #include -void x52test_parse_argv(int argc, char **argv, const struct x52test_cmd *cmds, +void x52test_parse_argv(int argc, const char **argv, const struct x52test_cmd *cmds, int test_all_bitmap, struct x52test_argv_result *out) { int i; diff --git a/joytest/x52_test_args.h b/joytest/x52_test_args.h index 4a5e87c..78a2924 100644 --- a/joytest/x52_test_args.h +++ b/joytest/x52_test_args.h @@ -26,7 +26,7 @@ struct x52test_argv_result { int bad_arg_index; }; -void x52test_parse_argv(int argc, char **argv, const struct x52test_cmd *cmds, +void x52test_parse_argv(int argc, const char **argv, const struct x52test_cmd *cmds, int test_all_bitmap, struct x52test_argv_result *out); #endif /* X52_TEST_ARGS_H */ diff --git a/joytest/x52_test_args_test.c b/joytest/x52_test_args_test.c index 1dcfd60..c6e3ba4 100644 --- a/joytest/x52_test_args_test.c +++ b/joytest/x52_test_args_test.c @@ -30,7 +30,7 @@ static const struct x52test_cmd syn_cmds[] = { static void test_argc_one_is_test_all(void **state) { (void)state; - char *argv[] = { (char *)"prog", NULL }; + const char *argv[] = { "prog", NULL }; struct x52test_argv_result r; x52test_parse_argv(1, argv, syn_cmds, TEST_ALL_SYN, &r); @@ -41,7 +41,7 @@ static void test_argc_one_is_test_all(void **state) static void test_single_cmd(void **state) { (void)state; - char *argv[] = { (char *)"prog", (char *)"b", NULL }; + const char *argv[] = { "prog", "b", NULL }; struct x52test_argv_result r; x52test_parse_argv(2, argv, syn_cmds, TEST_ALL_SYN, &r); @@ -52,7 +52,7 @@ static void test_single_cmd(void **state) static void test_multi_cmd_ors(void **state) { (void)state; - char *argv[] = { (char *)"prog", (char *)"a", (char *)"c", NULL }; + const char *argv[] = { "prog", "a", "c", NULL }; struct x52test_argv_result r; x52test_parse_argv(3, argv, syn_cmds, TEST_ALL_SYN, &r); @@ -63,7 +63,7 @@ static void test_multi_cmd_ors(void **state) static void test_duplicate_cmd_ors_same_bit(void **state) { (void)state; - char *argv[] = { (char *)"prog", (char *)"a", (char *)"a", NULL }; + const char *argv[] = { "prog", "a", "a", NULL }; struct x52test_argv_result r; x52test_parse_argv(3, argv, syn_cmds, TEST_ALL_SYN, &r); @@ -74,7 +74,7 @@ static void test_duplicate_cmd_ors_same_bit(void **state) static void test_help_keyword(void **state) { (void)state; - char *argv[] = { (char *)"prog", (char *)"help", NULL }; + const char *argv[] = { "prog", "help", NULL }; struct x52test_argv_result r; x52test_parse_argv(2, argv, syn_cmds, TEST_ALL_SYN, &r); @@ -84,7 +84,7 @@ static void test_help_keyword(void **state) static void test_dashdash_help(void **state) { (void)state; - char *argv[] = { (char *)"prog", (char *)"--help", NULL }; + const char *argv[] = { "prog", "--help", NULL }; struct x52test_argv_result r; x52test_parse_argv(2, argv, syn_cmds, TEST_ALL_SYN, &r); @@ -94,7 +94,7 @@ static void test_dashdash_help(void **state) static void test_help_after_other_arg(void **state) { (void)state; - char *argv[] = { (char *)"prog", (char *)"a", (char *)"help", NULL }; + const char *argv[] = { "prog", "a", "help", NULL }; struct x52test_argv_result r; x52test_parse_argv(3, argv, syn_cmds, TEST_ALL_SYN, &r); @@ -104,7 +104,7 @@ static void test_help_after_other_arg(void **state) static void test_help_before_other_arg(void **state) { (void)state; - char *argv[] = { (char *)"prog", (char *)"help", (char *)"a", (char *)"b", NULL }; + const char *argv[] = { "prog", "help", "a", "b", NULL }; struct x52test_argv_result r; x52test_parse_argv(4, argv, syn_cmds, TEST_ALL_SYN, &r); @@ -115,7 +115,7 @@ static void test_help_before_other_arg(void **state) static void test_unknown_bad_index(void **state) { (void)state; - char *argv[] = { (char *)"prog", (char *)"a", (char *)"nope", NULL }; + const char *argv[] = { "prog", "a", "nope", NULL }; struct x52test_argv_result r; x52test_parse_argv(3, argv, syn_cmds, TEST_ALL_SYN, &r); @@ -126,7 +126,7 @@ static void test_unknown_bad_index(void **state) static void test_unknown_first_arg_index(void **state) { (void)state; - char *argv[] = { (char *)"prog", (char *)"xyz", NULL }; + const char *argv[] = { "prog", "xyz", NULL }; struct x52test_argv_result r; x52test_parse_argv(2, argv, syn_cmds, TEST_ALL_SYN, &r);