[Telepathy-commits] [telepathy-gabble/master] test-handles: accept InvalidHandle as well as historical InvalidArgument

Simon McVittie simon.mcvittie at collabora.co.uk
Tue Oct 14 07:40:39 PDT 2008


telepathy-glib used to raise InvalidArgument, but we've decided that was a bug.
---
 tests/test-handles.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/tests/test-handles.c b/tests/test-handles.c
index 33b9e72..45f9b2d 100644
--- a/tests/test-handles.c
+++ b/tests/test-handles.c
@@ -32,14 +32,20 @@ test_handles (guint handle_type)
 
   /* Handle zero is never valid */
   g_assert (tp_handle_is_valid (tp_repo, 0, &error) == FALSE);
-  g_assert (error->code == TP_ERROR_INVALID_ARGUMENT);
+  /* this should probably be InvalidHandle, but it was InvalidArgument in
+   * older telepathy-glib */
+  g_assert (error->code == TP_ERROR_INVALID_ARGUMENT ||
+      error->code == TP_ERROR_INVALID_HANDLE);
 
   g_error_free (error);
   error = NULL;
 
   /* Properly return error when handle isn't in the repo */
   g_assert (tp_handle_is_valid (tp_repo, 65536, &error) == FALSE);
-  g_assert (error->code == TP_ERROR_INVALID_ARGUMENT);
+  /* this should really be InvalidHandle, but it was InvalidArgument in
+   * older telepathy-glib */
+  g_assert (error->code == TP_ERROR_INVALID_ARGUMENT ||
+      error->code == TP_ERROR_INVALID_HANDLE);
 
   g_error_free (error);
   error = NULL;
-- 
1.5.6.5



More information about the Telepathy-commits mailing list