Merge branch 'dbus-1.10'

This commit is contained in:
Ralf Habacker 2015-11-16 14:22:23 +01:00
commit bc5ae92652
3 changed files with 37 additions and 33 deletions

View file

@ -2604,6 +2604,7 @@ bus_activation_service_reload_test (const DBusString *test_data_dir)
{
DBusString directory;
const char *tmp;
dbus_bool_t ret = FALSE;
if (!_dbus_string_init (&directory))
return FALSE;
@ -2611,16 +2612,14 @@ bus_activation_service_reload_test (const DBusString *test_data_dir)
tmp = _dbus_get_tmpdir ();
if (tmp == NULL)
return FALSE;
goto out;
if (!_dbus_string_append (&directory, tmp))
return FALSE;
goto out;
if (!_dbus_string_append (&directory, "/dbus-reload-test-") ||
!_dbus_generate_random_ascii (&directory, 6, NULL))
{
return FALSE;
}
goto out;
/* Do normal tests */
if (!init_service_reload_test (&directory))
@ -2642,11 +2641,13 @@ bus_activation_service_reload_test (const DBusString *test_data_dir)
/* Cleanup test directory */
if (!cleanup_service_reload_test (&directory))
return FALSE;
goto out;
ret = TRUE;
out:
_dbus_string_free (&directory);
return TRUE;
return ret;
}
#endif /* DBUS_ENABLE_EMBEDDED_TESTS */

View file

@ -1277,6 +1277,12 @@ check_get_connection_unix_user (BusContext *context,
{
; /* good, this is a valid response */
}
#ifdef DBUS_WIN
else if (dbus_message_is_error (message, DBUS_ERROR_FAILED))
{
/* this is OK, Unix uids aren't meaningful on Windows */
}
#endif
else
{
warn_unexpected (connection, message, "not this error");
@ -2926,7 +2932,6 @@ check_existent_service_no_auto_start (BusContext *context,
return retval;
}
#ifndef DBUS_WIN_FIXME
/* returns TRUE if the correct thing happens,
* but the correct thing may include OOM errors.
*/
@ -3015,11 +3020,19 @@ check_segfault_service_no_auto_start (BusContext *context,
/* make sure this only happens with the launch helper */
_dbus_assert (servicehelper != NULL);
}
#ifdef DBUS_WIN
else if (dbus_message_is_error (message,
DBUS_ERROR_SPAWN_CHILD_EXITED))
{
/* unhandled exceptions are normal exit codes */
}
#else
else if (dbus_message_is_error (message,
DBUS_ERROR_SPAWN_CHILD_SIGNALED))
{
; /* good, this is expected also */
}
#endif
else
{
warn_unexpected (connection, message, "not this error");
@ -3108,11 +3121,19 @@ check_segfault_service_auto_start (BusContext *context,
{
; /* good, this is a valid response */
}
#ifdef DBUS_WIN
else if (dbus_message_is_error (message,
DBUS_ERROR_SPAWN_CHILD_EXITED))
{
/* unhandled exceptions are normal exit codes */
}
#else
else if (dbus_message_is_error (message,
DBUS_ERROR_SPAWN_CHILD_SIGNALED))
{
; /* good, this is expected also */
}
#endif
else
{
warn_unexpected (connection, message, "not this error");
@ -3134,7 +3155,6 @@ check_segfault_service_auto_start (BusContext *context,
return retval;
}
#endif
#define TEST_ECHO_MESSAGE "Test echo message"
#define TEST_RUN_HELLO_FROM_SELF_MESSAGE "Test sending message to self"
@ -4823,13 +4843,12 @@ bus_dispatch_test_conf (const DBusString *test_data_dir,
_dbus_assert_not_reached ("GetAllMatchRules message failed");
#endif
#ifdef DBUS_WIN_FIXME
_dbus_warn("TODO: testing of GetConnectionUnixUser message skipped for now\n");
_dbus_warn("TODO: testing of GetConnectionUnixProcessID message skipped for now\n");
#else
if (!check_get_connection_unix_user (context, baz))
_dbus_assert_not_reached ("GetConnectionUnixUser message failed");
#ifdef DBUS_WIN_FIXME
_dbus_verbose("TODO: testing of GetConnectionUnixProcessID message skipped for now\n");
#else
if (!check_get_connection_unix_process_id (context, baz))
_dbus_assert_not_reached ("GetConnectionUnixProcessID message failed");
#endif
@ -4849,12 +4868,8 @@ bus_dispatch_test_conf (const DBusString *test_data_dir,
check2_try_iterations (context, foo, "nonexistent_service_no_auto_start",
check_nonexistent_service_no_auto_start);
#ifdef DBUS_WIN_FIXME
_dbus_warn("TODO: dispatch.c segfault_service_no_auto_start test\n");
#else
check2_try_iterations (context, foo, "segfault_service_no_auto_start",
check_segfault_service_no_auto_start);
#endif
check2_try_iterations (context, foo, "existent_service_no_auto_start",
check_existent_service_no_auto_start);
@ -4862,14 +4877,9 @@ bus_dispatch_test_conf (const DBusString *test_data_dir,
check2_try_iterations (context, foo, "nonexistent_service_auto_start",
check_nonexistent_service_auto_start);
#ifdef DBUS_WIN_FIXME
_dbus_warn("TODO: dispatch.c segfault_service_auto_start test\n");
#else
/* only do the segfault test if we are not using the launcher */
check2_try_iterations (context, foo, "segfault_service_auto_start",
check_segfault_service_auto_start);
#endif
/* only do the shell fail test if we are not using the launcher */
check2_try_iterations (context, foo, "shell_fail_service_auto_start",
@ -4972,9 +4982,7 @@ bus_dispatch_test (const DBusString *test_data_dir)
"valid-config-files/debug-allow-all.conf", FALSE))
return FALSE;
#ifdef DBUS_WIN
_dbus_warn("Info: Launch helper activation tests skipped because launch-helper is not supported yet\n");
#else
#ifndef DBUS_WIN
/* run launch-helper activation tests */
_dbus_verbose ("Launch helper activation tests\n");
if (!bus_dispatch_test_conf (test_data_dir,

View file

@ -2403,7 +2403,7 @@ _dbus_delete_file (const DBusString *filename,
#include <imagehlp.h>
#include <stdio.h>
#define DPRINTF _dbus_warn
#define DPRINTF(fmt, ...) fprintf (stderr, fmt, ##__VA_ARGS__)
#ifdef _MSC_VER
#define BOOL int
@ -3649,13 +3649,8 @@ _dbus_win_set_error_from_win_error (DBusError *error,
(LPSTR) &msg, 0, NULL);
if (msg)
{
char *msg_copy;
msg_copy = dbus_malloc (strlen (msg));
strcpy (msg_copy, msg);
dbus_set_error (error, "win32.error", "%s", msg);
LocalFree (msg);
dbus_set_error (error, "win32.error", "%s", msg_copy);
}
else
dbus_set_error (error, "win32.error", "Unknown error code %d or FormatMessage failed", code);