while (f->server_conn == NULL)
{
- g_print (".");
+ test_progress ('.');
test_main_context_iterate (f->ctx, TRUE);
}
while (g_queue_is_empty (&f->client_messages))
{
- g_print (".");
+ test_progress ('.');
test_main_context_iterate (f->ctx, TRUE);
}
* rubbish, so it should disconnect */
while (g_queue_is_empty (&f->client_messages))
{
- g_print (".");
+ test_progress ('.');
test_main_context_iterate (f->ctx, TRUE);
}
* message, so it should disconnect */
while (g_queue_is_empty (&f->client_messages))
{
- g_print (".");
+ test_progress ('.');
test_main_context_iterate (f->ctx, TRUE);
}
g_assert_cmpuint (dbus_message_iter_get_arg_type (&var_iter), ==,
DBUS_TYPE_UINT32);
dbus_message_iter_get_basic (&var_iter, &u32);
- g_message ("%s of this process is %u", name, u32);
+ g_test_message ("%s of this process is %u", name, u32);
g_assert_cmpuint (u32, ==, geteuid ());
seen |= SEEN_UNIX_USER;
#else
g_assert_cmpuint (dbus_message_iter_get_arg_type (&var_iter), ==,
DBUS_TYPE_STRING);
dbus_message_iter_get_basic (&var_iter, &sid);
- g_message ("%s of this process is %s", name, sid);
+ g_test_message ("%s of this process is %s", name, sid);
if (_dbus_getsid (&self_sid, 0))
{
g_assert_cmpstr (self_sid, ==, sid);
g_assert_cmpuint (dbus_message_iter_get_arg_type (&var_iter), ==,
DBUS_TYPE_UINT32);
dbus_message_iter_get_basic (&var_iter, &u32);
- g_message ("%s of this process is %u", name, u32);
+ g_test_message ("%s of this process is %u", name, u32);
#ifdef G_OS_UNIX
g_assert_cmpuint (u32, ==, getpid ());
#elif defined(G_OS_WIN32)
g_assert_cmpuint (dbus_message_iter_get_arg_type (&ay_iter), ==,
DBUS_TYPE_BYTE);
dbus_message_iter_get_fixed_array (&ay_iter, &label, &len);
- g_message ("%s of this process is %s", name, label);
+ g_test_message ("%s of this process is %s", name, label);
g_assert_cmpuint (strlen (label) + 1, ==, len);
seen |= SEEN_LINUX_SECURITY_LABEL;
#else
g_assert_cmpstr (dbus_message_get_signature (m), ==, "u");
test_assert_no_error (&error);
- g_message ("GetConnectionUnixProcessID returned %u", pid);
+ g_test_message ("GetConnectionUnixProcessID returned %u", pid);
#ifdef G_OS_UNIX
g_assert_cmpuint (pid, ==, getpid ());
while (f->left_server_conn == NULL)
{
- g_print (".");
+ test_progress ('.');
test_main_context_iterate (f->ctx, TRUE);
}
while (f->right_server_conn == NULL)
{
- g_print (".");
+ test_progress ('.');
test_main_context_iterate (f->ctx, TRUE);
}
!dbus_connection_get_is_authenticated (f->left_server_conn) ||
!dbus_connection_get_is_authenticated (f->right_server_conn))
{
- g_printerr ("*");
+ test_progress ('*');
test_main_context_iterate (f->ctx, TRUE);
}
while (g_queue_get_length (&f->messages) < 1)
{
- g_print (".");
+ test_progress ('.');
test_main_context_iterate (f->ctx, TRUE);
}
while (g_queue_get_length (&f->messages) < 1)
{
- g_print (".");
+ test_progress ('.');
test_main_context_iterate (f->ctx, TRUE);
}
while (dbus_connection_get_is_connected (f->left_client_conn) ||
dbus_connection_get_is_connected (f->left_server_conn))
{
- g_print (".");
+ test_progress ('.');
test_main_context_iterate (f->ctx, TRUE);
}
while (dbus_connection_get_is_connected (f->left_client_conn) ||
dbus_connection_get_is_connected (f->left_server_conn))
{
- g_print (".");
+ test_progress ('.');
test_main_context_iterate (f->ctx, TRUE);
}
while (g_queue_get_length (&f->messages) < SOME_MESSAGES)
{
- g_print (".");
+ test_progress ('.');
test_main_context_iterate (f->ctx, TRUE);
}
while (dbus_connection_get_is_connected (f->left_client_conn) ||
dbus_connection_get_is_connected (f->left_server_conn))
{
- g_print (".");
+ test_progress ('.');
test_main_context_iterate (f->ctx, TRUE);
}
/* We're at or under the limit. The message gets through intact. */
while (g_queue_get_length (&f->messages) < 1)
{
- g_print (".");
+ test_progress ('.');
test_main_context_iterate (f->ctx, TRUE);
}
setup (f, addr);
listening_at = dbus_server_get_address (f->server);
- g_message ("listening at %s", listening_at);
+ g_test_message ("listening at %s", listening_at);
g_assert (g_str_has_prefix (listening_at, "unix:path="));
g_assert (strstr (listening_at, "dbus%3ddaemon%3dtest.") != NULL);
g_assert (strstr (listening_at, "/bus,") != NULL ||
setup (f, addr);
listening_at = dbus_server_get_address (f->server);
- g_message ("listening at %s", listening_at);
+ g_test_message ("listening at %s", listening_at);
/* we have fallen back to something in /tmp, either abstract or not */
g_assert (g_str_has_prefix (listening_at, "unix:"));
g_assert (strstr (listening_at, "=/tmp/") != NULL);
while (f->server_conn == NULL)
{
- g_print (".");
+ test_progress ('.');
test_main_context_iterate (f->ctx, TRUE);
}
}
while (f->server_conn == NULL)
{
- g_print (".");
+ test_progress ('.');
test_main_context_iterate (f->ctx, TRUE);
}
while (g_queue_is_empty (&f->server_messages))
{
- g_print (".");
+ test_progress ('.');
test_main_context_iterate (f->ctx, TRUE);
}
while (g_queue_is_empty (&f->server_messages))
{
- g_print (".");
+ test_progress ('.');
test_main_context_iterate (f->ctx, TRUE);
}
const char *file,
int line)
{
- g_message ("%s:%d: message type %d (%s)", file, line,
+ g_test_message ("%s:%d: message type %d (%s)", file, line,
dbus_message_get_type (m),
dbus_message_type_to_string (dbus_message_get_type (m)));
- g_message ("\tfrom: %s",
+ g_test_message ("\tfrom: %s",
not_null2 (dbus_message_get_sender (m), "(dbus-daemon)"));
- g_message ("\tto: %s",
+ g_test_message ("\tto: %s",
not_null2 (dbus_message_get_destination (m), "(broadcast)"));
- g_message ("\tpath: %s",
+ g_test_message ("\tpath: %s",
not_null (dbus_message_get_path (m)));
- g_message ("\tinterface: %s",
+ g_test_message ("\tinterface: %s",
not_null (dbus_message_get_interface (m)));
- g_message ("\tmember: %s",
+ g_test_message ("\tmember: %s",
not_null (dbus_message_get_member (m)));
- g_message ("\tsignature: %s",
+ g_test_message ("\tsignature: %s",
not_null (dbus_message_get_signature (m)));
- g_message ("\terror name: %s",
+ g_test_message ("\terror name: %s",
not_null (dbus_message_get_error_name (m)));
if (strcmp ("s", dbus_message_get_signature (m)) == 0)
DBUS_TYPE_STRING, &s,
DBUS_TYPE_INVALID);
test_assert_no_error (&e);
- g_message ("\tstring payload: %s", s);
+ g_test_message ("\tstring payload: %s", s);
}
}
while (f->left_server_conn == NULL)
{
- g_print (".");
+ test_progress ('.');
test_main_context_iterate (f->ctx, TRUE);
}
while (f->right_server_conn == NULL)
{
- g_print (".");
+ test_progress ('.');
test_main_context_iterate (f->ctx, TRUE);
}
while (g_queue_get_length (&f->messages) < 2)
{
- g_print (".");
+ test_progress ('.');
test_main_context_iterate (f->ctx, TRUE);
}
#include <dbus/dbus.h>
+#ifdef G_OS_WIN
+# define isatty(x) _isatty(x)
+#endif
+
void
_test_assert_no_error (const DBusError *e,
const char *file,
}
#endif
}
+
+void
+test_progress (char symbol)
+{
+ if (g_test_verbose () && isatty (1))
+ g_print ("%c", symbol);
+}
void test_init (int *argcp, char ***argvp);
+void test_progress (char symbol);
+
#endif