summaryrefslogtreecommitdiffstats
path: root/test/sslapitest.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2018-05-02 17:08:07 +0200
committerMatt Caswell <matt@openssl.org>2018-05-11 15:20:57 +0200
commite825109236f6795fbe24c0c6a489ef89ca05a906 (patch)
tree2ce2eef93cadc53e2893fa695d85612145dab509 /test/sslapitest.c
parentDon't set TCP_NODELAY on a UDP socket (diff)
downloadopenssl-e825109236f6795fbe24c0c6a489ef89ca05a906.tar.xz
openssl-e825109236f6795fbe24c0c6a489ef89ca05a906.zip
Add some more SSL_pending() and SSL_has_pending() tests
Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6159)
Diffstat (limited to 'test/sslapitest.c')
-rw-r--r--test/sslapitest.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/test/sslapitest.c b/test/sslapitest.c
index bce15dbc6b..26ef435417 100644
--- a/test/sslapitest.c
+++ b/test/sslapitest.c
@@ -4454,11 +4454,16 @@ static int test_ssl_pending(int tst)
SSL_ERROR_NONE)))
goto end;
- if (!TEST_true(SSL_write_ex(serverssl, msg, sizeof(msg), &written))
+ if (!TEST_int_eq(SSL_pending(clientssl), 0)
+ || !TEST_false(SSL_has_pending(clientssl))
+ || !TEST_int_eq(SSL_pending(serverssl), 0)
+ || !TEST_false(SSL_has_pending(serverssl))
+ || !TEST_true(SSL_write_ex(serverssl, msg, sizeof(msg), &written))
|| !TEST_size_t_eq(written, sizeof(msg))
|| !TEST_true(SSL_read_ex(clientssl, buf, sizeof(buf), &readbytes))
|| !TEST_size_t_eq(readbytes, sizeof(buf))
- || !TEST_int_eq(SSL_pending(clientssl), (int)(written - readbytes)))
+ || !TEST_int_eq(SSL_pending(clientssl), (int)(written - readbytes))
+ || !TEST_true(SSL_has_pending(clientssl)))
goto end;
testresult = 1;