This patch removes initialization of unsued parameters and uses - count = 0xdeadbeef; + count = 0; when after an API call 'count' is checked by ok(count, "Expected count > 0\n");
Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru --- dlls/kernel32/tests/locale.c | 44 ++++++++++++------------------------ 1 file changed, 15 insertions(+), 29 deletions(-)
diff --git a/dlls/kernel32/tests/locale.c b/dlls/kernel32/tests/locale.c index 31add74e4e..8ff630a1eb 100644 --- a/dlls/kernel32/tests/locale.c +++ b/dlls/kernel32/tests/locale.c @@ -5318,7 +5318,7 @@ static void test_GetSystemPreferredUILanguages(void) }
/* (in)valid first parameter */ - count = 0xdeadbeef; + count = 0; size = 0; SetLastError(0xdeadbeef); ret = pGetSystemPreferredUILanguages(0, &count, NULL, &size); @@ -5326,7 +5326,6 @@ static void test_GetSystemPreferredUILanguages(void) ok(count, "Expected count > 0\n"); ok(size % 6 == 1, "Expected size (%d) %% 6 == 1\n", size);
- count = 0xdeadbeef; size = 0; SetLastError(0xdeadbeef); ret = pGetSystemPreferredUILanguages(MUI_FULL_LANGUAGE, &count, NULL, &size); @@ -5334,7 +5333,6 @@ static void test_GetSystemPreferredUILanguages(void) ok(ERROR_INVALID_PARAMETER == GetLastError(), "Expected error ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
- count = 0xdeadbeef; size = 0; SetLastError(0xdeadbeef); ret = pGetSystemPreferredUILanguages(MUI_LANGUAGE_ID | MUI_FULL_LANGUAGE, &count, NULL, &size); @@ -5342,7 +5340,6 @@ static void test_GetSystemPreferredUILanguages(void) ok(ERROR_INVALID_PARAMETER == GetLastError(), "Expected error ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
- count = 0xdeadbeef; size = 0; SetLastError(0xdeadbeef); ret = pGetSystemPreferredUILanguages(MUI_LANGUAGE_ID | MUI_LANGUAGE_NAME, &count, NULL, &size); @@ -5350,7 +5347,7 @@ static void test_GetSystemPreferredUILanguages(void) ok(ERROR_INVALID_PARAMETER == GetLastError(), "Expected error ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
- count = 0xdeadbeef; + count = 0; size = 0; SetLastError(0xdeadbeef); ret = pGetSystemPreferredUILanguages(MUI_LANGUAGE_ID | MUI_MACHINE_LANGUAGE_SETTINGS, &count, NULL, &size); @@ -5358,7 +5355,7 @@ static void test_GetSystemPreferredUILanguages(void) ok(count, "Expected count > 0\n"); ok(size % 5 == 1, "Expected size (%d) %% 5 == 1\n", size);
- count = 0xdeadbeef; + count = 0; size = 0; SetLastError(0xdeadbeef); ret = pGetSystemPreferredUILanguages(MUI_LANGUAGE_NAME | MUI_MACHINE_LANGUAGE_SETTINGS, &count, NULL, &size); @@ -5372,7 +5369,6 @@ static void test_GetSystemPreferredUILanguages(void) */
/* invalid third parameter */ - count = 0xdeadbeef; size = 1; SetLastError(0xdeadbeef); ret = pGetSystemPreferredUILanguages(MUI_LANGUAGE_ID, &count, NULL, &size); @@ -5385,7 +5381,7 @@ static void test_GetSystemPreferredUILanguages(void) * -> unhandled exception c0000005 */
- count = 0xdeadbeef; + count = 0; size_id = 0; SetLastError(0xdeadbeef); ret = pGetSystemPreferredUILanguages(MUI_LANGUAGE_ID, &count, NULL, &size_id); @@ -5393,7 +5389,7 @@ static void test_GetSystemPreferredUILanguages(void) ok(count, "Expected count > 0\n"); ok(size_id % 5 == 1, "Expected size (%d) %% 5 == 1\n", size_id);
- count = 0xdeadbeef; + count = 0; size_name = 0; SetLastError(0xdeadbeef); ret = pGetSystemPreferredUILanguages(MUI_LANGUAGE_NAME, &count, NULL, &size_name); @@ -5415,7 +5411,7 @@ static void test_GetSystemPreferredUILanguages(void) return; }
- count = 0xdeadbeef; + count = 0; size = size_buffer; memset(buffer, 0x5a, size_buffer * sizeof(WCHAR)); SetLastError(0xdeadbeef); @@ -5428,7 +5424,7 @@ static void test_GetSystemPreferredUILanguages(void) "Expected last two WCHARs being empty, got 0x%x 0x%x\n", buffer[size -2], buffer[size -1]);
- count = 0xdeadbeef; + count = 0; size = size_buffer; memset(buffer, 0x5a, size_buffer * sizeof(WCHAR)); SetLastError(0xdeadbeef); @@ -5441,7 +5437,7 @@ static void test_GetSystemPreferredUILanguages(void) "Expected last two WCHARs being empty, got 0x%x 0x%x\n", buffer[size -2], buffer[size -1]);
- count = 0xdeadbeef; + count = 0; size = size_buffer; SetLastError(0xdeadbeef); ret = pGetSystemPreferredUILanguages(MUI_LANGUAGE_NAME, &count, buffer, &size); @@ -5453,7 +5449,7 @@ static void test_GetSystemPreferredUILanguages(void) "Expected last two WCHARs being empty, got 0x%x 0x%x\n", buffer[size -2], buffer[size -1]);
- count = 0xdeadbeef; + count = 0; size = 0; SetLastError(0xdeadbeef); ret = pGetSystemPreferredUILanguages(MUI_MACHINE_LANGUAGE_SETTINGS, &count, NULL, &size); @@ -5465,7 +5461,6 @@ static void test_GetSystemPreferredUILanguages(void) "Expected last two WCHARs being empty, got 0x%x 0x%x\n", buffer[size -2], buffer[size -1]);
- count = 0xdeadbeef; size = 1; SetLastError(0xdeadbeef); ret = pGetSystemPreferredUILanguages(MUI_LANGUAGE_ID, &count, buffer, &size); @@ -5473,7 +5468,6 @@ static void test_GetSystemPreferredUILanguages(void) ok(ERROR_INSUFFICIENT_BUFFER == GetLastError(), "Expected error ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError());
- count = 0xdeadbeef; size = size_id -1; memset(buffer, 0x5a, size_buffer * sizeof(WCHAR)); SetLastError(0xdeadbeef); @@ -5482,7 +5476,6 @@ static void test_GetSystemPreferredUILanguages(void) ok(ERROR_INSUFFICIENT_BUFFER == GetLastError(), "Expected error ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError());
- count = 0xdeadbeef; size = size_id -2; memset(buffer, 0x5a, size_buffer * sizeof(WCHAR)); SetLastError(0xdeadbeef); @@ -5526,14 +5519,12 @@ static void test_GetUserPreferredUILanguages(void) ULONG count, size, size_id, size_name, size_buffer; WCHAR *buffer;
- if (!pGetUserPreferredUILanguages) { win_skip("GetUserPreferredUILanguages is not available.\n"); return; }
- count = 0xdeadbeef; size = 0; SetLastError(0xdeadbeef); ret = pGetUserPreferredUILanguages(MUI_FULL_LANGUAGE, &count, NULL, &size); @@ -5541,7 +5532,6 @@ static void test_GetUserPreferredUILanguages(void) ok(ERROR_INVALID_PARAMETER == GetLastError(), "Expected error ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
- count = 0xdeadbeef; size = 0; SetLastError(0xdeadbeef); ret = pGetUserPreferredUILanguages(MUI_LANGUAGE_ID | MUI_FULL_LANGUAGE, &count, NULL, &size); @@ -5549,7 +5539,6 @@ static void test_GetUserPreferredUILanguages(void) ok(ERROR_INVALID_PARAMETER == GetLastError(), "Expected error ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
- count = 0xdeadbeef; size = 0; SetLastError(0xdeadbeef); ret = pGetUserPreferredUILanguages(MUI_LANGUAGE_ID | MUI_MACHINE_LANGUAGE_SETTINGS, &count, NULL, &size); @@ -5557,7 +5546,6 @@ static void test_GetUserPreferredUILanguages(void) ok(ERROR_INVALID_PARAMETER == GetLastError(), "Expected error ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
- count = 0xdeadbeef; size = 1; SetLastError(0xdeadbeef); ret = pGetUserPreferredUILanguages(MUI_LANGUAGE_ID, &count, NULL, &size); @@ -5565,7 +5553,7 @@ static void test_GetUserPreferredUILanguages(void) ok(ERROR_INVALID_PARAMETER == GetLastError(), "Expected error ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
- count = 0xdeadbeef; + count = 0; size_id = 0; SetLastError(0xdeadbeef); ret = pGetUserPreferredUILanguages(MUI_LANGUAGE_ID, &count, NULL, &size_id); @@ -5573,7 +5561,7 @@ static void test_GetUserPreferredUILanguages(void) ok(count, "Expected count > 0\n"); ok(size_id % 5 == 1, "Expected size (%d) %% 5 == 1\n", size_id);
- count = 0xdeadbeef; + count = 0; size_name = 0; SetLastError(0xdeadbeef); ret = pGetUserPreferredUILanguages(MUI_LANGUAGE_NAME, &count, NULL, &size_name); @@ -5590,7 +5578,7 @@ static void test_GetUserPreferredUILanguages(void)
buffer = HeapAlloc(GetProcessHeap(), 0, size_buffer * sizeof(WCHAR));
- count = 0xdeadbeef; + count = 0; size = size_buffer; memset(buffer, 0x5a, size_buffer * sizeof(WCHAR)); SetLastError(0xdeadbeef); @@ -5603,7 +5591,7 @@ static void test_GetUserPreferredUILanguages(void) "Expected last two WCHARs being empty, got 0x%x 0x%x\n", buffer[size -2], buffer[size -1]);
- count = 0xdeadbeef; + count = 0; size = size_buffer; memset(buffer, 0x5a, size_buffer * sizeof(WCHAR)); SetLastError(0xdeadbeef); @@ -5616,7 +5604,7 @@ static void test_GetUserPreferredUILanguages(void) "Expected last two WCHARs being empty, got 0x%x 0x%x\n", buffer[size -2], buffer[size -1]);
- count = 0xdeadbeef; + count = 0; size = size_buffer; SetLastError(0xdeadbeef); ret = pGetUserPreferredUILanguages(MUI_LANGUAGE_NAME, &count, buffer, &size); @@ -5628,7 +5616,6 @@ static void test_GetUserPreferredUILanguages(void) "Expected last two WCHARs being empty, got 0x%x 0x%x\n", buffer[size -2], buffer[size -1]);
- count = 0xdeadbeef; size = 1; SetLastError(0xdeadbeef); ret = pGetUserPreferredUILanguages(MUI_LANGUAGE_ID, &count, buffer, &size); @@ -5636,7 +5623,6 @@ static void test_GetUserPreferredUILanguages(void) ok(ERROR_INSUFFICIENT_BUFFER == GetLastError(), "Expected error ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError());
- count = 0xdeadbeef; size = size_id -1; memset(buffer, 0x5a, size_buffer * sizeof(WCHAR)); SetLastError(0xdeadbeef); @@ -5645,7 +5631,7 @@ static void test_GetUserPreferredUILanguages(void) ok(ERROR_INSUFFICIENT_BUFFER == GetLastError(), "Expected error ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError());
- count = 0xdeadbeef; + count = 0; size = size_id -2; memset(buffer, 0x5a, size_buffer * sizeof(WCHAR)); SetLastError(0xdeadbeef);