diff options
| author | Diego Pino Garcia <dpino@igalia.com> | 2021-01-29 20:34:06 +0800 |
|---|---|---|
| committer | Patrick Griffis <tingping@tingping.se> | 2021-04-13 21:14:37 +0000 |
| commit | 92877095f757901c910886061161faa3c290dbd4 (patch) | |
| tree | 1bcc14ada8feec16659063596e849b8b5084bbf2 | |
| parent | 39f3f09a7f3b4917edeeccc6236754007947ff41 (diff) | |
| download | libsoup-92877095f757901c910886061161faa3c290dbd4.tar.gz | |
tests: replace fprintf for debug_printf
| -rw-r--r-- | tests/autobahn/soup-autobahn-test-client.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/autobahn/soup-autobahn-test-client.c b/tests/autobahn/soup-autobahn-test-client.c index 4d000226..b3bf804a 100644 --- a/tests/autobahn/soup-autobahn-test-client.c +++ b/tests/autobahn/soup-autobahn-test-client.c @@ -73,7 +73,7 @@ on_message_received (SoupWebsocketConnection *socket_connection, ConnectionContext *ctx = (ConnectionContext*) data; if (option_debug) - fprintf (stderr, "<- "); + debug_printf (1, "<- "); if (ctx && ctx->method) ctx->method (socket_connection, type, message, ctx->data); @@ -86,7 +86,7 @@ on_connection_closed (SoupWebsocketConnection *socket_connection, ConnectionContext *ctx = (ConnectionContext*) data; if (option_debug) - fprintf (stderr, "\nConnection closed\n"); + debug_printf (1, "\nConnection closed\n"); g_free (ctx); @@ -124,7 +124,7 @@ connect_and_run (SoupSession *session, char *path, ConnectionFunc method, gpoint ctx->data = data; if (option_debug) - fprintf (stderr, "About to connect to %s\n", uri); + debug_printf (1, "About to connect to %s\n", uri); soup_session_websocket_connect_async (session, message, NULL, NULL, G_PRIORITY_DEFAULT, NULL, on_connect, ctx); g_object_unref (message); @@ -144,7 +144,7 @@ test_case_message_received (SoupWebsocketConnection *socket_connection, return; if (option_debug) - fprintf (stderr, "-> "); + debug_printf (1, "-> "); soup_websocket_connection_send_message (socket_connection, type, message); } @@ -195,7 +195,7 @@ got_case_count (SoupWebsocketConnection *socket_connection, { total_num_cases = g_ascii_strtoull (g_bytes_get_data (message, NULL), NULL, 10); - fprintf (stderr, "Total number of cases: %u\n", total_num_cases); + debug_printf (1, "Total number of cases: %u\n", total_num_cases); } static void @@ -208,7 +208,7 @@ static void update_reports (SoupSession *session) { char *path = g_strdup_printf ("/updateReports?agent=%s", agent); - fprintf (stderr, "Updating reports..\n"); + debug_printf (1, "Updating reports..\n"); connect_and_run (session, path, NULL, NULL); g_free (path); } @@ -241,7 +241,7 @@ start_autobahn (void) { gboolean code = autobahn_server ("--start"); if (code == FALSE) { - fprintf(stderr, "Could not start Autobahn server\n"); + debug_printf(1, "Could not start Autobahn server\n"); exit(1); } } @@ -260,7 +260,7 @@ int main (int argc, char* argv[]) GError *error = NULL; SoupSession *session; - fprintf (stderr, "Starting Autobahn server\n"); + debug_printf (1, "Starting Autobahn server\n"); start_autobahn (); sleep (2); @@ -289,7 +289,7 @@ int main (int argc, char* argv[]) get_case_count (session); if (option_run_test >= 0 || option_run_all) { - test_init(argc, argv, NULL); + test_init (argc, argv, NULL); if (option_run_test >= 0) { run_case (session, option_run_test); } else { |
