+2008-04-22 Pranab Shenoy <pranab.loosinit.shenoy@gmail.com>
+
+ * init.c: Added test_commands_sorted unit test to check is
+ commands are sorted. Fixes bug #21245.
+
+ * test.c: Added test_commands_sorted to the test suite.
+
2008-04-22 Rabin Vincent <rabin@rab.in>
* ftp.c (ftp_get_listing): Only remove .listing if it has been
#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()
{
const char *test_parse_content_disposition();
const char *test_subdir_p();
const char *test_dir_matches_p();
+const char *test_commands_sorted();
const char *test_cmd_spec_restrict_file_names();
const char *test_append_uri_pathel();
const char *test_are_urls_equal();
mu_run_test (test_parse_content_disposition);
mu_run_test (test_subdir_p);
mu_run_test (test_dir_matches_p);
+ mu_run_test (test_commands_sorted);
mu_run_test (test_cmd_spec_restrict_file_names);
mu_run_test (test_append_uri_pathel);
mu_run_test (test_are_urls_equal);