"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "test/shell-test.c" between
dbus-1.13.14.tar.xz and dbus-1.13.16.tar.xz

About: D-Bus is an inter-process communication (IPC) system, allowing multiple, concurrently-running applications to communicate with one another. D-Bus supplies both a system daemon and a per-user-login-session daemon. Development version.

shell-test.c  (dbus-1.13.14.tar.xz):shell-test.c  (dbus-1.13.16.tar.xz)
skipping to change at line 68 skipping to change at line 68
{ {
_dbus_list_clear (&list); _dbus_list_clear (&list);
dbus_free (original_argv); dbus_free (original_argv);
_dbus_string_free (&str); _dbus_string_free (&str);
return FALSE; return FALSE;
} }
} }
_dbus_list_clear (&list); _dbus_list_clear (&list);
command_line = _dbus_string_get_data (&str); command_line = _dbus_string_get_data (&str);
printf ("# Testing command line '%s'\n", command_line); fprintf (stderr, "# Testing command line '%s'\n", command_line);
dbus_error_init (&error); dbus_error_init (&error);
if (!_dbus_shell_parse_argv (command_line, &shell_argc, &shell_argv, &error)) if (!_dbus_shell_parse_argv (command_line, &shell_argc, &shell_argv, &error))
{ {
printf ("# Error%s parsing command line: %s\n", fprintf (stderr, "# Error%s parsing command line: %s\n",
should_work ? "" : " (as expected)", should_work ? "" : " (as expected)",
error.message ? error.message : ""); error.message ? error.message : "");
dbus_free (original_argv); dbus_free (original_argv);
_dbus_string_free (&str); _dbus_string_free (&str);
return !should_work; return !should_work;
} }
else else
{ {
if (shell_argc != original_argc) if (shell_argc != original_argc)
{ {
printf ("# Number of arguments returned (%d) don't match original (%d) \n", fprintf (stderr, "# Number of arguments returned (%d) don't match orig inal (%d)\n",
shell_argc, original_argc); shell_argc, original_argc);
dbus_free (original_argv); dbus_free (original_argv);
dbus_free_string_array (shell_argv); dbus_free_string_array (shell_argv);
return FALSE; return FALSE;
} }
printf ("# Number of arguments: %d\n", shell_argc); fprintf (stderr, "# Number of arguments: %d\n", shell_argc);
for (i = 0; i < shell_argc; i++) for (i = 0; i < shell_argc; i++)
{ {
char *unquoted; char *unquoted;
unquoted = _dbus_shell_unquote (original_argv[i]); unquoted = _dbus_shell_unquote (original_argv[i]);
if (strcmp (unquoted ? unquoted : "", if (strcmp (unquoted ? unquoted : "",
shell_argv[i] ? shell_argv[i] : "")) shell_argv[i] ? shell_argv[i] : ""))
{ {
printf ("Position %d, returned argument (%s) does not match origin al (%s)\n", fprintf (stderr, "Position %d, returned argument (%s) does not mat ch original (%s)\n",
i, shell_argv[i], unquoted); i, shell_argv[i], unquoted);
dbus_free (unquoted); dbus_free (unquoted);
dbus_free (original_argv); dbus_free (original_argv);
dbus_free_string_array (shell_argv); dbus_free_string_array (shell_argv);
return FALSE; return FALSE;
} }
dbus_free (unquoted); dbus_free (unquoted);
if (shell_argv[i]) if (shell_argv[i])
printf ("Argument %d = %s\n", i, shell_argv[i]); fprintf (stderr, "# Argument %d = %s\n", i, shell_argv[i]);
} }
dbus_free_string_array (shell_argv); dbus_free_string_array (shell_argv);
} }
_dbus_string_free (&str); _dbus_string_free (&str);
dbus_free (original_argv); dbus_free (original_argv);
if (!should_work) if (!should_work)
{ {
printf ("# Expected an error\n"); fprintf (stderr, "# Expected an error\n");
return FALSE; return FALSE;
} }
return TRUE; return TRUE;
} }
static void static void
test_command_line (const char *arg1, ...) test_command_line (const char *arg1, ...)
{ {
va_list var_args; va_list var_args;
 End of changes. 7 change blocks. 
7 lines changed or deleted 7 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)