Signed-off-by: André Zwing nerv@dawncrow.de --- dlls/kernel32/tests/locale.c | 68 +++++++++++++++--------------------- 1 file changed, 28 insertions(+), 40 deletions(-)
diff --git a/dlls/kernel32/tests/locale.c b/dlls/kernel32/tests/locale.c index d64a08666f8..2d327b7130c 100644 --- a/dlls/kernel32/tests/locale.c +++ b/dlls/kernel32/tests/locale.c @@ -7048,22 +7048,19 @@ static BOOL CALLBACK calinfo_procA(LPSTR calinfo)
static void test_EnumCalendarInfoA(void) { + BOOL ret; INT i;
- ok( EnumCalendarInfoA( calinfo_procA, - LOCALE_USER_DEFAULT, - ENUM_ALL_CALENDARS, - CAL_RETURN_NUMBER | CAL_ICALINTVALUE ), - "EnumCalendarInfoA for user default locale failed: %u\n", GetLastError() ); + ret = EnumCalendarInfoA( calinfo_procA, LOCALE_USER_DEFAULT, ENUM_ALL_CALENDARS, + CAL_RETURN_NUMBER | CAL_ICALINTVALUE ); + ok( ret, "EnumCalendarInfoA for user default locale failed: %u\n", GetLastError() );
for (i = 0; i < ARRAY_SIZE( locales_with_optional_calendars ); i++) { LCID lcid = locales_with_optional_calendars[i]; - ok( EnumCalendarInfoA( calinfo_procA, - lcid, - ENUM_ALL_CALENDARS, - CAL_RETURN_NUMBER | CAL_ICALINTVALUE ) || - broken( GetLastError() == ERROR_INVALID_FLAGS ) /* no locale */, + ret = EnumCalendarInfoA( calinfo_procA, lcid, ENUM_ALL_CALENDARS, + CAL_RETURN_NUMBER | CAL_ICALINTVALUE ); + ok( ret || broken( GetLastError() == ERROR_INVALID_FLAGS ) /* no locale */, "EnumCalendarInfoA for LCID %#06x failed: %u\n", lcid, GetLastError() ); } } @@ -7076,22 +7073,19 @@ static BOOL CALLBACK calinfo_procW(LPWSTR calinfo)
static void test_EnumCalendarInfoW(void) { + BOOL ret; INT i;
- ok( EnumCalendarInfoW( calinfo_procW, - LOCALE_USER_DEFAULT, - ENUM_ALL_CALENDARS, - CAL_RETURN_NUMBER | CAL_ICALINTVALUE ), - "EnumCalendarInfoW for user default locale failed: %u\n", GetLastError() ); + ret = EnumCalendarInfoW( calinfo_procW, LOCALE_USER_DEFAULT, ENUM_ALL_CALENDARS, + CAL_RETURN_NUMBER | CAL_ICALINTVALUE ); + ok( ret, "EnumCalendarInfoW for user default locale failed: %u\n", GetLastError() );
for (i = 0; i < ARRAY_SIZE( locales_with_optional_calendars ); i++) { LCID lcid = locales_with_optional_calendars[i]; - ok( EnumCalendarInfoW( calinfo_procW, - lcid, - ENUM_ALL_CALENDARS, - CAL_RETURN_NUMBER | CAL_ICALINTVALUE ) || - broken( GetLastError() == ERROR_INVALID_FLAGS ) /* no locale */, + ret = EnumCalendarInfoW( calinfo_procW, lcid, ENUM_ALL_CALENDARS, + CAL_RETURN_NUMBER | CAL_ICALINTVALUE ); + ok( ret || broken( GetLastError() == ERROR_INVALID_FLAGS ) /* no locale */, "EnumCalendarInfoW for LCID %#06x failed: %u\n", lcid, GetLastError() ); } } @@ -7105,22 +7099,19 @@ static BOOL CALLBACK calinfoex_procA(LPSTR calinfo, LCID calid)
static void test_EnumCalendarInfoExA(void) { + BOOL ret; INT i;
- ok( EnumCalendarInfoExA( calinfoex_procA, - LOCALE_USER_DEFAULT, - ENUM_ALL_CALENDARS, - CAL_RETURN_NUMBER | CAL_ICALINTVALUE ), - "EnumCalendarInfoExA for user default locale failed: %u\n", GetLastError() ); + ret = EnumCalendarInfoExA( calinfoex_procA, LOCALE_USER_DEFAULT, ENUM_ALL_CALENDARS, + CAL_RETURN_NUMBER | CAL_ICALINTVALUE ); + ok( ret, "EnumCalendarInfoExA for user default locale failed: %u\n", GetLastError() );
for (i = 0; i < ARRAY_SIZE( locales_with_optional_calendars ); i++) { LCID lcid = locales_with_optional_calendars[i]; - ok( EnumCalendarInfoExA( calinfoex_procA, - lcid, - ENUM_ALL_CALENDARS, - CAL_RETURN_NUMBER | CAL_ICALINTVALUE ) || - broken( GetLastError() == ERROR_INVALID_FLAGS ) /* no locale */, + ret = EnumCalendarInfoExA( calinfoex_procA, lcid, ENUM_ALL_CALENDARS, + CAL_RETURN_NUMBER | CAL_ICALINTVALUE ); + ok( ret || broken( GetLastError() == ERROR_INVALID_FLAGS ) /* no locale */, "EnumCalendarInfoExA for LCID %#06x failed: %u\n", lcid, GetLastError() ); } } @@ -7134,22 +7125,19 @@ static BOOL CALLBACK calinfoex_procW(LPWSTR calinfo, LCID calid)
static void test_EnumCalendarInfoExW(void) { + BOOL ret; INT i;
- ok( EnumCalendarInfoExW( calinfoex_procW, - LOCALE_USER_DEFAULT, - ENUM_ALL_CALENDARS, - CAL_RETURN_NUMBER | CAL_ICALINTVALUE ), - "EnumCalendarInfoExW for user default locale failed: %u\n", GetLastError() ); + ret = EnumCalendarInfoExW( calinfoex_procW, LOCALE_USER_DEFAULT, ENUM_ALL_CALENDARS, + CAL_RETURN_NUMBER | CAL_ICALINTVALUE ); + ok( ret, "EnumCalendarInfoExW for user default locale failed: %u\n", GetLastError() );
for (i = 0; i < ARRAY_SIZE( locales_with_optional_calendars ); i++) { LCID lcid = locales_with_optional_calendars[i]; - ok( EnumCalendarInfoExW( calinfoex_procW, - lcid, - ENUM_ALL_CALENDARS, - CAL_RETURN_NUMBER | CAL_ICALINTVALUE ) || - broken( GetLastError() == ERROR_INVALID_FLAGS ) /* no locale */, + ret = EnumCalendarInfoExW( calinfoex_procW, lcid, ENUM_ALL_CALENDARS, + CAL_RETURN_NUMBER | CAL_ICALINTVALUE ); + ok( ret || broken( GetLastError() == ERROR_INVALID_FLAGS ) /* no locale */, "EnumCalendarInfoExW for LCID %#06x failed: %u\n", lcid, GetLastError() ); } }
Signed-off-by: André Zwing nerv@dawncrow.de --- dlls/kernelbase/tests/process.c | 36 +++++++++++++++++---------------- 1 file changed, 19 insertions(+), 17 deletions(-)
diff --git a/dlls/kernelbase/tests/process.c b/dlls/kernelbase/tests/process.c index a28411f4e5b..1a008be9a7b 100644 --- a/dlls/kernelbase/tests/process.c +++ b/dlls/kernelbase/tests/process.c @@ -35,6 +35,7 @@ static BOOL (WINAPI *pCompareObjectHandles)(HANDLE, HANDLE); static void test_CompareObjectHandles(void) { HANDLE h1, h2; + BOOL ret;
if (!pCompareObjectHandles) { @@ -42,24 +43,24 @@ static void test_CompareObjectHandles(void) return; }
- ok( pCompareObjectHandles( GetCurrentProcess(), GetCurrentProcess() ), - "comparing GetCurrentProcess() to self failed with %u\n", GetLastError() ); + ret = pCompareObjectHandles( GetCurrentProcess(), GetCurrentProcess() ); + ok( ret, "comparing GetCurrentProcess() to self failed with %u\n", GetLastError() );
- ok( pCompareObjectHandles( GetCurrentThread(), GetCurrentThread() ), - "comparing GetCurrentThread() to self failed with %u\n", GetLastError() ); + ret = pCompareObjectHandles( GetCurrentThread(), GetCurrentThread() ); + ok( ret, "comparing GetCurrentThread() to self failed with %u\n", GetLastError() );
SetLastError(0); - ok( !pCompareObjectHandles( GetCurrentProcess(), GetCurrentThread() ) && - GetLastError() == ERROR_NOT_SAME_OBJECT, + ret = pCompareObjectHandles( GetCurrentProcess(), GetCurrentThread() ); + ok( !ret && GetLastError() == ERROR_NOT_SAME_OBJECT, "comparing GetCurrentProcess() to GetCurrentThread() returned %u\n", GetLastError() );
h1 = NULL; - ok( DuplicateHandle( GetCurrentProcess(), GetCurrentProcess(), GetCurrentProcess(), - &h1, 0, FALSE, DUPLICATE_SAME_ACCESS ), - "failed to duplicate current process handle: %u\n", GetLastError() ); + ret = DuplicateHandle( GetCurrentProcess(), GetCurrentProcess(), GetCurrentProcess(), + &h1, 0, FALSE, DUPLICATE_SAME_ACCESS ); + ok( ret, "failed to duplicate current process handle: %u\n", GetLastError() );
- ok( pCompareObjectHandles( GetCurrentProcess(), h1 ), - "comparing GetCurrentProcess() with %p failed with %u\n", h1, GetLastError() ); + ret = pCompareObjectHandles( GetCurrentProcess(), h1 ); + ok( ret, "comparing GetCurrentProcess() with %p failed with %u\n", h1, GetLastError() );
CloseHandle( h1 );
@@ -67,12 +68,12 @@ static void test_CompareObjectHandles(void) ok( h1 != INVALID_HANDLE_VALUE, "CreateFile failed (%d)\n", GetLastError() );
h2 = NULL; - ok( DuplicateHandle( GetCurrentProcess(), h1, GetCurrentProcess(), - &h2, 0, FALSE, DUPLICATE_SAME_ACCESS ), - "failed to duplicate handle %p: %u\n", h1, GetLastError() ); + ret = DuplicateHandle( GetCurrentProcess(), h1, GetCurrentProcess(), + &h2, 0, FALSE, DUPLICATE_SAME_ACCESS ); + ok( ret, "failed to duplicate handle %p: %u\n", h1, GetLastError() );
- ok( pCompareObjectHandles( h1, h2 ), - "comparing %p with %p failed with %u\n", h1, h2, GetLastError() ); + ret = pCompareObjectHandles( h1, h2 ); + ok( ret, "comparing %p with %p failed with %u\n", h1, h2, GetLastError() );
CloseHandle( h2 );
@@ -80,7 +81,8 @@ static void test_CompareObjectHandles(void) ok( h2 != INVALID_HANDLE_VALUE, "CreateFile failed (%d)\n", GetLastError() );
SetLastError(0); - ok( !pCompareObjectHandles( h1, h2 ) && GetLastError() == ERROR_NOT_SAME_OBJECT, + ret = pCompareObjectHandles( h1, h2 ); + ok( !ret && GetLastError() == ERROR_NOT_SAME_OBJECT, "comparing %p with %p returned %u\n", h1, h2, GetLastError() );
CloseHandle( h2 );