Michael Stefaniuc : wer/tests: Use the available ARRAY_SIZE() macro.

Alexandre Julliard julliard at winehq.org
Wed May 30 15:30:50 CDT 2018


Module: wine
Branch: master
Commit: a237867ca7b31c1b04b6d15b808dbbd5439dd581
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=a237867ca7b31c1b04b6d15b808dbbd5439dd581

Author: Michael Stefaniuc <mstefani at winehq.org>
Date:   Wed May 30 01:15:35 2018 +0200

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

Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/wer/tests/main.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/dlls/wer/tests/main.c b/dlls/wer/tests/main.c
index b10a819..11a02fb 100644
--- a/dlls/wer/tests/main.c
+++ b/dlls/wer/tests/main.c
@@ -66,7 +66,7 @@ static void test_WerAddExcludedApplication(void)
     ok(hr == S_OK, "got 0x%x (expected S_OK)\n", hr);
 
     /* appname has a path */
-    res = GetWindowsDirectoryW(buffer, sizeof(buffer) / sizeof(buffer[0]));
+    res = GetWindowsDirectoryW(buffer, ARRAY_SIZE(buffer));
     if (res > 0) {
         /* the last part from the path is added to the inclusion list */
         hr = WerAddExcludedApplication(buffer, FALSE);
@@ -118,7 +118,7 @@ static void test_WerRemoveExcludedApplication(void)
         "got 0x%x (expected E_FAIL or HRESULT_FROM_WIN32(ERROR_ENVVAR_NOT_FOUND))\n", hr);
 
     /* appname has a path */
-    res = GetWindowsDirectoryW(buffer, sizeof(buffer) / sizeof(buffer[0]));
+    res = GetWindowsDirectoryW(buffer, ARRAY_SIZE(buffer));
     if (res > 0) {
         hr = WerRemoveExcludedApplication(buffer, FALSE);
         ok((hr == E_FAIL) || (hr == __HRESULT_FROM_WIN32(ERROR_ENVVAR_NOT_FOUND)),
@@ -223,7 +223,7 @@ static void  test_WerReportCreate(void)
 
     /* multiple active reports are possible */
     memset(table, 0, sizeof(table));
-    for (i = 0; i < (sizeof(table) / sizeof(table[0]) -1); i++) {
+    for (i = 0; i < (ARRAY_SIZE(table) - 1); i++) {
         report = (void *) 0xdeadbeef;
         hr = WerReportCreate(appcrash, WerReportCritical, NULL, &table[i]);
         ok(hr == S_OK, "%02d: got 0x%x and %p (expected S_OK)\n", i, hr, table[i]);




More information about the wine-cvs mailing list