From 455ccf4baa4756896a6acf12960d9ab71d186cd8 Mon Sep 17 00:00:00 2001 From: Michael Stefaniuc Date: Fri, 8 Jun 2018 22:19:07 +0200 Subject: [PATCH] ntprint/tests: Use the available ARRAY_SIZE() macro. Signed-off-by: Michael Stefaniuc Signed-off-by: Alexandre Julliard --- dlls/ntprint/tests/ntprint.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dlls/ntprint/tests/ntprint.c b/dlls/ntprint/tests/ntprint.c index 1710220def0..57caa49ab27 100644 --- a/dlls/ntprint/tests/ntprint.c +++ b/dlls/ntprint/tests/ntprint.c @@ -67,7 +67,7 @@ static void test_PSetupCreateMonitorInfo(VOID) { HANDLE mi; WCHAR buffer[1024] = {'\\','\\'}; - UINT len = sizeof(buffer) / sizeof(buffer[0]) - 2; + UINT len = ARRAY_SIZE(buffer) - 2; GetComputerNameW(buffer + 2, &len); SetLastError(0xdeadbeef); @@ -155,7 +155,7 @@ static void test_PSetupEnumMonitor(VOID) "and '> 0')\n", res, GetLastError(), minsize); - size = sizeof(buffer) / sizeof(buffer[0]); + size = ARRAY_SIZE(buffer); if ((minsize + 1) > size) { skip("overflow: %u\n", minsize); pPSetupDestroyMonitorInfo(mi); @@ -165,7 +165,7 @@ static void test_PSetupEnumMonitor(VOID) if (0) { /* XP: ERROR_INVALID_PARAMETER, w2k: Crash */ SetLastError(0xdeadbeef); - size = sizeof(buffer) / sizeof(buffer[0]); + size = ARRAY_SIZE(buffer); res = pPSetupEnumMonitor(NULL, 0, buffer, &size); ok( !res && (GetLastError() == ERROR_INVALID_PARAMETER), "got %u with %u (expected '0' with ERROR_INVALID_PARAMETER)\n", @@ -175,7 +175,7 @@ static void test_PSetupEnumMonitor(VOID) if (0) { /* XP: Crash, w2k: Success (how can that work?) */ SetLastError(0xdeadbeef); - size = sizeof(buffer) / sizeof(buffer[0]); + size = ARRAY_SIZE(buffer); res = pPSetupEnumMonitor(mi, 0, NULL, &size); trace("got %u with %u and %u\n", res, GetLastError(), size); } @@ -213,7 +213,7 @@ static void test_PSetupEnumMonitor(VOID) while (res && (index < 20)) { SetLastError(0xdeadbeef); buffer[0] = '\0'; - size = sizeof(buffer) / sizeof(buffer[0]); + size = ARRAY_SIZE(buffer); res = pPSetupEnumMonitor(mi, index, buffer, &size); ok( res || (GetLastError() == ERROR_NO_MORE_ITEMS), "(%u) got %u with %u and %u (expected '!=0' or: '0' with "