X-Git-Url: http://sjero.net/git/?p=wget;a=blobdiff_plain;f=src%2Finit.c;h=fcb7c2ccbd8254c9a680ff8d536a13d891cb2a75;hp=e079df95d12d1b2ac4afd24fb98df1a035260a51;hb=e72b57629bf49cdfd663002a8bb336a67b958979;hpb=3323b84c30b9d7fa16a6065225cb7135e7a6bcd7 diff --git a/src/init.c b/src/init.c index e079df95..fcb7c2cc 100644 --- a/src/init.c +++ b/src/init.c @@ -1530,6 +1530,29 @@ cleanup (void) #ifdef TESTING +const char * +test_commands_sorted() +{ + int prev_idx = 0, next_idx = 1; + int command_count = countof (commands) - 1; + int cmp = 0; + while (next_idx <= command_count) + { + cmp = strcasecmp (commands[prev_idx].name, commands[next_idx].name); + if (cmp > 0) + { + mu_assert ("FAILED", false); + break; + } + else + { + prev_idx ++; + next_idx ++; + } + } + return NULL; +} + const char * test_cmd_spec_restrict_file_names() {