summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2011-09-28 17:41:35 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2012-04-17 11:03:04 +0100
commit539bd92b8703134057c039f965ff7a5b5434c3a7 (patch)
tree6013b3323d849871f61652d60c1032ad0cd080d5
parentb0dc0f419b641f4ab8fdd8eaf69f4ed4c2d61159 (diff)
downloaddbus-glib-539bd92b8703134057c039f965ff7a5b5434c3a7.tar.gz
Remove tests in test-dbus-glib which basically just test error mapping
Also remove the methods on MyObject that only existed to support these tests; ThrowError is now versatile enough to implement them all. Leave ThrowUnregisteredError as it is, since it violates GError expectations (see GNOME#660371), but stop using it in test-dbus-glib - it's enough to use it in test-error-mapping. Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=40151 Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
-rw-r--r--test/core/my-object.c36
-rw-r--r--test/core/test-dbus-glib.c45
-rw-r--r--test/core/test-service-glib.xml9
3 files changed, 0 insertions, 90 deletions
diff --git a/test/core/my-object.c b/test/core/my-object.c
index e3636b5..82b6322 100644
--- a/test/core/my-object.c
+++ b/test/core/my-object.c
@@ -5,9 +5,6 @@
#include "my-object.h"
#include "my-object-marshal.h"
-static gboolean my_object_throw_error_under_score (MyObject *obj,
- GError **error);
-
#include "test-service-glib-glue.h"
void
@@ -313,39 +310,6 @@ my_object_throw_error (MyObject *obj, GError **error)
}
gboolean
-my_object_throw_not_supported (MyObject *obj, GError **error)
-{
- g_set_error (error,
- DBUS_GERROR,
- DBUS_GERROR_NOT_SUPPORTED,
- "%s",
- "this method always loses");
- return FALSE;
-}
-
-gboolean
-my_object_throw_error_multi_word (MyObject *obj, GError **error)
-{
- g_set_error (error,
- MY_OBJECT_ERROR,
- MY_OBJECT_ERROR_MULTI_WORD,
- "%s",
- "this method's error has a hyphen");
- return FALSE;
-}
-
-static gboolean
-my_object_throw_error_under_score (MyObject *obj, GError **error)
-{
- g_set_error (error,
- MY_OBJECT_ERROR,
- MY_OBJECT_ERROR_UNDER_SCORE,
- "%s",
- "this method's error has an underscore");
- return FALSE;
-}
-
-gboolean
my_object_throw_unregistered_error (MyObject *obj, GError **error)
{
/* Unregistered errors shouldn't cause a dbus abort. See
diff --git a/test/core/test-dbus-glib.c b/test/core/test-dbus-glib.c
index a42ee05..ffc2ae9 100644
--- a/test/core/test-dbus-glib.c
+++ b/test/core/test-dbus-glib.c
@@ -816,27 +816,6 @@ main (int argc, char **argv)
g_print ("ThrowError failed (as expected) returned error: %s\n", error->message);
g_clear_error (&error);
- g_print ("Calling ThrowNotSupported\n");
- if (dbus_g_proxy_call (proxy, "ThrowNotSupported", &error,
- G_TYPE_INVALID, G_TYPE_INVALID) != FALSE)
- lose ("ThrowNotSupported call unexpectedly succeeded!");
-
- if (error->domain != DBUS_GERROR || error->code != DBUS_GERROR_NOT_SUPPORTED)
- lose ("ThrowNotSupported call returned unexpected error: %s #%u: %s %s",
- g_quark_to_string (error->domain), error->code,
- dbus_g_error_get_name (error), error->message);
-
- g_print ("ThrowNotSupported correctly returned error: %s\n", error->message);
- g_clear_error (&error);
-
- g_print ("Calling ThrowUnregisteredError\n");
- if (dbus_g_proxy_call (proxy, "ThrowUnregisteredError", &error,
- G_TYPE_INVALID, G_TYPE_INVALID) != FALSE)
- lose ("ThrowError call unexpectedly succeeded!");
-
- g_print ("ThrowUnregisteredError failed (as expected) returned error: %s\n", error->message);
- g_clear_error (&error);
-
g_print ("Calling IncrementRetvalError (for error)\n");
error = NULL;
v_UINT32_2 = 0;
@@ -911,30 +890,6 @@ main (int argc, char **argv)
g_print ("(wrapped) ThrowError failed (as expected) returned error: %s\n", error->message);
g_clear_error (&error);
-
- g_print ("Calling (wrapped) throw_error_multi_word\n");
- if (org_freedesktop_DBus_GLib_Tests_MyObject_throw_error_multi_word (proxy, &error) != FALSE)
- lose ("(wrapped) ThrowErrorMultiWord call unexpectedly succeeded!");
-
- g_print ("(wrapped) ThrowErrorMultiWord failed (as expected) returned error: %s\n", error->message);
- g_clear_error (&error);
-
- g_print ("Calling (wrapped) throw_error_under_score\n");
- if (org_freedesktop_DBus_GLib_Tests_MyObject_throw_error_under_score (proxy, &error) != FALSE)
- lose ("(wrapped) ThrowErrorUnderScore call unexpectedly succeeded!");
-
- g_assert_error (error, DBUS_GERROR, DBUS_GERROR_REMOTE_EXCEPTION);
- g_assert_cmpstr (dbus_g_error_get_name (error), ==,
- "org.freedesktop.DBus.GLib.Tests.MyObject.Under_score");
-
- g_print ("(wrapped) ThrowErrorUnderScore failed (as expected) returned error: %s\n", error->message);
- g_clear_error (&error);
-
- if (org_freedesktop_DBus_GLib_Tests_MyObject_async_throw_error (proxy, &error) != FALSE)
- lose ("(wrapped) AsyncThrowError call unexpectedly succeeded!");
-
- g_print ("(wrapped) AsyncThrowError failed (as expected) returned error: %s\n", error->message);
- g_clear_error (&error);
g_print ("Calling (wrapped) uppercase\n");
if (!org_freedesktop_DBus_GLib_Tests_MyObject_uppercase (proxy, "foobar", &v_STRING_2, &error))
diff --git a/test/core/test-service-glib.xml b/test/core/test-service-glib.xml
index 1b595cc..d91620c 100644
--- a/test/core/test-service-glib.xml
+++ b/test/core/test-service-glib.xml
@@ -31,15 +31,6 @@
<method name="ThrowError">
</method>
- <method name="ThrowNotSupported">
- </method>
-
- <method name="ThrowErrorMultiWord">
- </method>
-
- <method name="ThrowErrorUnderScore">
- </method>
-
<method name="ThrowUnregisteredError">
</method>