[Telepathy-commits] [telepathy-glib/master] Replace MYASSERT_NO_ERROR with test_assert_no_error now that they're equivalent
Simon McVittie
simon.mcvittie at collabora.co.uk
Tue Mar 17 07:38:13 PDT 2009
---
tests/dbus/channel-introspect.c | 48 +++++++++++-----------
tests/dbus/cli-group.c | 18 ++++----
tests/dbus/connection-bug-18845.c | 17 ++++----
tests/dbus/connection-error.c | 7 ++-
tests/dbus/connection-getinterfaces-failure.c | 7 ++-
tests/dbus/connection-handles.c | 14 +++---
tests/dbus/connection-inject-bug16307.c | 9 ++--
tests/dbus/connection.c | 23 ++++++-----
tests/dbus/contacts-bug-19101.c | 8 ++--
tests/dbus/contacts-mixin.c | 12 +++---
tests/dbus/contacts.c | 34 ++++++++--------
tests/dbus/finalized-in-invalidated-handler.c | 13 +++---
tests/dbus/group-mixin.c | 20 +++++-----
tests/dbus/invalidated-while-invoking-signals.c | 7 ++-
tests/dbus/message-mixin.c | 47 +++++++++++-----------
tests/dbus/self-handle.c | 8 ++--
tests/dbus/self-presence.c | 16 ++++----
tests/dbus/test-disconnection.c | 21 +++++-----
tests/dbus/text-mixin.c | 28 +++++++-------
tests/dbus/text-respawn.c | 26 ++++++------
tests/lib/myassert.h | 4 --
21 files changed, 196 insertions(+), 191 deletions(-)
diff --git a/tests/dbus/channel-introspect.c b/tests/dbus/channel-introspect.c
index 741ad60..f52d076 100644
--- a/tests/dbus/channel-introspect.c
+++ b/tests/dbus/channel-introspect.c
@@ -122,22 +122,22 @@ main (int argc,
MYASSERT (tp_base_connection_register (service_conn_as_base, "simple",
&name, &conn_path, &error), "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
conn = tp_connection_new (dbus, name, conn_path, &error);
MYASSERT (conn != NULL, "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
MYASSERT (tp_connection_run_until_ready (conn, TRUE, &error, NULL),
"");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
contact_repo = tp_base_connection_get_handles (service_conn_as_base,
TP_HANDLE_TYPE_CONTACT);
MYASSERT (contact_repo != NULL, "");
handle = tp_handle_ensure (contact_repo, IDENTIFIER, NULL, &error);
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
chan_path = g_strdup_printf ("%s/Channel", conn_path);
@@ -163,7 +163,7 @@ main (int argc,
chan = tp_channel_new (conn, chan_path, TP_IFACE_CHANNEL_TYPE_TEXT,
TP_HANDLE_TYPE_CONTACT, handle, &error);
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
tp_proxy_invalidate ((TpProxy *) chan, &invalidated_for_test);
MYASSERT (!tp_channel_run_until_ready (chan, &error, NULL), "");
@@ -179,7 +179,7 @@ main (int argc,
chan = tp_channel_new (conn, chan_path, TP_IFACE_CHANNEL_TYPE_TEXT,
TP_HANDLE_TYPE_CONTACT, handle, &error);
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
was_ready = FALSE;
tp_channel_call_when_ready (chan, channel_ready, &was_ready);
@@ -203,10 +203,10 @@ main (int argc,
chan = tp_channel_new (conn, chan_path, TP_IFACE_CHANNEL_TYPE_TEXT,
TP_HANDLE_TYPE_CONTACT, handle, &error);
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
MYASSERT (tp_channel_run_until_ready (chan, &error, NULL), "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
MYASSERT_SAME_UINT (service_chan->get_handle_called, 0);
MYASSERT_SAME_UINT (service_chan->get_interfaces_called, 1);
MYASSERT_SAME_UINT (service_chan->get_channel_type_called, 0);
@@ -227,10 +227,10 @@ main (int argc,
chan = tp_channel_new (conn, props_chan_path, NULL,
TP_UNKNOWN_HANDLE_TYPE, 0, &error);
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
MYASSERT (tp_channel_run_until_ready (chan, &error, NULL), "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
MYASSERT_SAME_UINT (service_props_chan->get_handle_called, 0);
MYASSERT_SAME_UINT (service_props_chan->get_channel_type_called, 0);
MYASSERT_SAME_UINT (service_props_chan->get_interfaces_called, 0);
@@ -262,13 +262,13 @@ main (int argc,
tp_g_value_slice_new_static_boxed (G_TYPE_STRV, NULL));
chan = tp_channel_new_from_properties (conn, chan_path, asv, &error);
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
g_hash_table_destroy (asv);
asv = NULL;
MYASSERT (tp_channel_run_until_ready (chan, &error, NULL), "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
MYASSERT_SAME_UINT (service_chan->get_handle_called, 0);
MYASSERT_SAME_UINT (service_chan->get_channel_type_called, 0);
/* FIXME: with an improved fast-path we could avoid this one too maybe? */
@@ -290,10 +290,10 @@ main (int argc,
chan = tp_channel_new (conn, chan_path, NULL,
TP_HANDLE_TYPE_CONTACT, handle, &error);
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
MYASSERT (tp_channel_run_until_ready (chan, &error, NULL), "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
MYASSERT_SAME_UINT (service_chan->get_handle_called, 0);
MYASSERT_SAME_UINT (service_chan->get_interfaces_called, 1);
MYASSERT_SAME_UINT (service_chan->get_channel_type_called, 1);
@@ -314,10 +314,10 @@ main (int argc,
chan = tp_channel_new (conn, chan_path, TP_IFACE_CHANNEL_TYPE_TEXT,
TP_UNKNOWN_HANDLE_TYPE, 0, &error);
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
MYASSERT (tp_channel_run_until_ready (chan, &error, NULL), "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
MYASSERT_SAME_UINT (service_chan->get_handle_called, 1);
MYASSERT_SAME_UINT (service_chan->get_interfaces_called, 1);
MYASSERT_SAME_UINT (service_chan->get_channel_type_called, 0);
@@ -338,10 +338,10 @@ main (int argc,
chan = tp_channel_new (conn, chan_path, TP_IFACE_CHANNEL_TYPE_TEXT,
TP_HANDLE_TYPE_CONTACT, 0, &error);
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
MYASSERT (tp_channel_run_until_ready (chan, &error, NULL), "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
MYASSERT_SAME_UINT (service_chan->get_handle_called, 1);
MYASSERT_SAME_UINT (service_chan->get_interfaces_called, 1);
MYASSERT_SAME_UINT (service_chan->get_channel_type_called, 0);
@@ -356,7 +356,7 @@ main (int argc,
bad_chan_path = g_strdup_printf ("%s/Does/Not/Actually/Exist", conn_path);
chan = tp_channel_new (conn, bad_chan_path, NULL,
TP_UNKNOWN_HANDLE_TYPE, 0, &error);
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
was_ready = FALSE;
tp_channel_call_when_ready (chan, channel_ready, &was_ready);
@@ -380,7 +380,7 @@ main (int argc,
bad_chan_path = g_strdup_printf ("%s/Does/Not/Actually/Exist", conn_path);
chan = tp_channel_new (conn, bad_chan_path, NULL,
TP_UNKNOWN_HANDLE_TYPE, 0, &error);
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
MYASSERT (!tp_channel_run_until_ready (chan, &error, NULL), "");
MYASSERT (error != NULL, "");
@@ -406,7 +406,7 @@ main (int argc,
chan = tp_channel_new (conn, chan_path, TP_IFACE_CHANNEL_TYPE_TEXT,
TP_HANDLE_TYPE_CONTACT, handle, &error);
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
was_ready = FALSE;
tp_channel_call_when_ready (chan, channel_ready, &was_ready);
@@ -414,7 +414,7 @@ main (int argc,
g_main_loop_run (mainloop);
g_message ("Leaving main loop");
MYASSERT (was_ready == TRUE, "");
- MYASSERT_NO_ERROR (invalidated);
+ test_assert_no_error (invalidated);
MYASSERT_SAME_UINT (service_chan->get_handle_called, 0);
MYASSERT_SAME_UINT (service_chan->get_interfaces_called, 1);
MYASSERT_SAME_UINT (service_chan->get_channel_type_called, 0);
@@ -428,7 +428,7 @@ main (int argc,
was_ready = FALSE;
tp_channel_call_when_ready (chan, channel_ready, &was_ready);
MYASSERT (was_ready == TRUE, "");
- MYASSERT_NO_ERROR (invalidated);
+ test_assert_no_error (invalidated);
assert_chan_sane (chan, handle);
@@ -437,7 +437,7 @@ main (int argc,
g_message ("Channel already dead, so we are called back synchronously");
MYASSERT (tp_cli_connection_run_disconnect (conn, -1, &error, NULL), "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
was_ready = FALSE;
tp_channel_call_when_ready (chan, channel_ready, &was_ready);
diff --git a/tests/dbus/cli-group.c b/tests/dbus/cli-group.c
index 297a8cd..ac74582 100644
--- a/tests/dbus/cli-group.c
+++ b/tests/dbus/cli-group.c
@@ -90,7 +90,7 @@ test_channel_proxy (TestTextChannelGroup *service_chan,
gboolean has_detailed_flag, has_properties_flag;
MYASSERT (tp_channel_run_until_ready (chan, &error, NULL), "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
/* We want to ensure that each of these signals fires exactly once per
* change. The channel emits both MembersChanged and MembersChangedDetailed,
@@ -267,7 +267,7 @@ run_membership_test (guint channel_number,
chan = tp_channel_new (conn, chan_path, NULL, TP_UNKNOWN_HANDLE_TYPE, 0,
&error);
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
expecting_invalidated = FALSE;
g_signal_connect (chan, "invalidated", (GCallback) channel_invalidated_cb,
@@ -346,10 +346,10 @@ check_removed_error_in_invalidated (void)
chan = tp_channel_new (conn, chan_path, NULL, TP_UNKNOWN_HANDLE_TYPE, 0,
&error);
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
MYASSERT (tp_channel_run_until_ready (chan, &error, NULL), "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
DEBUG ("ready!");
g_signal_connect (chan, "invalidated", (GCallback) check_invalidated_cb,
@@ -413,15 +413,15 @@ main (int argc,
MYASSERT (tp_base_connection_register (service_conn_as_base, "simple",
&name, &conn_path, &error), "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
conn = tp_connection_new (dbus, name, conn_path, &error);
MYASSERT (conn != NULL, "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
MYASSERT (tp_connection_run_until_ready (conn, TRUE, &error, NULL),
"");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
contact_repo = tp_base_connection_get_handles (service_conn_as_base,
TP_HANDLE_TYPE_CONTACT);
@@ -434,13 +434,13 @@ main (int argc,
mainloop = g_main_loop_new (NULL, FALSE);
MYASSERT (tp_cli_connection_run_connect (conn, -1, &error, NULL), "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
run_membership_tests ();
check_removed_error_in_invalidated ();
MYASSERT (tp_cli_connection_run_disconnect (conn, -1, &error, NULL), "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
/* clean up */
diff --git a/tests/dbus/connection-bug-18845.c b/tests/dbus/connection-bug-18845.c
index 2e7f2b2..57098f8 100644
--- a/tests/dbus/connection-bug-18845.c
+++ b/tests/dbus/connection-bug-18845.c
@@ -16,6 +16,7 @@
#include "tests/lib/myassert.h"
#include "tests/lib/simple-conn.h"
+#include "tests/lib/util.h"
static GMainLoop *mainloop;
@@ -60,14 +61,14 @@ main (int argc,
MYASSERT (tp_base_connection_register (service_conn_as_base, "simple",
&name, &conn_path, &error), "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
conn = tp_connection_new (dbus, name, conn_path, &error);
MYASSERT (conn != NULL, "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
MYASSERT (tp_connection_run_until_ready (conn, TRUE, &error, NULL),
"");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
{
const gchar *ids[] = {
@@ -78,7 +79,7 @@ main (int argc,
MYASSERT (tp_cli_connection_run_request_handles (conn, -1,
TP_HANDLE_TYPE_CONTACT, ids, &handles, &error, NULL), "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
g_array_free (handles, TRUE);
}
@@ -88,7 +89,7 @@ main (int argc,
*/
proxy = tp_proxy_borrow_interface_by_id ((TpProxy *) conn,
TP_IFACE_QUARK_CONNECTION, &error);
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
g_signal_emit_by_name (proxy, "destroy");
g_idle_add_full (G_PRIORITY_LOW, no_more_idling_around, mainloop, NULL);
@@ -102,12 +103,12 @@ main (int argc,
*/
conn = tp_connection_new (dbus, name, conn_path, &error);
MYASSERT (conn != NULL, "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
MYASSERT (tp_connection_run_until_ready (conn, TRUE, &error, NULL), "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
MYASSERT (tp_cli_connection_run_disconnect (conn, -1, &error, NULL), "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
g_object_unref (conn);
diff --git a/tests/dbus/connection-error.c b/tests/dbus/connection-error.c
index fc12cdc..fee6681 100644
--- a/tests/dbus/connection-error.c
+++ b/tests/dbus/connection-error.c
@@ -16,6 +16,7 @@
#include "tests/lib/myassert.h"
#include "tests/lib/simple-conn.h"
+#include "tests/lib/util.h"
static int connection_errors;
@@ -123,14 +124,14 @@ main (int argc,
MYASSERT (tp_base_connection_register (service_conn_as_base, "simple",
&name, &conn_path, &error), "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
conn = tp_connection_new (dbus, name, conn_path, &error);
MYASSERT (conn != NULL, "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
MYASSERT (tp_connection_run_until_ready (conn, TRUE, &error, NULL),
"");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
connection_errors = 0;
tp_cli_connection_connect_to_connection_error (conn, on_connection_error,
diff --git a/tests/dbus/connection-getinterfaces-failure.c b/tests/dbus/connection-getinterfaces-failure.c
index ae63b97..4c9c19b 100644
--- a/tests/dbus/connection-getinterfaces-failure.c
+++ b/tests/dbus/connection-getinterfaces-failure.c
@@ -15,6 +15,7 @@
#include "tests/lib/myassert.h"
#include "tests/lib/simple-conn.h"
+#include "tests/lib/util.h"
static GType bug15306_connection_get_type (void);
@@ -109,15 +110,15 @@ main (int argc,
MYASSERT (tp_base_connection_register (service_conn_as_base, "simple",
&name, &conn_path, &error), "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
conn = tp_connection_new (dbus, name, conn_path, &error);
MYASSERT (conn != NULL, "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
MYASSERT (tp_connection_run_until_ready (conn, TRUE, &error, NULL),
"");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
/* disconnect the service_conn */
MYASSERT (tp_cli_connection_connect_to_status_changed (conn,
diff --git a/tests/dbus/connection-handles.c b/tests/dbus/connection-handles.c
index e9dd69c..37eba35 100644
--- a/tests/dbus/connection-handles.c
+++ b/tests/dbus/connection-handles.c
@@ -120,7 +120,7 @@ test_request_and_release (SimpleConnection *service_conn,
g_main_loop_run (result.loop);
- MYASSERT_NO_ERROR (result.error);
+ test_assert_no_error (result.error);
MYASSERT (result.ids != NULL, "");
MYASSERT (result.handles != NULL, "");
@@ -195,7 +195,7 @@ test_request_hold_release (SimpleConnection *service_conn,
g_main_loop_run (result.loop);
- MYASSERT_NO_ERROR (result.error);
+ test_assert_no_error (result.error);
MYASSERT (result.ids != NULL, "");
MYASSERT (result.handles != NULL, "");
@@ -238,7 +238,7 @@ test_request_hold_release (SimpleConnection *service_conn,
g_main_loop_run (result.loop);
- MYASSERT_NO_ERROR (result.error);
+ test_assert_no_error (result.error);
MYASSERT (result.ids == NULL, "");
MYASSERT (result.handles != NULL, "");
@@ -323,14 +323,14 @@ main (int argc,
MYASSERT (tp_base_connection_register (service_conn_as_base, "simple",
&name, &conn_path, &error), "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
client_conn = tp_connection_new (dbus, name, conn_path, &error);
MYASSERT (client_conn != NULL, "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
MYASSERT (tp_connection_run_until_ready (client_conn, TRUE, &error, NULL),
"");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
/* Tests */
@@ -341,7 +341,7 @@ main (int argc,
MYASSERT (tp_cli_connection_run_disconnect (client_conn, -1, &error, NULL),
"");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
service_conn_as_base = NULL;
g_object_unref (service_conn);
diff --git a/tests/dbus/connection-inject-bug16307.c b/tests/dbus/connection-inject-bug16307.c
index 93129fc..21b4419 100644
--- a/tests/dbus/connection-inject-bug16307.c
+++ b/tests/dbus/connection-inject-bug16307.c
@@ -15,6 +15,7 @@
#include "tests/lib/myassert.h"
#include "tests/lib/bug16307-conn.h"
+#include "tests/lib/util.h"
static GMainLoop *mainloop;
@@ -53,21 +54,21 @@ main (int argc,
MYASSERT (tp_base_connection_register (service_conn_as_base, "simple",
&name, &conn_path, &error), "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
/* client side */
conn = tp_connection_new (dbus, name, conn_path, &error);
MYASSERT (conn != NULL, "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
bug16307_connection_inject_get_status_return (service_conn);
MYASSERT (tp_connection_run_until_ready (conn, TRUE, &error, NULL),
"");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
MYASSERT (tp_cli_connection_run_disconnect (conn, -1, &error, NULL), "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
service_conn_as_base = NULL;
g_object_unref (service_conn);
diff --git a/tests/dbus/connection.c b/tests/dbus/connection.c
index dcd8604..ea796ad 100644
--- a/tests/dbus/connection.c
+++ b/tests/dbus/connection.c
@@ -16,6 +16,7 @@
#include "tests/lib/myassert.h"
#include "tests/lib/simple-conn.h"
+#include "tests/lib/util.h"
static GMainLoop *mainloop;
@@ -33,7 +34,7 @@ test_run_until_invalid (TpDBusDaemon *dbus,
conn = tp_connection_new (dbus, name, conn_path, &error);
MYASSERT (conn != NULL, "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
tp_proxy_invalidate ((TpProxy *) conn, &invalidated_for_test);
MYASSERT (!tp_connection_run_until_ready (conn, TRUE, &error, NULL),
@@ -56,11 +57,11 @@ test_run_until_ready (TpDBusDaemon *dbus,
conn = tp_connection_new (dbus, name, conn_path, &error);
MYASSERT (conn != NULL, "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
MYASSERT (tp_connection_run_until_ready (conn, TRUE, &error, NULL),
"");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
g_object_unref (conn);
}
@@ -118,21 +119,21 @@ test_call_when_ready (TpDBusDaemon *dbus,
conn = tp_connection_new (dbus, name, conn_path, &error);
MYASSERT (conn != NULL, "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
tp_connection_call_when_ready (conn, conn_ready, &ctx);
g_message ("Entering main loop");
g_main_loop_run (mainloop);
g_message ("Leaving main loop");
MYASSERT (ctx.ready == TRUE, "");
- MYASSERT_NO_ERROR (ctx.error);
+ test_assert_no_error (ctx.error);
/* Connection already ready, so we are called back synchronously */
ctx.ready = FALSE;
tp_connection_call_when_ready (conn, conn_ready, &ctx);
MYASSERT (ctx.ready == TRUE, "");
- MYASSERT_NO_ERROR (ctx.error);
+ test_assert_no_error (ctx.error);
g_object_unref (conn);
}
@@ -149,7 +150,7 @@ test_call_when_invalid (TpDBusDaemon *dbus,
conn = tp_connection_new (dbus, name, conn_path, &error);
MYASSERT (conn != NULL, "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
/* Connection becomes invalid, so we are called back synchronously */
@@ -203,7 +204,7 @@ main (int argc,
MYASSERT (tp_base_connection_register (service_conn_as_base, "simple",
&name, &conn_path, &error), "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
test_run_until_invalid (dbus, service_conn, name, conn_path);
test_run_until_ready (dbus, service_conn, name, conn_path);
@@ -212,12 +213,12 @@ main (int argc,
conn = tp_connection_new (dbus, name, conn_path, &error);
MYASSERT (conn != NULL, "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
MYASSERT (tp_connection_run_until_ready (conn, TRUE, &error, NULL),
"");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
MYASSERT (tp_cli_connection_run_disconnect (conn, -1, &error, NULL), "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
MYASSERT (!tp_connection_run_until_ready (conn, FALSE, &error, NULL), "");
MYASSERT_SAME_UINT (error->domain, TP_ERRORS);
diff --git a/tests/dbus/contacts-bug-19101.c b/tests/dbus/contacts-bug-19101.c
index 85625dc..cda5d03 100644
--- a/tests/dbus/contacts-bug-19101.c
+++ b/tests/dbus/contacts-bug-19101.c
@@ -160,14 +160,14 @@ main (int argc,
MYASSERT (tp_base_connection_register (service_conn_as_base, "simple",
&name, &conn_path, &error), "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
client_conn = tp_connection_new (dbus, name, conn_path, &error);
MYASSERT (client_conn != NULL, "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
MYASSERT (tp_connection_run_until_ready (client_conn, TRUE, &error, NULL),
"");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
/* Tests */
@@ -177,7 +177,7 @@ main (int argc,
MYASSERT (tp_cli_connection_run_disconnect (client_conn, -1, &error, NULL),
"");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
g_object_unref (client_conn);
service_conn_as_base = NULL;
diff --git a/tests/dbus/contacts-mixin.c b/tests/dbus/contacts-mixin.c
index 4f66b12..408cb9b 100644
--- a/tests/dbus/contacts-mixin.c
+++ b/tests/dbus/contacts-mixin.c
@@ -31,7 +31,7 @@ test_no_features (ContactsConnection *service_conn,
MYASSERT (tp_cli_connection_interface_contacts_run_get_contact_attributes (
client_conn, -1, handles, NULL, FALSE, &contacts, &error, NULL), "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
MYASSERT_SAME_UINT (g_hash_table_size (contacts), 3);
attrs = g_hash_table_lookup (contacts,
@@ -77,7 +77,7 @@ test_features (ContactsConnection *service_conn,
MYASSERT (tp_cli_connection_interface_contacts_run_get_contact_attributes (
client_conn, -1, handles, interfaces, FALSE, &contacts, &error, NULL),
"");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
MYASSERT_SAME_UINT (g_hash_table_size (contacts), 3);
attrs = g_hash_table_lookup (contacts,
@@ -171,14 +171,14 @@ main (int argc,
MYASSERT (tp_base_connection_register (service_conn_as_base, "simple",
&name, &conn_path, &error), "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
client_conn = tp_connection_new (dbus, name, conn_path, &error);
MYASSERT (client_conn != NULL, "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
MYASSERT (tp_connection_run_until_ready (client_conn, TRUE, &error, NULL),
"");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
/* Set up some contacts */
@@ -205,7 +205,7 @@ main (int argc,
MYASSERT (tp_cli_connection_run_disconnect (client_conn, -1, &error, NULL),
"");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
service_conn_as_base = NULL;
g_object_unref (service_conn);
diff --git a/tests/dbus/contacts.c b/tests/dbus/contacts.c
index 0d93423..0dc9fd3 100644
--- a/tests/dbus/contacts.c
+++ b/tests/dbus/contacts.c
@@ -143,7 +143,7 @@ test_by_handle (ContactsConnection *service_conn,
MYASSERT (result.contacts->len == 3, ": %u", result.contacts->len);
MYASSERT (result.invalid->len == 2, ": %u", result.invalid->len);
- MYASSERT_NO_ERROR (result.error);
+ test_assert_no_error (result.error);
MYASSERT (g_ptr_array_index (result.contacts, 0) != NULL, "");
MYASSERT (g_ptr_array_index (result.contacts, 1) != NULL, "");
@@ -187,7 +187,7 @@ test_by_handle (ContactsConnection *service_conn,
MYASSERT (result.contacts->len == 4, ": %u", result.contacts->len);
MYASSERT (result.invalid->len == 0, ": %u", result.invalid->len);
- MYASSERT_NO_ERROR (result.error);
+ test_assert_no_error (result.error);
/* 0, 1 and 3 we already have a reference to */
MYASSERT (g_ptr_array_index (result.contacts, 0) == contacts[0], "");
@@ -263,7 +263,7 @@ test_no_features (ContactsConnection *service_conn,
MYASSERT (result.contacts->len == 3, ": %u", result.contacts->len);
MYASSERT (result.invalid->len == 0, ": %u", result.invalid->len);
- MYASSERT_NO_ERROR (result.error);
+ test_assert_no_error (result.error);
MYASSERT (g_ptr_array_index (result.contacts, 0) != NULL, "");
MYASSERT (g_ptr_array_index (result.contacts, 1) != NULL, "");
@@ -399,7 +399,7 @@ test_upgrade (ContactsConnection *service_conn,
MYASSERT (result.contacts->len == 3, ": %u", result.contacts->len);
MYASSERT (result.invalid->len == 0, ": %u", result.invalid->len);
- MYASSERT_NO_ERROR (result.error);
+ test_assert_no_error (result.error);
MYASSERT (g_ptr_array_index (result.contacts, 0) != NULL, "");
MYASSERT (g_ptr_array_index (result.contacts, 1) != NULL, "");
@@ -446,7 +446,7 @@ test_upgrade (ContactsConnection *service_conn,
MYASSERT (result.contacts->len == 3, ": %u", result.contacts->len);
MYASSERT (result.invalid == NULL, "");
- MYASSERT_NO_ERROR (result.error);
+ test_assert_no_error (result.error);
for (i = 0; i < 3; i++)
{
@@ -561,7 +561,7 @@ test_features (ContactsConnection *service_conn,
MYASSERT (result.contacts->len == 3, ": %u", result.contacts->len);
MYASSERT (result.invalid->len == 0, ": %u", result.invalid->len);
- MYASSERT_NO_ERROR (result.error);
+ test_assert_no_error (result.error);
MYASSERT (g_ptr_array_index (result.contacts, 0) != NULL, "");
MYASSERT (g_ptr_array_index (result.contacts, 1) != NULL, "");
@@ -781,7 +781,7 @@ test_by_id (TpConnection *client_conn)
MYASSERT (result.contacts->len == 0, ": %u", result.contacts->len);
MYASSERT (g_hash_table_size (result.bad_ids) == 1, ": %u",
g_hash_table_size (result.bad_ids));
- MYASSERT_NO_ERROR (result.error);
+ test_assert_no_error (result.error);
e = g_hash_table_lookup (result.bad_ids, "Not valid");
MYASSERT (e != NULL, "");
@@ -806,7 +806,7 @@ test_by_id (TpConnection *client_conn)
MYASSERT (result.contacts->len == 2, ": %u", result.contacts->len);
MYASSERT (g_hash_table_size (result.bad_ids) == 0, ": %u",
g_hash_table_size (result.bad_ids));
- MYASSERT_NO_ERROR (result.error);
+ test_assert_no_error (result.error);
MYASSERT (g_ptr_array_index (result.contacts, 0) != NULL, "");
MYASSERT (g_ptr_array_index (result.contacts, 1) != NULL, "");
@@ -842,7 +842,7 @@ test_by_id (TpConnection *client_conn)
MYASSERT (result.contacts->len == 3, ": %u", result.contacts->len);
MYASSERT (g_hash_table_size (result.bad_ids) == 2, ": %u",
g_hash_table_size (result.bad_ids));
- MYASSERT_NO_ERROR (result.error);
+ test_assert_no_error (result.error);
e = g_hash_table_lookup (result.bad_ids, "Not valid");
MYASSERT (e != NULL, "");
@@ -922,26 +922,26 @@ main (int argc,
MYASSERT (tp_base_connection_register (service_conn_as_base, "simple",
&name, &conn_path, &error), "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
MYASSERT (tp_base_connection_register (legacy_service_conn_as_base, "simple",
&legacy_name, &legacy_conn_path, &error), "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
client_conn = tp_connection_new (dbus, name, conn_path, &error);
MYASSERT (client_conn != NULL, "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
MYASSERT (tp_connection_run_until_ready (client_conn, TRUE, &error, NULL),
"");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
legacy_client_conn = tp_connection_new (dbus, legacy_name, legacy_conn_path,
&error);
MYASSERT (legacy_client_conn != NULL, "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
MYASSERT (tp_connection_run_until_ready (legacy_client_conn, TRUE, &error,
NULL), "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
/* Tests */
@@ -961,12 +961,12 @@ main (int argc,
MYASSERT (tp_cli_connection_run_disconnect (client_conn, -1, &error, NULL),
"");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
g_object_unref (client_conn);
MYASSERT (tp_cli_connection_run_disconnect (legacy_client_conn, -1, &error,
NULL), "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
g_object_unref (legacy_client_conn);
service_conn_as_base = NULL;
diff --git a/tests/dbus/finalized-in-invalidated-handler.c b/tests/dbus/finalized-in-invalidated-handler.c
index 8dd1c17..48cc63b 100644
--- a/tests/dbus/finalized-in-invalidated-handler.c
+++ b/tests/dbus/finalized-in-invalidated-handler.c
@@ -17,6 +17,7 @@
#include "tests/lib/myassert.h"
#include "tests/lib/simple-conn.h"
#include "tests/lib/textchan-null.h"
+#include "tests/lib/util.h"
static GMainLoop *mainloop;
@@ -88,14 +89,14 @@ main (int argc,
MYASSERT (tp_base_connection_register (service_conn_as_base, "simple",
&name, &conn_path, &error), "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
conn = tp_connection_new (dbus, name, conn_path, &error);
MYASSERT (conn != NULL, "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
MYASSERT (tp_connection_run_until_ready (conn, TRUE, &error, NULL), "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
/* Paste on a channel */
@@ -104,7 +105,7 @@ main (int argc,
MYASSERT (contact_repo != NULL, "");
handle = tp_handle_ensure (contact_repo, "them at example.org", NULL, &error);
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
chan_path = g_strdup_printf ("%s/Channel", conn_path);
service_chan = TEST_TEXT_CHANNEL_NULL (g_object_new (
@@ -116,10 +117,10 @@ main (int argc,
chan = tp_channel_new (conn, chan_path, TP_IFACE_CHANNEL_TYPE_TEXT,
TP_HANDLE_TYPE_CONTACT, handle, &error);
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
tp_channel_run_until_ready (chan, &error, NULL);
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
g_signal_connect (chan, "invalidated", G_CALLBACK (on_invalidated),
&chan);
diff --git a/tests/dbus/group-mixin.c b/tests/dbus/group-mixin.c
index d56977e..6d3b18b 100644
--- a/tests/dbus/group-mixin.c
+++ b/tests/dbus/group-mixin.c
@@ -164,7 +164,7 @@ check_initial_properties (void)
MYASSERT (tp_cli_dbus_properties_run_get_all (chan, -1,
TP_IFACE_CHANNEL_INTERFACE_GROUP, &props, &error, NULL), "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
members = tp_asv_get_boxed (props, "Members", DBUS_TYPE_G_UINT_ARRAY);
MYASSERT (members != NULL, ": Members should be defined"); \
@@ -297,7 +297,7 @@ check_incoming_invitation (void)
self_added_to_members);
MYASSERT (tp_cli_channel_interface_group_run_add_members (chan, -1,
contacts, "", &error, NULL), "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
wait_for_outstanding_signals ();
MYASSERT (!outstanding_signals (),
": MembersChanged and MembersChangedDetailed should have fired once");
@@ -493,7 +493,7 @@ test_group_mixin (void)
GError *error = NULL;
MYASSERT (tp_channel_run_until_ready (chan, &error, NULL), "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
MYASSERT (tp_proxy_has_interface (chan, TP_IFACE_CHANNEL_INTERFACE_GROUP),
"");
@@ -537,15 +537,15 @@ main (int argc,
MYASSERT (tp_base_connection_register (service_conn_as_base, "simple",
&name, &conn_path, &error), "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
conn = tp_connection_new (dbus, name, conn_path, &error);
MYASSERT (conn != NULL, "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
MYASSERT (tp_connection_run_until_ready (conn, TRUE, &error, NULL),
"");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
contact_repo = tp_base_connection_get_handles (service_conn_as_base,
TP_HANDLE_TYPE_CONTACT);
@@ -564,19 +564,19 @@ main (int argc,
mainloop = g_main_loop_new (NULL, FALSE);
MYASSERT (tp_cli_connection_run_connect (conn, -1, &error, NULL), "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
chan = tp_channel_new (conn, chan_path, NULL, TP_UNKNOWN_HANDLE_TYPE, 0,
&error);
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
MYASSERT (tp_channel_run_until_ready (chan, &error, NULL), "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
test_group_mixin ();
MYASSERT (tp_cli_connection_run_disconnect (conn, -1, &error, NULL), "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
/* clean up */
diff --git a/tests/dbus/invalidated-while-invoking-signals.c b/tests/dbus/invalidated-while-invoking-signals.c
index 009668b..1312b70 100644
--- a/tests/dbus/invalidated-while-invoking-signals.c
+++ b/tests/dbus/invalidated-while-invoking-signals.c
@@ -15,6 +15,7 @@
#include "tests/lib/myassert.h"
#include "tests/lib/simple-conn.h"
+#include "tests/lib/util.h"
static GMainLoop *mainloop;
@@ -79,14 +80,14 @@ main (int argc,
MYASSERT (tp_base_connection_register (service_as_base, "simple",
&name, &path, &error), "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
client = tp_connection_new (dbus, name, path, &error);
MYASSERT (client != NULL, "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
MYASSERT (tp_connection_run_until_ready (client, TRUE, &error, NULL), "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
MYASSERT (tp_cli_connection_connect_to_status_changed (client,
on_status_changed, &client, NULL, NULL, NULL), "");
diff --git a/tests/dbus/message-mixin.c b/tests/dbus/message-mixin.c
index 13c3438..06d68ef 100644
--- a/tests/dbus/message-mixin.c
+++ b/tests/dbus/message-mixin.c
@@ -18,6 +18,7 @@
#include "examples/cm/echo-message-parts/chan.h"
#include "examples/cm/echo-message-parts/conn.h"
#include "tests/lib/myassert.h"
+#include "tests/lib/util.h"
static guint received_count = 0;
static guint last_received_id = 0;
@@ -223,22 +224,22 @@ main (int argc,
MYASSERT (tp_base_connection_register (service_conn_as_base, "example",
&name, &conn_path, &error), "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
conn = tp_connection_new (dbus, name, conn_path, &error);
MYASSERT (conn != NULL, "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
MYASSERT (tp_connection_run_until_ready (conn, TRUE, &error, NULL),
"");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
contact_repo = tp_base_connection_get_handles (service_conn_as_base,
TP_HANDLE_TYPE_CONTACT);
MYASSERT (contact_repo != NULL, "");
handle = tp_handle_ensure (contact_repo, "them at example.org", NULL, &error);
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
{
GHashTable *request = g_hash_table_new_full (g_str_hash, g_str_equal,
@@ -255,17 +256,17 @@ main (int argc,
tp_cli_connection_interface_requests_run_create_channel (conn, -1,
request, &chan_path, NULL, &error, NULL);
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
g_hash_table_destroy (request);
}
chan = tp_channel_new (conn, chan_path, TP_IFACE_CHANNEL_TYPE_TEXT,
TP_HANDLE_TYPE_CONTACT, handle, &error);
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
tp_channel_run_until_ready (chan, &error, NULL);
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
MYASSERT (tp_cli_channel_type_text_connect_to_received (chan, on_received,
g_object_ref (contact_repo), g_object_unref, NULL, NULL) != NULL, "");
@@ -292,7 +293,7 @@ main (int argc,
tp_cli_dbus_properties_run_get_all (chan, -1,
TP_IFACE_CHANNEL_INTERFACE_MESSAGES, &properties, &error, NULL);
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
g_print ("\n\n==== Examining properties ====\n\n");
@@ -344,7 +345,7 @@ main (int argc,
while (received_count < 1 || message_received_count < 1)
g_main_context_iteration (NULL, TRUE);
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
MYASSERT (sent_count == 1, ": %u != 1", sent_count);
MYASSERT (received_count == 1, ": %u != 1", received_count);
MYASSERT (last_sent_type == TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL,
@@ -384,7 +385,7 @@ main (int argc,
while (received_count < 1 || message_received_count < 1)
g_main_context_iteration (NULL, TRUE);
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
MYASSERT (sent_count == 1, ": %u != 1", sent_count);
MYASSERT (received_count == 1, ": %u != 1", received_count);
MYASSERT (last_sent_type == TP_CHANNEL_TEXT_MESSAGE_TYPE_ACTION,
@@ -425,7 +426,7 @@ main (int argc,
while (received_count < 1 || message_received_count < 1)
g_main_context_iteration (NULL, TRUE);
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
MYASSERT (sent_count == 1, ": %u != 1", sent_count);
MYASSERT (received_count == 1, ": %u != 1", received_count);
MYASSERT (last_sent_type == TP_CHANNEL_TEXT_MESSAGE_TYPE_NOTICE,
@@ -522,7 +523,7 @@ main (int argc,
tp_cli_channel_interface_messages_run_send_message (chan, -1,
send_parts, 0 /* flags */, &token, &error, NULL);
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
/* wait for pending events to be delivered */
while (received_count < 1 || message_received_count < 1)
@@ -644,7 +645,7 @@ main (int argc,
tp_cli_channel_interface_messages_run_send_message (chan, -1,
send_parts, 0 /* flags */, &token, &error, NULL);
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
/* wait for pending events to be delivered */
while (received_count < 1 || message_received_count < 1)
@@ -741,7 +742,7 @@ main (int argc,
tp_cli_channel_interface_messages_run_send_message (chan, -1,
send_parts, 0 /* flags */, &token, &error, NULL);
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
/* wait for pending events to be delivered */
while (received_count < 1 || message_received_count < 1)
@@ -846,7 +847,7 @@ main (int argc,
tp_cli_channel_interface_messages_run_send_message (chan, -1,
send_parts, 0 /* flags */, &token, &error, NULL);
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
/* wait for pending events to be delivered */
while (received_count < 1 || message_received_count < 1)
@@ -902,7 +903,7 @@ main (int argc,
tp_cli_channel_interface_messages_run_get_pending_message_content (chan,
-1, last_received_id, part_numbers, &ret, &error, NULL);
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
MYASSERT (g_hash_table_size (ret) == 2, ": %u",
g_hash_table_size (ret));
@@ -931,7 +932,7 @@ main (int argc,
tp_cli_channel_type_text_run_list_pending_messages (chan, -1,
FALSE, &messages, &error, NULL);
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
g_print ("Freeing\n");
g_boxed_free (TP_ARRAY_TYPE_PENDING_TEXT_MESSAGE_LIST, messages);
@@ -976,7 +977,7 @@ main (int argc,
tp_cli_dbus_properties_run_get_all (chan, -1,
TP_IFACE_CHANNEL_INTERFACE_MESSAGES, &properties, &error, NULL);
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
g_print ("\n\n==== Examining properties ====\n\n");
@@ -1028,7 +1029,7 @@ main (int argc,
tp_cli_channel_type_text_run_acknowledge_pending_messages (chan, -1,
msgid, &error, NULL);
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
g_array_free (msgid, TRUE);
}
@@ -1041,7 +1042,7 @@ main (int argc,
tp_cli_channel_type_text_run_list_pending_messages (chan, -1,
TRUE, &messages, &error, NULL);
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
g_print ("Freeing\n");
g_boxed_free (TP_ARRAY_TYPE_PENDING_TEXT_MESSAGE_LIST, messages);
@@ -1053,13 +1054,13 @@ main (int argc,
GPtrArray *channels;
MYASSERT (tp_cli_channel_run_close (chan, -1, &error, NULL), "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
MYASSERT (tp_proxy_get_invalidated (chan) != NULL, "");
/* assert that the channel has really gone */
MYASSERT (tp_cli_connection_run_list_channels (conn, -1,
&channels, &error, NULL), "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
MYASSERT (channels->len == 0, "%u != 0", channels->len);
g_boxed_free (TP_ARRAY_TYPE_CHANNEL_INFO_LIST, channels);
}
@@ -1067,7 +1068,7 @@ main (int argc,
g_print ("\n\n==== End of tests ====\n");
MYASSERT (tp_cli_connection_run_disconnect (conn, -1, &error, NULL), "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
tp_handle_unref (contact_repo, handle);
g_object_unref (chan);
diff --git a/tests/dbus/self-handle.c b/tests/dbus/self-handle.c
index 6409e3f..bce822e 100644
--- a/tests/dbus/self-handle.c
+++ b/tests/dbus/self-handle.c
@@ -105,14 +105,14 @@ main (int argc,
MYASSERT (tp_base_connection_register (service_conn_as_base, "simple",
&name, &conn_path, &error), "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
client_conn = tp_connection_new (dbus, name, conn_path, &error);
MYASSERT (client_conn != NULL, "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
MYASSERT (tp_connection_run_until_ready (client_conn, TRUE, &error, NULL),
"");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
/* Tests */
@@ -122,7 +122,7 @@ main (int argc,
MYASSERT (tp_cli_connection_run_disconnect (client_conn, -1, &error, NULL),
"");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
g_object_unref (client_conn);
service_conn_as_base = NULL;
diff --git a/tests/dbus/self-presence.c b/tests/dbus/self-presence.c
index b91bc6f..8212dec 100644
--- a/tests/dbus/self-presence.c
+++ b/tests/dbus/self-presence.c
@@ -31,7 +31,7 @@ test_simple_presence (ContactsConnection *service_conn,
MYASSERT (tp_cli_dbus_properties_run_get (client_conn, -1,
TP_IFACE_CONNECTION_INTERFACE_SIMPLE_PRESENCE, "Statuses",
&value, &error, NULL), "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
MYASSERT (G_VALUE_TYPE (value) == TP_HASH_TYPE_SIMPLE_STATUS_SPEC_MAP,
": %s != %s", G_VALUE_TYPE_NAME (value),
@@ -90,7 +90,7 @@ test_simple_presence (ContactsConnection *service_conn,
MYASSERT (tp_cli_connection_interface_simple_presence_run_set_presence (
client_conn, -1, "available", "Here I am", &error, NULL), "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
}
static void
@@ -105,7 +105,7 @@ test_complex_presence (ContactsConnection *service_conn,
MYASSERT (tp_cli_connection_interface_presence_run_get_statuses (
client_conn, -1, &statuses, &error, NULL), "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
spec = g_hash_table_lookup (statuses, "available");
MYASSERT (spec != NULL, "");
@@ -190,7 +190,7 @@ test_complex_presence (ContactsConnection *service_conn,
MYASSERT (tp_cli_connection_interface_presence_run_set_status (
client_conn, -1, monster, &error, NULL), "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
g_hash_table_destroy (params);
params = NULL;
@@ -229,14 +229,14 @@ main (int argc,
MYASSERT (tp_base_connection_register (service_conn_as_base, "simple",
&name, &conn_path, &error), "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
client_conn = tp_connection_new (dbus, name, conn_path, &error);
MYASSERT (client_conn != NULL, "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
MYASSERT (tp_connection_run_until_ready (client_conn, TRUE, &error, NULL),
"");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
/* Tests */
@@ -247,7 +247,7 @@ main (int argc,
MYASSERT (tp_cli_connection_run_disconnect (client_conn, -1, &error, NULL),
"");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
g_object_unref (client_conn);
service_conn_as_base = NULL;
diff --git a/tests/dbus/test-disconnection.c b/tests/dbus/test-disconnection.c
index b7da4e6..815f6aa 100644
--- a/tests/dbus/test-disconnection.c
+++ b/tests/dbus/test-disconnection.c
@@ -8,6 +8,7 @@
#include "tests/lib/myassert.h"
#include "tests/lib/stub-object.h"
+#include "tests/lib/util.h"
/* just for convenience, since it's used a lot */
#define PTR(ui) GUINT_TO_POINTER(ui)
@@ -67,7 +68,7 @@ requested_name (TpDBusDaemon *proxy,
g_message ("RequestName raised %s",
(error == NULL ? "no error" : error->message));
/* we're on a private bus, so certainly nobody else should own this name */
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
MYASSERT (result == DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER, ": %u", result);
}
@@ -194,7 +195,7 @@ main (int argc,
g_message ("Connecting signal to a");
tp_cli_dbus_daemon_connect_to_name_owner_changed (a, noc, PTR (TEST_A),
destroy_user_data, (GObject *) z, &error_out);
- MYASSERT_NO_ERROR (error_out);
+ test_assert_no_error (error_out);
/* assert that connecting to a signal on an interface we don't have fails */
freed = FALSE;
@@ -212,7 +213,7 @@ main (int argc,
g_message ("Connecting signal to b");
tp_cli_dbus_daemon_connect_to_name_owner_changed (b, noc, PTR (TEST_B),
destroy_user_data, stub, &error_out);
- MYASSERT_NO_ERROR (error_out);
+ test_assert_no_error (error_out);
MYASSERT (!tp_intset_is_member (freed_user_data, TEST_B), "");
g_object_unref (stub);
@@ -221,7 +222,7 @@ main (int argc,
g_message ("Connecting signal to c");
tp_cli_dbus_daemon_connect_to_name_owner_changed (c, noc, PTR (TEST_C),
destroy_user_data, NULL, &error_out);
- MYASSERT_NO_ERROR (error_out);
+ test_assert_no_error (error_out);
MYASSERT (!tp_intset_is_member (freed_user_data, TEST_C), "");
g_message ("Forcibly invalidating c");
tp_proxy_invalidate ((TpProxy *) c, &err);
@@ -243,7 +244,7 @@ main (int argc,
g_message ("Connecting signal to d");
tp_cli_dbus_daemon_connect_to_name_owner_changed (d, noc, PTR (TEST_D),
destroy_user_data, NULL, &error_out);
- MYASSERT_NO_ERROR (error_out);
+ test_assert_no_error (error_out);
MYASSERT (!tp_intset_is_member (freed_user_data, TEST_D), "");
g_message ("Destroying d");
tmp_obj = d;
@@ -256,7 +257,7 @@ main (int argc,
g_message ("Connecting signal to e");
sc = tp_cli_dbus_daemon_connect_to_name_owner_changed (e, noc, PTR (TEST_E),
destroy_user_data, NULL, &error_out);
- MYASSERT_NO_ERROR (error_out);
+ test_assert_no_error (error_out);
MYASSERT (!tp_intset_is_member (freed_user_data, TEST_E), "");
g_message ("Disconnecting signal from e");
tp_proxy_signal_connection_disconnect (sc);
@@ -269,7 +270,7 @@ main (int argc,
g_message ("Connecting signal to f");
tp_cli_dbus_daemon_connect_to_name_owner_changed (f, noc, PTR (TEST_F),
destroy_user_data, NULL, &error_out);
- MYASSERT_NO_ERROR (error_out);
+ test_assert_no_error (error_out);
MYASSERT (!tp_intset_is_member (freed_user_data, TEST_F), "");
g_message ("Forcibly disposing f's DBusGProxy to simulate name owner loss");
tmp_obj = tp_proxy_borrow_interface_by_id ((TpProxy *) f,
@@ -293,7 +294,7 @@ main (int argc,
g_message ("Connecting signal to g");
tp_cli_dbus_daemon_connect_to_name_owner_changed (g, noc, PTR (TEST_G),
destroy_user_data, (GObject *) g, &error_out);
- MYASSERT_NO_ERROR (error_out);
+ test_assert_no_error (error_out);
MYASSERT (!tp_intset_is_member (freed_user_data, TEST_G), "");
g_message ("Destroying g");
tmp_obj = g;
@@ -310,7 +311,7 @@ main (int argc,
g_message ("Connecting signal to h");
sc = tp_cli_dbus_daemon_connect_to_name_owner_changed (h, noc, PTR (TEST_H),
destroy_user_data, stub, &error_out);
- MYASSERT_NO_ERROR (error_out);
+ test_assert_no_error (error_out);
MYASSERT (!tp_intset_is_member (freed_user_data, TEST_H), "");
g_object_unref (stub);
@@ -320,7 +321,7 @@ main (int argc,
g_message ("Connecting signal to z");
tp_cli_dbus_daemon_connect_to_name_owner_changed (z, noc, PTR (TEST_Z),
destroy_user_data, (GObject *) a, &error_out);
- MYASSERT_NO_ERROR (error_out);
+ test_assert_no_error (error_out);
/* make sure a NameOwnerChanged signal occurs */
g_message ("Requesting name");
diff --git a/tests/dbus/text-mixin.c b/tests/dbus/text-mixin.c
index 7329287..f38a0d4 100644
--- a/tests/dbus/text-mixin.c
+++ b/tests/dbus/text-mixin.c
@@ -106,22 +106,22 @@ main (int argc,
MYASSERT (tp_base_connection_register (service_conn_as_base, "example",
&name, &conn_path, &error), "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
conn = tp_connection_new (dbus, name, conn_path, &error);
MYASSERT (conn != NULL, "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
MYASSERT (tp_connection_run_until_ready (conn, TRUE, &error, NULL),
"");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
contact_repo = tp_base_connection_get_handles (service_conn_as_base,
TP_HANDLE_TYPE_CONTACT);
MYASSERT (contact_repo != NULL, "");
handle = tp_handle_ensure (contact_repo, "them at example.org", NULL, &error);
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
/* FIXME: exercise RequestChannel rather than just pasting on a channel */
@@ -136,10 +136,10 @@ main (int argc,
chan = tp_channel_new (conn, chan_path, TP_IFACE_CHANNEL_TYPE_TEXT,
TP_HANDLE_TYPE_CONTACT, handle, &error);
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
tp_channel_run_until_ready (chan, &error, NULL);
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
MYASSERT (tp_cli_channel_type_text_connect_to_received (chan, on_received,
g_object_ref (contact_repo), g_object_unref, NULL, NULL) != NULL, "");
@@ -151,7 +151,7 @@ main (int argc,
tp_cli_channel_type_text_run_send (chan, -1,
TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL, "Hello, world!",
&error, NULL);
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
test_connection_run_until_dbus_queue_processed (conn);
MYASSERT (sent_count == 1, ": %u != 1", sent_count);
@@ -173,7 +173,7 @@ main (int argc,
tp_cli_channel_type_text_run_send (chan, -1,
TP_CHANNEL_TEXT_MESSAGE_TYPE_ACTION, "drinks coffee",
&error, NULL);
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
test_connection_run_until_dbus_queue_processed (conn);
MYASSERT (sent_count == 1, ": %u != 1", sent_count);
@@ -196,7 +196,7 @@ main (int argc,
tp_cli_channel_type_text_run_send (chan, -1,
TP_CHANNEL_TEXT_MESSAGE_TYPE_NOTICE, "Printer on fire",
&error, NULL);
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
test_connection_run_until_dbus_queue_processed (conn);
MYASSERT (sent_count == 1, ": %u != 1", sent_count);
@@ -221,7 +221,7 @@ main (int argc,
tp_cli_channel_type_text_run_list_pending_messages (chan, -1,
FALSE, &messages, &error, NULL);
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
g_print ("Freeing\n");
g_boxed_free (TP_ARRAY_TYPE_PENDING_TEXT_MESSAGE_LIST, messages);
@@ -264,7 +264,7 @@ main (int argc,
tp_cli_channel_type_text_run_acknowledge_pending_messages (chan, -1,
ids, &error, NULL);
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
g_array_free (ids, TRUE);
}
@@ -277,7 +277,7 @@ main (int argc,
tp_cli_channel_type_text_run_list_pending_messages (chan, -1,
TRUE, &messages, &error, NULL);
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
g_print ("Freeing\n");
g_boxed_free (TP_ARRAY_TYPE_PENDING_TEXT_MESSAGE_LIST, messages);
@@ -289,7 +289,7 @@ main (int argc,
gboolean dead;
MYASSERT (tp_cli_channel_run_close (chan, -1, &error, NULL), "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
MYASSERT (tp_proxy_get_invalidated (chan) != NULL, "");
g_object_get (service_chan,
@@ -302,7 +302,7 @@ main (int argc,
g_print ("\n\n==== End of tests ====\n");
MYASSERT (tp_cli_connection_run_disconnect (conn, -1, &error, NULL), "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
tp_handle_unref (contact_repo, handle);
g_object_unref (chan);
diff --git a/tests/dbus/text-respawn.c b/tests/dbus/text-respawn.c
index d117ed3..505b309 100644
--- a/tests/dbus/text-respawn.c
+++ b/tests/dbus/text-respawn.c
@@ -108,22 +108,22 @@ main (int argc,
MYASSERT (tp_base_connection_register (service_conn_as_base, "example",
&name, &conn_path, &error), "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
conn = tp_connection_new (dbus, name, conn_path, &error);
MYASSERT (conn != NULL, "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
MYASSERT (tp_connection_run_until_ready (conn, TRUE, &error, NULL),
"");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
contact_repo = tp_base_connection_get_handles (service_conn_as_base,
TP_HANDLE_TYPE_CONTACT);
MYASSERT (contact_repo != NULL, "");
handle = tp_handle_ensure (contact_repo, "them at example.org", NULL, &error);
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
/* FIXME: exercise RequestChannel rather than just pasting on a channel */
@@ -138,10 +138,10 @@ main (int argc,
chan = tp_channel_new (conn, chan_path, TP_IFACE_CHANNEL_TYPE_TEXT,
TP_HANDLE_TYPE_CONTACT, handle, &error);
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
tp_channel_run_until_ready (chan, &error, NULL);
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
MYASSERT (tp_cli_channel_type_text_connect_to_received (chan, on_received,
g_object_ref (contact_repo), g_object_unref, NULL, NULL) != NULL, "");
@@ -153,7 +153,7 @@ main (int argc,
tp_cli_channel_type_text_run_send (chan, -1,
TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL, "Hello, world!",
&error, NULL);
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
test_connection_run_until_dbus_queue_processed (conn);
MYASSERT (sent_count == 1, ": %u != 1", sent_count);
@@ -177,7 +177,7 @@ main (int argc,
TpHandle new_initiator;
MYASSERT (tp_cli_channel_run_close (chan, -1, &error, NULL), "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
MYASSERT (tp_proxy_get_invalidated (chan) != NULL, "");
g_object_get (service_chan,
@@ -195,10 +195,10 @@ main (int argc,
chan = tp_channel_new (conn, chan_path, TP_IFACE_CHANNEL_TYPE_TEXT,
TP_HANDLE_TYPE_CONTACT, handle, &error);
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
tp_channel_run_until_ready (chan, &error, NULL);
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
g_print ("\n\n==== Listing messages ====\n");
@@ -208,7 +208,7 @@ main (int argc,
tp_cli_channel_type_text_run_list_pending_messages (chan, -1,
FALSE, &messages, &error, NULL);
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
MYASSERT_SAME_UINT (messages->len, 1);
structure = g_ptr_array_index (messages, 0);
@@ -236,7 +236,7 @@ main (int argc,
MYASSERT (tp_cli_channel_interface_destroyable_run_destroy (chan, -1,
&error, NULL), "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
MYASSERT (tp_proxy_get_invalidated (chan) != NULL, "");
g_object_get (service_chan,
@@ -249,7 +249,7 @@ main (int argc,
g_print ("\n\n==== End of tests ====\n");
MYASSERT (tp_cli_connection_run_disconnect (conn, -1, &error, NULL), "");
- MYASSERT_NO_ERROR (error);
+ test_assert_no_error (error);
tp_handle_unref (contact_repo, handle);
g_object_unref (chan);
diff --git a/tests/lib/myassert.h b/tests/lib/myassert.h
index 2ec75e4..b6bb816 100644
--- a/tests/lib/myassert.h
+++ b/tests/lib/myassert.h
@@ -13,10 +13,6 @@
}\
} G_STMT_END
-#define MYASSERT_NO_ERROR(e) \
- MYASSERT (e == NULL, ": %s #%d: %s", g_quark_to_string (e->domain), e->code,\
- e->message)
-
#define MYASSERT_SAME_ERROR(left, right) \
G_STMT_START {\
MYASSERT ((left)->domain == (right)->domain,\
--
1.5.6.5
More information about the telepathy-commits
mailing list