winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
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
List overview
wine-commits
June 2018
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
1 participants
629 discussions
Start a n
N
ew thread
Michael Stefaniuc : ieframe/tests: Use the available ARRAY_SIZE() macro.
by Alexandre Julliard
11 Jun '18
11 Jun '18
Module: wine Branch: master Commit: 41623d621657b238dbb61cf8a619b89a22bcd5d9 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=41623d621657b238dbb61cf8…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Thu Jun 7 23:44:37 2018 +0200 ieframe/tests: Use the available ARRAY_SIZE() macro. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ieframe/tests/intshcut.c | 2 +- dlls/ieframe/tests/webbrowser.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/ieframe/tests/intshcut.c b/dlls/ieframe/tests/intshcut.c index 0959a61..803e7ec 100644 --- a/dlls/ieframe/tests/intshcut.c +++ b/dlls/ieframe/tests/intshcut.c @@ -331,7 +331,7 @@ static void test_Load(void) GetTempPathW(MAX_PATH, file_path); lstrcatW(file_path, test_urlW); - for(test = load_tests; test < load_tests + sizeof(load_tests)/sizeof(*load_tests); test++) { + for(test = load_tests; test < load_tests + ARRAY_SIZE(load_tests); test++) { IPropertySetStorage *propsetstorage; IPropertyStorage *propstorage; PROPVARIANT v; diff --git a/dlls/ieframe/tests/webbrowser.c b/dlls/ieframe/tests/webbrowser.c index ca2a131..706d507 100644 --- a/dlls/ieframe/tests/webbrowser.c +++ b/dlls/ieframe/tests/webbrowser.c @@ -2167,7 +2167,7 @@ static void test_EnumVerbs(IWebBrowser2 *wb) fetched = 0xdeadbeef; memset(verbs, 0xa, sizeof(verbs)); verbs[1].lVerb = 0xdeadbeef; - hres = IEnumOLEVERB_Next(enum_verbs, sizeof(verbs)/sizeof(*verbs), verbs, &fetched); + hres = IEnumOLEVERB_Next(enum_verbs, ARRAY_SIZE(verbs), verbs, &fetched); ok(hres == S_OK, "Next failed: %08x\n", hres); ok(!fetched, "fetched = %d\n", fetched); /* Although fetched==0, an element is returned. */ @@ -2184,12 +2184,12 @@ static void test_EnumVerbs(IWebBrowser2 *wb) fetched = 0xdeadbeef; memset(verbs, 0xa, sizeof(verbs)); verbs[0].lVerb = 0xdeadbeef; - hres = IEnumOLEVERB_Next(enum_verbs, sizeof(verbs)/sizeof(*verbs), verbs, &fetched); + hres = IEnumOLEVERB_Next(enum_verbs, ARRAY_SIZE(verbs), verbs, &fetched); todo_wine ok(hres == S_OK, "Next failed: %08x\n", hres); todo_wine ok(fetched == 1, "fetched = %d\n", fetched); todo_wine ok(verbs[0].lVerb != 0xdeadbeef, "verbs[0].lVerb = %x\n", verbs[0].lVerb); - hres = IEnumOLEVERB_Next(enum_verbs, sizeof(verbs)/sizeof(*verbs), verbs, &fetched); + hres = IEnumOLEVERB_Next(enum_verbs, ARRAY_SIZE(verbs), verbs, &fetched); ok(hres == S_FALSE, "Next failed: %08x\n", hres); ok(!fetched, "fetched = %d\n", fetched);
1
0
0
0
Michael Stefaniuc : msvcr120/tests: Use the available ARRAY_SIZE() macro.
by Alexandre Julliard
11 Jun '18
11 Jun '18
Module: wine Branch: master Commit: dd8a9897effa3f0b2fe67c5586e300bea2e02530 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=dd8a9897effa3f0b2fe67c55…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Wed Jun 6 00:38:35 2018 +0200 msvcr120/tests: Use the available ARRAY_SIZE() macro. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcr120/tests/msvcr120.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/dlls/msvcr120/tests/msvcr120.c b/dlls/msvcr120/tests/msvcr120.c index 152bfdf..85e83a6 100644 --- a/dlls/msvcr120/tests/msvcr120.c +++ b/dlls/msvcr120/tests/msvcr120.c @@ -408,7 +408,7 @@ static void test_lconv(void) "Japanese", "Korean", "Spanish" }; - for(i = 0; i < sizeof(locstrs) / sizeof(char *); i ++) + for(i = 0; i < ARRAY_SIZE(locstrs); i ++) test_lconv_helper(locstrs[i]); } @@ -445,7 +445,7 @@ static void test__dpcomp(void) }; int i, ret; - for(i=0; i<sizeof(tests)/sizeof(*tests); i++) { + for(i=0; i<ARRAY_SIZE(tests); i++) { ret = p__dpcomp(tests[i].x, tests[i].y); ok(ret == tests[i].ret, "%d) dpcomp(%f, %f) = %x\n", i, tests[i].x, tests[i].y, ret); } @@ -473,7 +473,7 @@ static void test____lc_locale_name_func(void) int i, j; wchar_t **lc_names; - for(i=0; i<sizeof(tests)/sizeof(*tests); i++) { + for(i=0; i<ARRAY_SIZE(tests); i++) { if(!p_setlocale(LC_ALL, tests[i].locale)) continue; @@ -536,12 +536,11 @@ static void test__W_Gettnames(void) else ok(size==0x164, "structure size: %x\n", size); - for(i=0; i<sizeof(str)/sizeof(*str); i++) { + for(i=0; i<ARRAY_SIZE(str); i++) { ok(!strcmp(ret->str[i], str[i]), "ret->str[%d] = %s, expected %s\n", i, ret->str[i], str[i]); - MultiByteToWideChar(CP_ACP, 0, str[i], strlen(str[i])+1, - buf, sizeof(buf)/sizeof(*buf)); + MultiByteToWideChar(CP_ACP, 0, str[i], strlen(str[i])+1, buf, ARRAY_SIZE(buf)); ok(!lstrcmpW(ret->wstr[i], buf), "ret->wstr[%d] = %s, expected %s\n", i, wine_dbgstr_w(ret->wstr[i]), wine_dbgstr_w(buf)); } @@ -640,7 +639,7 @@ static void test_remainder(void) if(sizeof(void*) != 8) /* errno handling slightly different on 32-bit */ return; - for(i=0; i<sizeof(tests)/sizeof(*tests); i++) { + for(i=0; i<ARRAY_SIZE(tests); i++) { errno = -1; r = p_remainder(tests[i].x, tests[i].y); e = errno; @@ -907,7 +906,7 @@ static void test_wctype(void) }; int i, ret; - for(i=0; i<sizeof(properties)/sizeof(properties[0]); i++) { + for(i=0; i<ARRAY_SIZE(properties); i++) { ret = p_wctype(properties[i].name); ok(properties[i].mask == ret, "%d - Expected %x, got %x\n", i, properties[i].mask, ret); }
1
0
0
0
Michael Stefaniuc : msvcr110/tests: Use the available ARRAY_SIZE() macro.
by Alexandre Julliard
11 Jun '18
11 Jun '18
Module: wine Branch: master Commit: 51560bb9e5f50facae23935e97194bf72cca9dc1 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=51560bb9e5f50facae23935e…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Wed Jun 6 00:38:34 2018 +0200 msvcr110/tests: Use the available ARRAY_SIZE() macro. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcr110/tests/msvcr110.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/msvcr110/tests/msvcr110.c b/dlls/msvcr110/tests/msvcr110.c index 3aa394d..c0a182f 100644 --- a/dlls/msvcr110/tests/msvcr110.c +++ b/dlls/msvcr110/tests/msvcr110.c @@ -61,7 +61,7 @@ static void test_setlocale(void) "uz-Latn-uz", }; - for(i=0; i<sizeof(names)/sizeof(*names); i++) { + for(i=0; i<ARRAY_SIZE(names); i++) { ret = p_setlocale(LC_ALL, names[i]); ok(ret != NULL, "expected success, but got NULL\n"); ok(!strcmp(ret, names[i]), "expected %s, got %s\n", names[i], ret);
1
0
0
0
Michael Stefaniuc : msvcr90/tests: Use the available ARRAY_SIZE() macro.
by Alexandre Julliard
11 Jun '18
11 Jun '18
Module: wine Branch: master Commit: 551ff6e9666cd1d97a4dc3eb6414526e127da313 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=551ff6e9666cd1d97a4dc3eb…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Wed Jun 6 00:38:33 2018 +0200 msvcr90/tests: Use the available ARRAY_SIZE() macro. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcr90/tests/msvcr90.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/msvcr90/tests/msvcr90.c b/dlls/msvcr90/tests/msvcr90.c index dd62f3a..777d4fe 100644 --- a/dlls/msvcr90/tests/msvcr90.c +++ b/dlls/msvcr90/tests/msvcr90.c @@ -900,7 +900,7 @@ static void test_bsearch_s(void) CHECK_CALLED(invalid_parameter_handler, EINVAL); /* just try all array sizes */ - for (j=1;j<sizeof(arr)/sizeof(arr[0]);j++) { + for (j=1; j<ARRAY_SIZE(arr); j++) { for (i=0;i<j;i++) { l = arr[i]; g_bsearch_s_context_counter = 0; @@ -1494,7 +1494,7 @@ static void test__AdjustPointer(void) void *ret; int i; - for(i=0; i<sizeof(data)/sizeof(data[0]); i++) { + for(i=0; i<ARRAY_SIZE(data); i++) { ret = p__AdjustPointer(data[i].ptr, &data[i].this_ptr_offsets); ok(ret == data[i].ret, "%d) __AdjustPointer returned %p, expected %p\n", i, ret, data[i].ret); } @@ -1734,7 +1734,7 @@ static void test__fpieee_flt(void) ok(ret == EXCEPTION_CONTINUE_SEARCH, "_fpieee_flt returned %d\n", ret); ok(handler_called == 0, "handler_called = %d\n", handler_called); - for(i=0; i<sizeof(test_data)/sizeof(test_data[0]); i++) { + for(i=0; i<ARRAY_SIZE(test_data); i++) { ep.ExceptionRecord = &rec; ep.ContextRecord = &ctx; memset(&rec, 0, sizeof(rec));
1
0
0
0
Michael Stefaniuc : msvcp140/tests: Use the available ARRAY_SIZE() macro.
by Alexandre Julliard
11 Jun '18
11 Jun '18
Module: wine Branch: master Commit: 65033d22eaac4a04ce27944fdfc5fe5bc3360f83 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=65033d22eaac4a04ce27944f…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Wed Jun 6 00:38:32 2018 +0200 msvcp140/tests: Use the available ARRAY_SIZE() macro. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcp140/tests/msvcp140.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/dlls/msvcp140/tests/msvcp140.c b/dlls/msvcp140/tests/msvcp140.c index 593e0ce..06ea11d 100644 --- a/dlls/msvcp140/tests/msvcp140.c +++ b/dlls/msvcp140/tests/msvcp140.c @@ -555,11 +555,10 @@ static void test_to_byte(void) ok(!memcmp(dst, compare, sizeof(compare)), "Destination was modified: %s\n", dst); - for (i = 0; i < sizeof(tests) / sizeof(*tests); ++i) + for (i = 0; i < ARRAY_SIZE(tests); ++i) { ret = p_To_byte(tests[i], dst); - expected = WideCharToMultiByte(CP_ACP, 0, tests[i], -1, compare, sizeof(compare) / sizeof(*compare), - NULL, NULL); + expected = WideCharToMultiByte(CP_ACP, 0, tests[i], -1, compare, ARRAY_SIZE(compare), NULL, NULL); ok(ret == expected, "Got unexpected result %d, expected %d, test case %u\n", ret, expected, i); ok(!memcmp(dst, compare, sizeof(compare)), "Got unexpected output %s, test case %u\n", dst, i); } @@ -601,10 +600,10 @@ static void test_to_wide(void) ok(!ret, "Got unexpected result %d\n", ret); ok(!memcmp(dst, compare, sizeof(compare)), "Destination was modified: %s\n", wine_dbgstr_w(dst)); - for (i = 0; i < sizeof(tests) / sizeof(*tests); ++i) + for (i = 0; i < ARRAY_SIZE(tests); ++i) { ret = p_To_wide(tests[i], dst); - expected = MultiByteToWideChar(CP_ACP, 0, tests[i], -1, compare, sizeof(compare) / sizeof(*compare)); + expected = MultiByteToWideChar(CP_ACP, 0, tests[i], -1, compare, ARRAY_SIZE(compare)); ok(ret == expected, "Got unexpected result %d, expected %d, test case %u\n", ret, expected, i); ok(!memcmp(dst, compare, sizeof(compare)), "Got unexpected output %s, test case %u\n", wine_dbgstr_w(dst), i); @@ -829,7 +828,7 @@ static void test_Stat(void) todo_wine ok(0777 == perms, "_Lstat(): perms expect: 0777, got 0%o\n", perms); ok(CloseHandle(file), "CloseHandle\n"); - for(i=0; i<sizeof(tests)/sizeof(tests[0]); i++) { + for(i=0; i<ARRAY_SIZE(tests); i++) { perms = 0xdeadbeef; val = p_Stat(tests[i].path, &perms); todo_wine_if(tests[i].is_todo) { @@ -1043,7 +1042,7 @@ static void test_Unlink(void) ret = p_Link(f1W, f1_linkW); ok(ret == ERROR_SUCCESS, "_Link(): expect: ERROR_SUCCESS, got %d\n", ret); - for(i=0; i<sizeof(tests)/sizeof(tests[0]); i++) { + for(i=0; i<ARRAY_SIZE(tests); i++) { errno = 0xdeadbeef; ret = p_Unlink(tests[i].path); todo_wine_if(tests[i].is_todo)
1
0
0
0
Michael Stefaniuc : msvcp120/tests: Use the available ARRAY_SIZE() macro.
by Alexandre Julliard
11 Jun '18
11 Jun '18
Module: wine Branch: master Commit: b2a38758497f4018cf0087da3020ac201e27fc6b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b2a38758497f4018cf0087da…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Wed Jun 6 00:38:31 2018 +0200 msvcp120/tests: Use the available ARRAY_SIZE() macro. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcp120/tests/msvcp120.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/dlls/msvcp120/tests/msvcp120.c b/dlls/msvcp120/tests/msvcp120.c index 7f72075..969902d 100644 --- a/dlls/msvcp120/tests/msvcp120.c +++ b/dlls/msvcp120/tests/msvcp120.c @@ -785,7 +785,7 @@ static void test__Xtime_diff_to_millis2(void) MSVCRT_long ret; xtime t1, t2; - for(i = 0; i < sizeof(tests) / sizeof(tests[0]); ++ i) + for(i = 0; i < ARRAY_SIZE(tests); ++ i) { t1.sec = tests[i].sec_before; t1.nsec = tests[i].nsec_before; @@ -805,7 +805,7 @@ static void test_xtime_get(void) xtime before, after; int i; - for(i = 0; i < sizeof(tests) / sizeof(tests[0]); i ++) + for(i = 0; i < ARRAY_SIZE(tests); i ++) { p_xtime_get(&before, 1); Sleep(tests[i]); @@ -1166,7 +1166,7 @@ static void test_tr2_sys__Equivalent(void) ok(file != INVALID_HANDLE_VALUE, "create file failed: INVALID_HANDLE_VALUE\n"); CloseHandle(file); - for(i=0; i<sizeof(tests)/sizeof(tests[0]); i++) { + for(i=0; i<ARRAY_SIZE(tests); i++) { errno = 0xdeadbeef; val = p_tr2_sys__Equivalent(tests[i].path1, tests[i].path2); ok(tests[i].equivalent == val, "tr2_sys__Equivalent(): test %d expect: %d, got %d\n", i+1, tests[i].equivalent, val); @@ -1272,7 +1272,7 @@ static void test_tr2_sys__Make_dir(void) { "??invalid_name>>", -1 } }; - for(i=0; i<sizeof(tests)/sizeof(tests[0]); i++) { + for(i=0; i<ARRAY_SIZE(tests); i++) { errno = 0xdeadbeef; ret = p_tr2_sys__Make_dir(tests[i].path); ok(ret == tests[i].val, "tr2_sys__Make_dir(): test %d expect: %d, got %d\n", i+1, tests[i].val, ret); @@ -1301,7 +1301,7 @@ static void test_tr2_sys__Remove_dir(void) ok(p_tr2_sys__Make_dir("tr2_test_dir"), "tr2_sys__Make_dir() failed\n"); - for(i=0; i<sizeof(tests)/sizeof(tests[0]); i++) { + for(i=0; i<ARRAY_SIZE(tests); i++) { errno = 0xdeadbeef; ret = p_tr2_sys__Remove_dir(tests[i].path); ok(ret == tests[i].val, "test_tr2_sys__Remove_dir(): test %d expect: %d, got %d\n", i+1, tests[i].val, ret); @@ -1345,7 +1345,7 @@ static void test_tr2_sys__Copy_file(void) ok(SetEndOfFile(file), "SetEndOfFile failed\n"); CloseHandle(file); - for(i=0; i<sizeof(tests)/sizeof(tests[0]); i++) { + for(i=0; i<ARRAY_SIZE(tests); i++) { errno = 0xdeadbeef; ret = p_tr2_sys__Copy_file(tests[i].source, tests[i].dest, tests[i].fail_if_exists); todo_wine_if(tests[i].is_todo) @@ -1403,7 +1403,7 @@ static void test_tr2_sys__Rename(void) ret = p_tr2_sys__Rename("tr2_test_dir\\f1", "tr2_test_dir\\f1"); todo_wine ok(ERROR_SUCCESS == ret, "test_tr2_sys__Rename(): expect: ERROR_SUCCESS, got %d\n", ret); - for(i=0; i<sizeof(tests)/sizeof(tests[0]); i++) { + for(i=0; i<ARRAY_SIZE(tests); i++) { errno = 0xdeadbeef; if(tests[i].val == ERROR_SUCCESS) { h1 = CreateFileA(tests[i].old_path, 0, FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE, @@ -1542,7 +1542,7 @@ static void test_tr2_sys__Stat(void) todo_wine ok(ERROR_SUCCESS == err_code, "tr2_sys__Lstat(): err_code expect: ERROR_SUCCESS, got %d\n", err_code); ok(CloseHandle(file), "CloseHandle\n"); - for(i=0; i<sizeof(tests)/sizeof(tests[0]); i++) { + for(i=0; i<ARRAY_SIZE(tests); i++) { err_code = 0xdeadbeef; val = p_tr2_sys__Stat(tests[i].path, &err_code); todo_wine_if(tests[i].is_todo) @@ -1744,7 +1744,7 @@ static void test_tr2_sys__Link(void) ok(SetEndOfFile(file), "SetEndOfFile failed\n"); CloseHandle(file); - for(i=0; i<sizeof(tests)/sizeof(tests[0]); i++) { + for(i=0; i<ARRAY_SIZE(tests); i++) { errno = 0xdeadbeef; ret = p_tr2_sys__Link(tests[i].existing_path, tests[i].new_path); ok(ret == tests[i].last_error, "tr2_sys__Link(): test %d expect: %d, got %d\n", @@ -1820,7 +1820,7 @@ static void test_tr2_sys__Symlink(void) ok(SetEndOfFile(file), "SetEndOfFile failed\n"); CloseHandle(file); - for(i=0; i<sizeof(tests)/sizeof(tests[0]); i++) { + for(i=0; i<ARRAY_SIZE(tests); i++) { errno = 0xdeadbeef; SetLastError(0xdeadbeef); ret = p_tr2_sys__Symlink(tests[i].existing_path, tests[i].new_path); @@ -1892,7 +1892,7 @@ static void test_tr2_sys__Unlink(void) ret = p_tr2_sys__Link("tr2_test_dir/f1", "tr2_test_dir/f1_link"); ok(ret == ERROR_SUCCESS, "tr2_sys__Link(): expect: ERROR_SUCCESS, got %d\n", ret); - for(i=0; i<sizeof(tests)/sizeof(tests[0]); i++) { + for(i=0; i<ARRAY_SIZE(tests); i++) { errno = 0xdeadbeef; ret = p_tr2_sys__Unlink(tests[i].path); todo_wine_if(tests[i].is_todo) @@ -1949,14 +1949,14 @@ static void test_thrd(void) }; /* test for equal */ - for(i=0; i<sizeof(testeq)/sizeof(testeq[0]); i++) { + for(i=0; i<ARRAY_SIZE(testeq); i++) { ret = p__Thrd_equal(testeq[i].a, testeq[i].b); ok(ret == testeq[i].r, "(%p %u) = (%p %u) expected %d, got %d\n", testeq[i].a.hnd, testeq[i].a.id, testeq[i].b.hnd, testeq[i].b.id, testeq[i].r, ret); } /* test for less than */ - for(i=0; i<sizeof(testlt)/sizeof(testlt[0]); i++) { + for(i=0; i<ARRAY_SIZE(testlt); i++) { ret = p__Thrd_lt(testlt[i].a, testlt[i].b); ok(ret == testlt[i].r, "(%p %u) < (%p %u) expected %d, got %d\n", testlt[i].a.hnd, testlt[i].a.id, testlt[i].b.hnd, testlt[i].b.id, testlt[i].r, ret); @@ -2323,7 +2323,7 @@ static void test_vector_base_v4__Segment_index_of(void) {~0, 8*sizeof(void*)-1} }; - for(i=0; i<sizeof(tests) / sizeof(tests[0]); i++) { + for(i=0; i<ARRAY_SIZE(tests); i++) { ret = p_vector_base_v4__Segment_index_of(tests[i].x); ok(ret == tests[i].expect, "expected %ld, got %ld for %ld\n", (long)tests[i].expect, (long)ret, (long)tests[i].x);
1
0
0
0
Michael Stefaniuc : msvcp90/tests: Use the available ARRAY_SIZE() macro.
by Alexandre Julliard
11 Jun '18
11 Jun '18
Module: wine Branch: master Commit: c52a7b19cfaaad823ae541d8ac5c319f2772c2bf URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c52a7b19cfaaad823ae541d8…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Wed Jun 6 00:38:30 2018 +0200 msvcp90/tests: Use the available ARRAY_SIZE() macro. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcp90/tests/ios.c | 24 ++++++++++++------------ dlls/msvcp90/tests/misc.c | 2 +- dlls/msvcp90/tests/string.c | 6 +++--- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/dlls/msvcp90/tests/ios.c b/dlls/msvcp90/tests/ios.c index c075f01..8a91117 100644 --- a/dlls/msvcp90/tests/ios.c +++ b/dlls/msvcp90/tests/ios.c @@ -1137,7 +1137,7 @@ static void test_num_get_get_uint64(void) { "0xx10", NULL, FMTFLAG_hex, IOSTATE_failbit, 42, EOF }, }; - for(i=0; i<sizeof(tests)/sizeof(tests[0]); i++) { + for(i=0; i<ARRAY_SIZE(tests); i++) { /* char version */ call_func2(p_basic_string_char_ctor_cstr, &str, tests[i].str); call_func4(p_basic_stringstream_char_ctor_str, &ss, &str, OPENMODE_out|OPENMODE_in, TRUE); @@ -1287,7 +1287,7 @@ static void test_num_get_get_double(void) { "1.0e1,0", NULL, IOSTATE_goodbit, 10.0, ',' }, /* group in exponent */ }; - for(i=0; i<sizeof(tests)/sizeof(tests[0]); i++) { + for(i=0; i<ARRAY_SIZE(tests); i++) { /* char version */ call_func2(p_basic_string_char_ctor_cstr, &str, tests[i].str); call_func4(p_basic_stringstream_char_ctor_str, &ss, &str, OPENMODE_out|OPENMODE_in, TRUE); @@ -1406,7 +1406,7 @@ static void test_num_put_put_double(void) { -1.23456789e-9, NULL, 9, FMTFLAG_fixed, "-0.000000001" } }; - for(i=0; i<sizeof(tests)/sizeof(tests[0]); i++) { + for(i=0; i<ARRAY_SIZE(tests); i++) { /* char version */ call_func1(p_basic_stringstream_char_ctor, &ss); @@ -1499,7 +1499,7 @@ static void test_istream_ipfx(void) { "\n\t ws", TRUE, FALSE, TRUE, IOSTATE_goodbit, '\n' }, }; - for(i=0; i<sizeof(tests)/sizeof(tests[0]); i++) { + for(i=0; i<ARRAY_SIZE(tests); i++) { /* char version */ call_func2(p_basic_string_char_ctor_cstr, &str, tests[i].str); call_func4(p_basic_stringstream_char_ctor_str, &ss, &str, OPENMODE_out|OPENMODE_in, TRUE); @@ -1579,7 +1579,7 @@ static void test_istream_ignore(void) { "ABC ", 42, ' ', IOSTATE_goodbit, EOF }, /* delim at end */ }; - for(i=0; i<sizeof(tests)/sizeof(tests[0]); i++) { + for(i=0; i<ARRAY_SIZE(tests); i++) { /* char version */ call_func2(p_basic_string_char_ctor_cstr, &str, tests[i].str); call_func4(p_basic_stringstream_char_ctor_str, &ss, &str, OPENMODE_out|OPENMODE_in, TRUE); @@ -1643,7 +1643,7 @@ static void test_istream_seekg(void) { "", 0, SEEKDIR_beg, IOSTATE_failbit, EOF }, }; - for(i=0; i<sizeof(tests)/sizeof(tests[0]); i++) { + for(i=0; i<ARRAY_SIZE(tests); i++) { /* char version */ call_func2(p_basic_string_char_ctor_cstr, &str, tests[i].str); call_func4(p_basic_stringstream_char_ctor_str, &ss, &str, OPENMODE_out|OPENMODE_in, TRUE); @@ -1702,7 +1702,7 @@ static void test_istream_seekg_fpos(void) { "", 0, IOSTATE_failbit, EOF }, }; - for(i=0; i<sizeof(tests)/sizeof(tests[0]); i++) { + for(i=0; i<ARRAY_SIZE(tests); i++) { /* char version */ call_func2(p_basic_string_char_ctor_cstr, &str, tests[i].str); call_func4(p_basic_stringstream_char_ctor_str, &ss, &str, OPENMODE_out|OPENMODE_in, TRUE); @@ -1763,7 +1763,7 @@ static void test_istream_peek(void) { "ABCDEF", 'A', 'A', IOSTATE_goodbit }, }; - for(i=0; i<sizeof(tests)/sizeof(tests[0]); i++) { + for(i=0; i<ARRAY_SIZE(tests); i++) { /* char version */ call_func2(p_basic_string_char_ctor_cstr, &str, tests[i].str); call_func4(p_basic_stringstream_char_ctor_str, &ss, &str, OPENMODE_out|OPENMODE_in, TRUE); @@ -1834,7 +1834,7 @@ static void test_istream_tellg(void) { "ABCDEFGHIJ", -6, -1, -1, 0 } }; - for(i=0; i<sizeof(tests)/sizeof(tests[0]); i++) { + for(i=0; i<ARRAY_SIZE(tests); i++) { /* stringstream<char> version */ call_func2(p_basic_string_char_ctor_cstr, &str, tests[i].str); call_func4(p_basic_stringstream_char_ctor_str, &ss, &str, OPENMODE_out|OPENMODE_in, TRUE); @@ -1980,7 +1980,7 @@ static void test_istream_getline(void) { "this is some text\n", "this is some text\n", '\0', IOSTATE_eofbit, "this is some text\n", '\n', IOSTATE_faileof }, }; - for(i=0; i<sizeof(tests)/sizeof(tests[0]); i++) { + for(i=0; i<ARRAY_SIZE(tests); i++) { /* char version */ call_func2(p_basic_string_char_ctor_cstr, &str, tests[i].str); call_func4(p_basic_stringstream_char_ctor_str, &ss, &str, OPENMODE_out|OPENMODE_in, TRUE); @@ -2208,7 +2208,7 @@ static void test_ostream_print_complex_float(void) { {-1.23456789e-9,2.3456789e9}, NULL, 9, FMTFLAG_fixed, "(-0.000000001,2345678848.000000000)" } }; - for(i=0; i<sizeof(tests)/sizeof(tests[0]); i++) { + for(i=0; i<ARRAY_SIZE(tests); i++) { call_func1(p_basic_stringstream_char_ctor, &ss); if(tests[i].lcl) { @@ -2331,7 +2331,7 @@ static void test_istream_read_complex_double(void) { "(1.0eE10, 3)" , NULL, deadbeef, IOSTATE_failbit, ""}, }; - for(i=0; i<sizeof(tests)/sizeof(tests[0]); i++) { + for(i=0; i<ARRAY_SIZE(tests); i++) { call_func2(p_basic_string_char_ctor_cstr, &str, deadbeef_str); call_func4(p_basic_stringstream_char_ctor_str, &ss, &str, OPENMODE_out|OPENMODE_in, TRUE); p_basic_istream_char_read_complex_double(&ss.base.base1, &val); diff --git a/dlls/msvcp90/tests/misc.c b/dlls/msvcp90/tests/misc.c index ffc7b96..e9fd1e0 100644 --- a/dlls/msvcp90/tests/misc.c +++ b/dlls/msvcp90/tests/misc.c @@ -582,7 +582,7 @@ static void test_wctype(void) }; int i, ret; - for(i=0; i<sizeof(properties)/sizeof(properties[0]); i++) { + for(i=0; i<ARRAY_SIZE(properties); i++) { ret = p_wctype(properties[i].name); ok(properties[i].mask == ret, "%d - Expected %x, got %x\n", i, properties[i].mask, ret); } diff --git a/dlls/msvcp90/tests/string.c b/dlls/msvcp90/tests/string.c index 9d46df0..a0f16a9 100644 --- a/dlls/msvcp90/tests/string.c +++ b/dlls/msvcp90/tests/string.c @@ -554,7 +554,7 @@ static void test_basic_string_char_rfind(void) { { "aaa", "z", 0, 1, *p_basic_string_char_npos } /* can't find */ }; - for(i=0; i<sizeof(tests)/sizeof(tests[0]); i++) { + for(i=0; i<ARRAY_SIZE(tests); i++) { call_func2(p_basic_string_char_ctor_cstr, &str, tests[i].str); ret = (size_t)call_func4(p_basic_string_char_rfind_cstr_substr, &str, @@ -602,7 +602,7 @@ static void test_basic_string_char_replace(void) { { "ABCDEF", 6, *p_basic_string_char_npos, "-", "ABCDEF-" }, /* replace after end with npos */ }; - for(i=0; i<sizeof(tests)/sizeof(tests[0]); i++) { + for(i=0; i<ARRAY_SIZE(tests); i++) { call_func2(p_basic_string_char_ctor_cstr, &str, tests[i].str); ret = call_func4(p_basic_string_char_replace_cstr, &str, tests[i].off, tests[i].len, tests[i].replace); @@ -756,7 +756,7 @@ static void test_basic_string_char_find_last_not_of(void) { { "ABCDE", "", 5, 0, 4 }, }; - for(i=0; i<sizeof(tests)/sizeof(tests[0]); i++) { + for(i=0; i<ARRAY_SIZE(tests); i++) { call_func2(p_basic_string_char_ctor_cstr, &str, tests[i].str); ret = (size_t)call_func4(p_basic_string_char_find_last_not_of_cstr_substr,
1
0
0
0
Michael Stefaniuc : msvcp60/tests: Use the available ARRAY_SIZE() macro.
by Alexandre Julliard
11 Jun '18
11 Jun '18
Module: wine Branch: master Commit: d9a60ebf47e18e5e2c349e5c9af477f9e93b0940 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d9a60ebf47e18e5e2c349e5c…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Wed Jun 6 00:38:29 2018 +0200 msvcp60/tests: Use the available ARRAY_SIZE() macro. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcp60/tests/ios.c | 18 +++++++++--------- dlls/msvcp60/tests/string.c | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/dlls/msvcp60/tests/ios.c b/dlls/msvcp60/tests/ios.c index 087aa2c..1938a51 100644 --- a/dlls/msvcp60/tests/ios.c +++ b/dlls/msvcp60/tests/ios.c @@ -858,7 +858,7 @@ static void test_num_get_get_double(void) { "1.0e1,0", NULL, IOSTATE_goodbit, 10.0, ',' }, /* group in exponent */ }; - for(i=0; i<sizeof(tests)/sizeof(tests[0]); i++) { + for(i=0; i<ARRAY_SIZE(tests); i++) { /* char version */ call_func3(p_basic_string_char_ctor_cstr_alloc, &str, tests[i].str, &fake_allocator); call_func4(p_basic_stringstream_char_ctor_str, &ss, &str, OPENMODE_out|OPENMODE_in, TRUE); @@ -982,7 +982,7 @@ static void test_num_put_put_double(void) { -1.23456789e-9, NULL, 9, FMTFLAG_fixed, "-0.000000001" } }; - for(i=0; i<sizeof(tests)/sizeof(tests[0]); i++) { + for(i=0; i<ARRAY_SIZE(tests); i++) { /* char version */ call_func3(p_basic_stringstream_char_ctor_mode, &ss, OPENMODE_in|OPENMODE_out, TRUE); @@ -1072,7 +1072,7 @@ static void test_istream_ipfx(void) { "\n\t ws", TRUE, FALSE, TRUE, IOSTATE_goodbit, '\n' }, }; - for(i=0; i<sizeof(tests)/sizeof(tests[0]); i++) { + for(i=0; i<ARRAY_SIZE(tests); i++) { /* char version */ call_func3(p_basic_string_char_ctor_cstr_alloc, &str, tests[i].str, &fake_allocator); call_func4(p_basic_stringstream_char_ctor_str, &ss, &str, OPENMODE_out|OPENMODE_in, TRUE); @@ -1152,7 +1152,7 @@ static void test_istream_ignore(void) { "ABC ", 42, ' ', IOSTATE_goodbit, EOF }, /* delim at end */ }; - for(i=0; i<sizeof(tests)/sizeof(tests[0]); i++) { + for(i=0; i<ARRAY_SIZE(tests); i++) { /* char version */ call_func3(p_basic_string_char_ctor_cstr_alloc, &str, tests[i].str, &fake_allocator); call_func4(p_basic_stringstream_char_ctor_str, &ss, &str, OPENMODE_out|OPENMODE_in, TRUE); @@ -1216,7 +1216,7 @@ static void test_istream_seekg(void) { "", 0, SEEKDIR_beg, IOSTATE_goodbit, EOF }, }; - for(i=0; i<sizeof(tests)/sizeof(tests[0]); i++) { + for(i=0; i<ARRAY_SIZE(tests); i++) { /* char version */ call_func3(p_basic_string_char_ctor_cstr_alloc, &str, tests[i].str, &fake_allocator); call_func4(p_basic_stringstream_char_ctor_str, &ss, &str, OPENMODE_out|OPENMODE_in, TRUE); @@ -1275,7 +1275,7 @@ static void test_istream_seekg_fpos(void) { "", 0, IOSTATE_goodbit, EOF }, }; - for(i=0; i<sizeof(tests)/sizeof(tests[0]); i++) { + for(i=0; i<ARRAY_SIZE(tests); i++) { /* char version */ call_func3(p_basic_string_char_ctor_cstr_alloc, &str, tests[i].str, &fake_allocator); call_func4(p_basic_stringstream_char_ctor_str, &ss, &str, OPENMODE_out|OPENMODE_in, TRUE); @@ -1336,7 +1336,7 @@ static void test_istream_peek(void) { "ABCDEF", 'A', 'A', IOSTATE_goodbit }, }; - for(i=0; i<sizeof(tests)/sizeof(tests[0]); i++) { + for(i=0; i<ARRAY_SIZE(tests); i++) { /* char version */ call_func3(p_basic_string_char_ctor_cstr_alloc, &str, tests[i].str, &fake_allocator); call_func4(p_basic_stringstream_char_ctor_str, &ss, &str, OPENMODE_out|OPENMODE_in, TRUE); @@ -1407,7 +1407,7 @@ static void test_istream_tellg(void) { "ABCDEFGHIJ", -6, 0, 0, 0 } }; - for(i=0; i<sizeof(tests)/sizeof(tests[0]); i++) { + for(i=0; i<ARRAY_SIZE(tests); i++) { /* stringstream<char> version */ call_func3(p_basic_string_char_ctor_cstr_alloc, &str, tests[i].str, &fake_allocator); call_func4(p_basic_stringstream_char_ctor_str, &ss, &str, OPENMODE_out|OPENMODE_in, TRUE); @@ -1554,7 +1554,7 @@ static void test_istream_getline(void) return; } - for(i=0; i<sizeof(tests)/sizeof(tests[0]); i++) { + for(i=0; i<ARRAY_SIZE(tests); i++) { /* char version */ call_func3(p_basic_string_char_ctor_cstr_alloc, &str, tests[i].str, &fake_allocator); call_func4(p_basic_stringstream_char_ctor_str, &ss, &str, OPENMODE_out|OPENMODE_in, TRUE); diff --git a/dlls/msvcp60/tests/string.c b/dlls/msvcp60/tests/string.c index bf396f7..6a0efc1 100644 --- a/dlls/msvcp60/tests/string.c +++ b/dlls/msvcp60/tests/string.c @@ -599,7 +599,7 @@ static void test_basic_string_char_rfind(void) { { "aaa", "z", 0, 1, *p_basic_string_char_npos } /* can't find */ }; - for(i=0; i<sizeof(tests)/sizeof(tests[0]); i++) { + for(i=0; i<ARRAY_SIZE(tests); i++) { call_func3(p_basic_string_char_ctor_cstr_alloc, &str, tests[i].str, &fake_allocator); ret = (size_t)call_func4(p_basic_string_char_rfind_cstr_substr, &str, @@ -647,7 +647,7 @@ static void test_basic_string_char_replace(void) { { "ABCDEF", 6, *p_basic_string_char_npos, "-", "ABCDEF-" }, /* replace after end with npos */ }; - for(i=0; i<sizeof(tests)/sizeof(tests[0]); i++) { + for(i=0; i<ARRAY_SIZE(tests); i++) { call_func3(p_basic_string_char_ctor_cstr_alloc, &str, tests[i].str, &fake_allocator); ret = call_func4(p_basic_string_char_replace_cstr, &str, tests[i].off, tests[i].len, tests[i].replace);
1
0
0
0
Michael Stefaniuc : msvcirt/tests: Use the available ARRAY_SIZE() macro.
by Alexandre Julliard
11 Jun '18
11 Jun '18
Module: wine Branch: master Commit: 19626742770d64147afb41710d72066074acf232 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=19626742770d64147afb4171…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Wed Jun 6 00:38:28 2018 +0200 msvcirt/tests: Use the available ARRAY_SIZE() macro. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcirt/tests/msvcirt.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/msvcirt/tests/msvcirt.c b/dlls/msvcirt/tests/msvcirt.c index 61f166b..c856b50 100644 --- a/dlls/msvcirt/tests/msvcirt.c +++ b/dlls/msvcirt/tests/msvcirt.c @@ -3818,7 +3818,7 @@ static void test_ostream_print(void) ret = (int) call_func3(p_streambuf_xsputn, &ssb_test3.base, "we're gonna play it 3.14159", 27); ok(ret == 27, "expected 27 got %d\n", ret); - for (i = 0; i < sizeof(tests) / sizeof(tests[0]); i++) { + for (i = 0; i < ARRAY_SIZE(tests); i++) { os.base_ios.state = tests[i].state; os.base_ios.flags = tests[i].flags; os.base_ios.precision = tests[i].precision; @@ -5635,7 +5635,7 @@ static void test_istream_getint(void) pis = call_func3(p_istream_sb_ctor, &is, &ssb.base, TRUE); ok(pis == &is, "wrong return, expected %p got %p\n", &is, pis); - for (i = 0; i < sizeof(tests) / sizeof(tests[0]); i++) { + for (i = 0; i < ARRAY_SIZE(tests); i++) { len = strlen(tests[i].stream_content); is.base_ios.state = tests[i].initial_state; is.base_ios.flags = tests[i].flags; @@ -5747,7 +5747,7 @@ static void test_istream_getdouble(void) pis = call_func3(p_istream_sb_ctor, &is, &ssb.base, TRUE); ok(pis == &is, "wrong return, expected %p got %p\n", &is, pis); - for (i = 0; i < sizeof(tests) / sizeof(tests[0]); i++) { + for (i = 0; i < ARRAY_SIZE(tests); i++) { len = strlen(tests[i].stream_content); is.base_ios.state = tests[i].initial_state; is.base_ios.flags = tests[i].flags; @@ -5949,7 +5949,7 @@ static void test_istream_read(void) pis = call_func3(p_istream_sb_ctor, &is, &ssb.base, TRUE); ok(pis == &is, "wrong return, expected %p got %p\n", &is, pis); - for (i = 0; i < sizeof(tests) / sizeof(tests[0]); i++) { + for (i = 0; i < ARRAY_SIZE(tests); i++) { len = strlen(tests[i].stream_content); is.base_ios.state = IOSTATE_goodbit; is.base_ios.flags = tests[i].flags;
1
0
0
0
Dmitry Timoshkov : mstask/tests: Add more tests for IEnumWorkItems interface.
by Alexandre Julliard
11 Jun '18
11 Jun '18
Module: wine Branch: master Commit: 74cc9b6741960a1765ec73091e645c942ca7d0d7 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=74cc9b6741960a1765ec7309…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Mon Jun 11 17:24:38 2018 +0800 mstask/tests: Add more tests for IEnumWorkItems interface. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mstask/tests/task_scheduler.c | 75 +++++++++++++++++++++++++++++++++++--- 1 file changed, 70 insertions(+), 5 deletions(-) diff --git a/dlls/mstask/tests/task_scheduler.c b/dlls/mstask/tests/task_scheduler.c index d476638..f610225 100644 --- a/dlls/mstask/tests/task_scheduler.c +++ b/dlls/mstask/tests/task_scheduler.c @@ -212,23 +212,88 @@ done: static void test_Enum(void) { + static const WCHAR Task1[] = { 'w','i','n','e','t','a','s','k','1',0 }; ITaskScheduler *scheduler; + ITask *task; IEnumWorkItems *tasks; + WCHAR **names; + ULONG fetched; HRESULT hr; hr = CoCreateInstance(&CLSID_CTaskScheduler, NULL, CLSCTX_INPROC_SERVER, &IID_ITaskScheduler, (void **)&scheduler); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "got %#x\n", hr); + + /* cleanup after previous runs */ + ITaskScheduler_Delete(scheduler, Task1); + + hr = ITaskScheduler_NewWorkItem(scheduler, Task1, &CLSID_CTask, &IID_ITask, (IUnknown **)&task); + ok(hr == S_OK, "got %#x\n", hr); + hr = ITaskScheduler_AddWorkItem(scheduler, Task1, (IScheduledWorkItem *)task); + ok(hr == S_OK, "got %#x\n", hr); + + ITask_Release(task); -if (0) { /* crashes on win2k */ hr = ITaskScheduler_Enum(scheduler, NULL); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); -} + ok(hr == E_INVALIDARG, "got %#x\n", hr); hr = ITaskScheduler_Enum(scheduler, &tasks); - ok(hr == S_OK, "got 0x%08x\n", hr); + ok(hr == S_OK, "got %#x\n", hr); + + names = (void *)0xdeadbeef; + fetched = 0xdeadbeef; + hr = IEnumWorkItems_Next(tasks, 0, &names, &fetched); + ok(hr == E_INVALIDARG, "got %#x\n", hr); + ok(names == (void *)0xdeadbeef, "got %p\n", names); + ok(fetched == 0xdeadbeef, "got %#x\n", fetched); + + hr = IEnumWorkItems_Next(tasks, 1, NULL, NULL); + ok(hr == E_INVALIDARG, "got %#x\n", hr); + + names = NULL; + hr = IEnumWorkItems_Next(tasks, 1, &names, NULL); + ok(hr == S_OK, "got %#x\n", hr); + ok(names != NULL, "got NULL\n"); + ok(names[0] != NULL, "got NULL\n"); + CoTaskMemFree(names[0]); + CoTaskMemFree(names); + + names = (void *)0xdeadbeef; + hr = IEnumWorkItems_Next(tasks, 2, &names, NULL); + ok(hr == E_INVALIDARG, "got %#x\n", hr); + ok(names == (void *)0xdeadbeef, "got %p\n", names); + + hr = IEnumWorkItems_Reset(tasks); + ok(hr == S_OK, "got %#x\n", hr); + + names = NULL; + fetched = 0xdeadbeef; + hr = IEnumWorkItems_Next(tasks, 1, &names, &fetched); + ok(hr == S_OK, "got %#x\n", hr); + ok(names != NULL, "got NULL\n"); + ok(names[0] != NULL, "got NULL\n"); + ok(fetched == 1, "got %u\n", fetched); + CoTaskMemFree(names[0]); + CoTaskMemFree(names); + + while (IEnumWorkItems_Skip(tasks, 1) == S_OK) + /* do nothing*/; + + hr = IEnumWorkItems_Skip(tasks, 1); + ok(hr == S_FALSE, "got %#x\n", hr); + + names = (void *)0xdeadbeef; + fetched = 0xdeadbeef; + hr = IEnumWorkItems_Next(tasks, 1, &names, &fetched); + ok(hr == S_FALSE, "got %#x\n", hr); + ok(names == NULL, "got %p\n", names); + ok(fetched == 0, "got %u\n", fetched); + IEnumWorkItems_Release(tasks); + hr = ITaskScheduler_Delete(scheduler, Task1); + ok(hr == S_OK, "got %#x\n", hr); + ITaskScheduler_Release(scheduler); }
1
0
0
0
← Newer
1
...
44
45
46
47
48
49
50
...
63
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
Results per page:
10
25
50
100
200