summaryrefslogtreecommitdiff
path: root/test/name-test/test-pending-call-dispatch.c
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2016-02-08 20:28:21 +0000
committerRalf Habacker <ralf.habacker@freenet.de>2016-02-11 02:37:14 +0100
commitfec99c9b3d8318e3abae432f2aca50802a87f90e (patch)
tree1c2b5f8ac1525653ce8e7d72d13e0bf9190aca42 /test/name-test/test-pending-call-dispatch.c
parent8fd2be6013e3d0ff6a6ff63ea022f9606d9a87c6 (diff)
downloaddbus-fec99c9b3d8318e3abae432f2aca50802a87f90e.tar.gz
name-test C tests: produce structured (TAP) output
Similar to commit 58eefa1031e14cb402ed0aae85e6bce1ba030a28. test-privserver is a helper executable, not a test. I moved its output from stdout to stderr so it can't be misinterpreted as the test's stdout. Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92899 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
Diffstat (limited to 'test/name-test/test-pending-call-dispatch.c')
-rw-r--r--test/name-test/test-pending-call-dispatch.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/test/name-test/test-pending-call-dispatch.c b/test/name-test/test-pending-call-dispatch.c
index c8b5a467..7785564d 100644
--- a/test/name-test/test-pending-call-dispatch.c
+++ b/test/name-test/test-pending-call-dispatch.c
@@ -56,13 +56,13 @@ _run_iteration (DBusConnection *conn)
if (reply == NULL)
{
- printf ("Failed: Reply is NULL ***\n");
+ printf ("Bail out! Reply is NULL ***\n");
exit (1);
}
if (dbus_message_get_type (reply) == DBUS_MESSAGE_TYPE_ERROR)
{
- printf ("Failed: Reply is error: %s ***\n", dbus_message_get_error_name (reply));
+ printf ("Bail out! Reply is error: %s ***\n", dbus_message_get_error_name (reply));
exit (1);
}
@@ -72,6 +72,7 @@ _run_iteration (DBusConnection *conn)
}
+/* This test outputs TAP syntax: http://testanything.org/ */
int
main (int argc, char *argv[])
{
@@ -87,7 +88,7 @@ main (int argc, char *argv[])
but if it does and we are stuck in a poll call then we know the
stuck in poll bug has come back to haunt us */
- printf ("*** Testing stuck in poll\n");
+ printf ("# Testing stuck in poll\n");
dbus_error_init (&error);
@@ -104,10 +105,10 @@ main (int argc, char *argv[])
/* we just care about seconds */
delta = end_tv_sec - start_tv_sec;
- printf ("Iter %i: %lis\n", i, delta);
+ printf ("ok %d - %lis\n", i + 1, delta);
if (delta >= 5)
{
- printf ("Failed: looks like we might have been be stuck in poll ***\n");
+ printf ("Bail out! Looks like we might have been be stuck in poll ***\n");
exit (1);
}
}
@@ -119,6 +120,6 @@ main (int argc, char *argv[])
dbus_connection_send (conn, method, NULL);
dbus_message_unref (method);
- printf ("Success ***\n");
+ printf ("# Testing completed\n1..%d\n", i);
exit (0);
}