From f12ea1f1e0f11686be8abad608b56a8357c688bb Mon Sep 17 00:00:00 2001 From: Hugo Landau Date: Thu, 9 Nov 2023 10:27:14 +0000 Subject: [PATCH] QUIC MULTISTREAM TEST: Make error tests non-mutating and restore error code test Reviewed-by: Tomas Mraz Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/22674) --- test/quic_multistream_test.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/test/quic_multistream_test.c b/test/quic_multistream_test.c index 3782e65286..2fe44cd26f 100644 --- a/test/quic_multistream_test.c +++ b/test/quic_multistream_test.c @@ -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