From: Christian Grothoff Date: Tue, 24 Apr 2012 13:22:23 +0000 (+0000) Subject: -better error reporting X-Git-Tag: initial-import-from-subversion-38251~13798 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=42c30b1692fb9e979def91c52a6da61c00e6fc77;p=oweals%2Fgnunet.git -better error reporting --- diff --git a/src/vpn/test_gnunet_vpn.c b/src/vpn/test_gnunet_vpn.c index 7fcbe8b9e..4953e2410 100644 --- a/src/vpn/test_gnunet_vpn.c +++ b/src/vpn/test_gnunet_vpn.c @@ -225,8 +225,9 @@ curl_main () { if (msg->data.result != CURLE_OK) { - printf ("%s failed at %s:%d: `%s'\n", - "curl_multi_perform", + fprintf (stderr, + "%s failed at %s:%d: `%s'\n", + "curl_multi_perform", __FILE__, __LINE__, curl_easy_strerror (msg->data.result)); global_ret = 1; @@ -238,9 +239,15 @@ curl_main () curl = NULL; multi = NULL; if (cbc.pos != strlen ("/hello_world")) + { + GNUNET_break (0); global_ret = 2; + } if (0 != strncmp ("/hello_world", cbc.buf, strlen ("/hello_world"))) + { + GNUNET_break (0); global_ret = 3; + } #if VERBOSE fprintf (stderr, "Download complete, shutting down!\n"); #endif @@ -342,6 +349,7 @@ ctrl_c_shutdown (void *cls, { ctrl_c_task_id = GNUNET_SCHEDULER_NO_TASK; do_shutdown (); + GNUNET_break (0); global_ret = 1; } @@ -584,7 +592,10 @@ main (int argc, char *const *argv) if (0 != curl_global_init (CURL_GLOBAL_WIN32)) + { + fprintf (stderr, "failed to initialize curl\n"); return 2; + } setup_peer (&p1, "test_gnunet_vpn.conf"); GNUNET_log_setup ("test_gnunet_vpn", #if VERBOSE