QUIC MULTISTREAM TEST: Make error tests non-mutating and restore error code test

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22674)
This commit is contained in:
Hugo Landau 2023-11-09 10:27:14 +00:00
parent 499aacdc82
commit f12ea1f1e0

View File

@ -1858,14 +1858,14 @@ static int run_script_worker(struct helper *h, const struct script_op *script,
case OPK_EXPECT_ERR_REASON:
{
if (!TEST_size_t_eq((size_t)ERR_GET_REASON(ERR_get_error()), op->arg1))
if (!TEST_size_t_eq((size_t)ERR_GET_REASON(ERR_peek_last_error()), op->arg1))
goto out;
}
break;
case OPK_EXPECT_ERR_LIB:
{
if (!TEST_size_t_eq((size_t)ERR_GET_LIB(ERR_get_error()), op->arg1))
if (!TEST_size_t_eq((size_t)ERR_GET_LIB(ERR_peek_last_error()), op->arg1))
goto out;
}
break;
@ -2723,8 +2723,14 @@ static const struct script_op script_20_child[] = {
OP_C_READ_FAIL_WAIT (a)
OP_C_EXPECT_SSL_ERR (a, SSL_ERROR_SYSCALL)
OP_EXPECT_ERR_LIB (ERR_LIB_SYS)
OP_EXPECT_ERR_LIB (ERR_LIB_SSL)
OP_EXPECT_ERR_REASON (SSL_R_PROTOCOL_IS_SHUTDOWN)
OP_POP_ERR ()
OP_EXPECT_ERR_LIB (ERR_LIB_SSL)
OP_EXPECT_ERR_REASON (SSL_R_QUIC_NETWORK_ERROR)
OP_C_FREE_STREAM (a)
OP_END