[next] telepathy-glib: remove tp_connection_get_detailed_error()

Guillaume Desmottes gdesmott at kemper.freedesktop.org
Thu Feb 27 06:07:35 PST 2014


Module: telepathy-glib
Branch: next
Commit: 1eeb9763d8834cfc9a2f368ebd3bc23ea4e949d3
URL:    http://cgit.freedesktop.org/telepathy/telepathy-glib/commit/?id=1eeb9763d8834cfc9a2f368ebd3bc23ea4e949d3

Author: Guillaume Desmottes <guillaume.desmottes at collabora.co.uk>
Date:   Tue Feb 18 17:40:11 2014 +0100

remove tp_connection_get_detailed_error()

---

 .../telepathy-glib/telepathy-glib-sections.txt     |    1 -
 telepathy-glib/connection.c                        |    4 +-
 telepathy-glib/connection.h                        |    3 --
 tests/dbus/connection-error.c                      |   47 ++++++++------------
 tests/dbus/connection.c                            |   14 +++---
 5 files changed, 30 insertions(+), 39 deletions(-)

diff --git a/docs/reference/telepathy-glib/telepathy-glib-sections.txt b/docs/reference/telepathy-glib/telepathy-glib-sections.txt
index c0f2174..35427eb 100644
--- a/docs/reference/telepathy-glib/telepathy-glib-sections.txt
+++ b/docs/reference/telepathy-glib/telepathy-glib-sections.txt
@@ -3286,7 +3286,6 @@ tp_connection_set_contact_info_async
 tp_connection_set_contact_info_finish
 TP_UNKNOWN_CONNECTION_STATUS
 TP_ERRORS_DISCONNECTED
-tp_connection_get_detailed_error
 tp_connection_dup_detailed_error_vardict
 tp_connection_add_client_interest
 tp_connection_add_client_interest_by_id
diff --git a/telepathy-glib/connection.c b/telepathy-glib/connection.c
index 8bf6811..aff481f 100644
--- a/telepathy-glib/connection.c
+++ b/telepathy-glib/connection.c
@@ -2522,7 +2522,7 @@ tp_connection_get_capabilities (TpConnection *self)
   return self->priv->capabilities;
 }
 
-/**
+/*
  * tp_connection_get_detailed_error:
  * @self: a connection
  * @details: (out) (allow-none) (element-type utf8 GObject.Value) (transfer none):
@@ -2539,7 +2539,7 @@ tp_connection_get_capabilities (TpConnection *self)
  *
  * Since: 0.11.4
  */
