From 0359f9d430ea95df3f349d2f6be67d59f8cdd1e1 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Fri, 9 Sep 2011 15:53:49 +0200 Subject: [PATCH] secur32/tests: Avoid crash on test failure. --- dlls/secur32/tests/schannel.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/dlls/secur32/tests/schannel.c b/dlls/secur32/tests/schannel.c index 1b6fdf8d07..a729394b53 100644 --- a/dlls/secur32/tests/schannel.c +++ b/dlls/secur32/tests/schannel.c @@ -746,12 +746,15 @@ static void test_communication(void) buffers[0].pBuffers[1].BufferType = SECBUFFER_EMPTY; status = pDecryptMessage(&context, &buffers[0], 0, NULL); ok(status == SEC_E_OK, "DecryptMessage failed: %08x\n", status); - ok(buffers[0].pBuffers[0].BufferType == SECBUFFER_STREAM_HEADER, "Expected first buffer to be SECBUFFER_STREAM_HEADER\n"); - ok(buffers[0].pBuffers[1].BufferType == SECBUFFER_DATA, "Expected second buffer to be SECBUFFER_DATA\n"); - ok(buffers[0].pBuffers[2].BufferType == SECBUFFER_STREAM_TRAILER, "Expected third buffer to be SECBUFFER_STREAM_TRAILER\n"); + if (status == SEC_E_OK) + { + ok(buffers[0].pBuffers[0].BufferType == SECBUFFER_STREAM_HEADER, "Expected first buffer to be SECBUFFER_STREAM_HEADER\n"); + ok(buffers[0].pBuffers[1].BufferType == SECBUFFER_DATA, "Expected second buffer to be SECBUFFER_DATA\n"); + ok(buffers[0].pBuffers[2].BufferType == SECBUFFER_STREAM_TRAILER, "Expected third buffer to be SECBUFFER_STREAM_TRAILER\n"); - data = buffers[0].pBuffers[1].pvBuffer; - data[buffers[0].pBuffers[1].cbBuffer] = 0; + data = buffers[0].pBuffers[1].pvBuffer; + data[buffers[0].pBuffers[1].cbBuffer] = 0; + } pDeleteSecurityContext(&context); pFreeCredentialsHandle(&cred_handle);