[Telepathy-commits] [telepathy-glib/master] tests/lib/util.h: include file and line number in test_assert_no_error() failures

Simon McVittie simon.mcvittie at collabora.co.uk
Tue Mar 17 07:29:02 PDT 2009


---
 tests/lib/util.c |    7 +++++--
 tests/lib/util.h |    4 +++-
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/tests/lib/util.c b/tests/lib/util.c
index 35d3790..78dd9c6 100644
--- a/tests/lib/util.c
+++ b/tests/lib/util.c
@@ -17,11 +17,14 @@ test_connection_run_until_dbus_queue_processed (TpConnection *connection)
 }
 
 void
-test_assert_no_error (const GError *error)
+_test_assert_no_error (const GError *error,
+                       const char *file,
+                       int line)
 {
   if (error != NULL)
     {
-      g_error ("%s: code %u: %s", g_quark_to_string (error->domain),
+      g_error ("%s:%d:%s: code %u: %s",
+          file, line, g_quark_to_string (error->domain),
           error->code, error->message);
     }
 }
diff --git a/tests/lib/util.h b/tests/lib/util.h
index 0d29f67..ba76706 100644
--- a/tests/lib/util.h
+++ b/tests/lib/util.h
@@ -15,6 +15,8 @@
 
 void test_connection_run_until_dbus_queue_processed (TpConnection *connection);
 
-void test_assert_no_error (const GError *error);
+#define test_assert_no_error(e) _test_assert_no_error (e, __FILE__, __LINE__)
+
+void _test_assert_no_error (const GError *error, const char *file, int line);
 
 #endif
-- 
1.5.6.5




More information about the telepathy-commits mailing list