Wine-Devel
By thread
wine-devel@list.winehq.org
By month
Messages by month
- ----- 2026 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
June 2018
- 68 participants
- 1149 messages
[PATCH 1/2] dwrite: Test IDWriteTextFormat with nonexistent font
by Lucian Poston
Signed-off-by: Lucian Poston <lucianposton(a)pm.me>
---
dlls/dwrite/tests/layout.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 46 insertions(+)
diff --git a/dlls/dwrite/tests/layout.c b/dlls/dwrite/tests/layout.c
index c2dd273c6c..ac36aff5b5 100644
--- a/dlls/dwrite/tests/layout.c
+++ b/dlls/dwrite/tests/layout.c
@@ -32,6 +32,7 @@
#define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
static const WCHAR tahomaW[] = {'T','a','h','o','m','a',0};
+static const WCHAR nonExistentFontW[] = {'B','l','a','h','!',0};
static const WCHAR enusW[] = {'e','n','-','u','s',0};
struct testanalysissink
@@ -3294,6 +3295,51 @@ todo_wine
ok(metrics.lineCount == 1, "got %u\n", metrics.lineCount);
IDWriteTextLayout_Release(layout);
+ IDWriteTextFormat_Release(format);
+
+ /* nonexistent font */
+ hr = IDWriteFactory_CreateTextFormat(factory, nonExistentFontW, NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL,
+ DWRITE_FONT_STRETCH_NORMAL, 10.0, enusW, &format);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+
+ hr = IDWriteFactory_CreateTextLayout(factory, strW, 4, format, 500.0, 1000.0, &layout);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+
+ count = 0;
+ hr = IDWriteTextLayout_GetClusterMetrics(layout, clusters, 4, &count);
+todo_wine
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+todo_wine
+ ok(count == 4, "got %u\n", count);
+ for (i = 0, width = 0.0; i < count; i++)
+ width += clusters[i].width;
+
+ memset(&metrics, 0xcc, sizeof(metrics));
+ hr = IDWriteTextLayout_GetMetrics(layout, &metrics);
+todo_wine
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+todo_wine
+ ok(metrics.left == 0.0, "got %.2f\n", metrics.left);
+todo_wine
+ ok(metrics.top == 0.0, "got %.2f\n", metrics.top);
+todo_wine
+ ok(metrics.width == width, "got %.2f, expected %.2f\n", metrics.width, width);
+todo_wine
+ ok(metrics.widthIncludingTrailingWhitespace == width, "got %.2f, expected %.2f\n",
+ metrics.widthIncludingTrailingWhitespace, width);
+todo_wine
+ ok(metrics.height > 0.0, "got %.2f\n", metrics.height);
+todo_wine
+ ok(metrics.layoutWidth == 500.0, "got %.2f\n", metrics.layoutWidth);
+todo_wine
+ ok(metrics.layoutHeight == 1000.0, "got %.2f\n", metrics.layoutHeight);
+todo_wine
+ ok(metrics.maxBidiReorderingDepth == 1, "got %u\n", metrics.maxBidiReorderingDepth);
+todo_wine
+ ok(metrics.lineCount == 1, "got %u\n", metrics.lineCount);
+
+ IDWriteTextLayout_Release(layout);
+
IDWriteTextFormat_Release(format);
IDWriteFactory_Release(factory);
}
--
2.16.4
June 28, 2018
Re: [PATCH] include/d3d12: Fix typos.
by Henri Verbeet
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
June 27, 2018
Re: [PATCH] kernel32/tests: Use the available ARRAY_SIZE() macro
by Michael Stefaniuc
Unclear why this fails so massively on manual runs as the daily runs
don't show it to be a big problem.
Anyway, my patch is a true no-op.
The tests fail also with a whitespace only change
https://testbot.winehq.org/JobDetails.pl?Key=39420
bye
michael
On 06/27/2018 10:09 PM, Marvin wrote:
> Hi,
>
> While running your changed tests on Windows, I think I found new failures.
> Being a bot and all I'm not very good at pattern recognition, so I might be
> wrong, but could you please double-check?
> Full results can be found at
> https://testbot.winehq.org/JobDetails.pl?Key=39415
>
> Your paranoid android.
>
>
> === wvistau64 (64 bit file) ===
> TestBot process got stuck or died unexpectedly
> The previous 1 run(s) terminated abnormally
>
> === w1064 (64 bit module) ===
> kernel32:module crashed (c00000fd)
>
> === wvistau64 (32 bit virtual) ===
> virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
> virtual.c:2839: Test failed: expected policy flags 0, got 3
> virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
> virtual.c:2895: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:2909: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:2938: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:2953: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3001: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3016: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3034: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3052: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3133: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3157: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3197: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3222: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
> virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
> virtual.c:2839: Test failed: expected policy flags 1, got 3
> virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
> virtual.c:2938: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:2953: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3001: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3016: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3197: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3222: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
> virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
> virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
> virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
>
> === wvistau64_zh_CN (32 bit virtual) ===
> virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
> virtual.c:2839: Test failed: expected policy flags 0, got 3
> virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
> virtual.c:2895: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:2909: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:2938: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:2953: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3001: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3016: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3034: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3052: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3133: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3157: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3197: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3222: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
> virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
> virtual.c:2839: Test failed: expected policy flags 1, got 3
> virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
> virtual.c:2938: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:2953: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3001: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3016: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3197: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3222: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
> virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
> virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
> virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
>
> === wvistau64_fr (32 bit virtual) ===
> virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
> virtual.c:2839: Test failed: expected policy flags 0, got 3
> virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
> virtual.c:2895: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:2909: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:2938: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:2953: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3001: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3016: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3034: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3052: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3133: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3157: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3197: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3222: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
> virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
> virtual.c:2839: Test failed: expected policy flags 1, got 3
> virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
> virtual.c:2938: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:2953: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3001: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3016: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3197: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3222: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
> virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
> virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
> virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
>
> === wvistau64_he (32 bit virtual) ===
> virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
> virtual.c:2839: Test failed: expected policy flags 0, got 3
> virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
> virtual.c:2895: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:2909: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:2938: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:2953: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3001: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3016: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3034: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3052: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3133: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3157: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3197: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3222: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
> virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
> virtual.c:2839: Test failed: expected policy flags 1, got 3
> virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
> virtual.c:2938: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:2953: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3001: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3016: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3197: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3222: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
> virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
> virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
> virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
>
> === w2008s64 (32 bit virtual) ===
> virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
> virtual.c:2839: Test failed: expected policy flags 0, got 3
> virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
> virtual.c:2895: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:2909: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:2938: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:2953: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3001: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3016: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3034: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3052: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3133: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3157: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3197: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3222: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
> virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
> virtual.c:2839: Test failed: expected policy flags 1, got 3
> virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
> virtual.c:2938: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:2953: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3001: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3016: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3197: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3222: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
> virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
> virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
> virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
>
> === w7u (32 bit virtual) ===
> virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
> virtual.c:2839: Test failed: expected policy flags 0, got 3
> virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
> virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
> virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
> virtual.c:2839: Test failed: expected policy flags 1, got 3
> virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
> virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
> virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
> virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
> virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
>
> === w7pro64 (32 bit virtual) ===
> virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
> virtual.c:2839: Test failed: expected policy flags 0, got 3
> virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
> virtual.c:2895: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:2909: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:2938: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:2953: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3001: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3016: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3034: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3052: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3133: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3157: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3197: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3222: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
> virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
> virtual.c:2839: Test failed: expected policy flags 1, got 3
> virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
> virtual.c:2938: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:2953: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3001: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3016: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3197: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3222: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
> virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
> virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
> virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
>
> === w8 (32 bit virtual) ===
> virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
> virtual.c:2839: Test failed: expected policy flags 0, got 3
> virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
> virtual.c:2895: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:2909: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:2938: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:2953: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3001: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3016: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3034: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3052: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3133: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3157: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3197: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3222: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
> virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
> virtual.c:2839: Test failed: expected policy flags 1, got 3
> virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
> virtual.c:2938: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:2953: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3001: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3016: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3197: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3222: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
> virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
> virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
> virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
> TestBot process got stuck or died unexpectedly
> The previous 1 run(s) terminated abnormally
>
> === w8adm (32 bit virtual) ===
> virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
> virtual.c:2839: Test failed: expected policy flags 0, got 3
> virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
> virtual.c:2895: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:2909: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:2938: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:2953: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3001: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3016: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3034: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3052: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3133: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3157: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3197: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3222: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
> virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
> virtual.c:2839: Test failed: expected policy flags 1, got 3
> virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
> virtual.c:2938: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:2953: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3001: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3016: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3197: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3222: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
> virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
> virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
> virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
>
> === w864 (32 bit virtual) ===
> virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
> virtual.c:2839: Test failed: expected policy flags 0, got 3
> virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
> virtual.c:2895: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:2909: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:2938: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:2953: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3001: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3016: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3034: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3052: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3133: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3157: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3197: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3222: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
> virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
> virtual.c:2839: Test failed: expected policy flags 1, got 3
> virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
> virtual.c:2938: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:2953: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3001: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3016: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3197: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3222: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
> virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
> virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
> virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
>
> === w1064 (32 bit virtual) ===
> virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
> virtual.c:2839: Test failed: expected policy flags 0, got 3
> virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
> virtual.c:2895: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:2909: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:2938: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:2953: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3001: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3016: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3034: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3052: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3133: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3157: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3197: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3222: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
> virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
> virtual.c:2839: Test failed: expected policy flags 1, got 3
> virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
> virtual.c:2938: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:2953: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3001: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3016: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3197: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3222: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
> virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
> virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
> virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
> virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
>
>
June 27, 2018
Re: [PATCH vkd3d 4/4] libs/vkd3d: Trace build version.
by Henri Verbeet
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
June 27, 2018
Re: [PATCH vkd3d 2/4] tests: Add test for cube maps.
by Henri Verbeet
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
June 27, 2018
Re: [PATCH vkd3d 3/4] libs/vkd3d: Set names for internal threads.
by Henri Verbeet
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
June 27, 2018
Re: [PATCH vkd3d 1/4] libs/vkd3d: Implement cube shader resource views.
by Henri Verbeet
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
June 27, 2018
Re: [PATCH] kernel32/tests: Use the available ARRAY_SIZE() macro
by Marvin
Hi,
While running your changed tests on Windows, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at
https://testbot.winehq.org/JobDetails.pl?Key=39415
Your paranoid android.
=== wvistau64 (64 bit file) ===
TestBot process got stuck or died unexpectedly
The previous 1 run(s) terminated abnormally
=== w1064 (64 bit module) ===
kernel32:module crashed (c00000fd)
=== wvistau64 (32 bit virtual) ===
virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
virtual.c:2839: Test failed: expected policy flags 0, got 3
virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
virtual.c:2895: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:2909: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:2938: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:2953: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3001: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3016: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3034: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3052: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3133: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3157: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3197: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3222: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
virtual.c:2839: Test failed: expected policy flags 1, got 3
virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
virtual.c:2938: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:2953: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3001: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3016: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3197: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3222: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
=== wvistau64_zh_CN (32 bit virtual) ===
virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
virtual.c:2839: Test failed: expected policy flags 0, got 3
virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
virtual.c:2895: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:2909: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:2938: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:2953: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3001: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3016: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3034: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3052: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3133: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3157: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3197: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3222: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
virtual.c:2839: Test failed: expected policy flags 1, got 3
virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
virtual.c:2938: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:2953: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3001: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3016: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3197: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3222: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
=== wvistau64_fr (32 bit virtual) ===
virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
virtual.c:2839: Test failed: expected policy flags 0, got 3
virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
virtual.c:2895: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:2909: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:2938: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:2953: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3001: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3016: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3034: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3052: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3133: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3157: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3197: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3222: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
virtual.c:2839: Test failed: expected policy flags 1, got 3
virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
virtual.c:2938: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:2953: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3001: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3016: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3197: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3222: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
=== wvistau64_he (32 bit virtual) ===
virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
virtual.c:2839: Test failed: expected policy flags 0, got 3
virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
virtual.c:2895: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:2909: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:2938: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:2953: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3001: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3016: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3034: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3052: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3133: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3157: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3197: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3222: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
virtual.c:2839: Test failed: expected policy flags 1, got 3
virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
virtual.c:2938: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:2953: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3001: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3016: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3197: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3222: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
=== w2008s64 (32 bit virtual) ===
virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
virtual.c:2839: Test failed: expected policy flags 0, got 3
virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
virtual.c:2895: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:2909: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:2938: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:2953: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3001: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3016: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3034: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3052: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3133: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3157: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3197: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3222: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
virtual.c:2839: Test failed: expected policy flags 1, got 3
virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
virtual.c:2938: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:2953: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3001: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3016: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3197: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3222: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
=== w7u (32 bit virtual) ===
virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
virtual.c:2839: Test failed: expected policy flags 0, got 3
virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
virtual.c:2839: Test failed: expected policy flags 1, got 3
virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
=== w7pro64 (32 bit virtual) ===
virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
virtual.c:2839: Test failed: expected policy flags 0, got 3
virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
virtual.c:2895: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:2909: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:2938: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:2953: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3001: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3016: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3034: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3052: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3133: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3157: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3197: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3222: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
virtual.c:2839: Test failed: expected policy flags 1, got 3
virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
virtual.c:2938: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:2953: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3001: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3016: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3197: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3222: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
=== w8 (32 bit virtual) ===
virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
virtual.c:2839: Test failed: expected policy flags 0, got 3
virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
virtual.c:2895: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:2909: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:2938: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:2953: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3001: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3016: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3034: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3052: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3133: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3157: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3197: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3222: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
virtual.c:2839: Test failed: expected policy flags 1, got 3
virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
virtual.c:2938: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:2953: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3001: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3016: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3197: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3222: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
TestBot process got stuck or died unexpectedly
The previous 1 run(s) terminated abnormally
=== w8adm (32 bit virtual) ===
virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
virtual.c:2839: Test failed: expected policy flags 0, got 3
virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
virtual.c:2895: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:2909: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:2938: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:2953: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3001: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3016: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3034: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3052: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3133: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3157: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3197: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3222: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
virtual.c:2839: Test failed: expected policy flags 1, got 3
virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
virtual.c:2938: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:2953: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3001: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3016: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3197: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3222: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
=== w864 (32 bit virtual) ===
virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
virtual.c:2839: Test failed: expected policy flags 0, got 3
virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
virtual.c:2895: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:2909: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:2938: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:2953: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3001: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3016: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3034: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3052: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3133: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3157: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3197: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3222: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
virtual.c:2839: Test failed: expected policy flags 1, got 3
virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
virtual.c:2938: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:2953: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3001: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3016: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3197: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3222: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
=== w1064 (32 bit virtual) ===
virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
virtual.c:2839: Test failed: expected policy flags 0, got 3
virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
virtual.c:2895: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:2909: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:2938: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:2953: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3001: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3016: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3034: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3052: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3133: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3157: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3197: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3222: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
virtual.c:2839: Test failed: expected policy flags 1, got 3
virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
virtual.c:2938: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:2953: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3001: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3016: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3197: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3222: Test failed: expected no STATUS_ACCESS_VIOLATION exception, got 1 exceptions
virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
virtual.c:2801: Test failed: NtSetInformationProcess failed with status c0000022
virtual.c:2840: Test failed: expected policy permanent FALSE, got 1
virtual.c:3259: Test failed: NtSetInformationProcess failed with status c0000022
June 27, 2018
Re: [PATCH] kernel32/tests: Avoid ARRAY_SIZE-like macros
by Michael Stefaniuc
On 06/27/2018 09:07 PM, Marvin wrote:
> Hi,
>
> While running your changed tests on Windows, I think I found new failures.
> Being a bot and all I'm not very good at pattern recognition, so I might be
> wrong, but could you please double-check?
> Full results can be found at
> https://testbot.winehq.org/JobDetails.pl?Key=39414
>
> Your paranoid android.
>
>
> === w8 (32 bit comm) ===
> comm.c:859: Test failed: WaitCommEvent failed with a timeout
> comm.c:870: recovering after WAIT_TIMEOUT...
> comm.c:880: Test failed: WaitCommEvent error 0
> comm.c:881: Test failed: WaitCommEvent: expected EV_TXEMPTY, got 0
> comm.c:885: WaitCommEvent for EV_TXEMPTY took 1515 ms (timeout 1500)
> comm.c:886: Test failed: WaitCommEvent used 1515 ms for waiting
> comm.c:1553: test_AbortWaitCts timeout 500 handle 00000144
> comm.c:1520: Changing CommMask on the fly for handle 00000144 after timeout 500
Flaky tests, see
https://test.winehq.org/data/f637408a23fb0c92e56f677ab1793b66f739b14d/win8_…
The line numbers just changed.
bye
michael
June 27, 2018
Re: Bug #45385 related to keyboard and probably wineserver - where to start the search
by Alex Henrie
On Wed, Jun 27, 2018 at 11:24 AM John Found <johnfound(a)asm32.info> wrote:
>
> While reading the code in wineX11.drv/keyboard.c I noticed the following fragment from the function X11DRV_KeymapNotify:
>
> for (vkey = VK_LSHIFT; vkey <= VK_RMENU; vkey++)
> {
> int m = vkey - VK_LSHIFT;
> >>> if (modifiers[m].vkey && !(keystate[vkey] & 0x80) != !modifiers[m].pressed)
> {
> TRACE( "Adjusting state for vkey %#.2x. State before %#.2x\n",
> modifiers[m].vkey, keystate[vkey]);
>
> update_key_state( keystate, vkey, modifiers[m].pressed );
> changed = TRUE;
> }
> }
>
> Can someone explain what the condition pointed by >>> is doing? (Unfortunately, my C skills are pretty low...)
>
> Why not simply "(modifiers[m].vkey && (keystate[vkey] & 0x80) != modifiers[m].pressed)"?
I don't immediately know what this if statement is for, but I can tell
you that the ! operator converts a value of zero to 1 and a nonzero
value to 0. So, if keystate[vkey] & 0x80 is 0 then
modifiers[m].pressed must be nonzero and vice versa.
-Alex
June 27, 2018
Re: [PATCH] kernel32/tests: Avoid ARRAY_SIZE-like macros
by Marvin
Hi,
While running your changed tests on Windows, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at
https://testbot.winehq.org/JobDetails.pl?Key=39414
Your paranoid android.
=== w8 (32 bit comm) ===
comm.c:859: Test failed: WaitCommEvent failed with a timeout
comm.c:870: recovering after WAIT_TIMEOUT...
comm.c:880: Test failed: WaitCommEvent error 0
comm.c:881: Test failed: WaitCommEvent: expected EV_TXEMPTY, got 0
comm.c:885: WaitCommEvent for EV_TXEMPTY took 1515 ms (timeout 1500)
comm.c:886: Test failed: WaitCommEvent used 1515 ms for waiting
comm.c:1553: test_AbortWaitCts timeout 500 handle 00000144
comm.c:1520: Changing CommMask on the fly for handle 00000144 after timeout 500
June 27, 2018
[PATCH] user32/tests: Avoid a variable that holds an ARRAY_SIZE()
by Michael Stefaniuc
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/user32/tests/class.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/dlls/user32/tests/class.c b/dlls/user32/tests/class.c
index 92b9ad93a2..9b3b2b30f3 100644
--- a/dlls/user32/tests/class.c
+++ b/dlls/user32/tests/class.c
@@ -645,7 +645,6 @@ static void test_builtinproc(void)
"ScrollBar",
"#32770", /* dialog */
};
- static const int NUM_NORMAL_CLASSES = (sizeof(NORMAL_CLASSES)/sizeof(NORMAL_CLASSES[0]));
static const char classA[] = "deftest";
static const WCHAR classW[] = {'d','e','f','t','e','s','t',0};
WCHAR unistring[] = {0x142, 0x40e, 0x3b4, 0}; /* a string that would be destroyed by a W->A->W conversion */
@@ -656,7 +655,7 @@ static void test_builtinproc(void)
WCHAR buf[128];
ATOM atom;
HWND hwnd;
- int i;
+ unsigned int i;
pDefWindowProcA = (void *)GetProcAddress(GetModuleHandleA("user32.dll"), "DefWindowProcA");
pDefWindowProcW = (void *)GetProcAddress(GetModuleHandleA("user32.dll"), "DefWindowProcW");
@@ -771,7 +770,7 @@ static void test_builtinproc(void)
/* For most of the builtin controls both GetWindowLongPtrA and W returns a pointer that is executed directly
* by CallWindowProcA/W */
- for (i = 0; i < NUM_NORMAL_CLASSES; i++)
+ for (i = 0; i < ARRAY_SIZE(NORMAL_CLASSES); i++)
{
WNDPROC procA, procW;
hwnd = CreateWindowExA(0, NORMAL_CLASSES[i], classA, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 680, 260,
--
2.14.4
June 27, 2018
[PATCH] user32/tests: Don't undefine ARRAY_SIZE()
by Michael Stefaniuc
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/user32/tests/cursoricon.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/dlls/user32/tests/cursoricon.c b/dlls/user32/tests/cursoricon.c
index 95a6878e9a..3d56815848 100644
--- a/dlls/user32/tests/cursoricon.c
+++ b/dlls/user32/tests/cursoricon.c
@@ -1328,8 +1328,6 @@ static void test_LoadImage(void)
test_LoadImageFile("Cursor (invalid dwDIBOffset)", invalid_dwDIBOffset, sizeof(invalid_dwDIBOffset), "cur", 0);
}
-#undef ARRAY_SIZE
-
static void test_CreateIconFromResource(void)
{
HANDLE handle;
--
2.14.4
June 27, 2018
[PATCH] comdlg32/tests: Don't undefine ARRAY_SIZE()
by Michael Stefaniuc
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/comdlg32/tests/filedlg.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/dlls/comdlg32/tests/filedlg.c b/dlls/comdlg32/tests/filedlg.c
index aedb18a192..bf4d1f22eb 100644
--- a/dlls/comdlg32/tests/filedlg.c
+++ b/dlls/comdlg32/tests/filedlg.c
@@ -1116,9 +1116,6 @@ static void test_extension(void)
test_extension_helper(&ofn, "TestFilter (*.*.def)\0*.*.def\0", "deadbeef.xyz");
}
-#undef ARRAY_SIZE
-
-
static BOOL WINAPI test_null_enum(HWND hwnd, LPARAM lParam)
{
/* Find the textbox and send a filename so IDOK will work.
--
2.14.4
June 27, 2018
[PATCH] kernel32/tests: Use the available ARRAY_SIZE() macro
by Michael Stefaniuc
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/kernel32/tests/actctx.c | 30 +++++++--------
dlls/kernel32/tests/atom.c | 4 +-
dlls/kernel32/tests/codepage.c | 64 +++++++++++++++----------------
dlls/kernel32/tests/comm.c | 4 +-
dlls/kernel32/tests/console.c | 68 ++++++++++++++++-----------------
dlls/kernel32/tests/file.c | 38 +++++++++----------
dlls/kernel32/tests/heap.c | 2 +-
dlls/kernel32/tests/loader.c | 18 ++++-----
dlls/kernel32/tests/module.c | 13 ++++---
dlls/kernel32/tests/path.c | 86 +++++++++++++++++++++---------------------
dlls/kernel32/tests/pipe.c | 5 +--
dlls/kernel32/tests/process.c | 10 ++---
dlls/kernel32/tests/profile.c | 12 +++---
dlls/kernel32/tests/resource.c | 2 +-
dlls/kernel32/tests/thread.c | 2 +-
dlls/kernel32/tests/version.c | 2 +-
dlls/kernel32/tests/virtual.c | 20 +++++-----
dlls/kernel32/tests/volume.c | 4 +-
18 files changed, 191 insertions(+), 193 deletions(-)
diff --git a/dlls/kernel32/tests/actctx.c b/dlls/kernel32/tests/actctx.c
index 8c9ac79db3..96d9b8cbb6 100644
--- a/dlls/kernel32/tests/actctx.c
+++ b/dlls/kernel32/tests/actctx.c
@@ -533,7 +533,7 @@ static int strcmp_aw(LPCWSTR strw, const char *stra)
WCHAR buf[1024];
if (!stra) return 1;
- MultiByteToWideChar(CP_ACP, 0, stra, -1, buf, sizeof(buf)/sizeof(WCHAR));
+ MultiByteToWideChar(CP_ACP, 0, stra, -1, buf, ARRAY_SIZE(buf));
return lstrcmpW(strw, buf);
}
@@ -550,7 +550,7 @@ static BOOL create_manifest_file(const char *filename, const char *manifest, int
WCHAR path[MAX_PATH];
MultiByteToWideChar( CP_ACP, 0, filename, -1, path, MAX_PATH );
- GetFullPathNameW(path, sizeof(manifest_path)/sizeof(WCHAR), manifest_path, NULL);
+ GetFullPathNameW(path, ARRAY_SIZE(manifest_path), manifest_path, NULL);
if (manifest_len == -1)
manifest_len = strlen(manifest);
@@ -566,7 +566,7 @@ static BOOL create_manifest_file(const char *filename, const char *manifest, int
if (depmanifest)
{
MultiByteToWideChar( CP_ACP, 0, depfile, -1, path, MAX_PATH );
- GetFullPathNameW(path, sizeof(depmanifest_path)/sizeof(WCHAR), depmanifest_path, NULL);
+ GetFullPathNameW(path, ARRAY_SIZE(depmanifest_path), depmanifest_path, NULL);
file = CreateFileW(path, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS,
FILE_ATTRIBUTE_NORMAL, NULL);
ok(file != INVALID_HANDLE_VALUE, "CreateFile failed: %u\n", GetLastError());
@@ -2558,7 +2558,7 @@ static void init_paths(void)
static const WCHAR backslash[] = {'\\',0};
static const WCHAR subdir[] = {'T','e','s','t','S','u','b','d','i','r','\\',0};
- GetModuleFileNameW(NULL, exe_path, sizeof(exe_path)/sizeof(WCHAR));
+ GetModuleFileNameW(NULL, exe_path, ARRAY_SIZE(exe_path));
lstrcpyW(app_dir, exe_path);
for(ptr=app_dir+lstrlenW(app_dir); *ptr != '\\' && *ptr != '/'; ptr--);
ptr[1] = 0;
@@ -2570,7 +2570,7 @@ static void init_paths(void)
lstrcpyW(work_dir_subdir, work_dir);
lstrcatW(work_dir_subdir, subdir);
- GetModuleFileNameW(NULL, app_manifest_path, sizeof(app_manifest_path)/sizeof(WCHAR));
+ GetModuleFileNameW(NULL, app_manifest_path, ARRAY_SIZE(app_manifest_path));
lstrcpyW(app_manifest_path+lstrlenW(app_manifest_path), dot_manifest);
}
@@ -2580,7 +2580,7 @@ static void write_manifest(const char *filename, const char *manifest)
DWORD size;
CHAR path[MAX_PATH];
- GetTempPathA(sizeof(path)/sizeof(CHAR), path);
+ GetTempPathA(ARRAY_SIZE(path), path);
strcat(path, filename);
file = CreateFileA(path, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
@@ -2593,7 +2593,7 @@ static void delete_manifest_file(const char *filename)
{
CHAR path[MAX_PATH];
- GetTempPathA(sizeof(path)/sizeof(CHAR), path);
+ GetTempPathA(ARRAY_SIZE(path), path);
strcat(path, filename);
DeleteFileA(path);
}
@@ -2604,7 +2604,7 @@ static void test_CreateActCtx(void)
ACTCTXA actctx;
HANDLE handle;
- GetTempPathA(sizeof(path)/sizeof(CHAR), path);
+ GetTempPathA(ARRAY_SIZE(path), path);
strcat(path, "main_wndcls.manifest");
write_manifest("testdep1.manifest", manifest_wndcls1);
@@ -2621,7 +2621,7 @@ static void test_CreateActCtx(void)
pReleaseActCtx(handle);
/* with specified directory, that doesn't contain dependent assembly */
- GetWindowsDirectoryA(dir, sizeof(dir)/sizeof(CHAR));
+ GetWindowsDirectoryA(dir, ARRAY_SIZE(dir));
memset(&actctx, 0, sizeof(ACTCTXA));
actctx.cbSize = sizeof(ACTCTXA);
@@ -2667,7 +2667,7 @@ todo_wine
/* load manifest from lpAssemblyDirectory directory */
write_manifest("testdir.manifest", manifest1);
- GetTempPathA(sizeof(path)/sizeof(path[0]), path);
+ GetTempPathA(ARRAY_SIZE(path), path);
SetCurrentDirectoryA(path);
strcat(path, "assembly_dir");
strcpy(dir, path);
@@ -3048,14 +3048,14 @@ static void test_settings(void)
ret = pQueryActCtxSettingsW( 0, handle, namespace2005W, dpiAwareW, buffer, 80, &size );
ok( ret, "QueryActCtxSettingsW failed err %u\n", GetLastError() );
ok( !lstrcmpW( buffer, trueW ), "got %s\n", wine_dbgstr_w(buffer) );
- ok( size == sizeof(trueW)/sizeof(WCHAR), "wrong len %lu\n", size );
+ ok( size == ARRAY_SIZE(trueW), "wrong len %lu\n", size );
SetLastError( 0xdeadbeef );
size = 0xdead;
memset( buffer, 0xcc, sizeof(buffer) );
ret = pQueryActCtxSettingsW( 0, handle, namespace2005W, dpiAwareW, buffer, lstrlenW(trueW) + 1, &size );
ok( ret, "QueryActCtxSettingsW failed err %u\n", GetLastError() );
ok( !lstrcmpW( buffer, trueW ), "got %s\n", wine_dbgstr_w(buffer) );
- ok( size == sizeof(trueW)/sizeof(WCHAR), "wrong len %lu\n", size );
+ ok( size == ARRAY_SIZE(trueW), "wrong len %lu\n", size );
SetLastError( 0xdeadbeef );
size = 0xdead;
memset( buffer, 0xcc, sizeof(buffer) );
@@ -3087,7 +3087,7 @@ static void test_settings(void)
if (ret)
{
ok( !lstrcmpW( buffer, trueW ), "got %s\n", wine_dbgstr_w(buffer) );
- ok( size == sizeof(trueW)/sizeof(WCHAR), "wrong len %lu\n", size );
+ ok( size == ARRAY_SIZE(trueW), "wrong len %lu\n", size );
}
else ok( buffer[0] == 0xcccc, "got %s\n", wine_dbgstr_w(buffer) );
SetLastError( 0xdeadbeef );
@@ -3096,7 +3096,7 @@ static void test_settings(void)
ret = pQueryActCtxSettingsW( 0, handle, NULL, dpiAwareW, buffer, lstrlenW(trueW), &size );
ok( ret, "QueryActCtxSettingsW failed err %u\n", GetLastError() );
ok( !lstrcmpW( buffer, trueW ), "got %s\n", wine_dbgstr_w(buffer) );
- ok( size == sizeof(trueW)/sizeof(WCHAR), "wrong len %lu\n", size );
+ ok( size == ARRAY_SIZE(trueW), "wrong len %lu\n", size );
SetLastError( 0xdeadbeef );
size = 0xdead;
memset( buffer, 0xcc, sizeof(buffer) );
@@ -3104,7 +3104,7 @@ static void test_settings(void)
ok( !ret, "QueryActCtxSettingsW failed err %u\n", GetLastError() );
ok( GetLastError() == ERROR_INSUFFICIENT_BUFFER, "wrong error %u\n", GetLastError() );
ok( buffer[0] == 0xcccc, "got %s\n", wine_dbgstr_w(buffer) );
- ok( size == sizeof(trueW)/sizeof(WCHAR), "wrong len %lu\n", size );
+ ok( size == ARRAY_SIZE(trueW), "wrong len %lu\n", size );
pReleaseActCtx(handle);
create_manifest_file( "manifest_settings2.manifest", settings_manifest2, -1, NULL, NULL );
diff --git a/dlls/kernel32/tests/atom.c b/dlls/kernel32/tests/atom.c
index 0c1740869a..ad9e91ba25 100644
--- a/dlls/kernel32/tests/atom.c
+++ b/dlls/kernel32/tests/atom.c
@@ -276,7 +276,7 @@ static void test_get_atom_name(void)
do_initW(inW, "abcdefghij", 255);
atom = GlobalAddAtomW(inW);
ok(atom, "couldn't add atom for %s\n", in);
- len = GlobalGetAtomNameW(atom, outW, sizeof(outW)/sizeof(outW[0]));
+ len = GlobalGetAtomNameW(atom, outW, ARRAY_SIZE(outW));
ok(len == 255, "length mismatch (%u instead of 255)\n", len);
for (i = 0; i < 255; i++)
{
@@ -537,7 +537,7 @@ static void test_local_get_atom_name(void)
do_initW(inW, "abcdefghij", 255);
atom = AddAtomW(inW);
ok(atom, "couldn't add atom for %s\n", in);
- len = GetAtomNameW(atom, outW, sizeof(outW)/sizeof(outW[0]));
+ len = GetAtomNameW(atom, outW, ARRAY_SIZE(outW));
ok(len == 255, "length mismatch (%u instead of 255)\n", len);
for (i = 0; i < 255; i++)
{
diff --git a/dlls/kernel32/tests/codepage.c b/dlls/kernel32/tests/codepage.c
index 7389d93276..b15a3a10a7 100644
--- a/dlls/kernel32/tests/codepage.c
+++ b/dlls/kernel32/tests/codepage.c
@@ -205,7 +205,7 @@ static void test_other_invalid_parameters(void)
char c_string[] = "Hello World";
size_t c_string_len = sizeof(c_string);
WCHAR w_string[] = {'H','e','l','l','o',' ','W','o','r','l','d',0};
- size_t w_string_len = sizeof(w_string) / sizeof(WCHAR);
+ size_t w_string_len = ARRAY_SIZE(w_string);
BOOL used;
INT len;
@@ -683,7 +683,7 @@ static void test_utf7_encoding(void)
i, expected_len, expected_len, output[expected_len]);
}
- for (i = 0; i < sizeof(tests) / sizeof(tests[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(tests); i++)
{
memset(output, '#', sizeof(output) - 1);
output[sizeof(output) - 1] = 0;
@@ -746,12 +746,12 @@ static void test_utf7_decoding(void)
{
/* tests string conversion with srclen=-1 */
{
- "+T2BZfQ-", -1, output, sizeof(output) / sizeof(WCHAR) - 1,
+ "+T2BZfQ-", -1, output, ARRAY_SIZE(output) - 1,
{0x4F60,0x597D,0}, 3, 3
},
/* tests string conversion with srclen=-2 */
{
- "+T2BZfQ-", -2, output, sizeof(output) / sizeof(WCHAR) - 1,
+ "+T2BZfQ-", -2, output, ARRAY_SIZE(output) - 1,
{0x4F60,0x597D,0}, 3, 3
},
/* tests string conversion with dstlen=strlen(expected_dst) */
@@ -781,72 +781,72 @@ static void test_utf7_decoding(void)
},
/* tests ill-formed UTF-7: 6 bits, not enough for a byte pair */
{
- "+T-+T-+T-hello", -1, output, sizeof(output) / sizeof(WCHAR) - 1,
+ "+T-+T-+T-hello", -1, output, ARRAY_SIZE(output) - 1,
{'h','e','l','l','o',0}, 6, 6
},
/* tests ill-formed UTF-7: 12 bits, not enough for a byte pair */
{
- "+T2-+T2-+T2-hello", -1, output, sizeof(output) / sizeof(WCHAR) - 1,
+ "+T2-+T2-+T2-hello", -1, output, ARRAY_SIZE(output) - 1,
{'h','e','l','l','o',0}, 6, 6
},
/* tests ill-formed UTF-7: 18 bits, not a multiple of 16 and the last bit is a 1 */
{
- "+T2B-+T2B-+T2B-hello", -1, output, sizeof(output) / sizeof(WCHAR) - 1,
+ "+T2B-+T2B-+T2B-hello", -1, output, ARRAY_SIZE(output) - 1,
{0x4F60,0x4F60,0x4F60,'h','e','l','l','o',0}, 9, 9
},
/* tests ill-formed UTF-7: 24 bits, a multiple of 8 but not a multiple of 16 */
{
- "+T2BZ-+T2BZ-+T2BZ-hello", -1, output, sizeof(output) / sizeof(WCHAR) - 1,
+ "+T2BZ-+T2BZ-+T2BZ-hello", -1, output, ARRAY_SIZE(output) - 1,
{0x4F60,0x4F60,0x4F60,'h','e','l','l','o',0}, 9, 9
},
/* tests UTF-7 followed by characters that should be encoded but aren't */
{
- "+T2BZ-\x82\xFE", -1, output, sizeof(output) / sizeof(WCHAR) - 1,
+ "+T2BZ-\x82\xFE", -1, output, ARRAY_SIZE(output) - 1,
{0x4F60,0x0082,0x00FE,0}, 4, 4
},
/* tests srclen > strlen(src) */
{
- "a\0b", 4, output, sizeof(output) / sizeof(WCHAR) - 1,
+ "a\0b", 4, output, ARRAY_SIZE(output) - 1,
{'a',0,'b',0}, 4, 4
},
/* tests srclen < strlen(src) outside of a UTF-7 sequence */
{
- "hello", 2, output, sizeof(output) / sizeof(WCHAR) - 1,
+ "hello", 2, output, ARRAY_SIZE(output) - 1,
{'h','e'}, 2, 2
},
/* tests srclen < strlen(src) inside of a UTF-7 sequence */
{
- "+T2BZfQ-", 4, output, sizeof(output) / sizeof(WCHAR) - 1,
+ "+T2BZfQ-", 4, output, ARRAY_SIZE(output) - 1,
{0x4F60}, 1, 1
},
/* tests srclen < strlen(src) right at the beginning of a UTF-7 sequence */
{
- "hi+T2A-", 3, output, sizeof(output) / sizeof(WCHAR) - 1,
+ "hi+T2A-", 3, output, ARRAY_SIZE(output) - 1,
{'h','i'}, 2, 2
},
/* tests srclen < strlen(src) right at the end of a UTF-7 sequence */
{
- "+T2A-hi", 5, output, sizeof(output) / sizeof(WCHAR) - 1,
+ "+T2A-hi", 5, output, ARRAY_SIZE(output) - 1,
{0x4F60}, 1, 1
},
/* tests srclen < strlen(src) at the beginning of an escaped + sign */
{
- "hi+-", 3, output, sizeof(output) / sizeof(WCHAR) - 1,
+ "hi+-", 3, output, ARRAY_SIZE(output) - 1,
{'h','i'}, 2, 2
},
/* tests srclen < strlen(src) at the end of an escaped + sign */
{
- "+-hi", 2, output, sizeof(output) / sizeof(WCHAR) - 1,
+ "+-hi", 2, output, ARRAY_SIZE(output) - 1,
{'+'}, 1, 1
},
/* tests len=0 but no error */
{
- "+", 1, output, sizeof(output) / sizeof(WCHAR) - 1,
+ "+", 1, output, ARRAY_SIZE(output) - 1,
{}, 0, 0
},
/* tests a single null char */
{
- "", -1, output, sizeof(output) / sizeof(WCHAR) - 1,
+ "", -1, output, ARRAY_SIZE(output) - 1,
{0}, 1, 1
},
/* tests a buffer that runs out while not decoding a UTF-7 sequence */
@@ -867,9 +867,9 @@ static void test_utf7_decoding(void)
sprintf(input, "+%c+AAA", i);
memset(output, 0x23, sizeof(output) - sizeof(WCHAR));
- output[sizeof(output) / sizeof(WCHAR) - 1] = 0;
+ output[ARRAY_SIZE(output) - 1] = 0;
- len = MultiByteToWideChar(CP_UTF7, 0, input, 7, output, sizeof(output) / sizeof(WCHAR) - 1);
+ len = MultiByteToWideChar(CP_UTF7, 0, input, 7, output, ARRAY_SIZE(output) - 1);
if (i == '-')
{
@@ -909,9 +909,9 @@ static void test_utf7_decoding(void)
sprintf(input, "+B%c+AAA", i);
memset(output, 0x23, sizeof(output) - sizeof(WCHAR));
- output[sizeof(output) / sizeof(WCHAR) - 1] = 0;
+ output[ARRAY_SIZE(output) - 1] = 0;
- len = MultiByteToWideChar(CP_UTF7, 0, input, 8, output, sizeof(output) / sizeof(WCHAR) - 1);
+ len = MultiByteToWideChar(CP_UTF7, 0, input, 8, output, ARRAY_SIZE(output) - 1);
if (i == '-')
{
@@ -955,10 +955,10 @@ static void test_utf7_decoding(void)
i, wine_dbgstr_wn(expected, expected_len + 1), wine_dbgstr_wn(output, expected_len + 1));
}
- for (i = 0; i < sizeof(tests) / sizeof(tests[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(tests); i++)
{
memset(output, 0x23, sizeof(output) - sizeof(WCHAR));
- output[sizeof(output) / sizeof(WCHAR) - 1] = 0;
+ output[ARRAY_SIZE(output) - 1] = 0;
SetLastError(0xdeadbeef);
len = MultiByteToWideChar(CP_UTF7, 0, tests[i].src, tests[i].srclen,
@@ -1004,7 +1004,7 @@ static void test_undefined_byte_char(void)
};
INT i, ret;
- for (i = 0; i < (sizeof(testset) / sizeof(testset[0])); i++) {
+ for (i = 0; i < ARRAY_SIZE(testset); i++) {
if (! IsValidCodePage(testset[i].codepage))
{
skip("Codepage %d not available\n", testset[i].codepage);
@@ -1106,7 +1106,7 @@ static void test_threadcp(void)
last = GetThreadLocale();
acp = GetACP();
- for (i = 0; i < sizeof(lcids)/sizeof(lcids[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(lcids); i++)
{
SetThreadLocale(lcids[i].lcid);
@@ -1151,7 +1151,7 @@ static void test_threadcp(void)
}
/* IsDBCSLeadByteEx - locales without codepage */
- for (i = 0; i < sizeof(isleads_nocp)/sizeof(isleads_nocp[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(isleads_nocp); i++)
{
SetThreadLocale(isleads_nocp[i].lcid);
@@ -1163,7 +1163,7 @@ static void test_threadcp(void)
}
/* IsDBCSLeadByteEx - locales with codepage */
- for (i = 0; i < sizeof(isleads)/sizeof(isleads[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(isleads); i++)
{
SetThreadLocale(isleads[i].lcid);
@@ -1194,7 +1194,7 @@ static void test_dbcs_to_widechar(void)
MB_COMPOSITE |MB_ERR_INVALID_CHARS|MB_USEGLYPHCHARS,
};
- for (i = 0; i < sizeof(flags)/sizeof(DWORD); ++i)
+ for (i = 0; i < ARRAY_SIZE(flags); ++i)
{
memset(wbuf, 0xff, sizeof(wbuf));
count = MultiByteToWideChar(936, flags[i], (char*)&buf[0], 2, NULL, 0);
@@ -1206,7 +1206,7 @@ static void test_dbcs_to_widechar(void)
ok(wbuf[1] == 0xffff, "%04x: returned %04x (expected ffff)\n", flags[i], wbuf[1]);
}
- for (i = 0; i < sizeof(flags)/sizeof(DWORD); ++i)
+ for (i = 0; i < ARRAY_SIZE(flags); ++i)
{
memset(wbuf, 0xff, sizeof(wbuf));
count = MultiByteToWideChar(936, flags[i], (char*)&buf[0], 3, NULL, 0);
@@ -1232,7 +1232,7 @@ static void test_dbcs_to_widechar(void)
}
/* src ends with null character */
- for (i = 0; i < sizeof(flags)/sizeof(DWORD); ++i)
+ for (i = 0; i < ARRAY_SIZE(flags); ++i)
{
memset(wbuf, 0xff, sizeof(wbuf));
count = MultiByteToWideChar(936, flags[i], (char*)&buf[0], 4, NULL, 0);
@@ -1261,7 +1261,7 @@ static void test_dbcs_to_widechar(void)
}
/* src has null character, but not ends with it */
- for (i = 0; i < sizeof(flags)/sizeof(DWORD); ++i)
+ for (i = 0; i < ARRAY_SIZE(flags); ++i)
{
memset(wbuf, 0xff, sizeof(wbuf));
count = MultiByteToWideChar(936, flags[i], (char*)&buf[0], 5, NULL, 0);
diff --git a/dlls/kernel32/tests/comm.c b/dlls/kernel32/tests/comm.c
index d671e40f87..97a71358fe 100644
--- a/dlls/kernel32/tests/comm.c
+++ b/dlls/kernel32/tests/comm.c
@@ -580,7 +580,7 @@ static void test_BuildCommDCBW(const char *string, const TEST *ptest, int initia
WCHAR wide_string[sizeof(ptest->string)];
static int reportedDCBW = 0;
- MultiByteToWideChar(CP_ACP, 0, string, -1, wide_string, sizeof(wide_string) / sizeof(WCHAR));
+ MultiByteToWideChar(CP_ACP, 0, string, -1, wide_string, ARRAY_SIZE(wide_string));
/* set initial conditions */
memset(&dcb, initial_value, sizeof(DCB));
@@ -608,7 +608,7 @@ static void test_BuildCommDCBAndTimeoutsW(const char *string, const TEST *ptest,
WCHAR wide_string[sizeof(ptest->string)];
static int reportedDCBAndTW = 0;
- MultiByteToWideChar(CP_ACP, 0, string, -1, wide_string, sizeof(wide_string) / sizeof(WCHAR));
+ MultiByteToWideChar(CP_ACP, 0, string, -1, wide_string, ARRAY_SIZE(wide_string));
/* set initial conditions */
memset(&dcb, initial_value, sizeof(DCB));
diff --git a/dlls/kernel32/tests/console.c b/dlls/kernel32/tests/console.c
index 926c052686..ac77ab76b0 100644
--- a/dlls/kernel32/tests/console.c
+++ b/dlls/kernel32/tests/console.c
@@ -982,7 +982,7 @@ static void test_GetSetConsoleInputExeName(void)
GetModuleFileNameA(GetModuleHandleA(NULL), module, sizeof(module));
p = strrchr(module, '\\') + 1;
- ret = pGetConsoleInputExeNameA(sizeof(buffer)/sizeof(buffer[0]), buffer);
+ ret = pGetConsoleInputExeNameA(ARRAY_SIZE(buffer), buffer);
ok(ret, "GetConsoleInputExeNameA failed\n");
todo_wine ok(!lstrcmpA(buffer, p), "got %s expected %s\n", buffer, p);
@@ -1001,7 +1001,7 @@ static void test_GetSetConsoleInputExeName(void)
ret = pSetConsoleInputExeNameA(input_exe);
ok(ret, "SetConsoleInputExeNameA failed\n");
- ret = pGetConsoleInputExeNameA(sizeof(buffer)/sizeof(buffer[0]), buffer);
+ ret = pGetConsoleInputExeNameA(ARRAY_SIZE(buffer), buffer);
ok(ret, "GetConsoleInputExeNameA failed\n");
ok(!lstrcmpA(buffer, input_exe), "got %s expected %s\n", buffer, input_exe);
}
@@ -1074,7 +1074,7 @@ static void test_OpenCON(void)
unsigned i;
HANDLE h;
- for (i = 0; i < sizeof(accesses) / sizeof(accesses[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(accesses); i++)
{
h = CreateFileW(conW, GENERIC_WRITE, 0, NULL, accesses[i], 0, NULL);
ok(h != INVALID_HANDLE_VALUE || broken(accesses[i] == TRUNCATE_EXISTING /* Win8 */),
@@ -1179,7 +1179,7 @@ static void test_OpenConsoleW(void)
return;
}
- for (index = 0; index < sizeof(invalid_table)/sizeof(invalid_table[0]); index++)
+ for (index = 0; index < ARRAY_SIZE(invalid_table); index++)
{
SetLastError(0xdeadbeef);
ret = pOpenConsoleW(invalid_table[index].name, invalid_table[index].access,
@@ -1193,7 +1193,7 @@ static void test_OpenConsoleW(void)
invalid_table[index].gle, invalid_table[index].gle2, index, gle);
}
- for (index = 0; index < sizeof(valid_table)/sizeof(valid_table[0]); index++)
+ for (index = 0; index < ARRAY_SIZE(valid_table); index++)
{
ret = pOpenConsoleW(valid_table[index].name, valid_table[index].access,
valid_table[index].inherit, valid_table[index].creation);
@@ -1248,7 +1248,7 @@ static void test_CreateFileW(void)
HANDLE ret;
SECURITY_ATTRIBUTES sa;
- for (index = 0; index < sizeof(cf_table)/sizeof(cf_table[0]); index++)
+ for (index = 0; index < ARRAY_SIZE(cf_table); index++)
{
SetLastError(0xdeadbeef);
@@ -1380,7 +1380,7 @@ static void test_GetNumberOfConsoleInputEvents(HANDLE input_handle)
{INVALID_HANDLE_VALUE, &count, ERROR_INVALID_HANDLE},
};
- for (i = 0; i < sizeof(invalid_table)/sizeof(invalid_table[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(invalid_table); i++)
{
SetLastError(0xdeadbeef);
if (invalid_table[i].nrofevents) count = 0xdeadbeef;
@@ -1481,7 +1481,7 @@ static void test_WriteConsoleInputA(HANDLE input_handle)
event.EventType = MOUSE_EVENT;
event.Event.MouseEvent = mouse_event;
- for (i = 0; i < sizeof(invalid_table)/sizeof(invalid_table[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(invalid_table); i++)
{
if (invalid_table[i].win_crash)
continue;
@@ -1541,31 +1541,31 @@ static void test_WriteConsoleInputA(HANDLE input_handle)
ret = FlushConsoleInputBuffer(input_handle);
ok(ret == TRUE, "Expected FlushConsoleInputBuffer to return TRUE, got %d\n", ret);
- for (i = 0; i < sizeof(event_list)/sizeof(event_list[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(event_list); i++)
{
event_list[i].EventType = MOUSE_EVENT;
event_list[i].Event.MouseEvent = mouse_event;
}
/* Writing consecutive chunks of mouse events appears to work. */
- ret = WriteConsoleInputA(input_handle, event_list, sizeof(event_list)/sizeof(event_list[0]), &count);
+ ret = WriteConsoleInputA(input_handle, event_list, ARRAY_SIZE(event_list), &count);
ok(ret == TRUE, "Expected WriteConsoleInputA to return TRUE, got %d\n", ret);
- ok(count == sizeof(event_list)/sizeof(event_list[0]),
+ ok(count == ARRAY_SIZE(event_list),
"Expected count to be event list length, got %u\n", count);
ret = GetNumberOfConsoleInputEvents(input_handle, &count);
ok(ret == TRUE, "Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n", ret);
- ok(count == sizeof(event_list)/sizeof(event_list[0]),
+ ok(count == ARRAY_SIZE(event_list),
"Expected count to be event list length, got %u\n", count);
- ret = WriteConsoleInputA(input_handle, event_list, sizeof(event_list)/sizeof(event_list[0]), &count);
+ ret = WriteConsoleInputA(input_handle, event_list, ARRAY_SIZE(event_list), &count);
ok(ret == TRUE, "Expected WriteConsoleInputA to return TRUE, got %d\n", ret);
- ok(count == sizeof(event_list)/sizeof(event_list[0]),
+ ok(count == ARRAY_SIZE(event_list),
"Expected count to be event list length, got %u\n", count);
ret = GetNumberOfConsoleInputEvents(input_handle, &count);
ok(ret == TRUE, "Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n", ret);
- ok(count == 2*sizeof(event_list)/sizeof(event_list[0]),
+ ok(count == 2*ARRAY_SIZE(event_list),
"Expected count to be twice event list length, got %u\n", count);
/* Again, writing a single mouse event with adjacent mouse events queued doesn't appear to affect the count. */
@@ -1576,7 +1576,7 @@ static void test_WriteConsoleInputA(HANDLE input_handle)
ret = GetNumberOfConsoleInputEvents(input_handle, &count);
ok(ret == TRUE, "Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n", ret);
todo_wine
- ok(count == 2*sizeof(event_list)/sizeof(event_list[0]),
+ ok(count == 2*ARRAY_SIZE(event_list),
"Expected count to be twice event list length, got %u\n", count);
ret = FlushConsoleInputBuffer(input_handle);
@@ -1718,7 +1718,7 @@ static void test_WriteConsoleInputW(HANDLE input_handle)
event.EventType = MOUSE_EVENT;
event.Event.MouseEvent = mouse_event;
- for (i = 0; i < sizeof(invalid_table)/sizeof(invalid_table[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(invalid_table); i++)
{
if (invalid_table[i].win_crash)
continue;
@@ -1778,31 +1778,31 @@ static void test_WriteConsoleInputW(HANDLE input_handle)
ret = FlushConsoleInputBuffer(input_handle);
ok(ret == TRUE, "Expected FlushConsoleInputBuffer to return TRUE, got %d\n", ret);
- for (i = 0; i < sizeof(event_list)/sizeof(event_list[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(event_list); i++)
{
event_list[i].EventType = MOUSE_EVENT;
event_list[i].Event.MouseEvent = mouse_event;
}
/* Writing consecutive chunks of mouse events appears to work. */
- ret = WriteConsoleInputW(input_handle, event_list, sizeof(event_list)/sizeof(event_list[0]), &count);
+ ret = WriteConsoleInputW(input_handle, event_list, ARRAY_SIZE(event_list), &count);
ok(ret == TRUE, "Expected WriteConsoleInputW to return TRUE, got %d\n", ret);
- ok(count == sizeof(event_list)/sizeof(event_list[0]),
+ ok(count == ARRAY_SIZE(event_list),
"Expected count to be event list length, got %u\n", count);
ret = GetNumberOfConsoleInputEvents(input_handle, &count);
ok(ret == TRUE, "Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n", ret);
- ok(count == sizeof(event_list)/sizeof(event_list[0]),
+ ok(count == ARRAY_SIZE(event_list),
"Expected count to be event list length, got %u\n", count);
- ret = WriteConsoleInputW(input_handle, event_list, sizeof(event_list)/sizeof(event_list[0]), &count);
+ ret = WriteConsoleInputW(input_handle, event_list, ARRAY_SIZE(event_list), &count);
ok(ret == TRUE, "Expected WriteConsoleInputW to return TRUE, got %d\n", ret);
- ok(count == sizeof(event_list)/sizeof(event_list[0]),
+ ok(count == ARRAY_SIZE(event_list),
"Expected count to be event list length, got %u\n", count);
ret = GetNumberOfConsoleInputEvents(input_handle, &count);
ok(ret == TRUE, "Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n", ret);
- ok(count == 2*sizeof(event_list)/sizeof(event_list[0]),
+ ok(count == 2*ARRAY_SIZE(event_list),
"Expected count to be twice event list length, got %u\n", count);
/* Again, writing a single mouse event with adjacent mouse events queued doesn't appear to affect the count. */
@@ -1813,7 +1813,7 @@ static void test_WriteConsoleInputW(HANDLE input_handle)
ret = GetNumberOfConsoleInputEvents(input_handle, &count);
ok(ret == TRUE, "Expected GetNumberOfConsoleInputEvents to return TRUE, got %d\n", ret);
todo_wine
- ok(count == 2*sizeof(event_list)/sizeof(event_list[0]),
+ ok(count == 2*ARRAY_SIZE(event_list),
"Expected count to be twice event list length, got %u\n", count);
ret = FlushConsoleInputBuffer(input_handle);
@@ -1932,7 +1932,7 @@ static void test_WriteConsoleOutputCharacterA(HANDLE output_handle)
{output_handle, output, 1, {0, 0}, NULL, 0xdeadbeef, ERROR_INVALID_ACCESS, 1},
};
- for (i = 0; i < sizeof(invalid_table)/sizeof(invalid_table[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(invalid_table); i++)
{
if (invalid_table[i].win7_crash)
continue;
@@ -2016,7 +2016,7 @@ static void test_WriteConsoleOutputCharacterW(HANDLE output_handle)
{output_handle, outputW, 1, {0, 0}, NULL, 0xdeadbeef, ERROR_INVALID_ACCESS, 1},
};
- for (i = 0; i < sizeof(invalid_table)/sizeof(invalid_table[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(invalid_table); i++)
{
if (invalid_table[i].win7_crash)
continue;
@@ -2099,7 +2099,7 @@ static void test_WriteConsoleOutputAttribute(HANDLE output_handle)
{output_handle, &attr, 1, {0, 0}, NULL, 0xdeadbeef, ERROR_INVALID_ACCESS, 1},
};
- for (i = 0; i < sizeof(invalid_table)/sizeof(invalid_table[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(invalid_table); i++)
{
if (invalid_table[i].win7_crash)
continue;
@@ -2169,7 +2169,7 @@ static void test_FillConsoleOutputCharacterA(HANDLE output_handle)
{output_handle, 'a', 1, {0, 0}, NULL, ERROR_INVALID_ACCESS, 1},
};
- for (i = 0; i < sizeof(invalid_table)/sizeof(invalid_table[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(invalid_table); i++)
{
if (invalid_table[i].win7_crash)
continue;
@@ -2228,7 +2228,7 @@ static void test_FillConsoleOutputCharacterW(HANDLE output_handle)
{output_handle, 'a', 1, {0, 0}, NULL, ERROR_INVALID_ACCESS, 1},
};
- for (i = 0; i < sizeof(invalid_table)/sizeof(invalid_table[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(invalid_table); i++)
{
if (invalid_table[i].win7_crash)
continue;
@@ -2287,7 +2287,7 @@ static void test_FillConsoleOutputAttribute(HANDLE output_handle)
{output_handle, FOREGROUND_BLUE, 1, {0, 0}, NULL, ERROR_INVALID_ACCESS, 1},
};
- for (i = 0; i < sizeof(invalid_table)/sizeof(invalid_table[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(invalid_table); i++)
{
if (invalid_table[i].win7_crash)
continue;
@@ -2365,7 +2365,7 @@ static void test_ReadConsoleOutputCharacterA(HANDLE output_handle)
{output_handle, &read, 1, {0, 0}, NULL, 0xdeadbeef, ERROR_INVALID_ACCESS, 1},
};
- for (i = 0; i < sizeof(invalid_table)/sizeof(invalid_table[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(invalid_table); i++)
{
if (invalid_table[i].win7_crash)
continue;
@@ -2449,7 +2449,7 @@ static void test_ReadConsoleOutputCharacterW(HANDLE output_handle)
{output_handle, &read, 1, {0, 0}, NULL, 0xdeadbeef, ERROR_INVALID_ACCESS, 1},
};
- for (i = 0; i < sizeof(invalid_table)/sizeof(invalid_table[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(invalid_table); i++)
{
if (invalid_table[i].win7_crash)
continue;
@@ -2532,7 +2532,7 @@ static void test_ReadConsoleOutputAttribute(HANDLE output_handle)
{output_handle, &attr, 1, {0, 0}, NULL, 0xdeadbeef, ERROR_INVALID_ACCESS, 1},
};
- for (i = 0; i < sizeof(invalid_table)/sizeof(invalid_table[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(invalid_table); i++)
{
if (invalid_table[i].win7_crash)
continue;
diff --git a/dlls/kernel32/tests/file.c b/dlls/kernel32/tests/file.c
index 410c3f0591..1c4157279b 100644
--- a/dlls/kernel32/tests/file.c
+++ b/dlls/kernel32/tests/file.c
@@ -1836,7 +1836,7 @@ static void test_DeleteFileW( void )
/* test DeleteFile on empty directory */
ret = GetTempPathW(MAX_PATH, pathW);
- if (ret + sizeof(dirW)/sizeof(WCHAR)-1 + sizeof(subdirW)/sizeof(WCHAR)-1 >= MAX_PATH)
+ if (ret + ARRAY_SIZE(dirW)-1 + ARRAY_SIZE(subdirW)-1 >= MAX_PATH)
{
ok(0, "MAX_PATH exceeded in constructing paths\n");
return;
@@ -2366,9 +2366,9 @@ static void test_file_sharing(void)
return;
}
- for (a1 = 0; a1 < sizeof(access_modes)/sizeof(access_modes[0]); a1++)
+ for (a1 = 0; a1 < ARRAY_SIZE(access_modes); a1++)
{
- for (s1 = 0; s1 < sizeof(sharing_modes)/sizeof(sharing_modes[0]); s1++)
+ for (s1 = 0; s1 < ARRAY_SIZE(sharing_modes); s1++)
{
SetLastError(0xdeadbeef);
h = CreateFileA( filename, access_modes[a1].dw, sharing_modes[s1].dw,
@@ -2378,9 +2378,9 @@ static void test_file_sharing(void)
ok(0,"couldn't create file \"%s\" (err=%d)\n",filename,GetLastError());
return;
}
- for (a2 = 0; a2 < sizeof(access_modes)/sizeof(access_modes[0]); a2++)
+ for (a2 = 0; a2 < ARRAY_SIZE(access_modes); a2++)
{
- for (s2 = 0; s2 < sizeof(sharing_modes)/sizeof(sharing_modes[0]); s2++)
+ for (s2 = 0; s2 < ARRAY_SIZE(sharing_modes); s2++)
{
SetLastError(0xdeadbeef);
h2 = CreateFileA( filename, access_modes[a2].dw, sharing_modes[s2].dw,
@@ -2411,7 +2411,7 @@ static void test_file_sharing(void)
}
}
- for (a1 = 0; a1 < sizeof(mapping_modes)/sizeof(mapping_modes[0]); a1++)
+ for (a1 = 0; a1 < ARRAY_SIZE(mapping_modes); a1++)
{
HANDLE m;
@@ -2428,9 +2428,9 @@ static void test_file_sharing(void)
CloseHandle( h );
if (!m) continue;
- for (a2 = 0; a2 < sizeof(access_modes)/sizeof(access_modes[0]); a2++)
+ for (a2 = 0; a2 < ARRAY_SIZE(access_modes); a2++)
{
- for (s2 = 0; s2 < sizeof(sharing_modes)/sizeof(sharing_modes[0]); s2++)
+ for (s2 = 0; s2 < ARRAY_SIZE(sharing_modes); s2++)
{
SetLastError(0xdeadbeef);
h2 = CreateFileA( filename, access_modes[a2].dw, sharing_modes[s2].dw,
@@ -2861,10 +2861,10 @@ static void test_FindFirstFile_wildcards(void)
CreateDirectoryA("test-dir", NULL);
SetCurrentDirectoryA("test-dir");
- for (i = 0; i < sizeof(files) / sizeof(files[0]); ++i)
+ for (i = 0; i < ARRAY_SIZE(files); ++i)
_lclose(_lcreat(files[i], 0));
- for (i = 0; i < sizeof(tests) / sizeof(tests[0]); ++i)
+ for (i = 0; i < ARRAY_SIZE(tests); ++i)
{
char correct[512];
char incorrect[512];
@@ -2901,7 +2901,7 @@ static void test_FindFirstFile_wildcards(void)
missing[0] ? missing+2 : "none");
}
- for (i = 0; i < sizeof(files) / sizeof(files[0]); ++i)
+ for (i = 0; i < ARRAY_SIZE(files); ++i)
DeleteFileA(files[i]);
SetCurrentDirectoryA("..");
RemoveDirectoryA("test-dir");
@@ -3007,7 +3007,7 @@ static void test_async_file_errors(void)
ovl.hEvent = hSem;
completion_count = 0;
szFile[0] = '\0';
- GetWindowsDirectoryA(szFile, sizeof(szFile)/sizeof(szFile[0])-1-strlen("\\win.ini"));
+ GetWindowsDirectoryA(szFile, ARRAY_SIZE(szFile)-1-strlen("\\win.ini"));
strcat(szFile, "\\win.ini");
hFile = CreateFileA(szFile, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
NULL, OPEN_ALWAYS, FILE_FLAG_OVERLAPPED, NULL);
@@ -3881,7 +3881,7 @@ todo_wine_if (i == 1)
}
}
- for (i = 0; i < sizeof(td)/sizeof(td[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(td); i++)
{
SetLastError(0xdeadbeef);
hfile = CreateFileA(file_name, td[i].access, 0, NULL, td[i].disposition, 0, 0);
@@ -3987,7 +3987,7 @@ static void test_GetFileInformationByHandleEx(void)
ok(directory != INVALID_HANDLE_VALUE, "GetFileInformationByHandleEx: failed to open the temp folder, "
"got error %u.\n", GetLastError());
- for (i = 0; i < sizeof(checks) / sizeof(checks[0]); i += 1)
+ for (i = 0; i < ARRAY_SIZE(checks); i += 1)
{
SetLastError(0xdeadbeef);
ret = pGetFileInformationByHandleEx(directory, checks[i].handleClass, checks[i].ptr, checks[i].size);
@@ -4129,7 +4129,7 @@ static void test_OpenFileById(void)
ok(ret2 != INVALID_FILE_ATTRIBUTES,
"OpenFileById: GetFileAttributesA failed to find the temp file, got error %u\n", GetLastError());
- ret2 = MultiByteToWideChar(CP_ACP, 0, tempFileName + strlen(tempPath), -1, tempFileNameW, sizeof(tempFileNameW)/sizeof(tempFileNameW[0]));
+ ret2 = MultiByteToWideChar(CP_ACP, 0, tempFileName + strlen(tempPath), -1, tempFileNameW, ARRAY_SIZE(tempFileNameW));
ok(ret2, "OpenFileById: MultiByteToWideChar failed to convert tempFileName, got error %u.\n", GetLastError());
tempFileNameLen = ret2 - 1;
@@ -4587,7 +4587,7 @@ static void test_file_access(void)
GetTempPathA(MAX_PATH, path);
GetTempFileNameA(path, "foo", 0, fname);
- for (i = 0; i < sizeof(td)/sizeof(td[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(td); i++)
{
SetLastError(0xdeadbeef);
hfile = CreateFileA(fname, td[i].access, 0, NULL, CREATE_ALWAYS,
@@ -4601,7 +4601,7 @@ static void test_file_access(void)
else
ok(hfile != INVALID_HANDLE_VALUE, "%d: CreateFile error %d\n", i, GetLastError());
- for (j = 0; j < sizeof(td)/sizeof(td[0]); j++)
+ for (j = 0; j < ARRAY_SIZE(td); j++)
{
SetLastError(0xdeadbeef);
ret = DuplicateHandle(GetCurrentProcess(), hfile, GetCurrentProcess(), &hdup,
@@ -4843,7 +4843,7 @@ static void test_GetFinalPathNameByHandleW(void)
success = GetVolumePathNameW(long_path, drive_part, MAX_PATH);
ok(success, "GetVolumePathNameW error %u\n", GetLastError());
- success = GetVolumeNameForVolumeMountPointW(drive_part, volume_path, sizeof(volume_path) / sizeof(WCHAR));
+ success = GetVolumeNameForVolumeMountPointW(drive_part, volume_path, ARRAY_SIZE(volume_path));
ok(success, "GetVolumeNameForVolumeMountPointW error %u\n", GetLastError());
/* Test for VOLUME_NAME_GUID */
@@ -4863,7 +4863,7 @@ static void test_GetFinalPathNameByHandleW(void)
wine_dbgstr_w(file_part), wine_dbgstr_w(result_path));
drive_part[lstrlenW(drive_part)-1] = 0;
- success = QueryDosDeviceW(drive_part, nt_path, sizeof(nt_path) / sizeof(WCHAR));
+ success = QueryDosDeviceW(drive_part, nt_path, ARRAY_SIZE(nt_path));
ok(success, "QueryDosDeviceW error %u\n", GetLastError());
/* Test for VOLUME_NAME_NT */
diff --git a/dlls/kernel32/tests/heap.c b/dlls/kernel32/tests/heap.c
index fefd3e7956..38fae0eede 100644
--- a/dlls/kernel32/tests/heap.c
+++ b/dlls/kernel32/tests/heap.c
@@ -823,7 +823,7 @@ static void test_obsolete_flags(void)
return;
}
- for (i = 0; i < sizeof(test_global_flags)/sizeof(test_global_flags[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(test_global_flags); i++)
{
gbl = GlobalAlloc(test_global_flags[i].flags, 4);
ok(gbl != NULL, "GlobalAlloc failed\n");
diff --git a/dlls/kernel32/tests/loader.c b/dlls/kernel32/tests/loader.c
index c9ca02c28e..38ae3685dc 100644
--- a/dlls/kernel32/tests/loader.c
+++ b/dlls/kernel32/tests/loader.c
@@ -697,7 +697,7 @@ static void test_Loader(void)
/* prevent displaying of the "Unable to load this DLL" message box */
SetErrorMode(SEM_FAILCRITICALERRORS);
- for (i = 0; i < sizeof(td)/sizeof(td[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(td); i++)
{
nt_header = nt_header_template;
nt_header.FileHeader.NumberOfSections = td[i].number_of_sections;
@@ -922,7 +922,7 @@ static void test_Loader(void)
error_match = FALSE;
for (error_index = 0;
- ! error_match && error_index < sizeof(td[i].errors) / sizeof(DWORD);
+ ! error_match && error_index < ARRAY_SIZE(td[i].errors);
error_index++)
{
error_match = td[i].errors[error_index] == GetLastError();
@@ -1581,7 +1581,7 @@ static void test_VirtualProtect(void *base, void *section)
orig_prot = old_prot;
- for (i = 0; i < sizeof(td)/sizeof(td[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(td); i++)
{
SetLastError(0xdeadbeef);
ret = VirtualQuery(section, &info, sizeof(info));
@@ -1712,7 +1712,7 @@ static void test_section_access(void)
GetTempPathA(MAX_PATH, temp_path);
- for (i = 0; i < sizeof(td)/sizeof(td[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(td); i++)
{
IMAGE_NT_HEADERS nt_header;
@@ -2028,7 +2028,7 @@ static DWORD WINAPI mutex_thread_proc(void *param)
trace("%04x: mutex_thread_proc: starting\n", GetCurrentThreadId());
while (1)
{
- ret = WaitForMultipleObjects(sizeof(wait_list)/sizeof(wait_list[0]), wait_list, FALSE, 50);
+ ret = WaitForMultipleObjects(ARRAY_SIZE(wait_list), wait_list, FALSE, 50);
if (ret == WAIT_OBJECT_0) break;
else if (ret == WAIT_OBJECT_0 + 1)
{
@@ -3364,7 +3364,7 @@ static void test_ResolveDelayLoadedAPI(void)
section.PointerToRawData = 0x2000;
section.VirtualAddress = 0x2000;
- i = sizeof(td)/sizeof(td[0]);
+ i = ARRAY_SIZE(td);
section.Misc.VirtualSize = sizeof(test_dll) + sizeof(hint) + sizeof(test_func) + sizeof(HMODULE) +
2 * (i + 1) * sizeof(IMAGE_THUNK_DATA);
ok(section.Misc.VirtualSize <= 0x1000, "Too much tests, add a new section!\n");
@@ -3413,7 +3413,7 @@ static void test_ResolveDelayLoadedAPI(void)
SetFilePointer( hfile, idd.ImportAddressTableRVA, NULL, SEEK_SET );
- for (i = 0; i < sizeof(td)/sizeof(td[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(td); i++)
{
/* 0x1a00 is an empty space between delay data and extended delay data, real thunks are not necessary */
itd32.u1.Function = nt_header.OptionalHeader.ImageBase + 0x1a00 + i * 0x20;
@@ -3427,7 +3427,7 @@ static void test_ResolveDelayLoadedAPI(void)
ret = WriteFile(hfile, &itd32, sizeof(itd32), &dummy, NULL);
ok(ret, "WriteFile error %d\n", GetLastError());
- for (i = 0; i < sizeof(td)/sizeof(td[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(td); i++)
{
if (td[i].func)
itd32.u1.AddressOfData = idd.DllNameRVA + sizeof(test_dll);
@@ -3480,7 +3480,7 @@ static void test_ResolveDelayLoadedAPI(void)
itda = RVAToAddr(delaydir->ImportAddressTableRVA, hlib);
htarget = LoadLibraryA(RVAToAddr(delaydir->DllNameRVA, hlib));
- for (i = 0; i < sizeof(td)/sizeof(td[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(td); i++)
{
void *ret, *load;
diff --git a/dlls/kernel32/tests/module.c b/dlls/kernel32/tests/module.c
index 0b4ce14c46..ba65e0a761 100644
--- a/dlls/kernel32/tests/module.c
+++ b/dlls/kernel32/tests/module.c
@@ -39,7 +39,7 @@ static BOOL cmpStrAW(const char* a, const WCHAR* b, DWORD lenA, DWORD lenB)
WCHAR aw[1024];
DWORD len = MultiByteToWideChar( AreFileApisANSI() ? CP_ACP : CP_OEMCP, 0,
- a, lenA, aw, sizeof(aw) / sizeof(aw[0]) );
+ a, lenA, aw, ARRAY_SIZE(aw));
if (len != lenB) return FALSE;
return memcmp(aw, b, len * sizeof(WCHAR)) == 0;
}
@@ -149,7 +149,7 @@ static void testGetModuleFileName(const char* name)
{
memset(bufW, '-', sizeof(bufW));
SetLastError(0xdeadbeef);
- len1W = GetModuleFileNameW(hMod, bufW, sizeof(bufW) / sizeof(WCHAR));
+ len1W = GetModuleFileNameW(hMod, bufW, ARRAY_SIZE(bufW));
ok(GetLastError() == ERROR_SUCCESS ||
broken(GetLastError() == 0xdeadbeef), /* <= XP SP3 */
"LastError was not reset: %u\n", GetLastError());
@@ -191,7 +191,8 @@ static void testGetModuleFileName_Wrong(void)
if (is_unicode_enabled)
{
bufW[0] = '*';
- ok(GetModuleFileNameW((void*)0xffffffff, bufW, sizeof(bufW) / sizeof(WCHAR)) == 0, "Unexpected success in module handle\n");
+ ok(GetModuleFileNameW((void*)0xffffffff, bufW, ARRAY_SIZE(bufW)) == 0,
+ "Unexpected success in module handle\n");
ok(bufW[0] == '*', "When failing, buffer shouldn't be written to\n");
}
@@ -538,7 +539,7 @@ static void test_LoadLibraryEx_search_flags(void)
ok( !mod, "LoadLibrary succeeded\n" );
ok( GetLastError() == ERROR_MOD_NOT_FOUND, "wrong error %u\n", GetLastError() );
- for (j = 0; j < sizeof(tests) / sizeof(tests[0]); j++)
+ for (j = 0; j < ARRAY_SIZE(tests); j++)
{
for (k = 0; tests[j].add_dirs[k]; k++)
{
@@ -598,7 +599,7 @@ static void testGetDllDirectory(void)
"C:\\Some\\Path\\",
"Q:\\A\\Long\\Path with spaces that\\probably\\doesn't exist!",
};
- const int test_count = sizeof(dll_directories) / sizeof(dll_directories[0]);
+ const int test_count = ARRAY_SIZE(dll_directories);
if (!pGetDllDirectoryA || !pGetDllDirectoryW)
{
@@ -917,7 +918,7 @@ static void test_AddDllDirectory(void)
}
buf[0] = '\0';
- GetTempPathW( sizeof(path)/sizeof(path[0]), path );
+ GetTempPathW(ARRAY_SIZE(path), path );
ret = GetTempFileNameW( path, tmpW, 0, buf );
ok( ret, "GetTempFileName failed err %u\n", GetLastError() );
SetLastError( 0xdeadbeef );
diff --git a/dlls/kernel32/tests/path.c b/dlls/kernel32/tests/path.c
index 632aefc34e..ca1cbf30ec 100644
--- a/dlls/kernel32/tests/path.c
+++ b/dlls/kernel32/tests/path.c
@@ -1018,7 +1018,7 @@ static void test_GetTempPathA(char* tmp_dir)
len = GetTempPathA(slen / 2, buf);
ok(len == slen || broken(len == slen + 1) /* read the big comment above */ ,
"expected %d, got %d\n", slen, len);
- for(len = 0; len < sizeof(buf) / sizeof(buf[0]); len++)
+ for(len = 0; len < ARRAY_SIZE(buf); len++)
ok(buf[len] == 'a', "expected 'a' at [%d], got 0x%x\n", len, buf[len]);
}
@@ -1029,7 +1029,7 @@ static void test_GetTempPathW(char* tmp_dir)
WCHAR tmp_dirW[MAX_PATH];
static const WCHAR fooW[] = {'f','o','o',0};
- MultiByteToWideChar(CP_ACP,0,tmp_dir,-1,tmp_dirW,sizeof(tmp_dirW)/sizeof(*tmp_dirW));
+ MultiByteToWideChar(CP_ACP, 0, tmp_dir, -1, tmp_dirW, ARRAY_SIZE(tmp_dirW));
len_with_null = lstrlenW(tmp_dirW) + 1;
/* This one is different from ANSI version: ANSI version doesn't
@@ -1064,18 +1064,18 @@ static void test_GetTempPathW(char* tmp_dir)
ok(lstrcmpiW(buf, tmp_dirW) == 0, "GetTempPathW returned an incorrect temporary path\n");
ok(len == lstrlenW(buf), "returned length should be equal to the length of string\n");
- for(len = 0; len < sizeof(buf) / sizeof(buf[0]); len++)
+ for(len = 0; len < ARRAY_SIZE(buf); len++)
buf[len] = 'a';
len = GetTempPathW(len, buf);
ok(lstrcmpiW(buf, tmp_dirW) == 0, "GetTempPathW returned an incorrect temporary path\n");
ok(len == lstrlenW(buf), "returned length should be equal to the length of string\n");
/* The rest of the buffer must be zeroed */
slen = len + 1;
- for(len++; len < sizeof(buf) / sizeof(buf[0]); len++)
+ for(len++; len < ARRAY_SIZE(buf); len++)
ok(buf[len] == '\0', "expected NULL at [%d], got 0x%x\n", len, buf[len]);
/* When the buffer is not long enough the length passed is zeroed */
- for(len = 0; len < sizeof(buf) / sizeof(buf[0]); len++)
+ for(len = 0; len < ARRAY_SIZE(buf); len++)
buf[len] = 'a';
len = GetTempPathW(slen / 2, buf);
ok(len == slen || broken(len == slen + 1) /* read the big comment above */ ,
@@ -1096,7 +1096,7 @@ static void test_GetTempPathW(char* tmp_dir)
for(len = 0; len < slen / 2; len++)
ok(buf[len] == '\0', "expected NULL at [%d], got 0x%x\n", len, buf[len]);
- for(; len < sizeof(buf) / sizeof(buf[0]); len++)
+ for(; len < ARRAY_SIZE(buf); len++)
ok(buf[len] == 'a', "expected 'a' at [%d], got 0x%x\n", len, buf[len]);
/* bogus application from bug 38220 passes the count value in sizeof(buffer)
@@ -1331,7 +1331,7 @@ static void test_GetLongPathNameW(void)
* files.
*/
name[0] = 0;
- while (lstrlenW(name) < (sizeof(name)/sizeof(WCHAR) - 1))
+ while (lstrlenW(name) < (ARRAY_SIZE(name) - 1))
lstrcatW(name, letterX);
GetTempPathW(MAX_PATH, tempdir);
@@ -1429,7 +1429,7 @@ static void test_GetShortPathNameW(void)
lstrcatW( path, test_path );
lstrcatW( path, backSlash );
short_path[0] = 0;
- length = GetShortPathNameW( path, short_path, sizeof(short_path) / sizeof(*short_path) );
+ length = GetShortPathNameW( path, short_path, ARRAY_SIZE( short_path ));
ok( length, "GetShortPathNameW returned 0.\n" );
lstrcpyW( path, tmppath );
@@ -1460,7 +1460,7 @@ static void test_GetShortPathNameW(void)
ok( file != INVALID_HANDLE_VALUE, "File was not created.\n" );
CloseHandle( file );
- length = GetShortPathNameW( path, short_path, sizeof(short_path)/sizeof(*short_path) );
+ length = GetShortPathNameW( path, short_path, ARRAY_SIZE( short_path ));
ok( length, "GetShortPathNameW failed: %u.\n", GetLastError() );
ret = DeleteFileW( path );
@@ -1752,7 +1752,7 @@ static void create_manifest_file(const char *filename, const char *manifest)
MultiByteToWideChar( CP_ACP, 0, filename, -1, path, MAX_PATH );
- GetTempPathW(sizeof(manifest_path)/sizeof(WCHAR), manifest_path);
+ GetTempPathW(ARRAY_SIZE(manifest_path), manifest_path);
lstrcatW(manifest_path, path);
file = CreateFileW(manifest_path, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
@@ -1777,7 +1777,7 @@ static HANDLE test_create(const char *file)
HANDLE handle;
MultiByteToWideChar(CP_ACP, 0, file, -1, path, MAX_PATH);
- GetTempPathW(sizeof(manifest_path)/sizeof(WCHAR), manifest_path);
+ GetTempPathW(ARRAY_SIZE(manifest_path), manifest_path);
lstrcatW(manifest_path, path);
memset(&actctx, 0, sizeof(ACTCTXW));
@@ -1818,18 +1818,18 @@ static void test_SearchPathA(void)
return;
}
- GetWindowsDirectoryA(pathA, sizeof(pathA)/sizeof(CHAR));
+ GetWindowsDirectoryA(pathA, ARRAY_SIZE(pathA));
/* NULL filename */
SetLastError(0xdeadbeef);
- ret = pSearchPathA(pathA, NULL, NULL, sizeof(buffA)/sizeof(CHAR), buffA, &ptrA);
+ ret = pSearchPathA(pathA, NULL, NULL, ARRAY_SIZE(buffA), buffA, &ptrA);
ok(ret == 0, "Expected failure, got %d\n", ret);
ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected ERROR_INVALID_PARAMETER, got %x\n", GetLastError());
/* empty filename */
SetLastError(0xdeadbeef);
- ret = pSearchPathA(pathA, fileA, NULL, sizeof(buffA)/sizeof(CHAR), buffA, &ptrA);
+ ret = pSearchPathA(pathA, fileA, NULL, ARRAY_SIZE(buffA), buffA, &ptrA);
ok(ret == 0, "Expected failure, got %d\n", ret);
ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected ERROR_INVALID_PARAMETER, got %x\n", GetLastError());
@@ -1845,38 +1845,38 @@ static void test_SearchPathA(void)
delete_manifest_file("main.manifest");
/* search fails without active context */
- ret = pSearchPathA(NULL, testdepA, NULL, sizeof(buffA)/sizeof(CHAR), buffA, NULL);
+ ret = pSearchPathA(NULL, testdepA, NULL, ARRAY_SIZE(buffA), buffA, NULL);
ok(ret == 0, "got %d\n", ret);
- ret = pSearchPathA(NULL, kernel32A, NULL, sizeof(path2A)/sizeof(CHAR), path2A, NULL);
+ ret = pSearchPathA(NULL, kernel32A, NULL, ARRAY_SIZE(path2A), path2A, NULL);
ok(ret && ret == strlen(path2A), "got %d\n", ret);
ret = pActivateActCtx(handle, &cookie);
ok(ret, "failed to activate context, %u\n", GetLastError());
/* works when activated */
- ret = pSearchPathA(NULL, testdepA, NULL, sizeof(buffA)/sizeof(CHAR), buffA, NULL);
+ ret = pSearchPathA(NULL, testdepA, NULL, ARRAY_SIZE(buffA), buffA, NULL);
ok(ret && ret == strlen(buffA), "got %d\n", ret);
- ret = pSearchPathA(NULL, "testdep.dll", ".ext", sizeof(buffA)/sizeof(CHAR), buffA, NULL);
+ ret = pSearchPathA(NULL, "testdep.dll", ".ext", ARRAY_SIZE(buffA), buffA, NULL);
ok(ret && ret == strlen(buffA), "got %d\n", ret);
- ret = pSearchPathA(NULL, "testdep", ".dll", sizeof(buffA)/sizeof(CHAR), buffA, NULL);
+ ret = pSearchPathA(NULL, "testdep", ".dll", ARRAY_SIZE(buffA), buffA, NULL);
ok(ret && ret == strlen(buffA), "got %d\n", ret);
- ret = pSearchPathA(NULL, "testdep", ".ext", sizeof(buffA)/sizeof(CHAR), buffA, NULL);
+ ret = pSearchPathA(NULL, "testdep", ".ext", ARRAY_SIZE(buffA), buffA, NULL);
ok(!ret, "got %d\n", ret);
/* name contains path */
- ret = pSearchPathA(NULL, testdeprelA, NULL, sizeof(buffA)/sizeof(CHAR), buffA, NULL);
+ ret = pSearchPathA(NULL, testdeprelA, NULL, ARRAY_SIZE(buffA), buffA, NULL);
ok(!ret, "got %d\n", ret);
/* fails with specified path that doesn't contain this file */
- ret = pSearchPathA(pathA, testdepA, NULL, sizeof(buffA)/sizeof(CHAR), buffA, NULL);
+ ret = pSearchPathA(pathA, testdepA, NULL, ARRAY_SIZE(buffA), buffA, NULL);
ok(!ret, "got %d\n", ret);
/* path is redirected for wellknown names too */
- ret = pSearchPathA(NULL, kernel32A, NULL, sizeof(buffA)/sizeof(CHAR), buffA, NULL);
+ ret = pSearchPathA(NULL, kernel32A, NULL, ARRAY_SIZE(buffA), buffA, NULL);
ok(ret && ret == strlen(buffA), "got %d\n", ret);
ok(strcmp(buffA, path2A), "got wrong path %s, %s\n", buffA, path2A);
@@ -1911,14 +1911,14 @@ static void test_SearchPathW(void)
if (0)
{
/* NULL filename, crashes on nt4 */
- pSearchPathW(pathW, NULL, NULL, sizeof(buffW)/sizeof(WCHAR), buffW, &ptrW);
+ pSearchPathW(pathW, NULL, NULL, ARRAY_SIZE(buffW), buffW, &ptrW);
}
- GetWindowsDirectoryW(pathW, sizeof(pathW)/sizeof(WCHAR));
+ GetWindowsDirectoryW(pathW, ARRAY_SIZE(pathW));
/* empty filename */
SetLastError(0xdeadbeef);
- ret = pSearchPathW(pathW, fileW, NULL, sizeof(buffW)/sizeof(WCHAR), buffW, &ptrW);
+ ret = pSearchPathW(pathW, fileW, NULL, ARRAY_SIZE(buffW), buffW, &ptrW);
ok(ret == 0, "Expected failure, got %d\n", ret);
ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected ERROR_INVALID_PARAMETER, got %x\n", GetLastError());
@@ -1934,50 +1934,50 @@ if (0)
delete_manifest_file("main.manifest");
/* search fails without active context */
- ret = pSearchPathW(NULL, testdepW, NULL, sizeof(buffW)/sizeof(WCHAR), buffW, NULL);
+ ret = pSearchPathW(NULL, testdepW, NULL, ARRAY_SIZE(buffW), buffW, NULL);
ok(ret == 0, "got %d\n", ret);
- ret = pSearchPathW(NULL, kernel32dllW, NULL, sizeof(path2W)/sizeof(WCHAR), path2W, NULL);
+ ret = pSearchPathW(NULL, kernel32dllW, NULL, ARRAY_SIZE(path2W), path2W, NULL);
ok(ret && ret == lstrlenW(path2W), "got %d\n", ret);
/* full path, name without 'dll' extension */
- GetSystemDirectoryW(pathW, sizeof(pathW)/sizeof(WCHAR));
- ret = pSearchPathW(pathW, kernel32W, NULL, sizeof(path2W)/sizeof(WCHAR), path2W, NULL);
+ GetSystemDirectoryW(pathW, ARRAY_SIZE(pathW));
+ ret = pSearchPathW(pathW, kernel32W, NULL, ARRAY_SIZE(path2W), path2W, NULL);
ok(ret == 0, "got %d\n", ret);
- GetWindowsDirectoryW(pathW, sizeof(pathW)/sizeof(WCHAR));
+ GetWindowsDirectoryW(pathW, ARRAY_SIZE(pathW));
ret = pActivateActCtx(handle, &cookie);
ok(ret, "failed to activate context, %u\n", GetLastError());
/* works when activated */
- ret = pSearchPathW(NULL, testdepW, NULL, sizeof(buffW)/sizeof(WCHAR), buffW, NULL);
+ ret = pSearchPathW(NULL, testdepW, NULL, ARRAY_SIZE(buffW), buffW, NULL);
ok(ret && ret == lstrlenW(buffW), "got %d\n", ret);
- ret = pSearchPathW(NULL, testdepW, extW, sizeof(buffW)/sizeof(WCHAR), buffW, NULL);
+ ret = pSearchPathW(NULL, testdepW, extW, ARRAY_SIZE(buffW), buffW, NULL);
ok(ret && ret == lstrlenW(buffW), "got %d\n", ret);
- ret = pSearchPathW(NULL, testdep1W, dllW, sizeof(buffW)/sizeof(WCHAR), buffW, NULL);
+ ret = pSearchPathW(NULL, testdep1W, dllW, ARRAY_SIZE(buffW), buffW, NULL);
ok(ret && ret == lstrlenW(buffW), "got %d\n", ret);
- ret = pSearchPathW(NULL, testdep1W, extW, sizeof(buffW)/sizeof(WCHAR), buffW, NULL);
+ ret = pSearchPathW(NULL, testdep1W, extW, ARRAY_SIZE(buffW), buffW, NULL);
ok(!ret, "got %d\n", ret);
/* name contains path */
- ret = pSearchPathW(NULL, testdeprelW, NULL, sizeof(buffW)/sizeof(WCHAR), buffW, NULL);
+ ret = pSearchPathW(NULL, testdeprelW, NULL, ARRAY_SIZE(buffW), buffW, NULL);
ok(!ret, "got %d\n", ret);
/* fails with specified path that doesn't contain this file */
- ret = pSearchPathW(pathW, testdepW, NULL, sizeof(buffW)/sizeof(WCHAR), buffW, NULL);
+ ret = pSearchPathW(pathW, testdepW, NULL, ARRAY_SIZE(buffW), buffW, NULL);
ok(!ret, "got %d\n", ret);
/* path is redirected for wellknown names too, meaning it takes precedence over normal search order */
- ret = pSearchPathW(NULL, kernel32dllW, NULL, sizeof(buffW)/sizeof(WCHAR), buffW, NULL);
+ ret = pSearchPathW(NULL, kernel32dllW, NULL, ARRAY_SIZE(buffW), buffW, NULL);
ok(ret && ret == lstrlenW(buffW), "got %d\n", ret);
ok(lstrcmpW(buffW, path2W), "got wrong path %s, %s\n", wine_dbgstr_w(buffW), wine_dbgstr_w(path2W));
/* path is built using on manifest file name */
- ret = pSearchPathW(NULL, ole32W, NULL, sizeof(buffW)/sizeof(WCHAR), buffW, NULL);
+ ret = pSearchPathW(NULL, ole32W, NULL, ARRAY_SIZE(buffW), buffW, NULL);
ok(ret && ret == lstrlenW(buffW), "got %d\n", ret);
ret = pDeactivateActCtx(0, cookie);
@@ -2010,7 +2010,7 @@ static void test_GetFullPathNameA(void)
{"", MAX_PATH, output, &filepart},
};
- for (i = 0; i < sizeof(invalid_parameters)/sizeof(invalid_parameters[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(invalid_parameters); i++)
{
SetLastError(0xdeadbeef);
strcpy(output, "deadbeef");
@@ -2040,7 +2040,7 @@ static void test_GetFullPathNameA(void)
{ "c:\\\x83\x8f\x83\x43\x83\x93\\wine.c", "wine.c" },
{ "c:\\demo\\\x97\xa0\x95\x5c", "\x97\xa0\x95\x5c" }
};
- for (i = 0; i < sizeof(testset)/sizeof(testset[0]); i++) {
+ for (i = 0; i < ARRAY_SIZE(testset); i++) {
ret = GetFullPathNameA(testset[i].input, sizeof(output),
output, &filepart);
ok(ret, "[%d] GetFullPathName error %u\n", i, GetLastError());
@@ -2088,7 +2088,7 @@ static void test_GetFullPathNameW(void)
return;
}
- for (i = 0; i < sizeof(invalid_parameters)/sizeof(invalid_parameters[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(invalid_parameters); i++)
{
SetLastError(0xdeadbeef);
lstrcpyW(output, deadbeefW);
@@ -2261,7 +2261,7 @@ static void test_CheckNameLegalDOS8Dot3(void)
br = pCheckNameLegalDOS8Dot3A("testtest.txt", NULL, 0, NULL, NULL);
ok(br == FALSE, "CheckNameLegalDOS8Dot3A should have failed\n");
- for(i = 0; i < sizeof(cases)/sizeof(*cases); ++i){
+ for(i = 0; i < ARRAY_SIZE(cases); ++i){
br = pCheckNameLegalDOS8Dot3W(cases[i].name, NULL, 0, &has_space, &is_legal);
ok(br == TRUE, "CheckNameLegalDOS8Dot3W failed for %s\n", wine_dbgstr_w(cases[i].name));
ok(is_legal == cases[i].should_be_legal, "Got wrong legality for %s\n", wine_dbgstr_w(cases[i].name));
diff --git a/dlls/kernel32/tests/pipe.c b/dlls/kernel32/tests/pipe.c
index 13570b032c..0e6c7a3ae8 100644
--- a/dlls/kernel32/tests/pipe.c
+++ b/dlls/kernel32/tests/pipe.c
@@ -2381,9 +2381,8 @@ static void test_NamedPipeHandleState(void)
* on a local pipe.
*/
SetLastError(0xdeadbeef);
- ret = GetNamedPipeHandleStateA(server, &state, &instances,
- &maxCollectionCount, &collectDataTimeout, userName,
- sizeof(userName) / sizeof(userName[0]));
+ ret = GetNamedPipeHandleStateA(server, &state, &instances, &maxCollectionCount,
+ &collectDataTimeout, userName, ARRAY_SIZE(userName));
todo_wine
ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER,
"expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
diff --git a/dlls/kernel32/tests/process.c b/dlls/kernel32/tests/process.c
index b1a453998c..0eb113b635 100644
--- a/dlls/kernel32/tests/process.c
+++ b/dlls/kernel32/tests/process.c
@@ -423,7 +423,7 @@ static void doChild(const char* file, const char* option)
childPrintf(hFile, "[Misc]\n");
if (GetCurrentDirectoryA(sizeof(bufA), bufA))
childPrintf(hFile, "CurrDirA=%s\n", encodeA(bufA));
- if (GetCurrentDirectoryW(sizeof(bufW) / sizeof(bufW[0]), bufW))
+ if (GetCurrentDirectoryW(ARRAY_SIZE(bufW), bufW))
childPrintf(hFile, "CurrDirW=%s\n", encodeW(bufW));
childPrintf(hFile, "\n");
@@ -1987,14 +1987,14 @@ static void test_QueryFullProcessImageNameW(void)
ok(GetModuleFileNameW(NULL, module_name, 1024), "GetModuleFileNameW(NULL, ...) failed\n");
/* GetCurrentProcess pseudo-handle */
- size = sizeof(buf) / sizeof(buf[0]);
+ size = ARRAY_SIZE(buf);
expect_eq_d(TRUE, pQueryFullProcessImageNameW(GetCurrentProcess(), 0, buf, &size));
expect_eq_d(lstrlenW(buf), size);
expect_eq_ws_i(buf, module_name);
hSelf = OpenProcess(PROCESS_QUERY_LIMITED_INFORMATION, FALSE, GetCurrentProcessId());
/* Real handle */
- size = sizeof(buf) / sizeof(buf[0]);
+ size = ARRAY_SIZE(buf);
expect_eq_d(TRUE, pQueryFullProcessImageNameW(hSelf, 0, buf, &size));
expect_eq_d(lstrlenW(buf), size);
expect_eq_ws_i(buf, module_name);
@@ -2032,7 +2032,7 @@ static void test_QueryFullProcessImageNameW(void)
/* native path */
- size = sizeof(buf) / sizeof(buf[0]);
+ size = ARRAY_SIZE(buf);
expect_eq_d(TRUE, pQueryFullProcessImageNameW(hSelf, PROCESS_NAME_NATIVE, buf, &size));
expect_eq_d(lstrlenW(buf), size);
ok(buf[0] == '\\', "NT path should begin with '\\'\n");
@@ -2040,7 +2040,7 @@ static void test_QueryFullProcessImageNameW(void)
module_name[2] = '\0';
*device = '\0';
- size = QueryDosDeviceW(module_name, device, sizeof(device)/sizeof(device[0]));
+ size = QueryDosDeviceW(module_name, device, ARRAY_SIZE(device));
ok(size, "QueryDosDeviceW failed: le=%u\n", GetLastError());
len = lstrlenW(device);
ok(size >= len+2, "expected %d to be greater than %d+2 = strlen(%s)\n", size, len, wine_dbgstr_w(device));
diff --git a/dlls/kernel32/tests/profile.c b/dlls/kernel32/tests/profile.c
index c5c77025b2..4dbe129b76 100644
--- a/dlls/kernel32/tests/profile.c
+++ b/dlls/kernel32/tests/profile.c
@@ -71,7 +71,7 @@ static void test_profile_int(void)
{ SECTION, KEY, "B4294967297", TESTFILE, -1, 0 , 0},
{ SECTION, KEY, "B4294967297", TESTFILE, 1, 0 , 0},
};
- int i, num_test = (sizeof(profileInt)/sizeof(struct _profileInt));
+ int i, num_test = ARRAY_SIZE(profileInt);
UINT res;
DeleteFileA( TESTFILE);
@@ -144,8 +144,7 @@ static void test_profile_string(void)
CloseHandle( h);
/* works only in unicode, ascii crashes */
- ret=GetPrivateProfileStringW(emptyW, keyW, emptyW, bufW,
- sizeof(bufW)/sizeof(bufW[0]), TESTFILE2W);
+ ret=GetPrivateProfileStringW(emptyW, keyW, emptyW, bufW, ARRAY_SIZE(bufW), TESTFILE2W);
todo_wine
ok(ret == 13, "expected 13, got %u\n", ret);
todo_wine
@@ -153,8 +152,7 @@ static void test_profile_string(void)
wine_dbgstr_w(valsectionW), wine_dbgstr_w(bufW) );
/* works only in unicode, ascii crashes */
- ret=GetPrivateProfileStringW(sW, emptyW, emptyW, bufW,
- sizeof(bufW)/sizeof(bufW[0]), TESTFILE2W);
+ ret=GetPrivateProfileStringW(sW, emptyW, emptyW, bufW, ARRAY_SIZE(bufW), TESTFILE2W);
todo_wine
ok(ret == 10, "expected 10, got %u\n", ret);
todo_wine
@@ -394,7 +392,7 @@ static void test_profile_existing(void)
HANDLE h = 0;
char buffer[MAX_PATH];
- for (i=0; i < sizeof(pe)/sizeof(pe[0]); i++)
+ for (i=0; i < ARRAY_SIZE(pe); i++)
{
h = CreateFileA(testfile1, pe[i].dwDesiredAccess, pe[i].dwShareMode, NULL,
CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
@@ -434,7 +432,7 @@ static void test_profile_existing(void)
ok( WriteFile( h, buffer, strlen(buffer), &size, NULL ), "failed to write\n" );
CloseHandle( h );
- for (i=0; i < sizeof(pe)/sizeof(pe[0]); i++)
+ for (i=0; i < ARRAY_SIZE(pe); i++)
{
h = CreateFileA(testfile2, pe[i].dwDesiredAccess, pe[i].dwShareMode, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
diff --git a/dlls/kernel32/tests/resource.c b/dlls/kernel32/tests/resource.c
index 74066cfba3..b3aaed6840 100644
--- a/dlls/kernel32/tests/resource.c
+++ b/dlls/kernel32/tests/resource.c
@@ -478,7 +478,7 @@ START_TEST(resource)
update_empty_exe();
- for(i=0; i < sizeof( sec_variants ) / sizeof( sec_variants[0] ); i++)
+ for(i=0; i < ARRAY_SIZE(sec_variants); i++)
{
const struct _sec_variants *sec = &sec_variants[i];
build_exe( &sec->build );
diff --git a/dlls/kernel32/tests/thread.c b/dlls/kernel32/tests/thread.c
index 5fb19f0992..b69d2eb371 100644
--- a/dlls/kernel32/tests/thread.c
+++ b/dlls/kernel32/tests/thread.c
@@ -1933,7 +1933,7 @@ static void test_thread_info(void)
return;
}
- for (i = 0; i < sizeof(info_size)/sizeof(info_size[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(info_size); i++)
{
memset(buf, 0, sizeof(buf));
diff --git a/dlls/kernel32/tests/version.c b/dlls/kernel32/tests/version.c
index eb78a383d2..ebda2db1f1 100644
--- a/dlls/kernel32/tests/version.c
+++ b/dlls/kernel32/tests/version.c
@@ -606,7 +606,7 @@ static void test_VerifyVersionInfo(void)
}
}
- for (i = 0; i < sizeof(verify_version_tests)/sizeof(verify_version_tests[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(verify_version_tests); i++)
{
struct verify_version_test *test = &verify_version_tests[i];
DWORD srcinfo = test->srcinfo;
diff --git a/dlls/kernel32/tests/virtual.c b/dlls/kernel32/tests/virtual.c
index 4a449fd82b..a343fa435c 100644
--- a/dlls/kernel32/tests/virtual.c
+++ b/dlls/kernel32/tests/virtual.c
@@ -1716,7 +1716,7 @@ static void test_CreateFileMapping(void)
file[2] = CreateFileA( path, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, 0 );
ok( file[2] != INVALID_HANDLE_VALUE, "CreateFile error %u\n", GetLastError() );
- for (i = 0; i < sizeof(sec_flag_tests) / sizeof(sec_flag_tests[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(sec_flag_tests); i++)
{
DWORD flags = sec_flag_tests[i].flags;
DWORD perm = sec_flag_tests[i].file == 2 ? PAGE_READONLY : PAGE_READWRITE;
@@ -3333,7 +3333,7 @@ static void test_VirtualProtect(void)
ok(status == STATUS_SUCCESS, "NtProtectVirtualMemory should succeed, got %08x\n", status);
ok(old_prot == PAGE_NOACCESS, "got %#x != expected PAGE_NOACCESS\n", old_prot);
- for (i = 0; i < sizeof(td)/sizeof(td[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(td); i++)
{
SetLastError(0xdeadbeef);
ret = VirtualQuery(base, &info, sizeof(info));
@@ -3499,7 +3499,7 @@ static void test_VirtualAlloc_protection(void)
DWORD ret, i;
MEMORY_BASIC_INFORMATION info;
- for (i = 0; i < sizeof(td)/sizeof(td[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(td); i++)
{
SetLastError(0xdeadbeef);
base = VirtualAlloc(0, si.dwPageSize, MEM_COMMIT, td[i].prot);
@@ -3602,7 +3602,7 @@ static void test_CreateFileMapping_protection(void)
SetFilePointer(hfile, si.dwPageSize, NULL, FILE_BEGIN);
SetEndOfFile(hfile);
- for (i = 0; i < sizeof(td)/sizeof(td[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(td); i++)
{
SetLastError(0xdeadbeef);
hmap = CreateFileMappingW(hfile, NULL, td[i].prot | SEC_COMMIT, 0, si.dwPageSize, NULL);
@@ -3674,7 +3674,7 @@ static void test_CreateFileMapping_protection(void)
hmap = CreateFileMappingW(hfile, NULL, alloc_prot, 0, si.dwPageSize, NULL);
ok(hmap != 0, "%d: CreateFileMapping error %d\n", i, GetLastError());
- for (i = 0; i < sizeof(td)/sizeof(td[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(td); i++)
{
SetLastError(0xdeadbeef);
base = MapViewOfFile(hmap, FILE_MAP_READ | FILE_MAP_WRITE | (page_exec_supported ? FILE_MAP_EXECUTE : 0), 0, 0, 0);
@@ -3941,7 +3941,7 @@ static void test_mapping( HANDLE hfile, DWORD sec_flags )
BOOL anon_mapping = (hfile == INVALID_HANDLE_VALUE);
trace( "testing %s mapping flags %08x\n", anon_mapping ? "anonymous" : "file", sec_flags );
- for (i = 0; i < sizeof(page_prot)/sizeof(page_prot[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(page_prot); i++)
{
SetLastError(0xdeadbeef);
hmap = CreateFileMappingW(hfile, NULL, page_prot[i] | sec_flags, 0, si.dwPageSize, NULL);
@@ -3998,7 +3998,7 @@ static void test_mapping( HANDLE hfile, DWORD sec_flags )
ok(hmap != 0, "%d: CreateFileMapping(%04x) error %d\n", i, page_prot[i], GetLastError());
- for (j = 0; j < sizeof(view)/sizeof(view[0]); j++)
+ for (j = 0; j < ARRAY_SIZE(view); j++)
{
nt_base = map_view_of_file(hmap, view[j].access);
if (nt_base)
@@ -4085,7 +4085,7 @@ static void test_mapping( HANDLE hfile, DWORD sec_flags )
prev_prot = info.Protect;
alloc_prot = info.AllocationProtect;
- for (k = 0; k < sizeof(page_prot)/sizeof(page_prot[0]); k++)
+ for (k = 0; k < ARRAY_SIZE(page_prot); k++)
{
/*trace("map %#x, view %#x, requested prot %#x\n", page_prot[i], view[j].prot, page_prot[k]);*/
DWORD actual_prot = (sec_flags & SEC_IMAGE) ? map_prot_no_write(page_prot[k]) : page_prot[k];
@@ -4118,7 +4118,7 @@ static void test_mapping( HANDLE hfile, DWORD sec_flags )
}
}
- for (k = 0; k < sizeof(page_prot)/sizeof(page_prot[0]); k++)
+ for (k = 0; k < ARRAY_SIZE(page_prot); k++)
{
/*trace("map %#x, view %#x, requested prot %#x\n", page_prot[i], view[j].prot, page_prot[k]);*/
SetLastError(0xdeadbeef);
@@ -4172,7 +4172,7 @@ static void test_mapping( HANDLE hfile, DWORD sec_flags )
prev_prot = info.Protect;
alloc_prot = info.AllocationProtect;
- for (k = 0; k < sizeof(page_prot)/sizeof(page_prot[0]); k++)
+ for (k = 0; k < ARRAY_SIZE(page_prot); k++)
{
DWORD actual_prot = (sec_flags & SEC_IMAGE) ? map_prot_no_write(page_prot[k]) : page_prot[k];
SetLastError(0xdeadbeef);
diff --git a/dlls/kernel32/tests/volume.c b/dlls/kernel32/tests/volume.c
index f673fd2917..2de66cdfd0 100644
--- a/dlls/kernel32/tests/volume.c
+++ b/dlls/kernel32/tests/volume.c
@@ -251,7 +251,7 @@ static void test_GetVolumeNameForVolumeMountPointW(void)
{
BOOL ret;
WCHAR volume[MAX_PATH], path[] = {'c',':','\\',0};
- DWORD len = sizeof(volume) / sizeof(WCHAR);
+ DWORD len = ARRAY_SIZE(volume);
/* not present before w2k */
if (!pGetVolumeNameForVolumeMountPointW) {
@@ -795,7 +795,7 @@ static void test_GetVolumePathNameA(void)
ret = SetEnvironmentVariableA( "CurrentDrive", cwd );
ok( ret, "Failed to set an environment variable for the current working drive.\n" );
- for (i=0; i<sizeof(test_paths)/sizeof(test_paths[0]); i++)
+ for (i=0; i<ARRAY_SIZE(test_paths); i++)
{
BOOL broken_ret = test_paths[i].broken_error == NO_ERROR;
char *output = (test_paths[i].path_name != NULL ? volume_path : NULL);
--
2.14.4
June 27, 2018
[PATCH] kernel32/tests: Avoid ARRAY_SIZE-like macros
by Michael Stefaniuc
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/kernel32/tests/comm.c | 4 +---
dlls/kernel32/tests/toolhelp.c | 8 +++-----
2 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/dlls/kernel32/tests/comm.c b/dlls/kernel32/tests/comm.c
index 4fb9de1268..d671e40f87 100644
--- a/dlls/kernel32/tests/comm.c
+++ b/dlls/kernel32/tests/comm.c
@@ -410,8 +410,6 @@ static const TEST test[] =
},
};
-#define TEST_COUNT (sizeof(test) / sizeof(TEST))
-
/* This function can be useful if you are modifying the test cases and want to
output the contents of a DCB structure. */
/*static print_dcb(DCB *pdcb)
@@ -656,7 +654,7 @@ static void test_BuildCommDCB(void)
if(!port)
trace("Could not find a valid COM port. Some tests will be skipped.\n");
- for(i = 0; i < TEST_COUNT; i++)
+ for(i = 0; i < ARRAY_SIZE(test); i++)
{
char string[sizeof(test[i].string)];
diff --git a/dlls/kernel32/tests/toolhelp.c b/dlls/kernel32/tests/toolhelp.c
index c40dbc4f8f..bdb01b9824 100644
--- a/dlls/kernel32/tests/toolhelp.c
+++ b/dlls/kernel32/tests/toolhelp.c
@@ -217,8 +217,6 @@ static const char* sub_expected_modules[] =
"ntdll.dll"
};
-#define NUM_OF(x) (sizeof(x) / sizeof(x[0]))
-
static void test_module(DWORD pid, const char* expected[], unsigned num_expected)
{
HANDLE hSnapshot;
@@ -229,7 +227,7 @@ static void test_module(DWORD pid, const char* expected[], unsigned num_expected
unsigned i;
int num = 0;
- ok(NUM_OF(found) >= num_expected, "Internal: bump found[] size\n");
+ ok(ARRAY_SIZE(found) >= num_expected, "Internal: bump found[] size\n");
hSnapshot = pCreateToolhelp32Snapshot( TH32CS_SNAPMODULE, pid );
ok(hSnapshot != NULL, "Cannot create snapshot\n");
@@ -341,8 +339,8 @@ START_TEST(toolhelp)
test_process(pid, info.dwProcessId);
test_thread(pid, info.dwProcessId);
- test_module(pid, curr_expected_modules, NUM_OF(curr_expected_modules));
- test_module(info.dwProcessId, sub_expected_modules, NUM_OF(sub_expected_modules));
+ test_module(pid, curr_expected_modules, ARRAY_SIZE(curr_expected_modules));
+ test_module(info.dwProcessId, sub_expected_modules, ARRAY_SIZE(sub_expected_modules));
SetEvent(ev2);
winetest_wait_child_process( info.hProcess );
--
2.14.4
June 27, 2018
Re: [PATCH] msctf: Add TF_CreateCicLoadMutex stub.
by Nikolay Sivov
On 06/27/2018 08:51 PM, Andrey Gusev wrote:
> For https://bugs.winehq.org/show_bug.cgi?id=38270
>
> Signed-off-by: Andrey Gusev <andrey.goosev(a)gmail.com>
> ---
> dlls/msctf/msctf.c | 9 +++++++++
> dlls/msctf/msctf.spec | 2 +-
> 2 files changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/dlls/msctf/msctf.c b/dlls/msctf/msctf.c
> index a19eaa1d33..da7375a5c7 100644
> --- a/dlls/msctf/msctf.c
> +++ b/dlls/msctf/msctf.c
> @@ -682,6 +682,15 @@ HRESULT WINAPI TF_InvalidAssemblyListCacheIfExist(void)
> return S_OK;
> }
>
> +/***********************************************************************
> + * TF_CreateCicLoadMutex (MSCTF.@)
> + */
> +HRESULT WINAPI TF_CreateCicLoadMutex(void)
> +{
> + FIXME("stub!\n");
> + return E_FAIL;
> +}
> +
This looks undocumented, could be only useful for native components. But
what's a point in running ctfmon.exe?
> /***********************************************************************
> * TF_CreateLangBarMgr (MSCTF.@)
> */
> diff --git a/dlls/msctf/msctf.spec b/dlls/msctf/msctf.spec
> index c3d909ccf5..2a2430cb3e 100644
> --- a/dlls/msctf/msctf.spec
> +++ b/dlls/msctf/msctf.spec
> @@ -9,7 +9,7 @@
> @ stub TF_CheckThreadInputIdle
> @ stub TF_ClearLangBarAddIns
> @ stub TF_CreateCategoryMgr
> -@ stub TF_CreateCicLoadMutex
> +@ stdcall TF_CreateCicLoadMutex()
> @ stub TF_CreateDisplayAttributeMgr
> @ stdcall TF_CreateInputProcessorProfiles(ptr)
> @ stdcall TF_CreateLangBarItemMgr(ptr)
June 27, 2018
[PATCH] msctf: Add TF_CreateCicLoadMutex stub.
by Andrey Gusev
For https://bugs.winehq.org/show_bug.cgi?id=38270
Signed-off-by: Andrey Gusev <andrey.goosev(a)gmail.com>
---
dlls/msctf/msctf.c | 9 +++++++++
dlls/msctf/msctf.spec | 2 +-
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/dlls/msctf/msctf.c b/dlls/msctf/msctf.c
index a19eaa1d33..da7375a5c7 100644
--- a/dlls/msctf/msctf.c
+++ b/dlls/msctf/msctf.c
@@ -682,6 +682,15 @@ HRESULT WINAPI TF_InvalidAssemblyListCacheIfExist(void)
return S_OK;
}
+/***********************************************************************
+ * TF_CreateCicLoadMutex (MSCTF.@)
+ */
+HRESULT WINAPI TF_CreateCicLoadMutex(void)
+{
+ FIXME("stub!\n");
+ return E_FAIL;
+}
+
/***********************************************************************
* TF_CreateLangBarMgr (MSCTF.@)
*/
diff --git a/dlls/msctf/msctf.spec b/dlls/msctf/msctf.spec
index c3d909ccf5..2a2430cb3e 100644
--- a/dlls/msctf/msctf.spec
+++ b/dlls/msctf/msctf.spec
@@ -9,7 +9,7 @@
@ stub TF_CheckThreadInputIdle
@ stub TF_ClearLangBarAddIns
@ stub TF_CreateCategoryMgr
-@ stub TF_CreateCicLoadMutex
+@ stdcall TF_CreateCicLoadMutex()
@ stub TF_CreateDisplayAttributeMgr
@ stdcall TF_CreateInputProcessorProfiles(ptr)
@ stdcall TF_CreateLangBarItemMgr(ptr)
--
2.17.1
June 27, 2018
Re: [PATCH v2 1/4] explorer: Add a private message to notify the graphics driver when activity occurs.
by Alexandre Julliard
Zebediah Figura <zfigura(a)codeweavers.com> writes:
> @@ -661,6 +665,11 @@ static LRESULT WINAPI desktop_wnd_proc( HWND hwnd, UINT message, WPARAM wp, LPAR
> }
> return 0;
>
> + case WM_WINE_NOTIFY_ACTIVITY:
> + if (wine_notify_activity)
> + wine_notify_activity();
> + return 0;
> +
> default:
> return DefWindowProcW( hwnd, message, wp, lp );
> }
I think it would be cleaner to have the drivers wrap the desktop winproc
so that we don't need to define new driver functions. The Android driver
already does this.
--
Alexandre Julliard
julliard(a)winehq.org
June 27, 2018
Re: Bug #45385 related to keyboard and probably wineserver - where to start the search
by John Found
While reading the code in wineX11.drv/keyboard.c I noticed the following fragment from the function X11DRV_KeymapNotify:
for (vkey = VK_LSHIFT; vkey <= VK_RMENU; vkey++)
{
int m = vkey - VK_LSHIFT;
>>> if (modifiers[m].vkey && !(keystate[vkey] & 0x80) != !modifiers[m].pressed)
{
TRACE( "Adjusting state for vkey %#.2x. State before %#.2x\n",
modifiers[m].vkey, keystate[vkey]);
update_key_state( keystate, vkey, modifiers[m].pressed );
changed = TRUE;
}
}
Can someone explain what the condition pointed by >>> is doing? (Unfortunately, my C skills are pretty low...)
Why not simply "(modifiers[m].vkey && (keystate[vkey] & 0x80) != modifiers[m].pressed)"?
And why is modifiers[m].vkey included in the condition?
Best Regards
On Wed, 27 Jun 2018 08:50:22 +0300
John Found <johnfound(a)asm32.info> wrote:
> I just reported bug #45385 (https://bugs.winehq.org/show_bug.cgi?id=45385) and want to try to fix it.
>
> So I want to ask about some preliminary directions - where to check the code,
> what is the general structure of the code related to the bug subject, possible suspicious places.
>
> Here is the full bug report in order to save you a visit to the bug tracker:
>
> > I noticed that the state of the keys sometimes sticks in pressed state.
> >
> > This happens when cycling windows with some shortcut key combination.
> >
> > For example if cycling with Alt+Tab, on pressing Alt, the program gets WM_KEYDOWN and the state of the VK_MENU becomes pressed. But after cycling windows, the program does not get WM_KEYUP because the window is not focused and VK_MENU (and the respective VK_LMENU or VK_RMENU) remain in pressed state.
> >
> > When cycling back to the program window, the window get focused only after releasing Alt key, so it does not get this event as well.
> >
> > If cycling windows with another shortcut key combination (for example Alt+Shift+Tab - for backward cycling) both VK_MENU and VK_SHIFT keys stick.
> >
> > In the same time, GetAsyncKeyState returns the proper state of the keys.
> >
> > Note1: The problem is obviously in the wineserver code, because it handles the key state tables for the different threads.
> >
> > Note2: The effect happens only sometimes. It seems the code for proper processing is already there, but some racing conditions have place.
> >
> > Note3: There is some probability that the effect is in result of my application code, but it never happens on real Windows, so I considered it a bug.
> >
> > Note4: I tried to workaround this problem by reading the whole table by GetAsyncKeyState and setting it then with SetKeyboardState on WM_ACTIVATE message of the main window. This workaround actually works, but is too ugly IMO.
> > The same trick on WM_ACTIVATEAPP does not work.
--
John Found <johnfound(a)asm32.info>
June 27, 2018
Re: [PATCH vkd3d 4/4] libs/vkd3d: Trace build version.
by Marvin
Hi,
While running your changed tests on Windows, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at
https://testbot.winehq.org/JobDetails.pl?Key=39407
Your paranoid android.
=== debian9 (win32) ===
error: patch failed: configure.ac:93
Task: Patch failed to apply
June 27, 2018
Re: [PATCH vkd3d 3/4] libs/vkd3d: Set names for internal threads.
by Marvin
Hi,
While running your changed tests on Windows, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at
https://testbot.winehq.org/JobDetails.pl?Key=39406
Your paranoid android.
=== debian9 (win32) ===
error: patch failed: configure.ac:93
Task: Patch failed to apply
June 27, 2018
[PATCH vkd3d 4/4] libs/vkd3d: Trace build version.
by Józef Kucia
From: Józef Kucia <jkucia(a)codeweavers.com>
Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com>
---
Makefile.am | 11 ++++++++++-
libs/.gitignore | 1 +
libs/vkd3d/device.c | 2 ++
libs/vkd3d/vkd3d_private.h | 2 ++
4 files changed, 15 insertions(+), 1 deletion(-)
create mode 100644 libs/.gitignore
diff --git a/Makefile.am b/Makefile.am
index faefc679258e..14f2d5168134 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -94,7 +94,8 @@ libvkd3d_la_SOURCES = \
libs/vkd3d/vkd3d.map \
libs/vkd3d/vkd3d_main.c \
libs/vkd3d/vkd3d_private.h \
- libs/vkd3d/vulkan_procs.h
+ libs/vkd3d/vulkan_procs.h \
+ libs/vkd3d_version.c
libvkd3d_la_LDFLAGS = -version-info 1:0:0
libvkd3d_la_LIBADD = libvkd3d-common.la libvkd3d-shader.la @DL_LIBS@ @PTHREAD_LIBS@
if HAVE_LD_VERSION_SCRIPT
@@ -173,6 +174,14 @@ libvkd3d.pc: $(srcdir)/libs/vkd3d/libvkd3d.pc.in
-e 's![@]PACKAGE_VERSION[@]!$(PACKAGE_VERSION)!g' \
$< > $@
+libs/vkd3d_version.c: dummy-vkd3d-version
+ version=`(GIT_DIR=$(top_srcdir)/.git git describe HEAD 2>/dev/null || echo "vkd3d-$(PACKAGE_VERSION)") | sed -n -e '$$s/\(.*\)/const char vkd3d_build[] = "\1";/p'` && (echo $$version | cmp -s - $@) || echo $$version >$@ || ($(RM) $@ && exit 1)
+.SILENT: libs/vkd3d_version.c
+CLEANFILES += libs/vkd3d_version.c
+
+.PHONY: dummy-vkd3d-version
+dummy-vkd3d-version:
+
## Cross-compile tests
cross_implibs = crosslibs/d3d12
CROSS_CPPFLAGS = -I$(srcdir)/include -I$(srcdir)/include/private -I$(builddir)/include
diff --git a/libs/.gitignore b/libs/.gitignore
new file mode 100644
index 000000000000..b4fc05a293e0
--- /dev/null
+++ b/libs/.gitignore
@@ -0,0 +1 @@
+vkd3d_version.c
diff --git a/libs/vkd3d/device.c b/libs/vkd3d/device.c
index e4c4d5211d61..fb57d76b5666 100644
--- a/libs/vkd3d/device.c
+++ b/libs/vkd3d/device.c
@@ -284,6 +284,8 @@ static HRESULT vkd3d_instance_init(struct vkd3d_instance *instance,
VkResult vr;
HRESULT hr;
+ TRACE("Build: %s.\n", vkd3d_build);
+
if (!create_info->pfn_signal_event)
{
ERR("Invalid signal event function pointer.\n");
diff --git a/libs/vkd3d/vkd3d_private.h b/libs/vkd3d/vkd3d_private.h
index 29611b8ccdc5..685825955a7f 100644
--- a/libs/vkd3d/vkd3d_private.h
+++ b/libs/vkd3d/vkd3d_private.h
@@ -794,4 +794,6 @@ HRESULT vkd3d_load_vk_instance_procs(struct vkd3d_vk_instance_procs *procs,
HRESULT vkd3d_load_vk_device_procs(struct vkd3d_vk_device_procs *procs,
const struct vkd3d_vk_instance_procs *parent_procs, VkDevice device) DECLSPEC_HIDDEN;
+extern const char vkd3d_build[];
+
#endif /* __VKD3D_PRIVATE_H */
--
2.16.4
June 27, 2018
[PATCH vkd3d 3/4] libs/vkd3d: Set names for internal threads.
by Józef Kucia
From: Józef Kucia <jkucia(a)codeweavers.com>
Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com>
---
configure.ac | 2 ++
libs/vkd3d/command.c | 4 ++++
libs/vkd3d/vkd3d_private.h | 8 +++++---
m4/check-functions.m4 | 7 +++++++
4 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/configure.ac b/configure.ac
index daae6464fae9..2773a155cd78 100644
--- a/configure.ac
+++ b/configure.ac
@@ -93,6 +93,8 @@ VKD3D_CHECK_FUNC([HAVE_BUILTIN_POPCOUNT], [__builtin_popcount], [__builtin_popco
VKD3D_CHECK_FUNC([HAVE_SYNC_ADD_AND_FETCH], [__sync_add_and_fetch], [__sync_add_and_fetch((int *)0, 0)])
VKD3D_CHECK_FUNC([HAVE_SYNC_SUB_AND_FETCH], [__sync_sub_and_fetch], [__sync_sub_and_fetch((int *)0, 0)])
+VKD3D_CHECK_LIB_FUNCS([pthread_setname_np], [$PTHREAD_LIBS])
+
AM_CONDITIONAL([HAVE_WIDL], [test "x$WIDL" != "xno"])
AM_CONDITIONAL([HAVE_CROSSTARGET32], [test "x$CROSSTARGET32" != "xno"])
AM_CONDITIONAL([HAVE_CROSSTARGET64], [test "x$CROSSTARGET64" != "xno"])
diff --git a/libs/vkd3d/command.c b/libs/vkd3d/command.c
index ee1d3f6e1018..d29d18edb633 100644
--- a/libs/vkd3d/command.c
+++ b/libs/vkd3d/command.c
@@ -199,6 +199,10 @@ static void *vkd3d_fence_worker_main(void *arg)
struct vkd3d_fence_worker *worker = arg;
int rc;
+#ifdef HAVE_PTHREAD_SETNAME_NP
+ pthread_setname_np(pthread_self(), "vkd3d_worker");
+#endif
+
for (;;)
{
if ((rc = pthread_mutex_lock(&worker->mutex)))
diff --git a/libs/vkd3d/vkd3d_private.h b/libs/vkd3d/vkd3d_private.h
index 38f0bf38e215..29611b8ccdc5 100644
--- a/libs/vkd3d/vkd3d_private.h
+++ b/libs/vkd3d/vkd3d_private.h
@@ -19,12 +19,14 @@
#ifndef __VKD3D_PRIVATE_H
#define __VKD3D_PRIVATE_H
-#define VK_NO_PROTOTYPES
-
#define COBJMACROS
#define NONAMELESSUNION
-#include "vkd3d.h"
+#define VK_NO_PROTOTYPES
+
+#include "vkd3d_common.h"
#include "vkd3d_memory.h"
+
+#include "vkd3d.h"
#include "vkd3d_shader.h"
#include <assert.h>
diff --git a/m4/check-functions.m4 b/m4/check-functions.m4
index 8bb8213153af..17082a179719 100644
--- a/m4/check-functions.m4
+++ b/m4/check-functions.m4
@@ -7,3 +7,10 @@ AC_LINK_IFELSE([AC_LANG_SOURCE([int main(void) { return [$3]; }])],
[1],
[Define to 1 if you have $2.])],
[AC_MSG_RESULT([no])])])
+
+dnl VKD3D_CHECK_LIB_FUNCS
+AC_DEFUN([VKD3D_CHECK_LIB_FUNCS],
+[vkd3d_libs_saved="$LIBS"
+LIBS="$LIBS $2"
+AC_CHECK_FUNCS([$1], [$3], [$4])
+LIBS="$vkd3d_libs_saved"])
--
2.16.4
June 27, 2018
[PATCH vkd3d 2/4] tests: Add test for cube maps.
by Józef Kucia
From: Józef Kucia <jkucia(a)codeweavers.com>
Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com>
---
tests/d3d12.c | 305 +++++++++++++++++++++++++++++++++++++++++++++++
tests/vkd3d_d3d12_test.h | 15 +--
2 files changed, 313 insertions(+), 7 deletions(-)
diff --git a/tests/d3d12.c b/tests/d3d12.c
index c6220aa0113d..217b4368a6b2 100644
--- a/tests/d3d12.c
+++ b/tests/d3d12.c
@@ -909,6 +909,7 @@ static ID3D12RootSignature *create_texture_root_signature_(unsigned int line,
sampler_desc.AddressU = D3D12_TEXTURE_ADDRESS_MODE_CLAMP;
sampler_desc.AddressV = D3D12_TEXTURE_ADDRESS_MODE_CLAMP;
sampler_desc.AddressW = D3D12_TEXTURE_ADDRESS_MODE_CLAMP;
+ sampler_desc.MaxLOD = D3D12_FLOAT32_MAX;
sampler_desc.ShaderRegister = 0;
sampler_desc.RegisterSpace = 0;
sampler_desc.ShaderVisibility = shader_visibility;
@@ -8973,6 +8974,309 @@ static void test_gather(void)
destroy_test_context(&context);
}
+static void test_cube_maps(void)
+{
+ unsigned int i, j, sub_resource_idx, sub_resource_count;
+ D3D12_GRAPHICS_PIPELINE_STATE_DESC pso_desc;
+ D3D12_SHADER_RESOURCE_VIEW_DESC srv_desc;
+ ID3D12GraphicsCommandList *command_list;
+ D3D12_CPU_DESCRIPTOR_HANDLE cpu_handle;
+ D3D12_GPU_DESCRIPTOR_HANDLE gpu_handle;
+ D3D12_SUBRESOURCE_DATA *texture_data;
+ const D3D12_SHADER_BYTECODE *ps;
+ struct test_context_desc desc;
+ struct test_context context;
+ ID3D12DescriptorHeap *heap;
+ ID3D12CommandQueue *queue;
+ ID3D12PipelineState *pso;
+ ID3D12Resource *texture;
+ float *data;
+ HRESULT hr;
+
+ struct
+ {
+ unsigned int face;
+ unsigned int level;
+ unsigned int cube;
+ } constants;
+
+ const unsigned int texture_size = 64;
+ static const float white[] = {1.0f, 1.0f, 1.0f, 1.0f};
+ static const DWORD ps_cube_code[] =
+ {
+#if 0
+ TextureCube t;
+ SamplerState s;
+
+ uint face;
+ uint level;
+
+ float4 main(float4 position : SV_POSITION) : SV_Target
+ {
+ float2 p;
+ p.x = position.x / 640.0f;
+ p.y = position.y / 480.0f;
+
+ float3 coord;
+ switch (face)
+ {
+ case 0:
+ coord = float3(1.0f, p.x, p.y);
+ break;
+ case 1:
+ coord = float3(-1.0f, p.x, p.y);
+ break;
+ case 2:
+ coord = float3(p.x, 1.0f, p.y);
+ break;
+ case 3:
+ coord = float3(p.x, -1.0f, p.y);
+ break;
+ case 4:
+ coord = float3(p.x, p.y, 1.0f);
+ break;
+ case 5:
+ default:
+ coord = float3(p.x, p.y, -1.0f);
+ break;
+ }
+ return t.SampleLevel(s, coord, level);
+ }
+#endif
+ 0x43425844, 0x039aee18, 0xfd630453, 0xb884cf0f, 0x10100744, 0x00000001, 0x00000310, 0x00000003,
+ 0x0000002c, 0x00000060, 0x00000094, 0x4e475349, 0x0000002c, 0x00000001, 0x00000008, 0x00000020,
+ 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000030f, 0x505f5653, 0x5449534f, 0x004e4f49,
+ 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003,
+ 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x52444853, 0x00000274, 0x00000040,
+ 0x0000009d, 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x0300005a, 0x00106000, 0x00000000,
+ 0x04003058, 0x00107000, 0x00000000, 0x00005555, 0x04002064, 0x00101032, 0x00000000, 0x00000001,
+ 0x03000065, 0x001020f2, 0x00000000, 0x02000068, 0x00000001, 0x0400004c, 0x0020800a, 0x00000000,
+ 0x00000000, 0x03000006, 0x00004001, 0x00000000, 0x05000036, 0x00100012, 0x00000000, 0x00004001,
+ 0x3f800000, 0x0a000038, 0x00100062, 0x00000000, 0x00101106, 0x00000000, 0x00004002, 0x00000000,
+ 0x3acccccd, 0x3b088889, 0x00000000, 0x01000002, 0x03000006, 0x00004001, 0x00000001, 0x05000036,
+ 0x00100012, 0x00000000, 0x00004001, 0xbf800000, 0x0a000038, 0x00100062, 0x00000000, 0x00101106,
+ 0x00000000, 0x00004002, 0x00000000, 0x3acccccd, 0x3b088889, 0x00000000, 0x01000002, 0x03000006,
+ 0x00004001, 0x00000002, 0x0a000038, 0x00100052, 0x00000000, 0x00101106, 0x00000000, 0x00004002,
+ 0x3acccccd, 0x00000000, 0x3b088889, 0x00000000, 0x05000036, 0x00100022, 0x00000000, 0x00004001,
+ 0x3f800000, 0x01000002, 0x03000006, 0x00004001, 0x00000003, 0x0a000038, 0x00100052, 0x00000000,
+ 0x00101106, 0x00000000, 0x00004002, 0x3acccccd, 0x00000000, 0x3b088889, 0x00000000, 0x05000036,
+ 0x00100022, 0x00000000, 0x00004001, 0xbf800000, 0x01000002, 0x03000006, 0x00004001, 0x00000004,
+ 0x0a000038, 0x00100032, 0x00000000, 0x00101046, 0x00000000, 0x00004002, 0x3acccccd, 0x3b088889,
+ 0x00000000, 0x00000000, 0x05000036, 0x00100042, 0x00000000, 0x00004001, 0x3f800000, 0x01000002,
+ 0x0100000a, 0x0a000038, 0x00100032, 0x00000000, 0x00101046, 0x00000000, 0x00004002, 0x3acccccd,
+ 0x3b088889, 0x00000000, 0x00000000, 0x05000036, 0x00100042, 0x00000000, 0x00004001, 0xbf800000,
+ 0x01000002, 0x01000017, 0x06000056, 0x00100082, 0x00000000, 0x0020801a, 0x00000000, 0x00000000,
+ 0x0b000048, 0x001020f2, 0x00000000, 0x00100246, 0x00000000, 0x00107e46, 0x00000000, 0x00106000,
+ 0x00000000, 0x0010003a, 0x00000000, 0x0100003e,
+ };
+ static const D3D12_SHADER_BYTECODE ps_cube = {ps_cube_code, sizeof(ps_cube_code)};
+ static const DWORD ps_cube_array_code[] =
+ {
+#if 0
+ TextureCubeArray t;
+ SamplerState s;
+
+ uint face;
+ uint level;
+ uint cube;
+
+ float4 main(float4 position : SV_POSITION) : SV_Target
+ {
+ float2 p;
+ p.x = position.x / 640.0f;
+ p.y = position.y / 480.0f;
+
+ float3 coord;
+ switch (face)
+ {
+ case 0:
+ coord = float3(1.0f, p.x, p.y);
+ break;
+ case 1:
+ coord = float3(-1.0f, p.x, p.y);
+ break;
+ case 2:
+ coord = float3(p.x, 1.0f, p.y);
+ break;
+ case 3:
+ coord = float3(p.x, -1.0f, p.y);
+ break;
+ case 4:
+ coord = float3(p.x, p.y, 1.0f);
+ break;
+ case 5:
+ default:
+ coord = float3(p.x, p.y, -1.0f);
+ break;
+ }
+ return t.SampleLevel(s, float4(coord, cube), level);
+ }
+#endif
+ 0x43425844, 0xb8d5b94a, 0xdb4be034, 0x183aed19, 0xad4af415, 0x00000001, 0x00000328, 0x00000003,
+ 0x0000002c, 0x00000060, 0x00000094, 0x4e475349, 0x0000002c, 0x00000001, 0x00000008, 0x00000020,
+ 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000030f, 0x505f5653, 0x5449534f, 0x004e4f49,
+ 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003,
+ 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x52444853, 0x0000028c, 0x00000041,
+ 0x000000a3, 0x0100086a, 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x0300005a, 0x00106000,
+ 0x00000000, 0x04005058, 0x00107000, 0x00000000, 0x00005555, 0x04002064, 0x00101032, 0x00000000,
+ 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x02000068, 0x00000002, 0x0400004c, 0x0020800a,
+ 0x00000000, 0x00000000, 0x03000006, 0x00004001, 0x00000000, 0x05000036, 0x00100012, 0x00000000,
+ 0x00004001, 0x3f800000, 0x0a000038, 0x00100062, 0x00000000, 0x00101106, 0x00000000, 0x00004002,
+ 0x00000000, 0x3acccccd, 0x3b088889, 0x00000000, 0x01000002, 0x03000006, 0x00004001, 0x00000001,
+ 0x05000036, 0x00100012, 0x00000000, 0x00004001, 0xbf800000, 0x0a000038, 0x00100062, 0x00000000,
+ 0x00101106, 0x00000000, 0x00004002, 0x00000000, 0x3acccccd, 0x3b088889, 0x00000000, 0x01000002,
+ 0x03000006, 0x00004001, 0x00000002, 0x0a000038, 0x00100052, 0x00000000, 0x00101106, 0x00000000,
+ 0x00004002, 0x3acccccd, 0x00000000, 0x3b088889, 0x00000000, 0x05000036, 0x00100022, 0x00000000,
+ 0x00004001, 0x3f800000, 0x01000002, 0x03000006, 0x00004001, 0x00000003, 0x0a000038, 0x00100052,
+ 0x00000000, 0x00101106, 0x00000000, 0x00004002, 0x3acccccd, 0x00000000, 0x3b088889, 0x00000000,
+ 0x05000036, 0x00100022, 0x00000000, 0x00004001, 0xbf800000, 0x01000002, 0x03000006, 0x00004001,
+ 0x00000004, 0x0a000038, 0x00100032, 0x00000000, 0x00101046, 0x00000000, 0x00004002, 0x3acccccd,
+ 0x3b088889, 0x00000000, 0x00000000, 0x05000036, 0x00100042, 0x00000000, 0x00004001, 0x3f800000,
+ 0x01000002, 0x0100000a, 0x0a000038, 0x00100032, 0x00000000, 0x00101046, 0x00000000, 0x00004002,
+ 0x3acccccd, 0x3b088889, 0x00000000, 0x00000000, 0x05000036, 0x00100042, 0x00000000, 0x00004001,
+ 0xbf800000, 0x01000002, 0x01000017, 0x06000056, 0x00100032, 0x00000001, 0x00208a66, 0x00000000,
+ 0x00000000, 0x05000036, 0x00100082, 0x00000000, 0x0010000a, 0x00000001, 0x0b000048, 0x001020f2,
+ 0x00000000, 0x00100e46, 0x00000000, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x0010001a,
+ 0x00000001, 0x0100003e,
+ };
+ static const D3D12_SHADER_BYTECODE ps_cube_array = {ps_cube_array_code, sizeof(ps_cube_array_code)};
+ static const struct ps_test
+ {
+ const D3D12_SHADER_BYTECODE *ps;
+ unsigned int miplevel_count;
+ unsigned int array_size;
+ }
+ ps_tests[] =
+ {
+ {&ps_cube, 1, 6},
+ {&ps_cube, 2, 6},
+ {&ps_cube, 3, 6},
+
+ {&ps_cube_array, 1, 12},
+ {&ps_cube_array, 2, 12},
+ {&ps_cube_array, 3, 12},
+ };
+
+ memset(&desc, 0, sizeof(desc));
+ desc.rt_width = 640;
+ desc.rt_height = 480;
+ desc.rt_format = DXGI_FORMAT_R32_FLOAT;
+ desc.no_root_signature = true;
+ if (!init_test_context(&context, &desc))
+ return;
+ command_list = context.list;
+ queue = context.queue;
+
+ context.root_signature = create_texture_root_signature(context.device,
+ D3D12_SHADER_VISIBILITY_PIXEL, 3, 0);
+
+ init_pipeline_state_desc(&pso_desc, context.root_signature,
+ context.render_target_desc.Format, NULL, NULL, NULL);
+
+ heap = create_gpu_descriptor_heap(context.device, D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV, 1);
+ cpu_handle = ID3D12DescriptorHeap_GetCPUDescriptorHandleForHeapStart(heap);
+ gpu_handle = ID3D12DescriptorHeap_GetGPUDescriptorHandleForHeapStart(heap);
+
+ ps = NULL;
+ pso = NULL;
+ for (i = 0; i < ARRAY_SIZE(ps_tests); ++i)
+ {
+ const struct ps_test *test = &ps_tests[i];
+
+ if (ps != test->ps)
+ {
+ if (pso)
+ ID3D12PipelineState_Release(pso);
+
+ ps = test->ps;
+ pso_desc.PS = *test->ps;
+ hr = ID3D12Device_CreateGraphicsPipelineState(context.device, &pso_desc,
+ &IID_ID3D12PipelineState, (void **)&pso);
+ ok(hr == S_OK, "Failed to create graphics pipeline state, hr %#x.\n", hr);
+ }
+
+ texture = create_default_texture2d(context.device, texture_size, texture_size,
+ test->array_size, test->miplevel_count, DXGI_FORMAT_R32_FLOAT,
+ D3D12_RESOURCE_FLAG_NONE, D3D12_RESOURCE_STATE_COPY_DEST);
+ srv_desc.Format = DXGI_FORMAT_R32_FLOAT;
+ srv_desc.Shader4ComponentMapping = D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING;
+ if (ps == &ps_cube)
+ {
+ srv_desc.ViewDimension = D3D12_SRV_DIMENSION_TEXTURECUBE;
+ srv_desc.TextureCube.MostDetailedMip = 0;
+ srv_desc.TextureCube.MipLevels = test->miplevel_count;
+ srv_desc.TextureCube.ResourceMinLODClamp = 0.0f;
+ }
+ else
+ {
+ srv_desc.ViewDimension = D3D12_SRV_DIMENSION_TEXTURECUBEARRAY;
+ srv_desc.TextureCubeArray.MostDetailedMip = 0;
+ srv_desc.TextureCubeArray.MipLevels = test->miplevel_count;
+ srv_desc.TextureCubeArray.First2DArrayFace = 0;
+ srv_desc.TextureCubeArray.NumCubes = test->array_size / 6;
+ srv_desc.TextureCubeArray.ResourceMinLODClamp = 0.0f;
+ }
+ ID3D12Device_CreateShaderResourceView(context.device, texture, &srv_desc, cpu_handle);
+
+ sub_resource_count = test->array_size * test->miplevel_count;
+ texture_data = calloc(sub_resource_count, sizeof(*texture_data));
+ ok(texture_data, "Failed to allocate memory.\n");
+ for (sub_resource_idx = 0; sub_resource_idx < sub_resource_count; ++sub_resource_idx)
+ {
+ data = calloc(texture_size * texture_size, sizeof(*data));
+ ok(data, "Failed to allocate memory.\n");
+ for (j = 0; j < texture_size * texture_size; ++j)
+ data[j] = sub_resource_idx;
+
+ texture_data[sub_resource_idx].pData = data;
+ texture_data[sub_resource_idx].RowPitch = texture_size * sizeof(*data);
+ texture_data[sub_resource_idx].SlicePitch = 0;
+ }
+ upload_texture_data(texture, texture_data, sub_resource_count, queue, command_list);
+ for (sub_resource_idx = 0; sub_resource_idx < sub_resource_count; ++sub_resource_idx)
+ free((void *)texture_data[sub_resource_idx].pData);
+ free(texture_data);
+
+ reset_command_list(command_list, context.allocator);
+ transition_resource_state(command_list, texture,
+ D3D12_RESOURCE_STATE_COPY_DEST, D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE);
+
+ for (sub_resource_idx = 0; sub_resource_idx < sub_resource_count; ++sub_resource_idx)
+ {
+ constants.face = (sub_resource_idx / test->miplevel_count) % 6;
+ constants.level = sub_resource_idx % test->miplevel_count;
+ constants.cube = (sub_resource_idx / test->miplevel_count) / 6;
+
+ ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, context.rtv, white, 0, NULL);
+ ID3D12GraphicsCommandList_OMSetRenderTargets(command_list, 1, &context.rtv, FALSE, NULL);
+ ID3D12GraphicsCommandList_SetGraphicsRootSignature(command_list, context.root_signature);
+ ID3D12GraphicsCommandList_SetPipelineState(command_list, pso);
+ ID3D12GraphicsCommandList_SetDescriptorHeaps(command_list, 1, &heap);
+ ID3D12GraphicsCommandList_SetGraphicsRootDescriptorTable(command_list, 0, gpu_handle);
+ ID3D12GraphicsCommandList_SetGraphicsRoot32BitConstants(command_list, 1, 3, &constants.face, 0);
+ ID3D12GraphicsCommandList_IASetPrimitiveTopology(command_list, D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
+ ID3D12GraphicsCommandList_RSSetViewports(command_list, 1, &context.viewport);
+ ID3D12GraphicsCommandList_RSSetScissorRects(command_list, 1, &context.scissor_rect);
+ ID3D12GraphicsCommandList_DrawInstanced(command_list, 3, 1, 0, 0);
+
+ transition_resource_state(command_list, context.render_target,
+ D3D12_RESOURCE_STATE_RENDER_TARGET, D3D12_RESOURCE_STATE_COPY_SOURCE);
+
+ check_sub_resource_float(context.render_target, 0, queue, command_list, sub_resource_idx, 0);
+
+ reset_command_list(command_list, context.allocator);
+ transition_resource_state(command_list, context.render_target,
+ D3D12_RESOURCE_STATE_COPY_SOURCE, D3D12_RESOURCE_STATE_RENDER_TARGET);
+ }
+
+ ID3D12Resource_Release(texture);
+ }
+ ID3D12PipelineState_Release(pso);
+
+ ID3D12DescriptorHeap_Release(heap);
+ destroy_test_context(&context);
+}
+
static void test_descriptor_tables(void)
{
ID3D12DescriptorHeap *heap, *sampler_heap, *heaps[2];
@@ -17380,6 +17684,7 @@ START_TEST(d3d12)
run_test(test_root_constants);
run_test(test_texture);
run_test(test_gather);
+ run_test(test_cube_maps);
run_test(test_descriptor_tables);
run_test(test_descriptor_tables_overlapping_bindings);
run_test(test_update_root_descriptors);
diff --git a/tests/vkd3d_d3d12_test.h b/tests/vkd3d_d3d12_test.h
index b4a9a442a5d2..2ebb58f997b3 100644
--- a/tests/vkd3d_d3d12_test.h
+++ b/tests/vkd3d_d3d12_test.h
@@ -318,11 +318,12 @@ static void check_sub_resource_uint_(unsigned int line, ID3D12Resource *texture,
release_resource_readback(&rb);
}
-#define create_texture(a, b, c, d, e) create_default_texture_(__LINE__, a, b, c, d, 0, e)
-#define create_default_texture(a, b, c, d, e, f) create_default_texture_(__LINE__, a, b, c, d, e, f)
-static ID3D12Resource *create_default_texture_(unsigned int line, ID3D12Device *device,
- unsigned int width, unsigned int height, DXGI_FORMAT format,
- D3D12_RESOURCE_FLAGS flags, D3D12_RESOURCE_STATES initial_state)
+#define create_default_texture(a, b, c, d, e, f) create_default_texture2d_(__LINE__, a, b, c, 1, 1, d, e, f)
+#define create_texture(a, b, c, d, e) create_default_texture(a, b, c, d, 0, e)
+#define create_default_texture2d(a, b, c, d, e, f, g, h) create_default_texture2d_(__LINE__, a, b, c, d, e, f, g, h)
+static ID3D12Resource *create_default_texture2d_(unsigned int line, ID3D12Device *device,
+ unsigned int width, unsigned int height, unsigned int array_size, unsigned int miplevel_count,
+ DXGI_FORMAT format, D3D12_RESOURCE_FLAGS flags, D3D12_RESOURCE_STATES initial_state)
{
D3D12_HEAP_PROPERTIES heap_properties;
D3D12_RESOURCE_DESC resource_desc;
@@ -336,8 +337,8 @@ static ID3D12Resource *create_default_texture_(unsigned int line, ID3D12Device *
resource_desc.Dimension = D3D12_RESOURCE_DIMENSION_TEXTURE2D;
resource_desc.Width = width;
resource_desc.Height = height;
- resource_desc.DepthOrArraySize = 1;
- resource_desc.MipLevels = 1;
+ resource_desc.DepthOrArraySize = array_size;
+ resource_desc.MipLevels = miplevel_count;
resource_desc.Format = format;
resource_desc.SampleDesc.Count = 1;
resource_desc.Flags = flags;
--
2.16.4
June 27, 2018
[PATCH vkd3d 1/4] libs/vkd3d: Implement cube shader resource views.
by Józef Kucia
From: Józef Kucia <jkucia(a)codeweavers.com>
Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com>
---
include/vkd3d_d3d12.idl | 2 +-
libs/vkd3d/resource.c | 43 +++++++++++++++++++++++++++++++++++++------
2 files changed, 38 insertions(+), 7 deletions(-)
diff --git a/include/vkd3d_d3d12.idl b/include/vkd3d_d3d12.idl
index 5bfc76718873..ec7df5653faa 100644
--- a/include/vkd3d_d3d12.idl
+++ b/include/vkd3d_d3d12.idl
@@ -945,7 +945,7 @@ typedef struct D3D12_TEXCUBE_ARRAY_SRV
{
UINT MostDetailedMip;
UINT MipLevels;
- UINT First2DArraySlice;
+ UINT First2DArrayFace;
UINT NumCubes;
FLOAT ResourceMinLODClamp;
} D3D12_TEXCUBE_ARRAY_SRV;
diff --git a/libs/vkd3d/resource.c b/libs/vkd3d/resource.c
index e45c90083229..e1a5adf3364d 100644
--- a/libs/vkd3d/resource.c
+++ b/libs/vkd3d/resource.c
@@ -1150,6 +1150,7 @@ void d3d12_desc_create_srv(struct d3d12_desc *descriptor,
struct d3d12_device *device, struct d3d12_resource *resource,
const D3D12_SHADER_RESOURCE_VIEW_DESC *desc)
{
+ uint32_t miplevel_idx, miplevel_count, layer_idx, layer_count;
const struct vkd3d_format *format;
VkImageViewType vk_view_type;
struct vkd3d_view *view;
@@ -1174,22 +1175,52 @@ void d3d12_desc_create_srv(struct d3d12_desc *descriptor,
return;
}
- if (desc)
- FIXME("Unhandled SRV desc %p.\n", desc);
-
if (!(format = vkd3d_format_from_d3d12_resource_desc(&resource->desc, desc ? desc->Format : 0)))
{
FIXME("Failed to find format for %#x.\n", resource->desc.Format);
return;
}
+ vk_view_type = resource->desc.DepthOrArraySize > 1
+ ? VK_IMAGE_VIEW_TYPE_2D_ARRAY : VK_IMAGE_VIEW_TYPE_2D;
+ miplevel_idx = 0;
+ miplevel_count = VK_REMAINING_MIP_LEVELS;
+ layer_idx = 0;
+ layer_count = VK_REMAINING_ARRAY_LAYERS;
+ if (desc)
+ {
+ if (desc->Shader4ComponentMapping != D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING)
+ FIXME("Ignoring component mapping %#x.\n", desc->Shader4ComponentMapping);
+
+ switch (desc->ViewDimension)
+ {
+ case D3D12_SRV_DIMENSION_TEXTURECUBE:
+ vk_view_type = VK_IMAGE_VIEW_TYPE_CUBE;
+ miplevel_idx = desc->u.TextureCube.MostDetailedMip;
+ miplevel_count = desc->u.TextureCube.MipLevels;
+ layer_count = 6;
+ if (desc->u.TextureCube.ResourceMinLODClamp)
+ FIXME("Unhandled min LOD clamp %.8e.\n", desc->u.TextureCube.ResourceMinLODClamp);
+ break;
+ case D3D12_SRV_DIMENSION_TEXTURECUBEARRAY:
+ vk_view_type = VK_IMAGE_VIEW_TYPE_CUBE_ARRAY;
+ miplevel_idx = desc->u.TextureCubeArray.MostDetailedMip;
+ miplevel_count = desc->u.TextureCubeArray.MipLevels;
+ layer_idx = desc->u.TextureCubeArray.First2DArrayFace;
+ layer_count = 6 * desc->u.TextureCubeArray.NumCubes;
+ if (desc->u.TextureCubeArray.ResourceMinLODClamp)
+ FIXME("Unhandled min LOD clamp %.8e.\n", desc->u.TextureCubeArray.ResourceMinLODClamp);
+ break;
+ default:
+ FIXME("Unhandled view dimension %#x.\n", desc->ViewDimension);
+ }
+ }
+
if (!(view = vkd3d_view_create()))
return;
- vk_view_type = resource->desc.DepthOrArraySize > 1
- ? VK_IMAGE_VIEW_TYPE_2D_ARRAY : VK_IMAGE_VIEW_TYPE_2D;
if (vkd3d_create_texture_view(device, resource, format, vk_view_type,
- 0, VK_REMAINING_MIP_LEVELS, 0, VK_REMAINING_ARRAY_LAYERS, true, &view->u.vk_image_view) < 0)
+ miplevel_idx, miplevel_count, layer_idx, layer_count, true, &view->u.vk_image_view) < 0)
{
vkd3d_free(view);
return;
--
2.16.4
June 27, 2018
[PATCH] include/d3d12: Fix typos.
by Józef Kucia
Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com>
---
include/d3d12.idl | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/d3d12.idl b/include/d3d12.idl
index 69220e674cd7..43e9c2dca3bb 100644
--- a/include/d3d12.idl
+++ b/include/d3d12.idl
@@ -944,7 +944,7 @@ typedef struct D3D12_TEXCUBE_ARRAY_SRV
{
UINT MostDetailedMip;
UINT MipLevels;
- UINT First2DArraySlice;
+ UINT First2DArrayFace;
UINT NumCubes;
FLOAT ResourceMinLODClamp;
} D3D12_TEXCUBE_ARRAY_SRV;
@@ -2172,7 +2172,7 @@ interface ID3D12RootSignatureDeserializer : IUnknown
ID3DBlob **blob, ID3DBlob **error_blob);
typedef HRESULT (__stdcall *PFN_D3D12_CREATE_DEVICE)(IUnknown *adapter,
- D3D_FEATURE_LEVEL minmum_feature_level, REFIID iid, void **device);
+ D3D_FEATURE_LEVEL minimum_feature_level, REFIID iid, void **device);
[local] HRESULT __stdcall D3D12CreateDevice(IUnknown *adapter,
D3D_FEATURE_LEVEL minimum_feature_level, REFIID iid, void **device);
--
2.16.4
June 27, 2018
[PATCH v2] msvcp120: Add test for Concurrent_vector_Internal_resize and reverse.
by Piotr Caban
From: Hua Meng <161220092(a)smail.nju.edu.cn>
Signed-off-by: Hua meng <161220092(a)smail.nju.edu.cn>
Signed-off-by: Piotr Caban <piotr(a)codeweavers.com>
---
v2:
- added test for vector capacity after _Internal_reserve call
dlls/msvcp120/tests/msvcp120.c | 90
++++++++++++++++++++++++++++++++++++++++++
1 file changed, 90 insertions(+)
June 27, 2018
[PATCH 5/5] schedsvc: Use current time as trigger begin time when necessary.
by Dmitry Timoshkov
Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru>
---
dlls/schedsvc/atsvc.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/dlls/schedsvc/atsvc.c b/dlls/schedsvc/atsvc.c
index b463be6960..a0e0727b31 100644
--- a/dlls/schedsvc/atsvc.c
+++ b/dlls/schedsvc/atsvc.c
@@ -170,6 +170,9 @@ static BOOL trigger_get_next_runtime(const TASK_TRIGGER *trigger, const FILETIME
FileTimeToSystemTime(current_ft, ¤t_st);
get_begin_time(trigger, &begin_ft);
+ if (CompareFileTime(&begin_ft, current_ft) < 0)
+ begin_ft = *current_ft;
+
get_end_time(trigger, &end_ft);
switch (trigger->TriggerType)
--
2.16.3
June 27, 2018
[PATCH 4/5] schedsvc: Avoid an infinite loop.
by Dmitry Timoshkov
Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru>
---
dlls/schedsvc/atsvc.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/dlls/schedsvc/atsvc.c b/dlls/schedsvc/atsvc.c
index df4185eac2..b463be6960 100644
--- a/dlls/schedsvc/atsvc.c
+++ b/dlls/schedsvc/atsvc.c
@@ -194,6 +194,9 @@ static BOOL trigger_get_next_runtime(const TASK_TRIGGER *trigger, const FILETIME
break;
case TASK_TIME_TRIGGER_DAILY:
+ if (!trigger->Type.Daily.DaysInterval)
+ break; /* avoid infinite loop */
+
st = current_st;
st.wHour = trigger->wStartHour;
st.wMinute = trigger->wStartMinute;
--
2.16.3
June 27, 2018
[PATCH 3/5] schedsvc: Minor cleanup.
by Dmitry Timoshkov
Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru>
---
dlls/schedsvc/atsvc.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/dlls/schedsvc/atsvc.c b/dlls/schedsvc/atsvc.c
index b8adc7279d..df4185eac2 100644
--- a/dlls/schedsvc/atsvc.c
+++ b/dlls/schedsvc/atsvc.c
@@ -99,7 +99,7 @@ static void filetime_add_ms(FILETIME *ft, LONGLONG ms)
LONGLONG ll;
} *ftll = (union u_ftll *)ft;
- ftll->ll += ms * (ULONGLONG)10000;
+ ftll->ll += ms * (LONGLONG)10000;
}
static void filetime_add_minutes(FILETIME *ft, LONG minutes)
@@ -117,7 +117,7 @@ static void filetime_add_days(FILETIME *ft, LONG days)
filetime_add_hours(ft, (LONGLONG)days * 24);
}
-static void filetime_add_weeks(FILETIME *ft, ULONG weeks)
+static void filetime_add_weeks(FILETIME *ft, LONG weeks)
{
filetime_add_days(ft, (LONGLONG)weeks * 7);
}
@@ -250,7 +250,7 @@ static BOOL trigger_get_next_runtime(const TASK_TRIGGER *trigger, const FILETIME
return FALSE;
}
-static BOOL job_get_next_runtime(struct job_t *job, FILETIME *current_ft, FILETIME *next_rt)
+static BOOL job_get_next_runtime(struct job_t *job, const FILETIME *current_ft, FILETIME *next_rt)
{
FILETIME trigger_rt;
BOOL have_next_rt = FALSE;
@@ -307,7 +307,7 @@ BOOL get_next_runtime(LARGE_INTEGER *rt)
return have_next_rt;
}
-static BOOL job_runs_at(struct job_t *job, FILETIME *begin_ft, FILETIME *end_ft)
+static BOOL job_runs_at(struct job_t *job, const FILETIME *begin_ft, const FILETIME *end_ft)
{
FILETIME job_ft;
--
2.16.3
June 27, 2018
[PATCH 2/5] mstask: Avoid an infinite loop.
by Dmitry Timoshkov
Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru>
---
dlls/mstask/task.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/dlls/mstask/task.c b/dlls/mstask/task.c
index 6492f16986..6c27b76c95 100644
--- a/dlls/mstask/task.c
+++ b/dlls/mstask/task.c
@@ -532,6 +532,9 @@ static HRESULT WINAPI MSTASK_ITask_GetNextRunTime(ITask *iface, SYSTEMTIME *rt)
break;
case TASK_TIME_TRIGGER_DAILY:
+ if (!This->trigger[i].Type.Daily.DaysInterval)
+ break; /* avoid infinite loop */
+
st = current_st;
st.wHour = This->trigger[i].wStartHour;
st.wMinute = This->trigger[i].wStartMinute;
--
2.16.3
June 27, 2018
[PATCH 1/5] mstask: Use current time as trigger begin time when necessary.
by Dmitry Timoshkov
Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru>
---
dlls/mstask/task.c | 42 +++++++++++++++++++++++-------------------
1 file changed, 23 insertions(+), 19 deletions(-)
diff --git a/dlls/mstask/task.c b/dlls/mstask/task.c
index 490229ae71..6492f16986 100644
--- a/dlls/mstask/task.c
+++ b/dlls/mstask/task.c
@@ -481,7 +481,7 @@ static HRESULT WINAPI MSTASK_ITask_GetNextRunTime(ITask *iface, SYSTEMTIME *rt)
TaskImpl *This = impl_from_ITask(iface);
HRESULT hr = SCHED_S_TASK_NO_VALID_TRIGGERS;
SYSTEMTIME st, current_st;
- FILETIME current_ft, begin_ft, end_ft, best_ft;
+ FILETIME current_ft, trigger_ft, begin_ft, end_ft, best_ft;
BOOL have_best_time = FALSE;
DWORD i;
@@ -494,12 +494,16 @@ static HRESULT WINAPI MSTASK_ITask_GetNextRunTime(ITask *iface, SYSTEMTIME *rt)
}
GetLocalTime(¤t_st);
+ SystemTimeToFileTime(¤t_st, ¤t_ft);
for (i = 0; i < This->trigger_count; i++)
{
if (!(This->trigger[i].rgFlags & TASK_TRIGGER_FLAG_DISABLED))
{
get_begin_time(&This->trigger[i], &begin_ft);
+ if (CompareFileTime(&begin_ft, ¤t_ft) < 0)
+ begin_ft = current_ft;
+
get_end_time(&This->trigger[i], &end_ft);
switch (This->trigger[i].TriggerType)
@@ -516,12 +520,12 @@ static HRESULT WINAPI MSTASK_ITask_GetNextRunTime(ITask *iface, SYSTEMTIME *rt)
st.wMinute = This->trigger[i].wStartMinute;
st.wSecond = 0;
st.wMilliseconds = 0;
- SystemTimeToFileTime(&st, ¤t_ft);
- if (CompareFileTime(&begin_ft, ¤t_ft) <= 0 && CompareFileTime(¤t_ft, &end_ft) < 0)
+ SystemTimeToFileTime(&st, &trigger_ft);
+ if (CompareFileTime(&begin_ft, &trigger_ft) <= 0 && CompareFileTime(&trigger_ft, &end_ft) < 0)
{
- if (!have_best_time || CompareFileTime(¤t_ft, &best_ft) < 0)
+ if (!have_best_time || CompareFileTime(&trigger_ft, &best_ft) < 0)
{
- best_ft = current_ft;
+ best_ft = trigger_ft;
have_best_time = TRUE;
}
}
@@ -533,20 +537,20 @@ static HRESULT WINAPI MSTASK_ITask_GetNextRunTime(ITask *iface, SYSTEMTIME *rt)
st.wMinute = This->trigger[i].wStartMinute;
st.wSecond = 0;
st.wMilliseconds = 0;
- SystemTimeToFileTime(&st, ¤t_ft);
- while (CompareFileTime(¤t_ft, &end_ft) < 0)
+ SystemTimeToFileTime(&st, &trigger_ft);
+ while (CompareFileTime(&trigger_ft, &end_ft) < 0)
{
- if (CompareFileTime(¤t_ft, &begin_ft) >= 0)
+ if (CompareFileTime(&trigger_ft, &begin_ft) >= 0)
{
- if (!have_best_time || CompareFileTime(¤t_ft, &best_ft) < 0)
+ if (!have_best_time || CompareFileTime(&trigger_ft, &best_ft) < 0)
{
- best_ft = current_ft;
+ best_ft = trigger_ft;
have_best_time = TRUE;
}
break;
}
- filetime_add_days(¤t_ft, This->trigger[i].Type.Daily.DaysInterval);
+ filetime_add_days(&trigger_ft, This->trigger[i].Type.Daily.DaysInterval);
}
break;
@@ -559,18 +563,18 @@ static HRESULT WINAPI MSTASK_ITask_GetNextRunTime(ITask *iface, SYSTEMTIME *rt)
st.wMinute = This->trigger[i].wStartMinute;
st.wSecond = 0;
st.wMilliseconds = 0;
- SystemTimeToFileTime(&st, ¤t_ft);
- while (CompareFileTime(¤t_ft, &end_ft) < 0)
+ SystemTimeToFileTime(&st, &trigger_ft);
+ while (CompareFileTime(&trigger_ft, &end_ft) < 0)
{
- FileTimeToSystemTime(¤t_ft, &st);
+ FileTimeToSystemTime(&trigger_ft, &st);
- if (CompareFileTime(¤t_ft, &begin_ft) >= 0)
+ if (CompareFileTime(&trigger_ft, &begin_ft) >= 0)
{
if (This->trigger[i].Type.Weekly.rgfDaysOfTheWeek & (1 << st.wDayOfWeek))
{
- if (!have_best_time || CompareFileTime(¤t_ft, &best_ft) < 0)
+ if (!have_best_time || CompareFileTime(&trigger_ft, &best_ft) < 0)
{
- best_ft = current_ft;
+ best_ft = trigger_ft;
have_best_time = TRUE;
}
break;
@@ -578,9 +582,9 @@ static HRESULT WINAPI MSTASK_ITask_GetNextRunTime(ITask *iface, SYSTEMTIME *rt)
}
if (st.wDayOfWeek == 0 && This->trigger[i].Type.Weekly.WeeksInterval > 1) /* Sunday, goto next week */
- filetime_add_weeks(¤t_ft, This->trigger[i].Type.Weekly.WeeksInterval - 1);
+ filetime_add_weeks(&trigger_ft, This->trigger[i].Type.Weekly.WeeksInterval - 1);
else /* check next weekday */
- filetime_add_days(¤t_ft, 1);
+ filetime_add_days(&trigger_ft, 1);
}
break;
--
2.16.3
June 27, 2018
[PATCH] testbot/web: Let GetHtmlLine() detect and format the timeout errors.
by Francois Gouget
It already handles filtering and highlighting errors so it makes sense
to also have if reformat the timeout errors for the log summary.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
---
testbot/web/JobDetails.pl | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/testbot/web/JobDetails.pl b/testbot/web/JobDetails.pl
index e5f792929..e7e53d208 100644
--- a/testbot/web/JobDetails.pl
+++ b/testbot/web/JobDetails.pl
@@ -253,6 +253,11 @@ sub GetHtmlLine($$$)
return undef if ($Category ne "error" and !$FullLog);
my $Html = $self->escapeHTML($Line);
+ if (!$FullLog and $Html =~ m/^[^:]+:([^:]*)(?::[0-9a-f]+)? done \(258\)/)
+ {
+ my $Unit = $1;
+ return $Unit ne "" ? "$Unit: Timeout" : "Timeout";
+ }
if ($FullLog and $Category ne "none")
{
# Highlight all line categories in the full log
@@ -414,15 +419,7 @@ sub GenerateBody($)
print "<pre><code>";
$LogFirst = 0;
}
- if (!$MoreInfo->{Full} && $Line =~ m/^[^:]+:([^:]*)(?::[0-9a-f]+)? done \(258\)/)
- {
- my $Unit = $1 ne "" ? "$1: " : "";
- print "${Unit}Timeout\n";
- }
- else
- {
- print "$Html\n";
- }
+ print "$Html\n";
}
close($LogFile);
--
2.18.0
June 27, 2018
[PATCH] testbot: Track patches to the Wine modules separately.
by Francois Gouget
Patches to the dlls and programs modules don't require a rebuild of
the native Wine tools.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
---
testbot/lib/WineTestBot/PatchUtils.pm | 13 +++++++++++++
testbot/lib/WineTestBot/Patches.pm | 3 ++-
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/testbot/lib/WineTestBot/PatchUtils.pm b/testbot/lib/WineTestBot/PatchUtils.pm
index b2bfe6a9a..811c3b8b2 100644
--- a/testbot/lib/WineTestBot/PatchUtils.pm
+++ b/testbot/lib/WineTestBot/PatchUtils.pm
@@ -193,6 +193,19 @@ sub _HandleFile($$$)
}
$Tests->{$Module}->{Files}->{$File} = $Change;
}
+ elsif ($FilePath =~ m~^(dlls|programs)/([^/]+)/([^/\s]+)$~)
+ {
+ my ($Root, $Dir, $File) = ($1, $2, $3);
+ my $Module = ($Root eq "programs") ? "$Dir.exe" : $Dir;
+ $Impacts->{IsWinePatch} = 1;
+ $Impacts->{ModuleBuild} = 1;
+
+ if ($File eq "Makefile.in" and $Change ne "modify")
+ {
+ # This adds / removes a directory
+ $Impacts->{MakeMakefiles} = 1;
+ }
+ }
else
{
my $WineFiles = $Impacts->{WineFiles} || $_WineFiles;
diff --git a/testbot/lib/WineTestBot/Patches.pm b/testbot/lib/WineTestBot/Patches.pm
index fe333d943..50f720861 100644
--- a/testbot/lib/WineTestBot/Patches.pm
+++ b/testbot/lib/WineTestBot/Patches.pm
@@ -136,7 +136,8 @@ sub Submit($$$)
$PastImpacts = GetPatchImpact($PatchFileName) if ($IsSet);
my $Impacts = GetPatchImpact("$DataDir/patches/" . $self->Id, undef, $PastImpacts);
- if (!$Impacts->{WineBuild} and !$Impacts->{TestBuild})
+ if (!$Impacts->{WineBuild} and !$Impacts->{ModuleBuild} and
+ !$Impacts->{TestBuild})
{
if ($Impacts->{IsWinePatch})
{
--
2.18.0
June 27, 2018
[PATCH] testbot/WineRun*: Prefix the TestBot errors so they are easy to identify.
by Francois Gouget
Some scripts may need to detect them.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
---
testbot/bin/WineRunBuild.pl | 2 +-
testbot/bin/WineRunReconfig.pl | 2 +-
testbot/bin/WineRunTask.pl | 2 +-
testbot/bin/WineRunWineTest.pl | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/testbot/bin/WineRunBuild.pl b/testbot/bin/WineRunBuild.pl
index 176ade6b6..90b9f030a 100755
--- a/testbot/bin/WineRunBuild.pl
+++ b/testbot/bin/WineRunBuild.pl
@@ -269,7 +269,7 @@ sub FatalError($;$)
my ($ErrMessage, $Retry) = @_;
LogMsg "$JobId/$StepNo/$TaskNo $ErrMessage";
- LogTaskError($ErrMessage);
+ LogTaskError("BotError: $ErrMessage");
WrapUpAndExit('boterror', $Retry);
}
diff --git a/testbot/bin/WineRunReconfig.pl b/testbot/bin/WineRunReconfig.pl
index aa0cf955e..8a3d955a7 100755
--- a/testbot/bin/WineRunReconfig.pl
+++ b/testbot/bin/WineRunReconfig.pl
@@ -269,7 +269,7 @@ sub FatalError($;$)
my ($ErrMessage, $Retry) = @_;
LogMsg "$JobId/$StepNo/$TaskNo $ErrMessage";
- LogTaskError($ErrMessage);
+ LogTaskError("BotError: $ErrMessage");
WrapUpAndExit('boterror', $Retry);
}
diff --git a/testbot/bin/WineRunTask.pl b/testbot/bin/WineRunTask.pl
index 821ca55ea..fb2966303 100755
--- a/testbot/bin/WineRunTask.pl
+++ b/testbot/bin/WineRunTask.pl
@@ -319,7 +319,7 @@ sub FatalError($;$)
my ($ErrMessage, $Retry) = @_;
LogMsg "$JobId/$StepNo/$TaskNo $ErrMessage";
- LogTaskError($ErrMessage);
+ LogTaskError("BotError: $ErrMessage");
WrapUpAndExit('boterror', undef, $Retry);
}
diff --git a/testbot/bin/WineRunWineTest.pl b/testbot/bin/WineRunWineTest.pl
index 83cf5821b..1e43f9a41 100755
--- a/testbot/bin/WineRunWineTest.pl
+++ b/testbot/bin/WineRunWineTest.pl
@@ -320,7 +320,7 @@ sub FatalError($;$)
my ($ErrMessage, $Retry) = @_;
LogMsg "$JobId/$StepNo/$TaskNo $ErrMessage";
- LogTaskError($ErrMessage);
+ LogTaskError("BotError: $ErrMessage");
WrapUpAndExit('boterror', undef, $Retry);
}
--
2.18.0
June 27, 2018
[PATCH] testbot/CheckForWinetestUpdate: Fix the Wine reconfig timeout.
by Francois Gouget
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
---
testbot/bin/CheckForWinetestUpdate.pl | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/testbot/bin/CheckForWinetestUpdate.pl b/testbot/bin/CheckForWinetestUpdate.pl
index d3ef384c7..a570a1b80 100755
--- a/testbot/bin/CheckForWinetestUpdate.pl
+++ b/testbot/bin/CheckForWinetestUpdate.pl
@@ -286,7 +286,9 @@ sub AddReconfigJob($)
Debug(" $VMKey $VMType reconfig\n");
my $Task = $BuildStep->Tasks->Add();
$Task->VM($VM);
- $Task->Timeout($ReconfigTimeout);
+ $Task->Timeout($VMType eq "wine" ?
+ 3 * $WineReconfigTimeout : # 3 full Wine builds
+ $ReconfigTimeout); # 1 overall timeout
}
# Save the build step so the others can reference it.
--
2.18.0
June 27, 2018
[PATCH] testbot/web: Compile patches on wow64 if 64 bit tests have been selected.
by Francois Gouget
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
---
testbot/web/Submit.pl | 45 ++++++++++++++++++++++++-------------------
1 file changed, 25 insertions(+), 20 deletions(-)
diff --git a/testbot/web/Submit.pl b/testbot/web/Submit.pl
index 9fa252a11..38aa75fcb 100644
--- a/testbot/web/Submit.pl
+++ b/testbot/web/Submit.pl
@@ -858,30 +858,35 @@ sub OnSubmit($)
my $VMs = CreateVMs();
$VMs->AddFilter("Type", ["wine"]);
my $SortedKeys = $VMs->SortKeysBySortOrder($VMs->GetKeys());
- foreach my $VMKey (@$SortedKeys)
+ foreach my $Build ("win32", "wow64")
{
- my $VM = $VMs->GetItem($VMKey);
- my $FieldName = "vm_" . $self->CGI->escapeHTML($VMKey);
- next if (!$self->GetParam($FieldName)); # skip unselected VMs
+ next if ($Build eq "wow64" and !defined($self->GetParam("Run64")));
- if (!$Tasks)
+ foreach my $VMKey (@$SortedKeys)
{
- # First create the Wine test step
- my $WineStep = $Steps->Add();
- $WineStep->FileName($BaseName);
- $WineStep->FileType($FileType);
- $WineStep->InStaging(!1);
- $WineStep->Type("build");
- $WineStep->DebugLevel($self->GetParam("DebugLevel"));
- $WineStep->ReportSuccessfulTests(defined($self->GetParam("ReportSuccessfulTests")));
- $Tasks = $WineStep->Tasks;
- }
+ my $VM = $VMs->GetItem($VMKey);
+ my $FieldName = "vm_" . $self->CGI->escapeHTML($VMKey);
+ next if (!$self->GetParam($FieldName)); # skip unselected VMs
- # Then add a task for this VM
- my $Task = $Tasks->Add();
- $Task->VM($VM);
- $Task->CmdLineArg("win32");
- $Task->Timeout($WineReconfigTimeout);
+ if (!$Tasks)
+ {
+ # First create the Wine test step
+ my $WineStep = $Steps->Add();
+ $WineStep->FileName($BaseName);
+ $WineStep->FileType($FileType);
+ $WineStep->InStaging(!1);
+ $WineStep->Type("build");
+ $WineStep->DebugLevel($self->GetParam("DebugLevel"));
+ $WineStep->ReportSuccessfulTests(defined($self->GetParam("ReportSuccessfulTests")));
+ $Tasks = $WineStep->Tasks;
+ }
+
+ # Then add a task for this VM
+ my $Task = $Tasks->Add();
+ $Task->VM($VM);
+ $Task->CmdLineArg($Build);
+ $Task->Timeout($WineReconfigTimeout);
+ }
}
}
--
2.18.0
June 27, 2018
[PATCH] testbot: Fix the detection of the start and skipped report lines.
by Francois Gouget
This now matches the Wine report parser.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
---
testbot/lib/WineTestBot/LogUtils.pm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/testbot/lib/WineTestBot/LogUtils.pm b/testbot/lib/WineTestBot/LogUtils.pm
index 2d3042ec7..bccf30db3 100644
--- a/testbot/lib/WineTestBot/LogUtils.pm
+++ b/testbot/lib/WineTestBot/LogUtils.pm
@@ -408,7 +408,7 @@ sub GetLogLineCategory($)
return "todo";
}
if ($Line =~ /: Tests skipped: / or
- $Line =~ /^\w+:\w+ skipped /)
+ $Line =~ /^[_.a-z0-9-]+:[_a-z0-9]* skipped /)
{
return "skip";
}
@@ -431,7 +431,7 @@ sub GetLogLineCategory($)
return "error";
}
if ($Line =~ /^\+ \S/ or
- $Line =~ /^\w+:\w+ start / or
+ $Line =~ /^[_.a-z0-9-]+:[_a-z0-9]* start / or
# Build messages
$Line =~ /^(?:Build|Reconfig|Task): ok/)
{
--
2.18.0
June 27, 2018
[PATCH 3/3] testbot: Run WineTest on Wine VMs after commits.
by Francois Gouget
WineReconfig.pl now knows how to retrieve and cache the Gecko and Mono
addons, and how to create new wineprefixes. These are then captured by
the updated snapshot and are thus ready to use to run tests.
CheckForWinetestUpdate.pl creates additional steps to rerun the full
WineTest suite on the Wine VMs if the Wine rebuild was successful.
Running WineTest is handled by WineTest.pl and WineRunWineTest.pl
collects the corresponding reports in the latest directory in files
named '<vm>_<build>.report' where build is one of win32, wow32 or
wow64.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
---
testbot/bin/CheckForWinetestUpdate.pl | 44 +++++-
testbot/bin/WineRunWineTest.pl | 218 ++++++++++++++++++++++----
testbot/bin/build/WineReconfig.pl | 189 ++++++++++++++++++++--
testbot/bin/build/WineTest.pl | 118 ++++++++++++--
testbot/lib/WineTestBot/LogUtils.pm | 8 +-
testbot/lib/WineTestBot/Utils.pm | 19 ++-
6 files changed, 537 insertions(+), 59 deletions(-)
diff --git a/testbot/bin/CheckForWinetestUpdate.pl b/testbot/bin/CheckForWinetestUpdate.pl
index 74c59955f..d3ef384c7 100755
--- a/testbot/bin/CheckForWinetestUpdate.pl
+++ b/testbot/bin/CheckForWinetestUpdate.pl
@@ -273,10 +273,10 @@ sub AddReconfigJob($)
# Add a step to the job
my $Steps = $NewJob->Steps;
- my $NewStep = $Steps->Add();
- $NewStep->Type("reconfig");
- $NewStep->FileType("none");
- $NewStep->InStaging(!1);
+ my $BuildStep = $Steps->Add();
+ $BuildStep->Type("reconfig");
+ $BuildStep->FileType("none");
+ $BuildStep->InStaging(!1);
# And a task for each VM
my $SortedKeys = $VMs->SortKeysBySortOrder($VMs->GetKeys());
@@ -284,14 +284,46 @@ sub AddReconfigJob($)
{
my $VM = $VMs->GetItem($VMKey);
Debug(" $VMKey $VMType reconfig\n");
- my $Task = $NewStep->Tasks->Add();
+ my $Task = $BuildStep->Tasks->Add();
$Task->VM($VM);
$Task->Timeout($ReconfigTimeout);
}
- # Save it all
+ # Save the build step so the others can reference it.
my ($ErrKey, $ErrProperty, $ErrMessage) = $Jobs->Save();
if (defined $ErrMessage)
+ {
+ Error "Failed to save the build step: $ErrMessage\n";
+ return 0;
+ }
+
+ if ($VMType eq "wine")
+ {
+ # Add steps to run WineTest on Wine
+ foreach my $Build ("win32", "wow32", "wow64")
+ {
+ # Add a step to the job
+ my $NewStep = $Steps->Add();
+ $NewStep->PreviousNo($BuildStep->No);
+ $NewStep->Type("suite");
+ $NewStep->FileType("none");
+ $NewStep->InStaging(!1);
+
+ foreach my $VMKey (@$SortedKeys)
+ {
+ my $VM = $VMs->GetItem($VMKey);
+ Debug(" $VMKey $Build\n");
+ my $Task = $NewStep->Tasks->Add();
+ $Task->VM($VM);
+ $Task->CmdLineArg($Build);
+ $Task->Timeout($SuiteTimeout);
+ }
+ }
+ }
+
+ # Save it all
+ ($ErrKey, $ErrProperty, $ErrMessage) = $Jobs->Save();
+ if (defined $ErrMessage)
{
Error "Failed to save the Reconfig job: $ErrMessage\n";
return 0;
diff --git a/testbot/bin/WineRunWineTest.pl b/testbot/bin/WineRunWineTest.pl
index 53a2a0929..83cf5821b 100755
--- a/testbot/bin/WineRunWineTest.pl
+++ b/testbot/bin/WineRunWineTest.pl
@@ -1,7 +1,7 @@
#!/usr/bin/perl -Tw
# -*- Mode: Perl; perl-indent-level: 2; indent-tabs-mode: nil -*-
#
-# Makes sure the Wine patches compile.
+# Makes sure the Wine patches compile or run WineTest.
# See the bin/build/WineTest.pl script.
#
# Copyright 2018 Francois Gouget
@@ -46,6 +46,7 @@ use WineTestBot::PatchUtils;
use WineTestBot::VMs;
use WineTestBot::Log;
use WineTestBot::LogUtils;
+use WineTestBot::Utils;
use WineTestBot::Engine::Notify;
@@ -67,6 +68,35 @@ sub Error(@)
}
+#
+# Task helpers
+#
+
+sub TakeScreenshot($$)
+{
+ my ($VM, $FileName) = @_;
+
+ my $Domain = $VM->GetDomain();
+ my ($ErrMessage, $ImageSize, $ImageBytes) = $Domain->CaptureScreenImage();
+ if (!defined $ErrMessage)
+ {
+ if (open(my $Screenshot, ">", $FileName))
+ {
+ print $Screenshot $ImageBytes;
+ close($Screenshot);
+ }
+ else
+ {
+ Error "Could not open the screenshot file for writing: $!\n";
+ }
+ }
+ elsif ($Domain->IsPoweredOn())
+ {
+ Error "Could not capture a screenshot: $ErrMessage\n";
+ }
+}
+
+
#
# Setup and command line processing
#
@@ -190,15 +220,17 @@ sub LogTaskError($)
}
}
-sub WrapUpAndExit($;$$)
+sub WrapUpAndExit($;$$$)
{
- my ($Status, $Retry, $Timeout) = @_;
+ my ($Status, $TestFailures, $Retry, $TimedOut) = @_;
my $NewVMStatus = $Status eq 'queued' ? 'offline' : 'dirty';
my $VMResult = $Status eq "boterror" ? "boterror" :
$Status eq "queued" ? "error" :
- $Timeout ? "timeout" : "";
+ $TimedOut ? "timeout" : "";
+
+ Debug(Elapsed($Start), " Taking a screenshot\n");
+ TakeScreenshot($VM, "$TaskDir/screenshot.png");
- my $TestFailures;
my $Tries = $Task->TestFailures || 0;
if ($Retry)
{
@@ -253,6 +285,30 @@ sub WrapUpAndExit($;$$)
$VM->Save();
}
+ if ($Step->Type eq 'suite' and $Status eq 'completed' and !$TimedOut)
+ {
+ my $BuildList = $Task->CmdLineArg;
+ $BuildList =~ s/ .*$//;
+ foreach my $Build (split /,/, $BuildList)
+ {
+ # Keep the old report if the new one is missing
+ my $RptFileName = "$Build.report";
+ if (-f "$TaskDir/$RptFileName" and !-z "$TaskDir/$RptFileName")
+ {
+ # Update the reference VM suite results for WineSendLog.pl
+ my $LatestBaseName = join("", "$DataDir/latest/", $Task->VM->Name,
+ "_$Build");
+ unlink("$LatestBaseName.log");
+ link("$TaskDir/$RptFileName", "$LatestBaseName.log");
+ unlink("$LatestBaseName.err");
+ if (-f "$TaskDir/err" and !-z "$TaskDir/err")
+ {
+ link("$TaskDir/err", "$LatestBaseName.err");
+ }
+ }
+ }
+ }
+
my $Result = $VM->Name .": ". $VM->Status ." Status: $Status Failures: ". (defined $TestFailures ? $TestFailures : "unset");
LogMsg "Task $JobId/$StepNo/$TaskNo done ($Result)\n";
Debug(Elapsed($Start), " Done. $Result\n");
@@ -266,12 +322,12 @@ sub FatalError($;$)
LogMsg "$JobId/$StepNo/$TaskNo $ErrMessage";
LogTaskError($ErrMessage);
- WrapUpAndExit('boterror', $Retry);
+ WrapUpAndExit('boterror', undef, $Retry);
}
-sub FatalTAError($$)
+sub FatalTAError($$;$)
{
- my ($TA, $ErrMessage) = @_;
+ my ($TA, $ErrMessage, $PossibleCrash) = @_;
$ErrMessage .= ": ". $TA->GetLastError() if (defined $TA);
# A TestAgent operation failed, see if the VM is still accessible
@@ -297,7 +353,13 @@ sub FatalTAError($$)
else
{
# Ignore the TestAgent error, it's irrelevant
- $ErrMessage = "The test VM is powered off!\n";
+ $ErrMessage = "The test VM is powered off! Did the test shut it down?\n";
+ }
+ if ($PossibleCrash and !$Task->CanRetry())
+ {
+ # The test did it!
+ LogTaskError($ErrMessage);
+ WrapUpAndExit('completed', 1);
}
FatalError($ErrMessage, $Retry);
}
@@ -320,33 +382,78 @@ elsif (!$VM->GetDomain()->IsPoweredOn())
FatalError("The VM is not powered on\n");
}
-if ($Step->FileType ne "patchdlls")
+if (($Step->Type eq "suite" and $Step->FileType ne "none") or
+ ($Step->Type ne "suite" and $Step->FileType ne "patchdlls"))
{
FatalError("Unexpected file type '". $Step->FileType ."' found\n");
}
#
-# Run the task
+# Setup the VM
#
+my $TA = $VM->GetAgent();
+Debug(Elapsed($Start), " Setting the time\n");
+if (!$TA->SetTime())
+{
+ # Not a fatal error. Try the next port in case the VM runs a privileged
+ # TestAgentd daemon there.
+ my $PrivilegedTA = $VM->GetAgent(1);
+ if (!$PrivilegedTA->SetTime())
+ {
+ LogTaskError("Unable to set the VM system time: ". $PrivilegedTA->GetLastError() .". Maybe the TestAgentd process is missing the required privileges.\n");
+ $PrivilegedTA->Disconnect();
+ }
+}
my $FileName = $Step->GetFullFileName();
-my $TA = $VM->GetAgent();
-Debug(Elapsed($Start), " Sending '$FileName'\n");
-if (!$TA->SendFile($FileName, "staging/patch.diff", 0))
+if (defined $FileName)
{
- FatalTAError($TA, "Could not copy the patch to the VM");
+ Debug(Elapsed($Start), " Sending '$FileName'\n");
+ if (!$TA->SendFile($FileName, "staging/patch.diff", 0))
+ {
+ FatalTAError($TA, "Could not copy the patch to the VM");
+ }
}
+
my $Script = "#!/bin/sh\n".
- "( set -x\n" .
- " ../bin/build/WineTest.pl ". $Task->CmdLineArg ." build patch.diff\n".
- ") >Task.log 2>&1\n";
+ "( set -x\n".
+ " ../bin/build/WineTest.pl ";
+if ($Step->Type eq "suite")
+{
+ my $Tag = lc($VM->Name);
+ $Tag =~ s/^$TagPrefix//;
+ $Tag =~ s/[^a-zA-Z0-9]/-/g;
+ $Script .= $Task->CmdLineArg .",submit winetest $TagPrefix-$Tag ";
+ if (defined $WebHostName)
+ {
+ my $StepTask = 100 * $StepNo + $TaskNo;
+ $Script .= "-u \"http://$WebHostName/JobDetails.pl?Key=$JobId&s$StepTask=1#k$StepTask\" ";
+ }
+ my $Info = $VM->Description ? $VM->Description : "";
+ if ($VM->Details)
+ {
+ $Info .= ": " if ($Info ne "");
+ $Info .= $VM->Details;
+ }
+ $Script .= join(" ", "-m", ShQuote($AdminEMail), "-i", ShQuote($Info));
+}
+else
+{
+ $Script .= $Task->CmdLineArg ." build patch.diff";
+}
+$Script .= "\n) >Task.log 2>&1\n";
Debug(Elapsed($Start), " Sending the script: [$Script]\n");
if (!$TA->SendFileFromString($Script, "task", $TestAgent::SENDFILE_EXE))
{
FatalTAError($TA, "Could not send the task script to the VM");
}
+
+#
+# Run the test
+#
+
Debug(Elapsed($Start), " Starting the script\n");
my $Pid = $TA->Run(["./task"], 0);
if (!$Pid)
@@ -357,10 +464,11 @@ if (!$Pid)
#
# From that point on we want to at least try to grab the task log
-# before giving up
+# and a screenshot before giving up
#
-my ($NewStatus, $ErrMessage, $TAError, $TaskTimedOut);
+my $NewStatus = 'completed';
+my ($TaskFailures, $TaskTimedOut, $ErrMessage, $TAError, $PossibleCrash);
Debug(Elapsed($Start), " Waiting for the script (", $Task->Timeout, "s timeout)\n");
if (!defined $TA->Wait($Pid, $Task->Timeout, 60))
{
@@ -368,11 +476,19 @@ if (!defined $TA->Wait($Pid, $Task->Timeout, 60))
if ($ErrMessage =~ /timed out waiting for the child process/)
{
$ErrMessage = "The task timed out\n";
- $NewStatus = "badbuild";
+ if ($Step->Type eq "build")
+ {
+ $NewStatus = "badbuild";
+ }
+ else
+ {
+ $TaskFailures = 1;
+ }
$TaskTimedOut = 1;
}
else
{
+ $PossibleCrash = 1 if ($Step->Type ne "build");
$TAError = "An error occurred while waiting for the task to complete: $ErrMessage";
$ErrMessage = undef;
}
@@ -399,10 +515,11 @@ if ($TA->GetFile("Task.log", "$TaskDir/log"))
{
FatalError("$Result\n", "retry");
}
- else
+ elsif ($Result ne "missing" or $Step->Type ne "suite")
{
- # If the result line is missing we probably already have an error message
- # that explains why.
+ # There is no build and thus no result line when running WineTest.
+ # Otherwise if the result line is missing we probably already have an
+ # error message that explains why.
$NewStatus = "badbuild";
}
}
@@ -411,15 +528,62 @@ elsif (!defined $TAError)
$TAError = "An error occurred while retrieving the task log: ". $TA->GetLastError();
}
+#
+# Grab the test logs if any
+#
+
+my $TimedOut;
+if ($Step->Type ne "build")
+{
+ my $TaskDir = $Task->CreateDir();
+ my $BuildList = $Task->CmdLineArg;
+ $BuildList =~ s/ .*$//;
+ foreach my $Build (split /,/, $BuildList)
+ {
+ my $RptFileName = "$Build.report";
+ Debug(Elapsed($Start), " Retrieving '$RptFileName'\n");
+ if ($TA->GetFile($RptFileName, "$TaskDir/$RptFileName"))
+ {
+ chmod 0664, "$TaskDir/$RptFileName";
+
+ (my $LogFailures, my $LogErrors, $TimedOut) = ParseWineTestReport("$TaskDir/$RptFileName", 1, $Step->Type eq "suite", $TaskTimedOut);
+ if (!defined $LogFailures and @$LogErrors == 1)
+ {
+ # Could not open the file
+ $NewStatus = 'boterror';
+ Error "Unable to open '$RptFileName' for reading: $!\n";
+ LogTaskError("Unable to open '$RptFileName' for reading: $!\n");
+ }
+ else
+ {
+ # $LogFailures can legitimately be undefined in case of a timeout
+ $TaskFailures += $LogFailures || 0;
+ foreach my $Error (@$LogErrors)
+ {
+ LogTaskError("$Error\n");
+ }
+ }
+ }
+ elsif (!defined $TAError and
+ $TA->GetLastError() !~ /: No such file or directory/)
+ {
+ $TAError = "An error occurred while retrieving $RptFileName: ". $TA->GetLastError();
+ $NewStatus = 'boterror';
+ }
+ }
+}
+
+Debug(Elapsed($Start), " Disconnecting\n");
+$TA->Disconnect();
+
# Report the task errors even though they may have been caused by
# TestAgent trouble.
LogTaskError($ErrMessage) if (defined $ErrMessage);
-FatalTAError(undef, $TAError) if (defined $TAError);
-$TA->Disconnect();
+FatalTAError(undef, $TAError, $PossibleCrash) if (defined $TAError);
#
# Wrap up
#
-WrapUpAndExit($NewStatus, undef, $TaskTimedOut);
+WrapUpAndExit($NewStatus, $TaskFailures, undef, $TaskTimedOut || $TimedOut);
diff --git a/testbot/bin/build/WineReconfig.pl b/testbot/bin/build/WineReconfig.pl
index b030051c6..e3f14e243 100755
--- a/testbot/bin/build/WineReconfig.pl
+++ b/testbot/bin/build/WineReconfig.pl
@@ -40,6 +40,9 @@ my $Name0 = $0;
$Name0 =~ s+^.*/++;
+use Digest::SHA;
+use File::Path;
+
use WineTestBot::Config;
use WineTestBot::PatchUtils;
@@ -126,7 +129,7 @@ sub BuildWine($$$$)
{
my ($Targets, $NoRm, $Build, $Extras) = @_;
- return 1 if (!$Targets->{$Build});
+ return 1 if (!$Targets->{build} or !$Targets->{$Build});
mkdir "$DataDir/build-$Build" if (!-d "$DataDir/build-$Build");
# If $NoRm is not set, rebuild from scratch to make sure cruft will not
@@ -134,7 +137,7 @@ sub BuildWine($$$$)
InfoMsg "\nRebuilding the $Build Wine\n";
system("cd '$DataDir/build-$Build' && set -x && ".
($NoRm ? "" : "rm -rf * && ") .
- "time ../wine/configure $Extras --disable-winetest && ".
+ "time ../wine/configure $Extras && ".
"time make -j$ncpus");
if ($? != 0)
{
@@ -146,6 +149,154 @@ sub BuildWine($$$$)
}
+#
+# WinePrefix helpers
+#
+
+sub VerifyAddOn($$)
+{
+ my ($AddOn, $Arch) = @_;
+
+ my $Sha256 = Digest::SHA->new(256);
+ eval { $Sha256->addfile("$DataDir/$AddOn->{name}/$AddOn->{filename}") };
+ return "$@" if ($@);
+
+ my $Checksum = $Sha256->hexdigest();
+ return undef if ($Checksum eq $AddOn->{$Arch});
+ return "Bad checksum for '$AddOn->{filename}'";
+}
+
+sub UpdateAddOn($$$)
+{
+ my ($AddOn, $Name, $Arch) = @_;
+
+ if (!defined $AddOn)
+ {
+ LogMsg "Could not get information on the $Name addon\n";
+ return 0;
+ }
+ if (!$AddOn->{version})
+ {
+ LogMsg "Could not get the $Name version\n";
+ return 0;
+ }
+ if (!$AddOn->{$Arch})
+ {
+ LogMsg "Could not get the $Name $Arch checksum\n";
+ return 0;
+ }
+
+ $AddOn->{filename} = "wine". ($Name eq "gecko" ? "_" : "-") .
+ "$Name-$AddOn->{version}".
+ ($Arch eq "" ? "" : "-$Arch") .".msi";
+ return 1 if (!VerifyAddOn($AddOn, $Arch));
+
+ InfoMsg "Downloading $AddOn->{filename}\n";
+ mkdir "$DataDir/$Name";
+
+ my $Url="http://dl.winehq.org/wine/wine-$Name/$AddOn->{version}/$AddOn->{filename}";
+ for (1..3)
+ {
+ system("cd '$DataDir/$Name' && set -x && ".
+ "wget --no-verbose -O- '$Url' >'$AddOn->{filename}'");
+ last if ($? == 0);
+ }
+ my $ErrMessage = VerifyAddOn($AddOn, $Arch);
+ return 1 if (!defined $ErrMessage);
+ LogMsg "$ErrMessage\n";
+ return 0;
+}
+
+sub UpdateAddOns($)
+{
+ my ($Targets) = @_;
+ return 1 if (!$Targets->{addons});
+
+ my %AddOns;
+ if (open(my $fh, "<", "$DataDir/wine/dlls/appwiz.cpl/addons.c"))
+ {
+ my $Arch = "";
+ while (my $Line= <$fh>)
+ {
+ if ($Line =~ /^\s*#\s*define\s+ARCH_STRING\s+"([^"]+)"/)
+ {
+ $Arch = $1;
+ }
+ elsif ($Line =~ /^\s*#\s*define\s*(GECKO|MONO)_VERSION\s*"([^"]+)"/)
+ {
+ my ($AddOn, $Version) = ($1, $2);
+ $AddOn =~ tr/A-Z/a-z/;
+ $AddOns{$AddOn}->{name} = $AddOn;
+ $AddOns{$AddOn}->{version} = $Version;
+ }
+ elsif ($Line =~ /^\s*#\s*define\s*(GECKO|MONO)_SHA\s*"([^"]+)"/)
+ {
+ my ($AddOn, $Checksum) = ($1, $2);
+ $AddOn =~ tr/A-Z/a-z/;
+ $AddOns{$AddOn}->{$Arch} = $Checksum;
+ $Arch = "";
+ }
+ }
+ close($fh);
+ }
+ else
+ {
+ LogMsg "Could not open 'wine/dlls/appwiz.cpl/addons.c': $!\n";
+ return 0;
+ }
+
+ return UpdateAddOn($AddOns{gecko}, "gecko", "x86") &&
+ UpdateAddOn($AddOns{gecko}, "gecko", "x86_64") &&
+ UpdateAddOn($AddOns{mono}, "mono", "");
+}
+
+# See also WineTest.pl
+sub SetupWineEnvironment($)
+{
+ my ($Build) = @_;
+
+ $ENV{WINEPREFIX} = "$DataDir/wineprefix-$Build";
+ $ENV{DISPLAY} ||= ":0.0";
+}
+
+# See also WineTest.pl
+sub RunWine($$$)
+{
+ my ($Build, $Cmd, $CmdArgs) = @_;
+
+ my $Magic = `cd '$DataDir/build-$Build' && file $Cmd`;
+ my $Wine = ($Magic =~ /ELF 64/ ? "./wine64" : "./wine");
+ return system("cd '$DataDir/build-$Build' && set -x && ".
+ "time $Wine $Cmd $CmdArgs");
+}
+
+# Setup a brand new WinePrefix ready for use for testing.
+# This way we do it once instead of doing it for every test, thus saving
+# time. Note that this requires using a different wineprefix for each build.
+sub NewWinePrefix($$)
+{
+ my ($Targets, $Build) = @_;
+
+ return 1 if (!$Targets->{wineprefix} or !$Targets->{$Build});
+
+ InfoMsg "\nRecreating the $Build wineprefix\n";
+ SetupWineEnvironment($Build);
+ rmtree($ENV{WINEPREFIX});
+
+ # Crash dialogs cause delays so disable them
+ if (RunWine($Build, "./programs/reg/reg.exe.so", "ADD HKCU\\\\Software\\\\Wine\\\\WineDbg /v ShowCrashDialog /t REG_DWORD /d 0"))
+ {
+ LogMsg "Failed to disable the $Build build crash dialogs: $!\n";
+ return 0;
+ }
+
+ # Ensure the WinePrefix has been fully created before updating the snapshot
+ system("cd '$DataDir/build-$Build' && ./server/wineserver -w");
+
+ return 1;
+}
+
+
#
# Setup and command line processing
#
@@ -154,7 +305,7 @@ $ENV{PATH} = "/usr/lib/ccache:/usr/bin:/bin";
delete $ENV{ENV};
my %AllTargets;
-map { $AllTargets{$_} = 1 } qw(update win32 wow32 wow64);
+map { $AllTargets{$_} = 1 } qw(update addons build wineprefix win32 wow32 wow64);
my ($Usage, $TargetList, $NoRm);
while (@ARGV)
@@ -212,15 +363,18 @@ if (defined $Usage)
}
print "Usage: $Name0 [--no-rm] [--help] [TARGETS]\n";
print "\n";
- print "Performs all the tasks needed for the host to be ready to test new patches: update the Wine source and rebuild the Wine binaries.\n";
+ print "Performs all the tasks needed for the host to be ready to test new patches: update the Wine source and addons, and rebuild the Wine binaries.\n";
print "\n";
print "Where:\n";
print " TARGETS Is a comma-separated list of targets to process. By default all\n";
print " targets are processed.\n";
print " - update: Update Wine's source code.\n";
- print " - win32: Rebuild the regular 32 bit Wine.\n";
- print " - wow32: Rebuild the 32 bit WoW Wine.\n";
- print " - wow64: Rebuild the 64 bit WoW Wine.\n";
+ print " - build: Update the Wine builds.\n";
+ print " - addons: Update the Gecko and Mono Wine addons.\n";
+ print " - wineprefix: Update the wineprefixes.\n";
+ print " - win32: Apply the above to the regular 32 bit Wine.\n";
+ print " - wow32: Apply the above to the 32 bit WoW Wine.\n";
+ print " - wow64: Apply the above to the 64 bit WoW Wine.\n";
print " --no-rm Don't rebuild from scratch.\n";
print " --help Shows this usage message.\n";
exit 0;
@@ -240,16 +394,25 @@ if ($DataDir =~ /'/)
#
-# Run the builds
+# Run the builds and/or tests
#
CountCPUs();
-if (!BuildTestAgentd() ||
- !GitPull($Targets) ||
- !BuildWine($Targets, $NoRm, "win32", "") ||
- !BuildWine($Targets, $NoRm, "wow64", "--enable-win64") ||
- !BuildWine($Targets, $NoRm, "wow32", "--with-wine64='$DataDir/build-wow64'"))
+if (!BuildTestAgentd() or
+ !GitPull($Targets) or
+ !UpdateAddOns($Targets) or
+ !BuildWine($Targets, $NoRm, "win32", "") or
+ !BuildWine($Targets, $NoRm, "wow64", "--enable-win64") or
+ !BuildWine($Targets, $NoRm, "wow32", "--with-wine64='$DataDir/build-wow64'") or
+ !NewWinePrefix($Targets, "win32") or
+ # The wow32 and wow64 wineprefixes:
+ # - Are essentially identical.
+ # - Must be created after both WoW builds have been updated.
+ # - Make it possible to run the wow32 and wow64 tests in separate prefixes,
+ # thus ensuring they don't interfere with each other.
+ !NewWinePrefix($Targets, "wow64") or
+ !NewWinePrefix($Targets, "wow32"))
{
exit(1);
}
diff --git a/testbot/bin/build/WineTest.pl b/testbot/bin/build/WineTest.pl
index 3be81485e..518deae99 100755
--- a/testbot/bin/build/WineTest.pl
+++ b/testbot/bin/build/WineTest.pl
@@ -144,6 +144,62 @@ sub BuildWine($$)
}
+#
+# Test helpers
+#
+
+# See also WineReconfig.pl
+sub SetupWineEnvironment($)
+{
+ my ($Build) = @_;
+
+ $ENV{WINEPREFIX} = "$DataDir/wineprefix-$Build";
+ $ENV{DISPLAY} ||= ":0.0";
+}
+
+# See also WineReconfig.pl
+sub RunWine($$$)
+{
+ my ($Build, $Cmd, $CmdArgs) = @_;
+
+ my $Magic = `cd '$DataDir/build-$Build' && file $Cmd`;
+ my $Wine = ($Magic =~ /ELF 64/ ? "./wine64" : "./wine");
+ return system("cd '$DataDir/build-$Build' && set -x && ".
+ "time $Wine $Cmd $CmdArgs");
+}
+
+sub DailyWineTest($$$$)
+{
+ my ($Targets, $Build, $BaseTag, $Args) = @_;
+
+ return 1 if (!$Targets->{$Build});
+
+ InfoMsg "\nRunning WineTest in the $Build Wine\n";
+ SetupWineEnvironment($Build);
+
+ # Run WineTest. Ignore the exit code since it returns non-zero whenever
+ # there are test failures.
+ RunWine($Build, "./programs/winetest/winetest.exe.so",
+ "-c -o '../$Build.report' -t $BaseTag-$Build ". ShArgv2Cmd(@$Args));
+ if (!-f "$Build.report")
+ {
+ LogMsg "WineTest did not produce a report file\n";
+ return 0;
+ }
+
+ # Send the report to the website
+ if ($Targets->{submit} and
+ RunWine($Build, "./programs/winetest/winetest.exe.so",
+ "-c -s '../$Build.report'"))
+ {
+ LogMsg "WineTest failed to send the $Build report\n";
+ # Soldier on in case it's just a network issue
+ }
+
+ return 1;
+}
+
+
#
# Setup and command line processing
#
@@ -152,9 +208,9 @@ $ENV{PATH} = "/usr/lib/ccache:/usr/bin:/bin";
delete $ENV{ENV};
my %AllTargets;
-map { $AllTargets{$_} = 1 } qw(win32 wow32 wow64);
+map { $AllTargets{$_} = 1 } qw(win32 wow32 wow64 submit);
-my ($Usage, $TargetList, $Action, $FileName);
+my ($Usage, $TargetList, $Action, $FileName, $BaseTag);
while (@ARGV)
{
my $Arg = shift @ARGV;
@@ -177,6 +233,12 @@ while (@ARGV)
{
$Action = $Arg;
}
+ elsif (($Action || "") eq "winetest")
+ {
+ $BaseTag = $Arg;
+ # The remaining arguments are meant for WineTest
+ last;
+ }
elsif (!defined $FileName)
{
if (IsValidFileName($Arg))
@@ -230,6 +292,23 @@ if (!defined $Usage)
Error "you must specify the action to perform\n";
$Usage = 2;
}
+ elsif ($Action eq "winetest")
+ {
+ if (!defined $BaseTag)
+ {
+ Error "you must specify a base tag for WineTest\n";
+ $Usage = 2;
+ }
+ elsif ($BaseTag =~ m/^([\w_.\-]+)$/)
+ {
+ $BaseTag = $1;
+ }
+ else
+ {
+ Error "invalid WineTest base tag '$BaseTag'\n";
+ $Usage = 2;
+ }
+ }
elsif ($Action ne "build")
{
Error "invalid '$Action' action\n";
@@ -245,16 +324,23 @@ if (!defined $Usage)
if (defined $Usage)
{
print "Usage: $Name0 [--help] TARGETS build PATCH\n";
+ print "or $Name0 [--help] TARGETS winetest BASETAG ARGS\n";
print "\n";
- print "Applies the specified patch and rebuilds Wine.\n";
+ print "Tests the specified patch or runs WineTest in Wine.\n";
print "\n";
print "Where:\n";
- print " TARGETS Is a comma-separated list of targets for the build.\n";
+ print " TARGETS Is a comma-separated list of targets for the specified action.\n";
print " - win32: The regular 32 bit Wine build.\n";
print " - wow32: The 32 bit WoW Wine build.\n";
print " - wow64: The 64 bit WoW Wine build.\n";
+ print " - submit: Send the WineTest result to the website.\n";
print " build Verify that the patch compiles.\n";
print " PATCH Is the staging file containing the patch to test.\n";
+ print " winetest Run WineTest and submit the result to the website if the submit\n";
+ print " task was specified.\n";
+ print " BASETAG Is the tag for this WineTest run. Note that the build type is\n";
+ print " automatically added to this tag.\n";
+ print " ARGS The WineTest arguments.\n";
print " --help Shows this usage message.\n";
exit $Usage;
}
@@ -267,16 +353,28 @@ if ($DataDir =~ /'/)
#
-# Run the builds
+# Run the builds and tests
#
+# Clean up old reports
+map { unlink("$_.report") } keys %AllTargets;
+
CountCPUs();
-my $Impacts = ApplyPatch($FileName);
-exit(1) if (!$Impacts or
- !BuildWine($Targets, "win32") or
- !BuildWine($Targets, "wow64") or
- !BuildWine($Targets, "wow32"));
+if ($Action eq "build")
+{
+ my $Impacts = ApplyPatch($FileName);
+ exit(1) if (!$Impacts or
+ !BuildWine($Targets, "win32") or
+ !BuildWine($Targets, "wow64") or
+ !BuildWine($Targets, "wow32"));
+}
+elsif ($Action eq "winetest")
+{
+ exit(1) if (!DailyWineTest($Targets, "win32", $BaseTag, \@ARGV) or
+ !DailyWineTest($Targets, "wow64", $BaseTag, \@ARGV) or
+ !DailyWineTest($Targets, "wow32", $BaseTag, \@ARGV));
+}
LogMsg "ok\n";
exit;
diff --git a/testbot/lib/WineTestBot/LogUtils.pm b/testbot/lib/WineTestBot/LogUtils.pm
index 363f80827..2d3042ec7 100644
--- a/testbot/lib/WineTestBot/LogUtils.pm
+++ b/testbot/lib/WineTestBot/LogUtils.pm
@@ -458,6 +458,7 @@ sub GetLogFileNames($;$)
my ($Dir, $IncludeOld) = @_;
my @Candidates = ("exe32.report", "exe64.report",
+ "win32.report", "wow32.report", "wow64.report",
"log", "err");
push @Candidates, "log.old", "err.old" if ($IncludeOld);
@@ -472,10 +473,13 @@ sub GetLogFileNames($;$)
my %_LogFileLabels = (
"exe32.report" => "32 bit Windows report",
"exe64.report" => "64 bit Windows report",
- "err" => "task errors",
+ "win32.report" => "32 bit Wine report",
+ "wow32.report" => "32 bit WoW Wine report",
+ "wow64.report" => "64 bit Wow Wine report",
"log" => "task log",
- "err.old" => "old task errors",
+ "err" => "task errors",
"log.old" => "old logs",
+ "err.old" => "old task errors",
);
=pod
diff --git a/testbot/lib/WineTestBot/Utils.pm b/testbot/lib/WineTestBot/Utils.pm
index 111a56589..f64310b6b 100644
--- a/testbot/lib/WineTestBot/Utils.pm
+++ b/testbot/lib/WineTestBot/Utils.pm
@@ -29,7 +29,7 @@ use Exporter 'import';
our @EXPORT = qw(MakeSecureURL SecureConnection GenerateRandomString
OpenNewFile CreateNewFile CreateNewLink CreateNewDir
DurationToString BuildEMailRecipient IsValidFileName
- ShQuote);
+ ShQuote ShArgv2Cmd);
use Fcntl;
@@ -220,4 +220,21 @@ sub ShQuote($)
return "\"$Str\"";
}
+=pod
+=over 12
+
+=item C<ShArgv2Cmd()>
+
+Converts an argument list into a command line suitable for use in a shell.
+
+See also ShQuote().
+
+=back
+=cut
+
+sub ShArgv2Cmd(@)
+{
+ return join(' ', map { /[^a-zA-Z0-9\/.,+_-]/ ? ShQuote($_) : $_ } @_);
+}
+
1;
--
2.18.0
June 27, 2018
[PATCH 2/3] testbot/WineRunTask: Make the Wine report parser reusable.
by Francois Gouget
Moving it to LogUtils.pm makes it possible to reuse it in future
scripts.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
---
testbot/bin/WineRunTask.pl | 276 ++-----------------------
testbot/lib/WineTestBot/LogUtils.pm | 310 +++++++++++++++++++++++++++-
2 files changed, 322 insertions(+), 264 deletions(-)
diff --git a/testbot/bin/WineRunTask.pl b/testbot/bin/WineRunTask.pl
index 9faae28c3..821ca55ea 100755
--- a/testbot/bin/WineRunTask.pl
+++ b/testbot/bin/WineRunTask.pl
@@ -44,6 +44,7 @@ use WineTestBot::Config;
use WineTestBot::Jobs;
use WineTestBot::VMs;
use WineTestBot::Log;
+use WineTestBot::LogUtils;
use WineTestBot::Engine::Notify;
@@ -527,275 +528,24 @@ Debug(Elapsed($Start), " Retrieving the report file to '$RptFileName'\n");
if ($TA->GetFile($RptFileName, "$TaskDir/$RptFileName"))
{
chmod 0664, "$TaskDir/$RptFileName";
- if (open(my $LogFile, "<", "$TaskDir/$RptFileName"))
- {
- # There is more than one test unit when running the full test suite so keep
- # track of the current one. Note that for the TestBot we don't count or
- # complain about misplaced skips.
- my ($CurrentDll, $CurrentUnit) = ("", "");
- my $UnitSize = 0;
- my ($LineFailures, $LineTodos, $LineSkips) = (0, 0, 0);
- my ($SummaryFailures, $SummaryTodos, $SummarySkips) = (0, 0, 0);
- my ($CurrentIsBroken, %CurrentPids, $CurrentRc, $LogFailures);
-
- sub CheckUnit($$)
- {
- my ($Unit, $Type) = @_;
- if ($Unit eq $CurrentUnit or $CurrentUnit eq "")
- {
- $IsWineTest = 1;
- }
- # To avoid issuing many duplicate errors,
- # only report the first misplaced message.
- elsif ($IsWineTest and !$CurrentIsBroken)
- {
- LogTaskError("$CurrentDll:$CurrentUnit contains a misplaced $Type message for $Unit\n");
- $LogFailures++;
- $CurrentIsBroken = 1;
- }
- }
-
- sub CheckSummaryCounter($$$)
- {
- my ($Count, $SCount, $Type) = @_;
-
- if ($Count != 0 and $SCount == 0)
- {
- LogTaskError("$CurrentDll:$CurrentUnit has unaccounted for $Type messages\n");
- $LogFailures++;
- }
- elsif ($Count == 0 and $SCount != 0)
- {
- LogTaskError("$CurrentDll:$CurrentUnit is missing some $Type messages\n");
- $LogFailures++;
- }
- }
-
- sub CloseTestUnit($)
- {
- my ($Last) = @_;
-
- # Verify the summary lines
- if (!$CurrentIsBroken)
- {
- CheckSummaryCounter($LineFailures, $SummaryFailures, "failure");
- CheckSummaryCounter($LineTodos, $SummaryTodos, "todo");
- CheckSummaryCounter($LineSkips, $SummarySkips, "skip");
- }
-
- # Note that the summary lines may count some failures twice
- # so only use them as a fallback.
- $LineFailures ||= $SummaryFailures;
-
- if ($UnitSize > $MaxUnitSize)
- {
- LogTaskError("$CurrentDll:$CurrentUnit prints too much data ($UnitSize bytes)\n");
- $LogFailures++;
- }
- if (!$CurrentIsBroken and defined $CurrentRc)
- {
- # Check the exit code, particularly against failures reported
- # after the 'done' line (e.g. by subprocesses).
- if ($LineFailures != 0 and $CurrentRc == 0)
- {
- LogTaskError("$CurrentDll:$CurrentUnit returned success despite having failures\n");
- $LogFailures++;
- }
- elsif (!$IsWineTest and $CurrentRc != 0)
- {
- LogTaskError("The test returned a non-zero exit code\n");
- $LogFailures++;
- }
- elsif ($IsWineTest and $LineFailures == 0 and $CurrentRc != 0)
- {
- LogTaskError("$CurrentDll:$CurrentUnit returned a non-zero exit code despite reporting no failures\n");
- $LogFailures++;
- }
- }
- # For executables TestLauncher's done line may not be recognizable.
- elsif ($IsWineTest and !defined $CurrentRc)
- {
- if (!$Last)
- {
- LogTaskError("$CurrentDll:$CurrentUnit has no done line (or it is garbled)\n");
- }
- elsif ($Last and !$TaskTimedOut)
- {
- LogTaskError("The report seems to have been truncated\n");
- }
- $LogFailures++;
- }
-
- $LogFailures += $LineFailures;
-
- $CurrentDll = $CurrentUnit = "";
- $UnitSize = 0;
- $LineFailures = $LineTodos = $LineSkips = 0;
- $SummaryFailures = $SummaryTodos = $SummarySkips = 0;
- $CurrentIsBroken = 0;
- $CurrentRc = undef;
- %CurrentPids = ();
- }
-
- foreach my $Line (<$LogFile>)
- {
- $UnitSize += length($Line);
- if ($Line =~ m%^([_.a-z0-9-]+):([_a-z0-9]*) (start|skipped) (?:-|[/_.a-z0-9]+) (?:-|[.0-9a-f]+)\r?$%)
- {
- my ($Dll, $Unit, $Type) = ($1, $2, $3);
-
- # Close the previous test unit
- CloseTestUnit(0) if ($CurrentDll ne "");
-
- ($CurrentDll, $CurrentUnit) = ($Dll, $Unit);
-
- # Recognize skipped messages in case we need to skip tests in the VMs
- $CurrentRc = 0 if ($Type eq "skipped");
- }
- elsif ($Line =~ /^([_a-z0-9]+)\.c:\d+: Test (?:failed|succeeded inside todo block): / or
- ($CurrentUnit ne "" and
- $Line =~ /($CurrentUnit)\.c:\d+: Test (?:failed|succeeded inside todo block): /))
- {
- CheckUnit($1, "failure");
- $LineFailures++;
- }
- elsif ($Line =~ /^([_a-z0-9]+)\.c:\d+: Test marked todo: / or
- ($CurrentUnit ne "" and
- $Line =~ /($CurrentUnit)\.c:\d+: Test marked todo: /))
- {
- CheckUnit($1, "todo");
- $LineTodos++;
- }
- # TestLauncher's skip message is quite broken
- elsif ($Line =~ /^([_a-z0-9]+)(?:\.c)?:\d+:? Tests? skipped: / or
- ($CurrentUnit ne "" and
- $Line =~ /($CurrentUnit)(?:\.c)?:\d+:? Tests? skipped: /))
- {
- my $Unit = $1;
- # Don't complain and don't count misplaced skips. Only complain if they
- # are misreported (see CloseTestUnit). Also TestLauncher uses the wrong
- # name in its skip message when skipping tests.
- if ($Unit eq $CurrentUnit or $CurrentUnit eq "" or $Unit eq $CurrentDll)
- {
- $LineSkips++;
- }
- }
- elsif ($Line =~ /^Fatal: test '([_a-z0-9]+)' does not exist/)
- {
- # This also replaces a test summary line.
- $CurrentPids{0} = 1;
- $SummaryFailures++;
- $IsWineTest = 1;
-
- $LineFailures++;
- }
- elsif ($Line =~ /^(?:([0-9a-f]+):)?([_.a-z0-9]+): unhandled exception [0-9a-fA-F]{8} at / or
- ($CurrentUnit ne "" and
- $Line =~ /(?:([0-9a-f]+):)?($CurrentUnit): unhandled exception [0-9a-fA-F]{8} at /))
- {
- my ($Pid, $Unit) = ($1, $2);
-
- if ($Unit eq $CurrentUnit)
- {
- # This also replaces a test summary line.
- $CurrentPids{$Pid || 0} = 1;
- $SummaryFailures++;
- }
- CheckUnit($Unit, "unhandled exception");
- $LineFailures++;
- }
- elsif ($Line =~ /^(?:([0-9a-f]+):)?([_a-z0-9]+): \d+ tests? executed \((\d+) marked as todo, (\d+) failures?\), (\d+) skipped\./ or
- ($CurrentUnit ne "" and
- $Line =~ /(?:([0-9a-f]+):)?($CurrentUnit): \d+ tests? executed \((\d+) marked as todo, (\d+) failures?\), (\d+) skipped\./))
- {
- my ($Pid, $Unit, $Todos, $Failures, $Skips) = ($1, $2, $3, $4, $5);
-
- # Dlls that have only one test unit will run it even if there is
- # no argument. Also TestLauncher uses the wrong name in its test
- # summary line when skipping tests.
- if ($Unit eq $CurrentUnit or $CurrentUnit eq "" or $Unit eq $CurrentDll)
- {
- # There may be more than one summary line due to child processes
- $CurrentPids{$Pid || 0} = 1;
- $SummaryFailures += $Failures;
- $SummaryTodos += $Todos;
- $SummarySkips += $Skips;
- $IsWineTest = 1;
- }
- else
- {
- CheckUnit($Unit, "test summary") if ($Todos or $Failures);
- }
- }
- elsif ($Line =~ /^([_.a-z0-9-]+):([_a-z0-9]*)(?::([0-9a-f]+))? done \((-?\d+)\)(?:\r?$| in)/ or
- ($CurrentDll ne "" and
- $Line =~ /(\Q$CurrentDll\E):([_a-z0-9]*)(?::([0-9a-f]+))? done \((-?\d+)\)(?:\r?$| in)/))
- {
- my ($Dll, $Unit, $Pid, $Rc) = ($1, $2, $3, $4);
-
- if ($IsWineTest and ($Dll ne $CurrentDll or $Unit ne $CurrentUnit))
- {
- # First close the current test unit taking into account
- # it may have been polluted by the new one.
- $LogFailures++;
- $CurrentIsBroken = 1;
- CloseTestUnit(0);
-
- # Then switch to the new one, warning it's missing a start line,
- # and that its results may be inconsistent.
- ($CurrentDll, $CurrentUnit) = ($Dll, $Unit);
- LogTaskError("$Dll:$Unit had no start line (or it is garbled)\n");
- $CurrentIsBroken = 1;
- }
-
- if ($Rc == 258)
- {
- # The done line will already be shown as a timeout (see JobDetails)
- # so record the failure but don't add an error message.
- $LogFailures++;
- $CurrentIsBroken = 1;
- $TimedOut = ($Step->Type ne "suite");
- }
- elsif ((!$Pid and !%CurrentPids) or
- ($Pid and !$CurrentPids{$Pid} and !$CurrentPids{0}))
- {
- # The main summary line is missing
- if ($Rc & 0xc0000000)
- {
- LogTaskError(sprintf("%s:%s crashed (%08x)\n", $Dll, $Unit, $Rc & 0xffffffff));
- $LogFailures++;
- $CurrentIsBroken = 1;
- }
- elsif ($IsWineTest and !$CurrentIsBroken)
- {
- LogTaskError("$Dll:$Unit has no test summary line (early exit of the main process?)\n");
- $LogFailures++;
- }
- }
- elsif ($Rc & 0xc0000000)
- {
- # We know the crash happened in the main process which means we got
- # an "unhandled exception" message. So there is no need to add an
- # extra message or to increment the failure count. Still note that
- # there may be inconsistencies (e.g. unreported todos or skips).
- $CurrentIsBroken = 1;
- }
- $CurrentRc = $Rc;
- }
- }
- $CurrentIsBroken = 1 if ($TaskTimedOut);
- CloseTestUnit(1);
- close($LogFile);
- # $LogFailures can legitimately be undefined in case of a timeout
- $TaskFailures += $LogFailures || 0;
- }
- else
+ (my $LogFailures, my $LogErrors, $TimedOut) = ParseWineTestReport("$TaskDir/$RptFileName", $IsWineTest, $Step->Type eq "suite", $TaskTimedOut);
+ if (!defined $LogFailures and @$LogErrors == 1)
{
+ # Could not open the file
$NewStatus = 'boterror';
Error "Unable to open '$RptFileName' for reading: $!\n";
LogTaskError("Unable to open '$RptFileName' for reading: $!\n");
}
+ else
+ {
+ # $LogFailures can legitimately be undefined in case of a timeout
+ $TaskFailures += $LogFailures || 0;
+ foreach my $Error (@$LogErrors)
+ {
+ LogTaskError("$Error\n");
+ }
+ }
}
elsif (!defined $TAError)
{
diff --git a/testbot/lib/WineTestBot/LogUtils.pm b/testbot/lib/WineTestBot/LogUtils.pm
index 3dfd7c5e7..363f80827 100644
--- a/testbot/lib/WineTestBot/LogUtils.pm
+++ b/testbot/lib/WineTestBot/LogUtils.pm
@@ -27,7 +27,12 @@ WineTestBot::LogUtils - Provides functions to parse task logs
use Exporter 'import';
-our @EXPORT = qw(GetLogFileNames GetLogLabel GetLogLineCategory ParseTaskLog);
+our @EXPORT = qw(GetLogFileNames GetLogLabel GetLogLineCategory
+ ParseTaskLog ParseWineTestReport);
+
+use File::Basename;
+
+use WineTestBot::Config; # For $MaxUnitSize
#
@@ -75,6 +80,309 @@ sub ParseTaskLog($$)
}
+#
+# WineTest report parser
+#
+
+sub _NewCurrentUnit($$)
+{
+ my ($Dll, $Unit) = @_;
+
+ return {
+ # There is more than one test unit when running the full test suite so keep
+ # track of the current one. Note that for the TestBot we don't count or
+ # complain about misplaced skips.
+ Dll => $Dll,
+ Unit => $Unit,
+ UnitSize => 0,
+ LineFailures => 0,
+ LineTodos => 0,
+ LineSkips => 0,
+ SummaryFailures => 0,
+ SummaryTodos => 0,
+ SummarySkips => 0,
+ IsBroken => 0,
+ Rc => undef,
+ Pids => {},
+ };
+}
+
+sub _AddError($$;$)
+{
+ my ($Parser, $Error, $Cur) = @_;
+
+ $Error = "$Cur->{Dll}:$Cur->{Unit} $Error" if (defined $Cur);
+ push @{$Parser->{Errors}}, $Error;
+ $Parser->{Failures}++;
+}
+
+sub _CheckUnit($$$$)
+{
+ my ($Parser, $Cur, $Unit, $Type) = @_;
+
+ if ($Unit eq $Cur->{Unit} or $Cur->{Unit} eq "")
+ {
+ $Parser->{IsWineTest} = 1;
+ }
+ # To avoid issuing many duplicate errors,
+ # only report the first misplaced message.
+ elsif ($Parser->{IsWineTest} and !$Cur->{IsBroken})
+ {
+ _AddError($Parser, "contains a misplaced $Type message for $Unit", $Cur);
+ $Cur->{IsBroken} = 1;
+ }
+}
+
+sub _CheckSummaryCounter($$$$)
+{
+ my ($Parser, $Cur, $Field, $Type) = @_;
+
+ if ($Cur->{"Line$Field"} != 0 and $Cur->{"Summary$Field"} == 0)
+ {
+ _AddError($Parser, "has unaccounted for $Type messages", $Cur);
+ }
+ elsif ($Cur->{"Line$Field"} == 0 and $Cur->{"Summary$Field"} != 0)
+ {
+ _AddError($Parser, "is missing some $Type messages", $Cur);
+ }
+}
+
+sub _CloseTestUnit($$$)
+{
+ my ($Parser, $Cur, $Last) = @_;
+
+ # Verify the summary lines
+ if (!$Cur->{IsBroken})
+ {
+ _CheckSummaryCounter($Parser, $Cur, "Failures", "failure");
+ _CheckSummaryCounter($Parser, $Cur, "Todos", "todo");
+ _CheckSummaryCounter($Parser, $Cur, "Skips", "skip");
+ }
+
+ # Note that the summary lines may count some failures twice
+ # so only use them as a fallback.
+ $Cur->{LineFailures} ||= $Cur->{SummaryFailures};
+
+ if ($Cur->{UnitSize} > $MaxUnitSize)
+ {
+ _AddError($Parser, "prints too much data ($Cur->{UnitSize} bytes)", $Cur);
+ }
+ if (!$Cur->{IsBroken} and defined $Cur->{Rc})
+ {
+ # Check the exit code, particularly against failures reported
+ # after the 'done' line (e.g. by subprocesses).
+ if ($Cur->{LineFailures} != 0 and $Cur->{Rc} == 0)
+ {
+ _AddError($Parser, "returned success despite having failures", $Cur);
+ }
+ elsif (!$Parser->{IsWineTest} and $Cur->{Rc} != 0)
+ {
+ _AddError($Parser, "The test returned a non-zero exit code");
+ }
+ elsif ($Parser->{IsWineTest} and $Cur->{LineFailures} == 0 and $Cur->{Rc} != 0)
+ {
+ _AddError($Parser, "returned a non-zero exit code despite reporting no failures", $Cur);
+ }
+ }
+ # For executables TestLauncher's done line may not be recognizable.
+ elsif ($Parser->{IsWineTest} and !defined $Cur->{Rc})
+ {
+ if (!$Last)
+ {
+ _AddError($Parser, "has no done line (or it is garbled)", $Cur);
+ }
+ elsif ($Last and !$Parser->{TaskTimedOut})
+ {
+ _AddError($Parser, "The report seems to have been truncated");
+ }
+ }
+
+ $Parser->{Failures} += $Cur->{LineFailures};
+}
+
+=pod
+=over 12
+
+=item C<ParseWineTestReport()>
+
+Parses a Wine test report and returns the number of failures and extra errors,
+a list of extra errors, and whether the test timed out.
+
+=back
+=cut
+
+sub ParseWineTestReport($$$$)
+{
+ my ($FileName, $IsWineTest, $IsSuite, $TaskTimedOut) = @_;
+
+ my $LogFile;
+ if (!open($LogFile, "<", $FileName))
+ {
+ my $BaseName = basename($FileName);
+ return (undef, ["Unable to open '$BaseName' for reading: $!"], undef);
+ }
+
+ my $Parser = {
+ IsWineTest => $IsWineTest,
+ IsSuite => $IsSuite,
+ TaskTimedOut => $TaskTimedOut,
+
+ TimedOut => undef,
+ Failures => undef,
+ Errors => [],
+ };
+
+ my $Cur = _NewCurrentUnit("", "");
+ foreach my $Line (<$LogFile>)
+ {
+ $Cur->{UnitSize} += length($Line);
+ if ($Line =~ m%^([_.a-z0-9-]+):([_a-z0-9]*) (start|skipped) (?:-|[/_.a-z0-9]+) (?:-|[.0-9a-f]+)\r?$%)
+ {
+ my ($Dll, $Unit, $Type) = ($1, $2, $3);
+
+ # Close the previous test unit
+ _CloseTestUnit($Parser, $Cur, 0) if ($Cur->{Dll} ne "");
+ $Cur = _NewCurrentUnit($Dll, $Unit);
+
+ # Recognize skipped messages in case we need to skip tests in the VMs
+ $Cur->{Rc} = 0 if ($Type eq "skipped");
+ }
+ elsif ($Line =~ /^([_a-z0-9]+)\.c:\d+: Test (?:failed|succeeded inside todo block): / or
+ ($Cur->{Unit} ne "" and
+ $Line =~ /($Cur->{Unit})\.c:\d+: Test (?:failed|succeeded inside todo block): /))
+ {
+ _CheckUnit($Parser, $Cur, $1, "failure");
+ $Cur->{LineFailures}++;
+ }
+ elsif ($Line =~ /^([_a-z0-9]+)\.c:\d+: Test marked todo: / or
+ ($Cur->{Unit} ne "" and
+ $Line =~ /($Cur->{Unit})\.c:\d+: Test marked todo: /))
+ {
+ _CheckUnit($Parser, $Cur, $1, "todo");
+ $Cur->{LineTodos}++;
+ }
+ # TestLauncher's skip message is quite broken
+ elsif ($Line =~ /^([_a-z0-9]+)(?:\.c)?:\d+:? Tests? skipped: / or
+ ($Cur->{Unit} ne "" and
+ $Line =~ /($Cur->{Unit})(?:\.c)?:\d+:? Tests? skipped: /))
+ {
+ my $Unit = $1;
+ # Don't complain and don't count misplaced skips. Only complain if they
+ # are misreported (see _CloseTestUnit). Also TestLauncher uses the wrong
+ # name in its skip message when skipping tests.
+ if ($Unit eq $Cur->{Unit} or $Cur->{Unit} eq "" or $Unit eq $Cur->{Dll})
+ {
+ $Cur->{LineSkips}++;
+ }
+ }
+ elsif ($Line =~ /^Fatal: test '([_a-z0-9]+)' does not exist/)
+ {
+ # This also replaces a test summary line.
+ $Cur->{Pids}->{0} = 1;
+ $Cur->{SummaryFailures}++;
+ $Parser->{IsWineTest} = 1;
+
+ $Cur->{LineFailures}++;
+ }
+ elsif ($Line =~ /^(?:([0-9a-f]+):)?([_.a-z0-9]+): unhandled exception [0-9a-fA-F]{8} at / or
+ ($Cur->{Unit} ne "" and
+ $Line =~ /(?:([0-9a-f]+):)?($Cur->{Unit}): unhandled exception [0-9a-fA-F]{8} at /))
+ {
+ my ($Pid, $Unit) = ($1, $2);
+
+ if ($Unit eq $Cur->{Unit})
+ {
+ # This also replaces a test summary line.
+ $Cur->{Pids}->{$Pid || 0} = 1;
+ $Cur->{SummaryFailures}++;
+ }
+ _CheckUnit($Parser, $Cur, $Unit, "unhandled exception");
+ $Cur->{LineFailures}++;
+ }
+ elsif ($Line =~ /^(?:([0-9a-f]+):)?([_a-z0-9]+): \d+ tests? executed \((\d+) marked as todo, (\d+) failures?\), (\d+) skipped\./ or
+ ($Cur->{Unit} ne "" and
+ $Line =~ /(?:([0-9a-f]+):)?($Cur->{Unit}): \d+ tests? executed \((\d+) marked as todo, (\d+) failures?\), (\d+) skipped\./))
+ {
+ my ($Pid, $Unit, $Todos, $Failures, $Skips) = ($1, $2, $3, $4, $5);
+
+ # Dlls that have only one test unit will run it even if there is
+ # no argument. Also TestLauncher uses the wrong name in its test
+ # summary line when skipping tests.
+ if ($Unit eq $Cur->{Unit} or $Cur->{Unit} eq "" or $Unit eq $Cur->{Dll})
+ {
+ # There may be more than one summary line due to child processes
+ $Cur->{Pids}->{$Pid || 0} = 1;
+ $Cur->{SummaryFailures} += $Failures;
+ $Cur->{SummaryTodos} += $Todos;
+ $Cur->{SummarySkips} += $Skips;
+ $Parser->{IsWineTest} = 1;
+ }
+ else
+ {
+ _CheckUnit($Parser, $Cur, $Unit, "test summary") if ($Todos or $Failures);
+ }
+ }
+ elsif ($Line =~ /^([_.a-z0-9-]+):([_a-z0-9]*)(?::([0-9a-f]+))? done \((-?\d+)\)(?:\r?$| in)/ or
+ ($Cur->{Dll} ne "" and
+ $Line =~ /(\Q$Cur->{Dll}\E):([_a-z0-9]*)(?::([0-9a-f]+))? done \((-?\d+)\)(?:\r?$| in)/))
+ {
+ my ($Dll, $Unit, $Pid, $Rc) = ($1, $2, $3, $4);
+
+ if ($Parser->{IsWineTest} and ($Dll ne $Cur->{Dll} or $Unit ne $Cur->{Unit}))
+ {
+ # First close the current test unit taking into account
+ # it may have been polluted by the new one.
+ $Cur->{IsBroken} = 1;
+ _CloseTestUnit($Parser, $Cur, 0);
+
+ # Then switch to the new one, warning it's missing a start line,
+ # and that its results may be inconsistent.
+ ($Cur->{Dll}, $Cur->{Unit}) = ($Dll, $Unit);
+ _AddError($Parser, "had no start line (or it is garbled)", $Cur);
+ $Cur->{IsBroken} = 1;
+ }
+
+ if ($Rc == 258)
+ {
+ # The done line will already be shown as a timeout (see JobDetails)
+ # so record the failure but don't add an error message.
+ $Parser->{Failures}++;
+ $Cur->{IsBroken} = 1;
+ $Parser->{TimedOut} = $Parser->{IsSuite};
+ }
+ elsif ((!$Pid and !%{$Cur->{Pids}}) or
+ ($Pid and !$Cur->{Pids}->{$Pid} and !$Cur->{Pids}->{0}))
+ {
+ # The main summary line is missing
+ if ($Rc & 0xc0000000)
+ {
+ _AddError($Parser, sprintf("%s:%s crashed (%08x)", $Dll, $Unit, $Rc & 0xffffffff));
+ $Cur->{IsBroken} = 1;
+ }
+ elsif ($Parser->{IsWineTest} and !$Cur->{IsBroken})
+ {
+ _AddError($Parser, "$Dll:$Unit has no test summary line (early exit of the main process?)");
+ }
+ }
+ elsif ($Rc & 0xc0000000)
+ {
+ # We know the crash happened in the main process which means we got
+ # an "unhandled exception" message. So there is no need to add an
+ # extra message or to increment the failure count. Still note that
+ # there may be inconsistencies (e.g. unreported todos or skips).
+ $Cur->{IsBroken} = 1;
+ }
+ $Cur->{Rc} = $Rc;
+ }
+ }
+ $Cur->{IsBroken} = 1 if ($Parser->{TaskTimedOut});
+ _CloseTestUnit($Parser, $Cur, 1);
+ close($LogFile);
+
+ return ($Parser->{Failures}, $Parser->{Errors}, $Parser->{TimedOut});
+}
+
+
#
# Log querying and formatting
#
--
2.18.0
June 27, 2018
[PATCH 1/3] testbot/WineRunWineTest: Ignore other errors if we get a badpatch error.
by Francois Gouget
Just like finding a success line in the task log proves that it was
successful no matter what happened before, a 'badpatch' line
conclusively determines the task status.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
---
This is the same patch as yesterday but integrated into this series
since they conflict if applied out of order.
testbot/bin/WineRunWineTest.pl | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/testbot/bin/WineRunWineTest.pl b/testbot/bin/WineRunWineTest.pl
index 0aba7ecfc..53a2a0929 100755
--- a/testbot/bin/WineRunWineTest.pl
+++ b/testbot/bin/WineRunWineTest.pl
@@ -356,8 +356,8 @@ if (!$Pid)
#
-# From that point on we want to at least try to grab the task
-# log before giving up
+# From that point on we want to at least try to grab the task log
+# before giving up
#
my ($NewStatus, $ErrMessage, $TAError, $TaskTimedOut);
@@ -391,7 +391,9 @@ if ($TA->GetFile("Task.log", "$TaskDir/log"))
}
elsif ($Result eq "badpatch")
{
+ # This too is conclusive enough to ignore other errors.
$NewStatus = "badpatch";
+ $TAError = $ErrMessage = undef;
}
elsif ($Result =~ s/^nolog://)
{
--
2.18.0
June 27, 2018
Bug #45385 related to keyboard and probably wineserver - where to start the search
by John Found
I just reported bug #45385 (https://bugs.winehq.org/show_bug.cgi?id=45385) and want to try to fix it.
So I want to ask about some preliminary directions - where to check the code,
what is the general structure of the code related to the bug subject, possible suspicious places.
Here is the full bug report in order to save you a visit to the bug tracker:
> I noticed that the state of the keys sometimes sticks in pressed state.
>
> This happens when cycling windows with some shortcut key combination.
>
> For example if cycling with Alt+Tab, on pressing Alt, the program gets WM_KEYDOWN and the state of the VK_MENU becomes pressed. But after cycling windows, the program does not get WM_KEYUP because the window is not focused and VK_MENU (and the respective VK_LMENU or VK_RMENU) remain in pressed state.
>
> When cycling back to the program window, the window get focused only after releasing Alt key, so it does not get this event as well.
>
> If cycling windows with another shortcut key combination (for example Alt+Shift+Tab - for backward cycling) both VK_MENU and VK_SHIFT keys stick.
>
> In the same time, GetAsyncKeyState returns the proper state of the keys.
>
> Note1: The problem is obviously in the wineserver code, because it handles the key state tables for the different threads.
>
> Note2: The effect happens only sometimes. It seems the code for proper processing is already there, but some racing conditions have place.
>
> Note3: There is some probability that the effect is in result of my application code, but it never happens on real Windows, so I considered it a bug.
>
> Note4: I tried to workaround this problem by reading the whole table by GetAsyncKeyState and setting it then with SetKeyboardState on WM_ACTIVATE message of the main window. This workaround actually works, but is too ugly IMO.
> The same trick on WM_ACTIVATEAPP does not work.
--
John Found <johnfound(a)asm32.info>
June 27, 2018
[PATCH] msvcp120: Add test for Concurrent_vector_Internal_resize and reverse.
by Hua Meng
Signed-off-by: Hua meng <161220092(a)smail.nju.edu.cn>
---
dlls/msvcp120/tests/msvcp120.c | 86 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 86 insertions(+)
diff --git a/dlls/msvcp120/tests/msvcp120.c b/dlls/msvcp120/tests/msvcp120.c
index 2974482ec1..1a20f4ddde 100755
--- a/dlls/msvcp120/tests/msvcp120.c
+++ b/dlls/msvcp120/tests/msvcp120.c
@@ -124,6 +124,8 @@ static void * (WINAPI *call_thiscall_func5)( void *func, void *this, const void
const void *b, const void *c, const void *d );
static void * (WINAPI *call_thiscall_func6)( void *func, void *this, const void *a,
const void *b, const void *c, const void *d, const void *e );
+static void * (WINAPI *call_thiscall_func7)( void *func, void *this, const void *a,
+ const void *b, const void *c, const void *d, const void *e, const void *f );
static void init_thiscall_thunk(void)
{
@@ -140,6 +142,7 @@ static void init_thiscall_thunk(void)
call_thiscall_func4 = (void *)thunk;
call_thiscall_func5 = (void *)thunk;
call_thiscall_func6 = (void *)thunk;
+ call_thiscall_func7 = (void *)thunk;
}
#define call_func1(func,_this) call_thiscall_func1(func,_this)
@@ -152,6 +155,8 @@ static void init_thiscall_thunk(void)
(const void*)(b),(const void*)(c),(const void*)(d))
#define call_func6(func,_this,a,b,c,d,e) call_thiscall_func6(func,_this,(const void*)(a),\
(const void*)(b),(const void*)(c),(const void*)(d),(const void*)(e))
+#define call_func7(func,_this,a,b,c,d,e,f) call_thiscall_func7(func,_this,(const void*)(a),\
+ (const void*)(b),(const void*)(c),(const void*)(d),(const void*)(e),(const void*)(f))
#else
#define init_thiscall_thunk()
@@ -161,6 +166,7 @@ static void init_thiscall_thunk(void)
#define call_func4(func,_this,a,b,c) func(_this,a,b,c)
#define call_func5(func,_this,a,b,c,d) func(_this,a,b,c,d)
#define call_func6(func,_this,a,b,c,d,e) func(_this,a,b,c,d,e)
+#define call_func7(func,_this,a,b,c,d,e,f) func(_this,a,b,c,d,e,f)
#endif /* __i386__ */
static inline float __port_infinity(void)
@@ -422,6 +428,11 @@ static size_t (__thiscall *p_vector_base_v4__Internal_grow_by)(
vector_base_v4*, size_t, size_t, void (__cdecl*)(void*, const void*, size_t), const void *);
static size_t (__thiscall *p_vector_base_v4__Internal_grow_to_at_least_with_result)(
vector_base_v4*, size_t, size_t, void (__cdecl*)(void*, const void*, size_t), const void *);
+static void (__thiscall *p_vector_base_v4__Internal_reserve)(
+ vector_base_v4*, size_t, size_t, size_t);
+static void (__thiscall *p_vector_base_v4__Internal_resize)(
+ vector_base_v4*, size_t, size_t, size_t, void (__cdecl*)(void*, size_t),
+ void (__cdecl *copy)(void*, const void*, size_t), const void*);
static HMODULE msvcp;
#define SETNOFAIL(x,y) x = (void*)GetProcAddress(msvcp,y)
@@ -576,6 +587,10 @@ static BOOL init(void)
"?_Internal_grow_by(a)_Concurrent_vector_base_v4@details(a)Concurrency@@IEAA_K_K0P6AXPEAXPEBX0(a)Z2@Z");
SET(p_vector_base_v4__Internal_grow_to_at_least_with_result,
"?_Internal_grow_to_at_least_with_result(a)_Concurrent_vector_base_v4@details(a)Concurrency@@IEAA_K_K0P6AXPEAXPEBX0(a)Z2@Z");
+ SET(p_vector_base_v4__Internal_reserve,
+ "?_Internal_reserve(a)_Concurrent_vector_base_v4@details(a)Concurrency@@IEAAX_K00(a)Z");
+ SET(p_vector_base_v4__Internal_resize,
+ "?_Internal_resize(a)_Concurrent_vector_base_v4@details(a)Concurrency@@IEAAX_K00P6AXPEAX0(a)ZP6AX1PEBX0@Z3(a)Z");
} else {
SET(p_tr2_sys__File_size,
"?_File_size(a)sys@tr2(a)std@@YA_KPBD(a)Z");
@@ -699,6 +714,10 @@ static BOOL init(void)
"?_Internal_grow_by(a)_Concurrent_vector_base_v4@details(a)Concurrency@@IAEIIIP6AXPAXPBXI(a)Z1@Z");
SET(p_vector_base_v4__Internal_grow_to_at_least_with_result,
"?_Internal_grow_to_at_least_with_result(a)_Concurrent_vector_base_v4@details(a)Concurrency@@IAEIIIP6AXPAXPBXI(a)Z1@Z");
+ SET(p_vector_base_v4__Internal_reserve,
+ "?_Internal_reserve(a)_Concurrent_vector_base_v4@details(a)Concurrency@@IAEXIII(a)Z");
+ SET(p_vector_base_v4__Internal_resize,
+ "?_Internal_resize(a)_Concurrent_vector_base_v4@details(a)Concurrency@@IAEXIIIP6AXPAXI(a)ZP6AX0PBXI@Z2(a)Z");
#else
SET(p__Thrd_current,
"_Thrd_current");
@@ -750,6 +769,10 @@ static BOOL init(void)
"?_Internal_grow_by(a)_Concurrent_vector_base_v4@details(a)Concurrency@@IAAIIIP6AXPAXPBXI(a)Z1@Z");
SET(p_vector_base_v4__Internal_grow_to_at_least_with_result,
"?_Internal_grow_to_at_least_with_result(a)_Concurrent_vector_base_v4@details(a)Concurrency@@IAAIIIP6AXPAXPBXI(a)Z1@Z");
+ SET(p_vector_base_v4__Internal_reserve,
+ "?_Internal_reserve(a)_Concurrent_vector_base_v4@details(a)Concurrency@@IAAXIII(a)Z");
+ SET(p_vector_base_v4__Internal_resize,
+ "?_Internal_resize(a)_Concurrent_vector_base_v4@details(a)Concurrency@@IAEXIIIP6AXPAXI(a)ZP6AX0PBXI@Z2(a)Z");
#endif
}
SET(p__Thrd_equal,
@@ -3082,6 +3105,69 @@ static void test_vector_base_v4(void)
CHECK_CALLED(concurrent_vector_int_destroy);
concurrent_vector_int_dtor(&v2);
+ /* test for _Internal_reserve */
+ concurrent_vector_int_ctor(&v2);
+ SET_EXPECT(concurrent_vector_int_alloc);
+ data = call_func3(p_vector_base_v4__Internal_push_back, &v2, sizeof(int), &idx);
+ CHECK_CALLED(concurrent_vector_int_alloc);
+ ok(data != NULL, "_Internal_push_back returned NULL\n");
+ data = call_func3(p_vector_base_v4__Internal_push_back, &v2, sizeof(int), &idx);
+ ok(data != NULL, "_Internal_push_back returned NULL\n");
+ vector_elem_count += 2;
+ ok(v2.first_block == 1, "v2.first_block got %ld expected 1\n", (long)v2.first_block);
+ ok(v2.early_size == 2, "v2.early_size got %ld expected 2\n", (long)v2.early_size);
+ SET_EXPECT(concurrent_vector_int_alloc);
+ call_func4(p_vector_base_v4__Internal_reserve,
+ &v2, 3, sizeof(int), 4);
+ CHECK_CALLED(concurrent_vector_int_alloc);
+ ok(v2.first_block == 1, "v2.first_block got %ld expected 1\n", (long)v2.first_block);
+ ok(v2.early_size == 2, "v2.early_size got %ld expected 2\n", (long)v2.early_size);
+ SET_EXPECT(concurrent_vector_int_alloc);
+ call_func4(p_vector_base_v4__Internal_reserve,
+ &v2, 5, sizeof(int), 8);
+ CHECK_CALLED(concurrent_vector_int_alloc);
+ ok(v2.first_block == 1, "v2.first_block got %ld expected 1\n", (long)v2.first_block);
+ ok(v2.early_size == 2, "v2.early_size got %ld expected 2\n", (long)v2.early_size);
+ SET_EXPECT(concurrent_vector_int_destroy);
+ size = (size_t)call_func2(p_vector_base_v4__Internal_clear,
+ &v2, concurrent_vector_int_destroy);
+ ok(size == 3, "_Internal_clear returned %ld expected 3\n", (long)size);
+ CHECK_CALLED(concurrent_vector_int_destroy);
+ concurrent_vector_int_dtor(&v2);
+
+ /* test for _Internal_resize */
+ concurrent_vector_int_ctor(&v2);
+ SET_EXPECT(concurrent_vector_int_alloc);
+ data = call_func3(p_vector_base_v4__Internal_push_back, &v2, sizeof(int), &idx);
+ CHECK_CALLED(concurrent_vector_int_alloc);
+ ok(data != NULL, "_Internal_push_back returned NULL\n");
+ data = call_func3(p_vector_base_v4__Internal_push_back, &v2, sizeof(int), &idx);
+ ok(data != NULL, "_Internal_push_back returned NULL\n");
+ vector_elem_count += 2;
+ ok(v2.first_block == 1, "v2.first_block got %ld expected 1\n", (long)v2.first_block);
+ ok(v2.early_size == 2, "v2.early_size got %ld expected 2\n", (long)v2.early_size);
+ i = 0;
+ SET_EXPECT(concurrent_vector_int_destroy);
+ call_func7(p_vector_base_v4__Internal_resize,
+ &v2, 1, sizeof(int), 4, concurrent_vector_int_destroy, concurrent_vector_int_copy, &i);
+ CHECK_CALLED(concurrent_vector_int_destroy);
+ ok(v2.first_block == 1, "v2.first_block got %ld expected 1\n", (long)v2.first_block);
+ ok(v2.early_size == 1, "v2.early_size got %ld expected 1\n", (long)v2.early_size);
+ SET_EXPECT(concurrent_vector_int_alloc);
+ SET_EXPECT(concurrent_vector_int_copy);
+ call_func7(p_vector_base_v4__Internal_resize,
+ &v2, 3, sizeof(int), 4, concurrent_vector_int_destroy, concurrent_vector_int_copy, &i);
+ CHECK_CALLED(concurrent_vector_int_alloc);
+ CHECK_CALLED(concurrent_vector_int_copy);
+ ok(v2.first_block == 1, "v2.first_block got %ld expected 1\n", (long)v2.first_block);
+ ok(v2.early_size == 3, "v2.early_size got %ld expected 3\n", (long)v2.early_size);
+ SET_EXPECT(concurrent_vector_int_destroy);
+ size = (size_t)call_func2(p_vector_base_v4__Internal_clear,
+ &v2, concurrent_vector_int_destroy);
+ ok(size == 2, "_Internal_clear returned %ld expected 2\n", (long)size);
+ CHECK_CALLED(concurrent_vector_int_destroy);
+ concurrent_vector_int_dtor(&v2);
+
SET_EXPECT(concurrent_vector_int_destroy);
size = (size_t)call_func2(p_vector_base_v4__Internal_clear,
&vector, concurrent_vector_int_destroy);
--
2.11.0
June 27, 2018
[PATCH] configure.ac: use -Wno-unused-command-line-argument if supported
by Austin English
This avoids ~9000 warnings like:
austin(a)gcc113:~$ grep 'warning: argument unused during compilation'
without-patch.build.log | sort -u
clang-6.0: warning: argument unused during compilation: '-I ../atl'
[-Wunused-command-line-argument]
clang-6.0: warning: argument unused during compilation: '-I
../d3dcompiler_43' [-Wunused-command-line-argument]
clang-6.0: warning: argument unused during compilation: '-I ../d3dx11_43'
[-Wunused-command-line-argument]
clang-6.0: warning: argument unused during compilation: '-I ../d3dx9_36'
[-Wunused-command-line-argument]
clang-6.0: warning: argument unused during compilation: '-I
../../../include/msvcrt' [-Wunused-command-line-argument]
clang-6.0: warning: argument unused during compilation: '-I
../../include/msvcrt' [-Wunused-command-line-argument]
clang-6.0: warning: argument unused during compilation: '-I
../../../include' [-Wunused-command-line-argument]
clang-6.0: warning: argument unused during compilation: '-I ../../include'
[-Wunused-command-line-argument]
clang-6.0: warning: argument unused during compilation: '-I ../include'
[-Wunused-command-line-argument]
clang-6.0: warning: argument unused during compilation: '-I ../msvcm80'
[-Wunused-command-line-argument]
clang-6.0: warning: argument unused during compilation: '-I ../msvcp90'
[-Wunused-command-line-argument]
clang-6.0: warning: argument unused during compilation: '-I ../msvcrt'
[-Wunused-command-line-argument]
clang-6.0: warning: argument unused during compilation: '-I
/usr/include/dbus-1.0' [-Wunused-command-line-argument]
clang-6.0: warning: argument unused during compilation: '-I
/usr/include/freetype2' [-Wunused-command-line-argument]
clang-6.0: warning: argument unused during compilation: '-I
/usr/include/libpng12' [-Wunused-command-line-argument]
clang-6.0: warning: argument unused during compilation: '-I
/usr/include/libxml2' [-Wunused-command-line-argument]
clang-6.0: warning: argument unused during compilation: '-I
/usr/include/p11-kit-1' [-Wunused-command-line-argument]
clang-6.0: warning: argument unused during compilation: '-I
/usr/lib/aarch64-linux-gnu/dbus-1.0/include'
[-Wunused-command-line-argument]
clang-6.0: warning: argument unused during compilation: '-I ../wscript'
[-Wunused-command-line-argument]
clang-6.0: warning: argument unused during compilation: '-I ./..'
[-Wunused-command-line-argument]
clang-6.0: warning: argument unused during compilation: '-I ../..'
[-Wunused-command-line-argument]
clang-6.0: warning: argument unused during compilation: '-I .'
[-Wunused-command-line-argument]
clang-6.0: warning: argument unused during compilation: '-I ../xinput1_3'
[-Wunused-command-line-argument]
June 27, 2018
Re: [PATCH] d3dx9_36: fixed size to MBtoWC
by Matteo Bruni
With the subject changed to something along the lines of "d3dx9/tests:
Fix wide string size in MultiByteToWideChar() call." this is:
Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com>
June 26, 2018
[PATCH] shlwapi/tests: Pass the correct buffer size to WideCharToMultiByte()
by Michael Stefaniuc
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/shlwapi/tests/string.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/shlwapi/tests/string.c b/dlls/shlwapi/tests/string.c
index c7a2f5d346..9114ad88e1 100644
--- a/dlls/shlwapi/tests/string.c
+++ b/dlls/shlwapi/tests/string.c
@@ -694,7 +694,7 @@ static void test_StrFormatKBSizeW(void)
while(result->value)
{
pStrFormatKBSizeW(result->value, szBuffW, 256);
- WideCharToMultiByte(CP_ACP,0,szBuffW,-1,szBuff,sizeof(szBuff)/sizeof(WCHAR),NULL,NULL);
+ WideCharToMultiByte(CP_ACP, 0, szBuffW, -1, szBuff, ARRAY_SIZE(szBuff), NULL, NULL);
ok(!strcmp(result->kb_size, szBuff), "Formatted %s wrong: got %s, expected %s\n",
wine_dbgstr_longlong(result->value), szBuff, result->kb_size);
--
2.14.4
June 26, 2018
[PATCH] shlwapi/tests: Pass the correct buffer size to PathUnExpandEnvStringsW()
by Michael Stefaniuc
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/shlwapi/tests/path.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/shlwapi/tests/path.c b/dlls/shlwapi/tests/path.c
index d25620b3d5..4a6fbd91f6 100644
--- a/dlls/shlwapi/tests/path.c
+++ b/dlls/shlwapi/tests/path.c
@@ -1595,7 +1595,7 @@ static void test_PathUnExpandEnvStrings(void)
buffW[0] = 0;
lstrcpyW(pathW, sysdrvW);
lstrcatW(pathW, sysdrvW);
- ret = pPathUnExpandEnvStringsW(pathW, buffW, sizeof(buff)/sizeof(WCHAR));
+ ret = pPathUnExpandEnvStringsW(pathW, buffW, ARRAY_SIZE(buffW));
ok(ret, "got %d\n", ret);
/* expected string */
lstrcpyW(pathW, sysdriveW);
--
2.14.4
June 26, 2018
[PATCH] shlwapi/tests: Use the available ARRAY_SIZE() macro
by Michael Stefaniuc
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/shlwapi/tests/assoc.c | 8 +++---
dlls/shlwapi/tests/clist.c | 6 ++---
dlls/shlwapi/tests/istream.c | 6 ++---
dlls/shlwapi/tests/ordinal.c | 56 +++++++++++++++++++--------------------
dlls/shlwapi/tests/path.c | 20 +++++++-------
dlls/shlwapi/tests/string.c | 62 ++++++++++++++++++++++----------------------
dlls/shlwapi/tests/url.c | 42 +++++++++++++++---------------
7 files changed, 99 insertions(+), 101 deletions(-)
diff --git a/dlls/shlwapi/tests/assoc.c b/dlls/shlwapi/tests/assoc.c
index 266f3fd44a..4b461128dc 100644
--- a/dlls/shlwapi/tests/assoc.c
+++ b/dlls/shlwapi/tests/assoc.c
@@ -62,7 +62,7 @@ static void test_getstring_bad(void)
"Unexpected result : %08x\n", hr);
ok(len == 0xdeadbeef, "got %u\n", len);
- len = sizeof(buf)/sizeof(buf[0]);
+ len = ARRAY_SIZE(buf);
hr = pAssocQueryStringW(0, ASSOCSTR_EXECUTABLE, dotBad, open, buf, &len);
ok(hr == E_FAIL ||
hr == HRESULT_FROM_WIN32(ERROR_NO_ASSOCIATION) /* Win9x/WinMe/NT4/W2K/Vista/W2K8 */ ||
@@ -70,8 +70,8 @@ static void test_getstring_bad(void)
"Unexpected result : %08x\n", hr);
if (hr == S_OK)
{
- ok(len < sizeof(buf)/sizeof(buf[0]), "got %u\n", len);
- ok(!lstrcmpiW(buf + len - sizeof(openwith)/sizeof(openwith[0]), openwith), "wrong data\n");
+ ok(len < ARRAY_SIZE(buf), "got %u\n", len);
+ ok(!lstrcmpiW(buf + len - ARRAY_SIZE(openwith), openwith), "wrong data\n");
}
len = 0xdeadbeef;
@@ -105,7 +105,7 @@ static void test_getstring_bad(void)
hr == HRESULT_FROM_WIN32(ERROR_NOT_FOUND) /* Win8 */ ||
hr == S_FALSE, /* Win10 */
"Unexpected result : %08x\n", hr);
- ok((hr == S_FALSE && len < sizeof(buf)/sizeof(buf[0])) || len == 0xdeadbeef,
+ ok((hr == S_FALSE && len < ARRAY_SIZE(buf)) || len == 0xdeadbeef,
"got hr=%08x and len=%u\n", hr, len);
len = 0xdeadbeef;
diff --git a/dlls/shlwapi/tests/clist.c b/dlls/shlwapi/tests/clist.c
index b930470806..0adb0d47c0 100644
--- a/dlls/shlwapi/tests/clist.c
+++ b/dlls/shlwapi/tests/clist.c
@@ -362,8 +362,7 @@ static void test_CList(void)
if (hRet == S_OK)
{
/* 1 call for each element, + 1 for OK (use our null element for this) */
- ok(streamobj.writecalls == sizeof(SHLWAPI_CLIST_items)/sizeof(SHLWAPI_CLIST),
- "wrong call count\n");
+ ok(streamobj.writecalls == ARRAY_SIZE(SHLWAPI_CLIST_items), "wrong call count\n");
ok(streamobj.readcalls == 0,"called Read() in write\n");
ok(streamobj.seekcalls == 0,"called Seek() in write\n");
}
@@ -433,8 +432,7 @@ static void test_CList(void)
{
ok(streamobj.readbeyondend == FALSE, "read beyond end\n");
/* 2 calls per item, but only 1 for the terminator */
- ok(streamobj.readcalls == sizeof(SHLWAPI_CLIST_items)/sizeof(SHLWAPI_CLIST)*2-1,
- "wrong call count\n");
+ ok(streamobj.readcalls == ARRAY_SIZE(SHLWAPI_CLIST_items) * 2 - 1, "wrong call count\n");
ok(streamobj.writecalls == 0, "called Write() from create\n");
ok(streamobj.seekcalls == 0,"called Seek() from create\n");
diff --git a/dlls/shlwapi/tests/istream.c b/dlls/shlwapi/tests/istream.c
index 926f2f8157..300e9b9c00 100644
--- a/dlls/shlwapi/tests/istream.c
+++ b/dlls/shlwapi/tests/istream.c
@@ -726,12 +726,12 @@ START_TEST(istream)
int i, j, k;
- for (i = 0; i != sizeof(stgm_access)/sizeof(stgm_access[0]); i++) {
- for (j = 0; j != sizeof(stgm_sharing)/sizeof(stgm_sharing[0]); j ++) {
+ for (i = 0; i != ARRAY_SIZE(stgm_access); i++) {
+ for (j = 0; j != ARRAY_SIZE(stgm_sharing); j ++) {
test_SHCreateStreamOnFileA(stgm_access[i], stgm_sharing[j]);
test_SHCreateStreamOnFileW(stgm_access[i], stgm_sharing[j]);
- for (k = 0; k != sizeof(stgm_flags)/sizeof(stgm_flags[0]); k++)
+ for (k = 0; k != ARRAY_SIZE(stgm_flags); k++)
test_SHCreateStreamOnFileEx(stgm_access[i], stgm_sharing[j] | stgm_flags[k]);
}
}
diff --git a/dlls/shlwapi/tests/ordinal.c b/dlls/shlwapi/tests/ordinal.c
index db59e625f8..97e4606443 100644
--- a/dlls/shlwapi/tests/ordinal.c
+++ b/dlls/shlwapi/tests/ordinal.c
@@ -1862,14 +1862,14 @@ if (0)
/* all combinations documented as invalid succeeded */
flags = FDTF_SHORTTIME | FDTF_LONGTIME;
SetLastError(0xdeadbeef);
- ret = pSHFormatDateTimeW(&filetime, &flags, buff, sizeof(buff)/sizeof(WCHAR));
+ ret = pSHFormatDateTimeW(&filetime, &flags, buff, ARRAY_SIZE(buff));
ok(ret == lstrlenW(buff)+1 || ret == lstrlenW(buff),
"expected %d or %d, got %d\n", lstrlenW(buff)+1, lstrlenW(buff), ret);
ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %d\n", GetLastError());
flags = FDTF_SHORTDATE | FDTF_LONGDATE;
SetLastError(0xdeadbeef);
- ret = pSHFormatDateTimeW(&filetime, &flags, buff, sizeof(buff)/sizeof(WCHAR));
+ ret = pSHFormatDateTimeW(&filetime, &flags, buff, ARRAY_SIZE(buff));
ok(ret == lstrlenW(buff)+1 || ret == lstrlenW(buff),
"expected %d or %d, got %d\n", lstrlenW(buff)+1, lstrlenW(buff), ret);
ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %d\n", GetLastError());
@@ -1877,7 +1877,7 @@ if (0)
flags = FDTF_SHORTDATE | FDTF_LTRDATE | FDTF_RTLDATE;
SetLastError(0xdeadbeef);
buff[0] = 0; /* NT4 doesn't clear the buffer on failure */
- ret = pSHFormatDateTimeW(&filetime, &flags, buff, sizeof(buff)/sizeof(WCHAR));
+ ret = pSHFormatDateTimeW(&filetime, &flags, buff, ARRAY_SIZE(buff));
ok(ret == lstrlenW(buff)+1 || ret == lstrlenW(buff),
"expected %d or %d, got %d\n", lstrlenW(buff)+1, lstrlenW(buff), ret);
ok(GetLastError() == 0xdeadbeef,
@@ -1885,67 +1885,67 @@ if (0)
/* now check returned strings */
flags = FDTF_SHORTTIME;
- ret = pSHFormatDateTimeW(&filetime, &flags, buff, sizeof(buff)/sizeof(WCHAR));
+ ret = pSHFormatDateTimeW(&filetime, &flags, buff, ARRAY_SIZE(buff));
ok(ret == lstrlenW(buff)+1 || ret == lstrlenW(buff),
"expected %d or %d, got %d\n", lstrlenW(buff)+1, lstrlenW(buff), ret);
SetLastError(0xdeadbeef);
- ret = GetTimeFormatW(LOCALE_USER_DEFAULT, TIME_NOSECONDS, &st, NULL, buff2, sizeof(buff2)/sizeof(WCHAR));
+ ret = GetTimeFormatW(LOCALE_USER_DEFAULT, TIME_NOSECONDS, &st, NULL, buff2, ARRAY_SIZE(buff2));
ok(ret == lstrlenW(buff2)+1, "expected %d, got %d\n", lstrlenW(buff2)+1, ret);
ok(lstrcmpW(buff, buff2) == 0, "expected equal strings\n");
flags = FDTF_LONGTIME;
- ret = pSHFormatDateTimeW(&filetime, &flags, buff, sizeof(buff)/sizeof(WCHAR));
+ ret = pSHFormatDateTimeW(&filetime, &flags, buff, ARRAY_SIZE(buff));
ok(ret == lstrlenW(buff)+1 || ret == lstrlenW(buff),
"expected %d or %d, got %d\n", lstrlenW(buff)+1, lstrlenW(buff), ret);
- ret = GetTimeFormatW(LOCALE_USER_DEFAULT, 0, &st, NULL, buff2, sizeof(buff2)/sizeof(WCHAR));
+ ret = GetTimeFormatW(LOCALE_USER_DEFAULT, 0, &st, NULL, buff2, ARRAY_SIZE(buff2));
ok(ret == lstrlenW(buff2)+1, "expected %d, got %d\n", lstrlenW(buff2)+1, ret);
ok(lstrcmpW(buff, buff2) == 0, "expected equal strings\n");
/* both time flags */
flags = FDTF_LONGTIME | FDTF_SHORTTIME;
- ret = pSHFormatDateTimeW(&filetime, &flags, buff, sizeof(buff)/sizeof(WCHAR));
+ ret = pSHFormatDateTimeW(&filetime, &flags, buff, ARRAY_SIZE(buff));
ok(ret == lstrlenW(buff)+1 || ret == lstrlenW(buff),
"expected %d or %d, got %d\n", lstrlenW(buff)+1, lstrlenW(buff), ret);
- ret = GetTimeFormatW(LOCALE_USER_DEFAULT, 0, &st, NULL, buff2, sizeof(buff2)/sizeof(WCHAR));
+ ret = GetTimeFormatW(LOCALE_USER_DEFAULT, 0, &st, NULL, buff2, ARRAY_SIZE(buff2));
ok(ret == lstrlenW(buff2)+1, "expected %d, got %d\n", lstrlenW(buff2)+1, ret);
ok(lstrcmpW(buff, buff2) == 0, "expected equal string\n");
flags = FDTF_SHORTDATE;
- ret = pSHFormatDateTimeW(&filetime, &flags, buff, sizeof(buff)/sizeof(WCHAR));
+ ret = pSHFormatDateTimeW(&filetime, &flags, buff, ARRAY_SIZE(buff));
ok(ret == lstrlenW(buff)+1 || ret == lstrlenW(buff),
"expected %d or %d, got %d\n", lstrlenW(buff)+1, lstrlenW(buff), ret);
- ret = GetDateFormatW(LOCALE_USER_DEFAULT, DATE_SHORTDATE, &st, NULL, buff2, sizeof(buff2)/sizeof(WCHAR));
+ ret = GetDateFormatW(LOCALE_USER_DEFAULT, DATE_SHORTDATE, &st, NULL, buff2, ARRAY_SIZE(buff2));
ok(ret == lstrlenW(buff2)+1, "expected %d, got %d\n", lstrlenW(buff2)+1, ret);
ok(lstrcmpW(buff, buff2) == 0, "expected equal strings\n");
flags = FDTF_LONGDATE;
- ret = pSHFormatDateTimeW(&filetime, &flags, buff, sizeof(buff)/sizeof(WCHAR));
+ ret = pSHFormatDateTimeW(&filetime, &flags, buff, ARRAY_SIZE(buff));
ok(ret == lstrlenW(buff)+1 || ret == lstrlenW(buff),
"expected %d or %d, got %d\n", lstrlenW(buff)+1, lstrlenW(buff), ret);
- ret = GetDateFormatW(LOCALE_USER_DEFAULT, DATE_LONGDATE, &st, NULL, buff2, sizeof(buff2)/sizeof(WCHAR));
+ ret = GetDateFormatW(LOCALE_USER_DEFAULT, DATE_LONGDATE, &st, NULL, buff2, ARRAY_SIZE(buff2));
ok(ret == lstrlenW(buff2)+1, "expected %d, got %d\n", lstrlenW(buff2)+1, ret);
ok(lstrcmpW(buff, buff2) == 0, "expected equal strings\n");
/* both date flags */
flags = FDTF_LONGDATE | FDTF_SHORTDATE;
- ret = pSHFormatDateTimeW(&filetime, &flags, buff, sizeof(buff)/sizeof(WCHAR));
+ ret = pSHFormatDateTimeW(&filetime, &flags, buff, ARRAY_SIZE(buff));
ok(ret == lstrlenW(buff)+1 || ret == lstrlenW(buff),
"expected %d or %d, got %d\n", lstrlenW(buff)+1, lstrlenW(buff), ret);
- ret = GetDateFormatW(LOCALE_USER_DEFAULT, DATE_LONGDATE, &st, NULL, buff2, sizeof(buff2)/sizeof(WCHAR));
+ ret = GetDateFormatW(LOCALE_USER_DEFAULT, DATE_LONGDATE, &st, NULL, buff2, ARRAY_SIZE(buff2));
ok(ret == lstrlenW(buff2)+1, "expected %d, got %d\n", lstrlenW(buff2)+1, ret);
ok(lstrcmpW(buff, buff2) == 0, "expected equal strings\n");
/* various combinations of date/time flags */
flags = FDTF_LONGDATE | FDTF_SHORTTIME;
- ret = pSHFormatDateTimeW(&filetime, &flags, buff, sizeof(buff)/sizeof(WCHAR));
+ ret = pSHFormatDateTimeW(&filetime, &flags, buff, ARRAY_SIZE(buff));
ok(ret == lstrlenW(buff)+1 || ret == lstrlenW(buff),
"expected %d or %d, got %d\n", lstrlenW(buff)+1, lstrlenW(buff), ret);
- ret = GetTimeFormatW(LOCALE_USER_DEFAULT, TIME_NOSECONDS, &st, NULL, buff3, sizeof(buff3)/sizeof(WCHAR));
+ ret = GetTimeFormatW(LOCALE_USER_DEFAULT, TIME_NOSECONDS, &st, NULL, buff3, ARRAY_SIZE(buff3));
ok(ret == lstrlenW(buff3)+1, "expected %d, got %d\n", lstrlenW(buff3)+1, ret);
ok(lstrcmpW(buff3, buff + lstrlenW(buff) - lstrlenW(buff3)) == 0,
"expected (%s), got (%s) for time part\n",
wine_dbgstr_w(buff3), wine_dbgstr_w(buff + lstrlenW(buff) - lstrlenW(buff3)));
- ret = GetDateFormatW(LOCALE_USER_DEFAULT, DATE_LONGDATE, &st, NULL, buff2, sizeof(buff2)/sizeof(WCHAR));
+ ret = GetDateFormatW(LOCALE_USER_DEFAULT, DATE_LONGDATE, &st, NULL, buff2, ARRAY_SIZE(buff2));
ok(ret == lstrlenW(buff2)+1, "expected %d, got %d\n", lstrlenW(buff2)+1, ret);
p1 = buff;
p2 = buff2;
@@ -1963,15 +1963,15 @@ if (0)
wine_dbgstr_w(buff2), wine_dbgstr_w(buff));
flags = FDTF_LONGDATE | FDTF_LONGTIME;
- ret = pSHFormatDateTimeW(&filetime, &flags, buff, sizeof(buff)/sizeof(WCHAR));
+ ret = pSHFormatDateTimeW(&filetime, &flags, buff, ARRAY_SIZE(buff));
ok(ret == lstrlenW(buff)+1 || ret == lstrlenW(buff),
"expected %d or %d, got %d\n", lstrlenW(buff)+1, lstrlenW(buff), ret);
- ret = GetTimeFormatW(LOCALE_USER_DEFAULT, 0, &st, NULL, buff3, sizeof(buff3)/sizeof(WCHAR));
+ ret = GetTimeFormatW(LOCALE_USER_DEFAULT, 0, &st, NULL, buff3, ARRAY_SIZE(buff3));
ok(ret == lstrlenW(buff3)+1, "expected %d, got %d\n", lstrlenW(buff3)+1, ret);
ok(lstrcmpW(buff3, buff + lstrlenW(buff) - lstrlenW(buff3)) == 0,
"expected (%s), got (%s) for time part\n",
wine_dbgstr_w(buff3), wine_dbgstr_w(buff + lstrlenW(buff) - lstrlenW(buff3)));
- ret = GetDateFormatW(LOCALE_USER_DEFAULT, DATE_LONGDATE, &st, NULL, buff2, sizeof(buff2)/sizeof(WCHAR));
+ ret = GetDateFormatW(LOCALE_USER_DEFAULT, DATE_LONGDATE, &st, NULL, buff2, ARRAY_SIZE(buff2));
ok(ret == lstrlenW(buff2)+1, "expected %d, got %d\n", lstrlenW(buff2)+1, ret);
p1 = buff;
p2 = buff2;
@@ -1989,25 +1989,25 @@ if (0)
wine_dbgstr_w(buff2), wine_dbgstr_w(buff));
flags = FDTF_SHORTDATE | FDTF_SHORTTIME;
- ret = pSHFormatDateTimeW(&filetime, &flags, buff, sizeof(buff)/sizeof(WCHAR));
+ ret = pSHFormatDateTimeW(&filetime, &flags, buff, ARRAY_SIZE(buff));
ok(ret == lstrlenW(buff)+1 || ret == lstrlenW(buff),
"expected %d or %d, got %d\n", lstrlenW(buff)+1, lstrlenW(buff), ret);
- ret = GetDateFormatW(LOCALE_USER_DEFAULT, DATE_SHORTDATE, &st, NULL, buff2, sizeof(buff2)/sizeof(WCHAR));
+ ret = GetDateFormatW(LOCALE_USER_DEFAULT, DATE_SHORTDATE, &st, NULL, buff2, ARRAY_SIZE(buff2));
ok(ret == lstrlenW(buff2)+1, "expected %d, got %d\n", lstrlenW(buff2)+1, ret);
lstrcatW(buff2, spaceW);
- ret = GetTimeFormatW(LOCALE_USER_DEFAULT, TIME_NOSECONDS, &st, NULL, buff3, sizeof(buff3)/sizeof(WCHAR));
+ ret = GetTimeFormatW(LOCALE_USER_DEFAULT, TIME_NOSECONDS, &st, NULL, buff3, ARRAY_SIZE(buff3));
ok(ret == lstrlenW(buff3)+1, "expected %d, got %d\n", lstrlenW(buff3)+1, ret);
lstrcatW(buff2, buff3);
ok(lstrcmpW(buff, buff2) == 0, "expected equal strings\n");
flags = FDTF_SHORTDATE | FDTF_LONGTIME;
- ret = pSHFormatDateTimeW(&filetime, &flags, buff, sizeof(buff)/sizeof(WCHAR));
+ ret = pSHFormatDateTimeW(&filetime, &flags, buff, ARRAY_SIZE(buff));
ok(ret == lstrlenW(buff)+1 || ret == lstrlenW(buff),
"expected %d or %d, got %d\n", lstrlenW(buff)+1, lstrlenW(buff), ret);
- ret = GetDateFormatW(LOCALE_USER_DEFAULT, DATE_SHORTDATE, &st, NULL, buff2, sizeof(buff2)/sizeof(WCHAR));
+ ret = GetDateFormatW(LOCALE_USER_DEFAULT, DATE_SHORTDATE, &st, NULL, buff2, ARRAY_SIZE(buff2));
ok(ret == lstrlenW(buff2)+1, "expected %d, got %d\n", lstrlenW(buff2)+1, ret);
lstrcatW(buff2, spaceW);
- ret = GetTimeFormatW(LOCALE_USER_DEFAULT, 0, &st, NULL, buff3, sizeof(buff3)/sizeof(WCHAR));
+ ret = GetTimeFormatW(LOCALE_USER_DEFAULT, 0, &st, NULL, buff3, ARRAY_SIZE(buff3));
ok(ret == lstrlenW(buff3)+1, "expected %d, got %d\n", lstrlenW(buff3)+1, ret);
lstrcatW(buff2, buff3);
ok(lstrcmpW(buff, buff2) == 0, "expected equal strings\n");
@@ -2068,7 +2068,7 @@ static void test_SHGetObjectCompatFlags(void)
{
int j;
- for (j = 0; j < sizeof(values)/sizeof(struct compat_value); j++)
+ for (j = 0; j < ARRAY_SIZE(values); j++)
if (lstrcmpA(values[j].nameA, valueA) == 0)
{
expected |= values[j].value;
diff --git a/dlls/shlwapi/tests/path.c b/dlls/shlwapi/tests/path.c
index 91c66b7ef3..d25620b3d5 100644
--- a/dlls/shlwapi/tests/path.c
+++ b/dlls/shlwapi/tests/path.c
@@ -283,7 +283,7 @@ static void test_PathCreateFromUrl(void)
ok(len == 0xdeca, "got %x expected 0xdeca\n", len);
/* Test the decoding itself */
- for(i = 0; i < sizeof(TEST_PATHFROMURL) / sizeof(TEST_PATHFROMURL[0]); i++) {
+ for (i = 0; i < ARRAY_SIZE(TEST_PATHFROMURL); i++) {
len = INTERNET_MAX_URL_LENGTH;
ret = pPathCreateFromUrlA(TEST_PATHFROMURL[i].url, ret_path, &len, 0);
todo_wine_if (TEST_PATHFROMURL[i].todo & 0x1)
@@ -350,7 +350,7 @@ static void test_PathIsUrl(void)
size_t i;
BOOL ret;
- for(i = 0; i < sizeof(TEST_PATH_IS_URL)/sizeof(TEST_PATH_IS_URL[0]); i++) {
+ for (i = 0; i < ARRAY_SIZE(TEST_PATH_IS_URL); i++) {
ret = PathIsURLA(TEST_PATH_IS_URL[i].path);
ok(ret == TEST_PATH_IS_URL[i].expect,
"returned %d from path %s, expected %d\n", ret, TEST_PATH_IS_URL[i].path,
@@ -1403,7 +1403,7 @@ static void test_PathCommonPrefixA(void)
static void test_PathUnquoteSpaces(void)
{
int i;
- for(i = 0; i < sizeof(TEST_PATH_UNQUOTE_SPACES) / sizeof(TEST_PATH_UNQUOTE_SPACES[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(TEST_PATH_UNQUOTE_SPACES); i++)
{
char *path = strdupA(TEST_PATH_UNQUOTE_SPACES[i].path);
WCHAR *pathW = GetWideString(TEST_PATH_UNQUOTE_SPACES[i].path);
@@ -1484,10 +1484,10 @@ static void test_PathUnExpandEnvStrings(void)
ret = pPathUnExpandEnvStringsA(envvarA, buff, sizeof(buff));
ok(!ret && GetLastError() == 0xdeadbeef, "got %d, error %d\n", ret, GetLastError());
- ret = GetEnvironmentVariableW(computernameW, envvarW, sizeof(envvarW)/sizeof(WCHAR));
+ ret = GetEnvironmentVariableW(computernameW, envvarW, ARRAY_SIZE(envvarW));
ok(ret, "got %d\n", ret);
SetLastError(0xdeadbeef);
- ret = pPathUnExpandEnvStringsW(envvarW, buffW, sizeof(buffW)/sizeof(WCHAR));
+ ret = pPathUnExpandEnvStringsW(envvarW, buffW, ARRAY_SIZE(buffW));
ok(!ret && GetLastError() == 0xdeadbeef, "got %d, error %d\n", ret, GetLastError());
/* something that can't be represented with env var */
@@ -1559,7 +1559,7 @@ static void test_PathUnExpandEnvStrings(void)
lstrcpyW(pathW, nonpathW);
buffW[0] = 'x'; buffW[1] = 0;
SetLastError(0xdeadbeef);
- ret = pPathUnExpandEnvStringsW(pathW, buffW, sizeof(buffW)/sizeof(WCHAR));
+ ret = pPathUnExpandEnvStringsW(pathW, buffW, ARRAY_SIZE(buffW));
ok(!ret && GetLastError() == 0xdeadbeef, "got %d, error %d\n", ret, GetLastError());
ok(buffW[0] == 'x', "wrong return string %s\n", wine_dbgstr_w(buffW));
@@ -1580,13 +1580,13 @@ static void test_PathUnExpandEnvStrings(void)
/* buffer size is enough to hold variable name only */
buffW[0] = 'x'; buffW[1] = 0;
SetLastError(0xdeadbeef);
- ret = pPathUnExpandEnvStringsW(pathW, buffW, sizeof(sysrootW)/sizeof(WCHAR));
+ ret = pPathUnExpandEnvStringsW(pathW, buffW, ARRAY_SIZE(sysrootW));
ok(!ret && GetLastError() == 0xdeadbeef, "got %d, error %d\n", ret, GetLastError());
ok(buffW[0] == 'x', "wrong return string %s\n", wine_dbgstr_w(buffW));
/* enough size */
buffW[0] = 0;
- ret = pPathUnExpandEnvStringsW(pathW, buffW, sizeof(buffW)/sizeof(WCHAR));
+ ret = pPathUnExpandEnvStringsW(pathW, buffW, ARRAY_SIZE(buffW));
ok(ret, "got %d\n", ret);
ok(!memcmp(buffW, sysrootW, sizeof(sysrootW) - sizeof(WCHAR)), "wrong return string %s\n", wine_dbgstr_w(buffW));
@@ -1626,7 +1626,7 @@ static void test_PathIsRelativeA(void)
return;
}
- num = sizeof(test_path_is_relative) / sizeof(test_path_is_relative[0]);
+ num = ARRAY_SIZE(test_path_is_relative);
for (i = 0; i < num; i++) {
ret = pPathIsRelativeA(test_path_is_relative[i].path);
ok(ret == test_path_is_relative[i].expect,
@@ -1646,7 +1646,7 @@ static void test_PathIsRelativeW(void)
return;
}
- num = sizeof(test_path_is_relative) / sizeof(test_path_is_relative[0]);
+ num = ARRAY_SIZE(test_path_is_relative);
for (i = 0; i < num; i++) {
path = GetWideString(test_path_is_relative[i].path);
diff --git a/dlls/shlwapi/tests/string.c b/dlls/shlwapi/tests/string.c
index 7f069a4849..c7a2f5d346 100644
--- a/dlls/shlwapi/tests/string.c
+++ b/dlls/shlwapi/tests/string.c
@@ -412,7 +412,7 @@ static void test_StrCpyW(void)
while(result->value)
{
- MultiByteToWideChar(CP_ACP,0,result->byte_size_64,-1,szSrc,sizeof(szSrc)/sizeof(WCHAR));
+ MultiByteToWideChar(CP_ACP, 0, result->byte_size_64, -1, szSrc, ARRAY_SIZE(szSrc));
lpRes = StrCpyW(szBuff, szSrc);
ok(!StrCmpW(szSrc, szBuff) && lpRes == szBuff, "Copied string %s wrong\n", result->byte_size_64);
@@ -476,7 +476,7 @@ static void test_StrToIntW(void)
while (result->string)
{
- MultiByteToWideChar(CP_ACP,0,result->string,-1,szBuff,sizeof(szBuff)/sizeof(WCHAR));
+ MultiByteToWideChar(CP_ACP, 0, result->string, -1, szBuff, ARRAY_SIZE(szBuff));
return_val = StrToIntW(szBuff);
ok(return_val == result->str_to_int, "converted '%s' wrong (%d)\n",
result->string, return_val);
@@ -526,7 +526,7 @@ static void test_StrToIntExW(void)
while (result->string)
{
return_val = -1;
- MultiByteToWideChar(CP_ACP,0,result->string,-1,szBuff,sizeof(szBuff)/sizeof(WCHAR));
+ MultiByteToWideChar(CP_ACP, 0, result->string, -1, szBuff, ARRAY_SIZE(szBuff));
bRet = StrToIntExW(szBuff, 0, &return_val);
ok(!bRet || return_val != -1, "No result returned from '%s'\n",
result->string);
@@ -540,7 +540,7 @@ static void test_StrToIntExW(void)
while (result->string)
{
return_val = -1;
- MultiByteToWideChar(CP_ACP,0,result->string,-1,szBuff,sizeof(szBuff)/sizeof(WCHAR));
+ MultiByteToWideChar(CP_ACP, 0, result->string, -1, szBuff, ARRAY_SIZE(szBuff));
bRet = StrToIntExW(szBuff, STIF_SUPPORT_HEX, &return_val);
ok(!bRet || return_val != -1, "No result returned from '%s'\n",
result->string);
@@ -605,7 +605,7 @@ static void test_StrToInt64ExW(void)
while (result->string)
{
return_val = -1;
- MultiByteToWideChar(CP_ACP,0,result->string,-1,szBuff,sizeof(szBuff)/sizeof(WCHAR));
+ MultiByteToWideChar(CP_ACP, 0, result->string, -1, szBuff, ARRAY_SIZE(szBuff));
bRet = pStrToInt64ExW(szBuff, 0, &return_val);
ok(!bRet || return_val != -1, "No result returned from '%s'\n",
result->string);
@@ -619,7 +619,7 @@ static void test_StrToInt64ExW(void)
while (result->string)
{
return_val = -1;
- MultiByteToWideChar(CP_ACP,0,result->string,-1,szBuff,sizeof(szBuff)/sizeof(WCHAR));
+ MultiByteToWideChar(CP_ACP, 0, result->string, -1, szBuff, ARRAY_SIZE(szBuff));
bRet = pStrToInt64ExW(szBuff, STIF_SUPPORT_HEX, &return_val);
ok(!bRet || return_val != -1, "No result returned from '%s'\n",
result->string);
@@ -865,7 +865,7 @@ static void test_StrCpyNXA(void)
}
memset(dest, '\n', sizeof(dest));
- lpszRes = pStrCpyNXA(dest, lpSrc, sizeof(dest)/sizeof(dest[0]));
+ lpszRes = pStrCpyNXA(dest, lpSrc, ARRAY_SIZE(dest));
ok(lpszRes == dest + 5 && !memcmp(dest, "hello\0\n\n", sizeof(dest)),
"StrCpyNXA: expected %p, \"hello\\0\\n\\n\", got %p, \"%d,%d,%d,%d,%d,%d,%d,%d\"\n",
dest + 5, lpszRes, dest[0], dest[1], dest[2], dest[3], dest[4], dest[5], dest[6], dest[7]);
@@ -886,7 +886,7 @@ static void test_StrCpyNXW(void)
}
memcpy(dest, lpInit, sizeof(lpInit));
- lpszRes = pStrCpyNXW(dest, lpSrc, sizeof(dest)/sizeof(dest[0]));
+ lpszRes = pStrCpyNXW(dest, lpSrc, ARRAY_SIZE(dest));
ok(lpszRes == dest + 5 && !memcmp(dest, lpRes, sizeof(dest)),
"StrCpyNXW: expected %p, \"hello\\0\\n\\n\", got %p, \"%d,%d,%d,%d,%d,%d,%d,%d\"\n",
dest + 5, lpszRes, dest[0], dest[1], dest[2], dest[3], dest[4], dest[5], dest[6], dest[7]);
@@ -949,7 +949,7 @@ static void test_SHAnsiToAnsi(void)
}
memset(dest, '\n', sizeof(dest));
- dwRet = pSHAnsiToAnsi("hello", dest, sizeof(dest)/sizeof(dest[0]));
+ dwRet = pSHAnsiToAnsi("hello", dest, ARRAY_SIZE(dest));
ok(dwRet == 6 && !memcmp(dest, "hello\0\n\n", sizeof(dest)),
"SHAnsiToAnsi: expected 6, \"hello\\0\\n\\n\", got %d, \"%d,%d,%d,%d,%d,%d,%d,%d\"\n",
dwRet, dest[0], dest[1], dest[2], dest[3], dest[4], dest[5], dest[6], dest[7]);
@@ -976,7 +976,7 @@ static void test_SHUnicodeToUnicode(void)
}
memcpy(dest, lpInit, sizeof(lpInit));
- dwRet = pSHUnicodeToUnicode(lpSrc, dest, sizeof(dest)/sizeof(dest[0]));
+ dwRet = pSHUnicodeToUnicode(lpSrc, dest, ARRAY_SIZE(dest));
ok(dwRet == 6 && !memcmp(dest, lpRes, sizeof(dest)),
"SHUnicodeToUnicode: expected 6, \"hello\\0\\n\\n\", got %d, \"%d,%d,%d,%d,%d,%d,%d,%d\"\n",
dwRet, dest[0], dest[1], dest[2], dest[3], dest[4], dest[5], dest[6], dest[7]);
@@ -1158,7 +1158,7 @@ static void test_StrStrA(void)
ret = StrStrA("", "");
ok(!ret, "Expected StrStrA to return NULL, got %p\n", ret);
- for (i = 0; i < sizeof(StrStrA_cases)/sizeof(StrStrA_cases[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(StrStrA_cases); i++)
{
ret = StrStrA(deadbeefA, StrStrA_cases[i].search);
ok(ret == StrStrA_cases[i].expect,
@@ -1212,7 +1212,7 @@ static void test_StrStrW(void)
ret = StrStrW(emptyW, emptyW);
ok(!ret, "Expected StrStrW to return NULL, got %p\n", ret);
- for (i = 0; i < sizeof(StrStrW_cases)/sizeof(StrStrW_cases[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(StrStrW_cases); i++)
{
ret = StrStrW(deadbeefW, StrStrW_cases[i].search);
ok(ret == StrStrW_cases[i].expect,
@@ -1260,7 +1260,7 @@ static void test_StrStrIA(void)
ret = StrStrIA("", "");
ok(!ret, "Expected StrStrIA to return NULL, got %p\n", ret);
- for (i = 0; i < sizeof(StrStrIA_cases)/sizeof(StrStrIA_cases[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(StrStrIA_cases); i++)
{
ret = StrStrIA(deadbeefA, StrStrIA_cases[i].search);
ok(ret == StrStrIA_cases[i].expect,
@@ -1316,7 +1316,7 @@ static void test_StrStrIW(void)
ret = StrStrIW(emptyW, emptyW);
ok(!ret, "Expected StrStrIW to return NULL, got %p\n", ret);
- for (i = 0; i < sizeof(StrStrIW_cases)/sizeof(StrStrIW_cases[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(StrStrIW_cases); i++)
{
ret = StrStrIW(deadbeefW, StrStrIW_cases[i].search);
ok(ret == StrStrIW_cases[i].expect,
@@ -1343,13 +1343,13 @@ static void test_StrStrNW(void)
const WCHAR *expect;
} StrStrNW_cases[] =
{
- {emptyW, sizeof(deadbeefW)/sizeof(WCHAR), NULL},
- {deadW, sizeof(deadbeefW)/sizeof(WCHAR), deadbeefW},
- {dead_lowerW, sizeof(deadbeefW)/sizeof(WCHAR), NULL},
- {adbeW, sizeof(deadbeefW)/sizeof(WCHAR), deadbeefW + 2},
- {adbe_lowerW, sizeof(deadbeefW)/sizeof(WCHAR), NULL},
- {beefW, sizeof(deadbeefW)/sizeof(WCHAR), deadbeefW + 4},
- {beef_lowerW, sizeof(deadbeefW)/sizeof(WCHAR), NULL},
+ {emptyW, ARRAY_SIZE(deadbeefW), NULL},
+ {deadW, ARRAY_SIZE(deadbeefW), deadbeefW},
+ {dead_lowerW, ARRAY_SIZE(deadbeefW), NULL},
+ {adbeW, ARRAY_SIZE(deadbeefW), deadbeefW + 2},
+ {adbe_lowerW, ARRAY_SIZE(deadbeefW), NULL},
+ {beefW, ARRAY_SIZE(deadbeefW), deadbeefW + 4},
+ {beef_lowerW, ARRAY_SIZE(deadbeefW), NULL},
{beefW, 0, NULL},
{beefW, 1, NULL},
{beefW, 2, NULL},
@@ -1386,7 +1386,7 @@ static void test_StrStrNW(void)
ret = pStrStrNW(emptyW, emptyW, 10);
ok(!ret, "Expected StrStrNW to return NULL, got %p\n", ret);
- for (i = 0; i < sizeof(StrStrNW_cases)/sizeof(StrStrNW_cases[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(StrStrNW_cases); i++)
{
ret = pStrStrNW(deadbeefW, StrStrNW_cases[i].search, StrStrNW_cases[i].count);
ok(ret == StrStrNW_cases[i].expect,
@@ -1426,14 +1426,14 @@ static void test_StrStrNIW(void)
const WCHAR *expect;
} StrStrNIW_cases[] =
{
- {emptyW, sizeof(deadbeefW)/sizeof(WCHAR), NULL},
- {deadW, sizeof(deadbeefW)/sizeof(WCHAR), deadbeefW},
- {dead_lowerW, sizeof(deadbeefW)/sizeof(WCHAR), deadbeefW},
- {adbeW, sizeof(deadbeefW)/sizeof(WCHAR), deadbeefW + 2},
- {adbe_lowerW, sizeof(deadbeefW)/sizeof(WCHAR), deadbeefW + 2},
- {beefW, sizeof(deadbeefW)/sizeof(WCHAR), deadbeefW + 4},
- {beef_lowerW, sizeof(deadbeefW)/sizeof(WCHAR), deadbeefW + 4},
- {cafeW, sizeof(deadbeefW)/sizeof(WCHAR), NULL},
+ {emptyW, ARRAY_SIZE(deadbeefW), NULL},
+ {deadW, ARRAY_SIZE(deadbeefW), deadbeefW},
+ {dead_lowerW, ARRAY_SIZE(deadbeefW), deadbeefW},
+ {adbeW, ARRAY_SIZE(deadbeefW), deadbeefW + 2},
+ {adbe_lowerW, ARRAY_SIZE(deadbeefW), deadbeefW + 2},
+ {beefW, ARRAY_SIZE(deadbeefW), deadbeefW + 4},
+ {beef_lowerW, ARRAY_SIZE(deadbeefW), deadbeefW + 4},
+ {cafeW, ARRAY_SIZE(deadbeefW), NULL},
{beefW, 0, NULL},
{beefW, 1, NULL},
{beefW, 2, NULL},
@@ -1480,7 +1480,7 @@ static void test_StrStrNIW(void)
ret = pStrStrNIW(emptyW, emptyW, 10);
ok(!ret, "Expected StrStrNIW to return NULL, got %p\n", ret);
- for (i = 0; i < sizeof(StrStrNIW_cases)/sizeof(StrStrNIW_cases[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(StrStrNIW_cases); i++)
{
ret = pStrStrNIW(deadbeefW, StrStrNIW_cases[i].search, StrStrNIW_cases[i].count);
ok(ret == StrStrNIW_cases[i].expect,
diff --git a/dlls/shlwapi/tests/url.c b/dlls/shlwapi/tests/url.c
index ac896b06e4..d30737f60a 100644
--- a/dlls/shlwapi/tests/url.c
+++ b/dlls/shlwapi/tests/url.c
@@ -539,7 +539,7 @@ static void test_UrlApplyScheme(void)
return;
}
- for(i = 0; i < sizeof(TEST_APPLY)/sizeof(TEST_APPLY[0]); i++) {
+ for (i = 0; i < ARRAY_SIZE(TEST_APPLY); i++) {
len = TEST_APPLY_MAX_LENGTH;
lstrcpyA(newurl, untouchedA);
res = pUrlApplySchemeA(TEST_APPLY[i].url, newurl, &len, TEST_APPLY[i].flags);
@@ -916,7 +916,7 @@ static void test_UrlEscapeA(void)
"got %d, expected %d\n", size, 1);
ok(empty_string[0] == 127, "String has changed, empty_string[0] = %d\n", empty_string[0]);
- for(i=0; i<sizeof(TEST_ESCAPE)/sizeof(TEST_ESCAPE[0]); i++) {
+ for (i = 0; i < ARRAY_SIZE(TEST_ESCAPE); i++) {
CHAR ret_url[INTERNET_MAX_URL_LENGTH];
size = INTERNET_MAX_URL_LENGTH;
@@ -983,7 +983,7 @@ static void test_UrlEscapeW(void)
/* Check actual escaping */
- size = sizeof(overwrite)/sizeof(WCHAR);
+ size = ARRAY_SIZE(overwrite);
ret = pUrlEscapeW(overwrite, overwrite, &size, URL_ESCAPE_SPACES_ONLY);
ok(ret == S_OK, "got %x, expected S_OK\n", ret);
ok(size == 9, "got %d, expected 9\n", size);
@@ -997,12 +997,12 @@ static void test_UrlEscapeW(void)
ok(wc == 127, "String has changed, wc = %d\n", wc);
/* non-ASCII range */
- size = sizeof(ret_urlW)/sizeof(WCHAR);
+ size = ARRAY_SIZE(ret_urlW);
ret = pUrlEscapeW(naW, ret_urlW, &size, 0);
ok(ret == S_OK, "got %x, expected S_OK\n", ret);
ok(!lstrcmpW(naescapedW, ret_urlW), "got %s, expected %s\n", wine_dbgstr_w(ret_urlW), wine_dbgstr_w(naescapedW));
- for (i = 0; i < sizeof(TEST_ESCAPE)/sizeof(TEST_ESCAPE[0]); i++) {
+ for (i = 0; i < ARRAY_SIZE(TEST_ESCAPE); i++) {
WCHAR *urlW, *expected_urlW;
@@ -1018,7 +1018,7 @@ static void test_UrlEscapeW(void)
FreeWideString(expected_urlW);
}
- for(i=0; i<sizeof(TEST_ESCAPEW)/sizeof(TEST_ESCAPEW[0]); i++) {
+ for (i = 0; i < ARRAY_SIZE(TEST_ESCAPEW); i++) {
WCHAR ret_url[INTERNET_MAX_URL_LENGTH];
size = INTERNET_MAX_URL_LENGTH;
@@ -1113,7 +1113,7 @@ static void test_UrlCanonicalizeA(void)
test_url_canonicalize(-1, "", 0, S_OK, S_FALSE /* Vista/win2k8 */, "", FALSE);
/* test url-modification */
- for(i=0; i<sizeof(TEST_CANONICALIZE)/sizeof(TEST_CANONICALIZE[0]); i++) {
+ for (i = 0; i < ARRAY_SIZE(TEST_CANONICALIZE); i++) {
test_url_canonicalize(i, TEST_CANONICALIZE[i].url, TEST_CANONICALIZE[i].flags,
TEST_CANONICALIZE[i].expectret, TEST_CANONICALIZE[i].expectret, TEST_CANONICALIZE[i].expecturl,
TEST_CANONICALIZE[i].todo);
@@ -1185,7 +1185,7 @@ static void test_UrlCanonicalizeW(void)
BOOL choped;
int pos;
- MultiByteToWideChar(CP_ACP, 0, "http://www.winehq.org/X", -1, szUrl, sizeof(szUrl)/sizeof(szUrl[0]));
+ MultiByteToWideChar(CP_ACP, 0, "http://www.winehq.org/X", -1, szUrl, ARRAY_SIZE(szUrl));
pos = lstrlenW(szUrl) - 1;
szUrl[pos] = i;
urllen = INTERNET_MAX_URL_LENGTH;
@@ -1267,7 +1267,7 @@ static void test_url_combine(const char *szUrl1, const char *szUrl2, DWORD dwFla
static void test_UrlCombine(void)
{
unsigned int i;
- for(i=0; i<sizeof(TEST_COMBINE)/sizeof(TEST_COMBINE[0]); i++) {
+ for (i = 0; i < ARRAY_SIZE(TEST_COMBINE); i++) {
test_url_combine(TEST_COMBINE[i].url1, TEST_COMBINE[i].url2, TEST_COMBINE[i].flags,
TEST_COMBINE[i].expectret, TEST_COMBINE[i].expecturl);
}
@@ -1288,7 +1288,7 @@ static void test_UrlCreateFromPath(void)
return;
}
- for(i = 0; i < sizeof(TEST_URLFROMPATH) / sizeof(TEST_URLFROMPATH[0]); i++) {
+ for (i = 0; i < ARRAY_SIZE(TEST_URLFROMPATH); i++) {
len = INTERNET_MAX_URL_LENGTH;
ret = pUrlCreateFromPathA(TEST_URLFROMPATH[i].path, ret_url, &len, 0);
ok(ret == TEST_URLFROMPATH[i].ret, "ret %08x from path %s\n", ret, TEST_URLFROMPATH[i].path);
@@ -1342,8 +1342,8 @@ static void test_UrlIs(void)
test_UrlIs_null(URLIS_OPAQUE);
test_UrlIs_null(URLIS_URL);
- for(i = 0; i < sizeof(TEST_PATH_IS_URL) / sizeof(TEST_PATH_IS_URL[0]); i++) {
- MultiByteToWideChar(CP_ACP, 0, TEST_PATH_IS_URL[i].path, -1, wurl, sizeof(wurl)/sizeof(*wurl));
+ for (i = 0; i < ARRAY_SIZE(TEST_PATH_IS_URL); i++) {
+ MultiByteToWideChar(CP_ACP, 0, TEST_PATH_IS_URL[i].path, -1, wurl, ARRAY_SIZE(wurl));
ret = pUrlIsA( TEST_PATH_IS_URL[i].path, URLIS_URL );
ok( ret == TEST_PATH_IS_URL[i].expect,
@@ -1357,8 +1357,8 @@ static void test_UrlIs(void)
TEST_PATH_IS_URL[i].path, TEST_PATH_IS_URL[i].expect );
}
}
- for(i = 0; i < sizeof(TEST_URLIS_ATTRIBS) / sizeof(TEST_URLIS_ATTRIBS[0]); i++) {
- MultiByteToWideChar(CP_ACP, 0, TEST_URLIS_ATTRIBS[i].url, -1, wurl, sizeof(wurl)/sizeof(*wurl));
+ for (i = 0; i < ARRAY_SIZE(TEST_URLIS_ATTRIBS); i++) {
+ MultiByteToWideChar(CP_ACP, 0, TEST_URLIS_ATTRIBS[i].url, -1, wurl, ARRAY_SIZE(wurl));
ret = pUrlIsA( TEST_URLIS_ATTRIBS[i].url, URLIS_OPAQUE);
ok( ret == TEST_URLIS_ATTRIBS[i].expectOpaque,
@@ -1403,7 +1403,7 @@ static void test_UrlUnescape(void)
win_skip("UrlUnescapeA not found\n");
return;
}
- for(i=0; i<sizeof(TEST_URL_UNESCAPE)/sizeof(TEST_URL_UNESCAPE[0]); i++) {
+ for (i = 0; i < ARRAY_SIZE(TEST_URL_UNESCAPE); i++) {
dwEscaped=INTERNET_MAX_URL_LENGTH;
res = pUrlUnescapeA(TEST_URL_UNESCAPE[i].url, szReturnUrl, &dwEscaped, 0);
ok(res == S_OK,
@@ -1494,7 +1494,7 @@ static void test_ParseURL(void)
PARSEDURLW parsedw;
HRESULT hres;
- for(test = parse_url_tests; test < parse_url_tests + sizeof(parse_url_tests)/sizeof(*parse_url_tests); test++) {
+ for (test = parse_url_tests; test < parse_url_tests + ARRAY_SIZE(parse_url_tests); test++) {
memset(&parseda, 0xd0, sizeof(parseda));
parseda.cbSize = sizeof(parseda);
hres = pParseURLA(test->url, &parseda);
@@ -1516,7 +1516,7 @@ static void test_ParseURL(void)
ok(parseda.nScheme == 0xd0d0d0d0, "nScheme = %d\n", parseda.nScheme);
}
- MultiByteToWideChar(CP_ACP, 0, test->url, -1, url, sizeof(url)/sizeof(WCHAR));
+ MultiByteToWideChar(CP_ACP, 0, test->url, -1, url, ARRAY_SIZE(url));
memset(&parsedw, 0xd0, sizeof(parsedw));
parsedw.cbSize = sizeof(parsedw);
@@ -1595,23 +1595,23 @@ static void test_HashData(void)
"Expected HashData to return E_INVALIDARG, got 0x%08x\n", res);
/* Test passing valid pointers with sizes of zero. */
- for (i = 0; i < sizeof(input)/sizeof(BYTE); i++)
+ for (i = 0; i < ARRAY_SIZE(input); i++)
input[i] = 0x00;
- for (i = 0; i < sizeof(output)/sizeof(BYTE); i++)
+ for (i = 0; i < ARRAY_SIZE(output); i++)
output[i] = 0xFF;
res = pHashData(input, 0, output, 0);
ok(res == S_OK, "Expected HashData to return S_OK, got 0x%08x\n", res);
/* The buffers should be unchanged. */
- for (i = 0; i < sizeof(input)/sizeof(BYTE); i++)
+ for (i = 0; i < ARRAY_SIZE(input); i++)
{
ok(input[i] == 0x00, "Expected the input buffer to be unchanged\n");
if(input[i] != 0x00) break;
}
- for (i = 0; i < sizeof(output)/sizeof(BYTE); i++)
+ for (i = 0; i < ARRAY_SIZE(output); i++)
{
ok(output[i] == 0xFF, "Expected the output buffer to be unchanged\n");
if(output[i] != 0xFF) break;
--
2.14.4
June 26, 2018
Re: [PATCH vkd3d 10/12] libs/vkd3d: Add support for 2D array render target views.
by Henri Verbeet
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
June 26, 2018