Commit 323198df authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

secure32/tests: Use the available ARRAY_SIZE() macro.

parent 5085f4f9
...@@ -1165,7 +1165,7 @@ static void testSignSeal(void) ...@@ -1165,7 +1165,7 @@ static void testSignSeal(void)
trace("Testing with more than one buffer.\n"); trace("Testing with more than one buffer.\n");
crypt.cBuffers = sizeof(complex_data)/sizeof(complex_data[0]); crypt.cBuffers = ARRAY_SIZE(complex_data);
crypt.pBuffers = complex_data; crypt.pBuffers = complex_data;
complex_data[0].BufferType = SECBUFFER_DATA|SECBUFFER_READONLY_WITH_CHECKSUM; complex_data[0].BufferType = SECBUFFER_DATA|SECBUFFER_READONLY_WITH_CHECKSUM;
...@@ -1436,7 +1436,7 @@ static void test_cred_multiple_use(void) ...@@ -1436,7 +1436,7 @@ static void test_cred_multiple_use(void)
getSecError(ret)); getSecError(ret));
buffer_desc.ulVersion = SECBUFFER_VERSION; buffer_desc.ulVersion = SECBUFFER_VERSION;
buffer_desc.cBuffers = sizeof(buffers)/sizeof(buffers[0]); buffer_desc.cBuffers = ARRAY_SIZE(buffers);
buffer_desc.pBuffers = buffers; buffer_desc.pBuffers = buffers;
ret = pInitializeSecurityContextA(&cred, NULL, NULL, ISC_REQ_CONNECTION, ret = pInitializeSecurityContextA(&cred, NULL, NULL, ISC_REQ_CONNECTION,
...@@ -1487,7 +1487,7 @@ static void test_null_auth_data(void) ...@@ -1487,7 +1487,7 @@ static void test_null_auth_data(void)
buffers[0].pvBuffer = HeapAlloc(GetProcessHeap(), 0, buffers[0].cbBuffer); buffers[0].pvBuffer = HeapAlloc(GetProcessHeap(), 0, buffers[0].cbBuffer);
buffer_desc.ulVersion = SECBUFFER_VERSION; buffer_desc.ulVersion = SECBUFFER_VERSION;
buffer_desc.cBuffers = sizeof(buffers)/sizeof(buffers[0]); buffer_desc.cBuffers = ARRAY_SIZE(buffers);
buffer_desc.pBuffers = buffers; buffer_desc.pBuffers = buffers;
size = sizeof(user); size = sizeof(user);
......
...@@ -67,7 +67,7 @@ static void testGetComputerObjectNameA(void) ...@@ -67,7 +67,7 @@ static void testGetComputerObjectNameA(void)
BOOLEAN rc; BOOLEAN rc;
UINT i; UINT i;
for (i = 0; i < (sizeof(formats) / sizeof(formats[0])); i++) { for (i = 0; i < ARRAY_SIZE(formats); i++) {
size = 0; size = 0;
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
rc = pGetComputerObjectNameA(formats[i], NULL, &size); rc = pGetComputerObjectNameA(formats[i], NULL, &size);
...@@ -112,7 +112,7 @@ static void testGetComputerObjectNameW(void) ...@@ -112,7 +112,7 @@ static void testGetComputerObjectNameW(void)
BOOLEAN rc; BOOLEAN rc;
UINT i; UINT i;
for (i = 0; i < (sizeof(formats) / sizeof(formats[0])); i++) { for (i = 0; i < ARRAY_SIZE(formats); i++) {
size = 0; size = 0;
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
rc = pGetComputerObjectNameW(formats[i], NULL, &size); rc = pGetComputerObjectNameW(formats[i], NULL, &size);
...@@ -134,7 +134,7 @@ static void testGetComputerObjectNameW(void) ...@@ -134,7 +134,7 @@ static void testGetComputerObjectNameW(void)
if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) continue; if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) continue;
size = sizeof(nameW)/sizeof(nameW[0]); size = ARRAY_SIZE(nameW);
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
rc = pGetComputerObjectNameW(formats[i], nameW, &size); rc = pGetComputerObjectNameW(formats[i], nameW, &size);
switch (formats[i]) switch (formats[i])
...@@ -158,7 +158,7 @@ static void testGetUserNameExA(void) ...@@ -158,7 +158,7 @@ static void testGetUserNameExA(void)
BOOLEAN rc; BOOLEAN rc;
UINT i; UINT i;
for (i = 0; i < (sizeof(formats) / sizeof(formats[0])); i++) { for (i = 0; i < ARRAY_SIZE(formats); i++) {
size = sizeof(name); size = sizeof(name);
ZeroMemory(name, sizeof(name)); ZeroMemory(name, sizeof(name));
rc = pGetUserNameExA(formats[i], name, &size); rc = pGetUserNameExA(formats[i], name, &size);
...@@ -205,7 +205,7 @@ static void testGetUserNameExW(void) ...@@ -205,7 +205,7 @@ static void testGetUserNameExW(void)
BOOLEAN rc; BOOLEAN rc;
UINT i; UINT i;
for (i = 0; i < (sizeof(formats) / sizeof(formats[0])); i++) { for (i = 0; i < ARRAY_SIZE(formats); i++) {
size = sizeof(nameW); size = sizeof(nameW);
ZeroMemory(nameW, sizeof(nameW)); ZeroMemory(nameW, sizeof(nameW));
rc = pGetUserNameExW(formats[i], nameW, &size); rc = pGetUserNameExW(formats[i], nameW, &size);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment