[SETUPAPI_WINETEST] Sync with Wine Staging 4.0. CORE-15682
[reactos.git] / modules / rostests / winetests / setupapi / setupcab.c
index f252886..2e776e6 100644 (file)
@@ -109,7 +109,7 @@ static void test_invalid_parametersA(void)
 
     create_source_fileA(source, NULL, 0);
 
-    for (i = 0; i < sizeof(invalid_parameters)/sizeof(invalid_parameters[0]); i++)
+    for (i = 0; i < ARRAY_SIZE(invalid_parameters); i++)
     {
         SetLastError(0xdeadbeef);
         ret = SetupIterateCabinetA(invalid_parameters[i].CabinetFile, 0,
@@ -170,12 +170,12 @@ static void test_invalid_parametersW(void)
         return;
     }
 
-    GetTempPathW(sizeof(temp)/sizeof(WCHAR), temp);
+    GetTempPathW(ARRAY_SIZE(temp), temp);
     GetTempFileNameW(temp, docW, 0, source);
 
     create_source_fileW(source, NULL, 0);
 
-    for (i = 0; i < sizeof(invalid_parameters)/sizeof(invalid_parameters[0]); i++)
+    for (i = 0; i < ARRAY_SIZE(invalid_parameters); i++)
     {
         SetLastError(0xdeadbeef);
         ret = SetupIterateCabinetW(invalid_parameters[i].CabinetFile, 0,
@@ -275,7 +275,7 @@ static void test_invalid_callbackW(void)
         return;
     }
 
-    GetTempPathW(sizeof(temp)/sizeof(WCHAR), temp);
+    GetTempPathW(ARRAY_SIZE(temp), temp);
     GetTempFileNameW(temp, docW, 0, source);
 
     create_source_fileW(source, comp_cab_zip_multi, sizeof(comp_cab_zip_multi));
@@ -331,7 +331,7 @@ static UINT CALLBACK simple_callbackA(PVOID Context, UINT Notification,
 
         ctx->count++;
 
-        if (index < sizeof(expected_files)/sizeof(char *))
+        if (index < ARRAY_SIZE(expected_files))
         {
             ok(!strcmp(expected_files[index], info->NameInCabinet),
                "[%d] Expected file \"%s\", got \"%s\"\n",
@@ -389,8 +389,7 @@ static void test_simple_enumerationA(void)
     ctx.target = target;
     ret = SetupIterateCabinetA(source, 0, simple_callbackA, &ctx);
     ok(ret == 1, "Expected SetupIterateCabinetA to return 1, got %d\n", ret);
-    ok(ctx.count == sizeof(expected_files)/sizeof(char *),
-       "Unexpectedly enumerated %d files\n", ctx.count);
+    ok(ctx.count == ARRAY_SIZE(expected_files), "Unexpectedly enumerated %d files\n", ctx.count);
 
     DeleteFileA(source);
     DeleteFileA(target);
@@ -434,7 +433,7 @@ static UINT CALLBACK simple_callbackW(PVOID Context, UINT Notification,
 
         ctx->count++;
 
-        if (index < sizeof(expected_filesW)/sizeof(WCHAR *))
+        if (index < ARRAY_SIZE(expected_filesW))
         {
             ok(!lstrcmpW(expected_filesW[index], info->NameInCabinet),
                "[%d] Expected file %s, got %s\n",
@@ -488,7 +487,7 @@ static void test_simple_enumerationW(void)
         return;
     }
 
-    GetTempPathW(sizeof(temp)/sizeof(WCHAR), temp);
+    GetTempPathW(ARRAY_SIZE(temp), temp);
     GetTempFileNameW(temp, docW, 0, source);
     GetTempFileNameW(temp, docW, 0, target);
 
@@ -499,8 +498,7 @@ static void test_simple_enumerationW(void)
     ctx.target = target;
     ret = SetupIterateCabinetW(source, 0, simple_callbackW, &ctx);
     ok(ret == 1, "Expected SetupIterateCabinetW to return 1, got %d\n", ret);
-    ok(ctx.count == sizeof(expected_files)/sizeof(WCHAR *),
-       "Unexpectedly enumerated %d files\n", ctx.count);
+    ok(ctx.count == ARRAY_SIZE(expected_files), "Unexpectedly enumerated %d files\n", ctx.count);
 
     DeleteFileW(source);
     DeleteFileW(target);