-const gchar *
+static const gchar *
 tp_connection_get_detailed_error (TpConnection *self,
     const GHashTable **details)
 {
diff --git a/telepathy-glib/connection.h b/telepathy-glib/connection.h
index 0d2a882..6d2b558 100644
--- a/telepathy-glib/connection.h
+++ b/telepathy-glib/connection.h
@@ -183,9 +183,6 @@ gint tp_connection_presence_type_cmp_availability (TpConnectionPresenceType p1,
   TpConnectionPresenceType p2);
 
 _TP_AVAILABLE_IN_0_20
-const gchar *tp_connection_get_detailed_error (TpConnection *self,
-    const GHashTable **details);
-_TP_AVAILABLE_IN_0_20
 gchar *tp_connection_dup_detailed_error_vardict (TpConnection *self,
     GVariant **details) G_GNUC_WARN_UNUSED_RESULT;
 
diff --git a/tests/dbus/connection-error.c b/tests/dbus/connection-error.c
index cac973c..4fdb867 100644
--- a/tests/dbus/connection-error.c
+++ b/tests/dbus/connection-error.c
@@ -154,14 +154,13 @@ test_registered_error (Test *test,
     gconstpointer nil G_GNUC_UNUSED)
 {
   GError *error = NULL;
-  const GHashTable *asv;
+  GVariant *asv;
   gboolean ok;
+  gchar *str;
 
   asv = GUINT_TO_POINTER (0xDEADBEEF);
-  g_assert_cmpstr (tp_connection_get_detailed_error (test->conn, NULL), ==,
-      NULL);
-  g_assert_cmpstr (tp_connection_get_detailed_error (test->conn, &asv), ==,
-      NULL);
+  g_assert_cmpstr (tp_connection_dup_detailed_error_vardict (test->conn, &asv),
+      ==, NULL);
   g_assert_cmpuint (GPOINTER_TO_UINT (asv), ==, 0xDEADBEEF);
 
   connection_errors = 0;
@@ -182,11 +181,11 @@ test_registered_error (Test *test,
   g_assert_error (error, example_com_error_quark (), DOMAIN_SPECIFIC_ERROR);
   g_assert (!ok);
 
-  g_assert_cmpstr (tp_connection_get_detailed_error (test->conn, NULL), ==,
-      "com.example.DomainSpecificError");
-  g_assert_cmpstr (tp_connection_get_detailed_error (test->conn, &asv), ==,
-      "com.example.DomainSpecificError");
+  str = tp_connection_dup_detailed_error_vardict (test->conn, &asv);
+  g_assert_cmpstr (str, ==, "com.example.DomainSpecificError");
   g_assert (asv != NULL);
+  g_variant_unref (asv);
+  g_free (str);
 
   g_assert_cmpstr (g_quark_to_string (error->domain), ==,
       g_quark_to_string (example_com_error_quark ()));
@@ -212,8 +211,9 @@ test_unregistered_error (Test *test,
     gconstpointer nil G_GNUC_UNUSED)
 {
   GError *error = NULL;
-  const GHashTable *asv;
+  GVariant *asv;
   gboolean ok;
+  gchar *str;
 
   connection_errors = 0;
   tp_cli_connection_connect_to_connection_error (test->conn,
@@ -235,11 +235,13 @@ test_unregistered_error (Test *test,
   g_assert_error (error, TP_ERROR, TP_ERROR_NETWORK_ERROR);
   g_assert (!ok);
 
-  g_assert_cmpstr (tp_connection_get_detailed_error (test->conn, NULL), ==,
-      "net.example.WTF");
-  g_assert_cmpstr (tp_connection_get_detailed_error (test->conn, &asv), ==,
-      "net.example.WTF");
+  str = tp_connection_dup_detailed_error_vardict (test->conn, NULL);
+  g_assert_cmpstr (str, ==, "net.example.WTF");
+  g_free (str);
+  str = tp_connection_dup_detailed_error_vardict (test->conn, &asv);
+  g_assert_cmpstr (str, ==, "net.example.WTF");
   g_assert (asv != NULL);
+  g_variant_unref (asv);
 
   g_error_free (error);
   error = NULL;
@@ -262,17 +264,15 @@ test_detailed_error (Test *test,
     gconstpointer mode)
 {
   GError *error = NULL;
-  const GHashTable *asv;
+  GVariant *asv;
   gchar *str;
   GVariant *variant, *details;
   gboolean ok;
   gint32 bees;
 
   asv = GUINT_TO_POINTER (0xDEADBEEF);
-  g_assert_cmpstr (tp_connection_get_detailed_error (test->conn, NULL), ==,
-      NULL);
-  g_assert_cmpstr (tp_connection_get_detailed_error (test->conn, &asv), ==,
-      NULL);
+  g_assert_cmpstr (tp_connection_dup_detailed_error_vardict (test->conn, &asv),
+      ==, NULL);
   g_assert_cmpuint (GPOINTER_TO_UINT (asv), ==, 0xDEADBEEF);
 
   connection_errors = 0;
@@ -302,15 +302,6 @@ test_detailed_error (Test *test,
 
   g_assert_error (error, example_com_error_quark (), DOMAIN_SPECIFIC_ERROR);
 
-  g_assert_cmpstr (tp_connection_get_detailed_error (test->conn, NULL), ==,
-      "com.example.DomainSpecificError");
-  g_assert_cmpstr (tp_connection_get_detailed_error (test->conn, &asv), ==,
-      "com.example.DomainSpecificError");
-  g_assert (asv != NULL);
-  g_assert_cmpstr (tp_asv_get_string (asv, "debug-message"), ==,
-      "not enough bees");
-  g_assert_cmpint (tp_asv_get_int32 (asv, "bees-required", NULL), ==, 2342);
-
   str = tp_connection_dup_detailed_error_vardict (test->conn, NULL);
   g_assert_cmpstr (str, ==, "com.example.DomainSpecificError");
   g_free (str);
diff --git a/tests/dbus/connection.c b/tests/dbus/connection.c
index 4e1b525..b655355 100644
--- a/tests/dbus/connection.c
+++ b/tests/dbus/connection.c
@@ -198,7 +198,8 @@ test_fail_to_prepare (Test *test,
 {
   GError *error = NULL;
   GQuark features[] = { TP_CONNECTION_FEATURE_CONNECTED, 0 };
-  const GHashTable *asv;
+  GVariant *asv;
+  gchar *str;
 
   test->conn = tp_tests_connection_new (test->dbus, test->conn_name, test->conn_path,
       &error);
@@ -248,11 +249,14 @@ test_fail_to_prepare (Test *test,
   g_assert (!tp_proxy_is_prepared (test->conn,
         TP_CONNECTION_FEATURE_CONNECTED));
 
-  g_assert_cmpstr (tp_connection_get_detailed_error (test->conn, NULL), ==,
-      TP_ERROR_STR_PERMISSION_DENIED);
-  g_assert_cmpstr (tp_connection_get_detailed_error (test->conn, &asv), ==,
-      TP_ERROR_STR_PERMISSION_DENIED);
+  str = tp_connection_dup_detailed_error_vardict (test->conn, NULL);
+  g_assert_cmpstr (str, ==, TP_ERROR_STR_PERMISSION_DENIED);
+  g_free (str);
+  str = tp_connection_dup_detailed_error_vardict (test->conn, &asv);
+  g_assert_cmpstr (str, ==, TP_ERROR_STR_PERMISSION_DENIED);
   g_assert (asv != NULL);
+  g_free (str);
+  g_variant_unref (asv);
 }
 
 static void



More information about the telepathy-commits mailing list