diff options
author | Tim Kosse <tim.kosse@filezilla-project.org> | 2016-01-15 13:48:10 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2016-05-30 10:15:01 +0200 |
commit | b065a235f1f354b9a647e05830e277efb44a2c3d (patch) | |
tree | 77a013d71ce2cfb9aeddbcc0e56975dc8681e631 /tests | |
parent | 5086808e6654c62e6d1e7c40d3bd7a60d89c2959 (diff) | |
download | gnutls-b065a235f1f354b9a647e05830e277efb44a2c3d.tar.gz |
Move call to terminate() until after printing the error message.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/sign-md5-rep.c | 9 | ||||
-rw-r--r-- | tests/status-request-ok.c | 6 | ||||
-rw-r--r-- | tests/status-request.c | 6 |
3 files changed, 7 insertions, 14 deletions
diff --git a/tests/sign-md5-rep.c b/tests/sign-md5-rep.c index 72616dc37d..c72d8a11a9 100644 --- a/tests/sign-md5-rep.c +++ b/tests/sign-md5-rep.c @@ -166,18 +166,16 @@ static void client(int fd) } if (ret < 0) { - terminate(); fail("client: Handshake failed: %s\n", gnutls_strerror(ret)); - exit(1); + terminate(); } else { if (debug) success("client: Handshake was completed\n"); } if (gnutls_sign_algorithm_get(session) == GNUTLS_SIGN_RSA_MD5) { - terminate(); fail("client: MD5 was negotiated\n"); - exit(1); + terminate(); } success("client: %s was negotiated\n", gnutls_sign_get_name(gnutls_sign_algorithm_get(session))); @@ -199,9 +197,8 @@ static void client(int fd) ("client: Peer has closed the TLS connection\n"); goto end; } else if (ret < 0) { - terminate(); fail("client: Error: %s\n", gnutls_strerror(ret)); - exit(1); + terminate(); } gnutls_bye(session, GNUTLS_SHUT_WR); diff --git a/tests/status-request-ok.c b/tests/status-request-ok.c index b7d7f4c76e..293671dd71 100644 --- a/tests/status-request-ok.c +++ b/tests/status-request-ok.c @@ -180,9 +180,8 @@ static void client(int fd) } if (ret < 0) { - terminate(); fail("client: Handshake failed: %s\n", gnutls_strerror(ret)); - exit(1); + terminate(); } else { if (debug) success("client: Handshake was completed\n"); @@ -194,9 +193,8 @@ static void client(int fd) (gnutls_protocol_get_version(session))); if (received == 0) { - terminate(); fail("client: didn't receive status request\n"); - exit(1); + terminate(); } gnutls_bye(session, GNUTLS_SHUT_WR); diff --git a/tests/status-request.c b/tests/status-request.c index f0e528cf91..8a4f2691d4 100644 --- a/tests/status-request.c +++ b/tests/status-request.c @@ -174,9 +174,8 @@ static void client(int fd) } if (ret < 0) { - terminate(); fail("client: Handshake failed: %s\n", gnutls_strerror(ret)); - exit(1); + terminate(); } else { if (debug) success("client: Handshake was completed\n"); @@ -200,9 +199,8 @@ static void client(int fd) ("client: Peer has closed the TLS connection\n"); goto end; } else if (ret < 0) { - terminate(); fail("client: Error: %s\n", gnutls_strerror(ret)); - exit(1); + terminate(); } gnutls_bye(session, GNUTLS_SHUT_WR); |