Commit 9870f932 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

kernel32/tests: Fix initialization of parameters in Get[*]PreferredUILanguages tests.

parent 7c461d63
...@@ -5318,7 +5318,7 @@ static void test_GetSystemPreferredUILanguages(void) ...@@ -5318,7 +5318,7 @@ static void test_GetSystemPreferredUILanguages(void)
} }
/* (in)valid first parameter */ /* (in)valid first parameter */
count = 0xdeadbeef; count = 0;
size = 0; size = 0;
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = pGetSystemPreferredUILanguages(0, &count, NULL, &size); ret = pGetSystemPreferredUILanguages(0, &count, NULL, &size);
...@@ -5326,7 +5326,6 @@ static void test_GetSystemPreferredUILanguages(void) ...@@ -5326,7 +5326,6 @@ static void test_GetSystemPreferredUILanguages(void)
ok(count, "Expected count > 0\n"); ok(count, "Expected count > 0\n");
ok(size % 6 == 1, "Expected size (%d) %% 6 == 1\n", size); ok(size % 6 == 1, "Expected size (%d) %% 6 == 1\n", size);
count = 0xdeadbeef;
size = 0; size = 0;
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = pGetSystemPreferredUILanguages(MUI_FULL_LANGUAGE, &count, NULL, &size); ret = pGetSystemPreferredUILanguages(MUI_FULL_LANGUAGE, &count, NULL, &size);
...@@ -5334,7 +5333,6 @@ static void test_GetSystemPreferredUILanguages(void) ...@@ -5334,7 +5333,6 @@ static void test_GetSystemPreferredUILanguages(void)
ok(ERROR_INVALID_PARAMETER == GetLastError(), ok(ERROR_INVALID_PARAMETER == GetLastError(),
"Expected error ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); "Expected error ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
count = 0xdeadbeef;
size = 0; size = 0;
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = pGetSystemPreferredUILanguages(MUI_LANGUAGE_ID | MUI_FULL_LANGUAGE, &count, NULL, &size); ret = pGetSystemPreferredUILanguages(MUI_LANGUAGE_ID | MUI_FULL_LANGUAGE, &count, NULL, &size);
...@@ -5342,7 +5340,6 @@ static void test_GetSystemPreferredUILanguages(void) ...@@ -5342,7 +5340,6 @@ static void test_GetSystemPreferredUILanguages(void)
ok(ERROR_INVALID_PARAMETER == GetLastError(), ok(ERROR_INVALID_PARAMETER == GetLastError(),
"Expected error ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); "Expected error ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
count = 0xdeadbeef;
size = 0; size = 0;
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = pGetSystemPreferredUILanguages(MUI_LANGUAGE_ID | MUI_LANGUAGE_NAME, &count, NULL, &size); ret = pGetSystemPreferredUILanguages(MUI_LANGUAGE_ID | MUI_LANGUAGE_NAME, &count, NULL, &size);
...@@ -5350,7 +5347,7 @@ static void test_GetSystemPreferredUILanguages(void) ...@@ -5350,7 +5347,7 @@ static void test_GetSystemPreferredUILanguages(void)
ok(ERROR_INVALID_PARAMETER == GetLastError(), ok(ERROR_INVALID_PARAMETER == GetLastError(),
"Expected error ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); "Expected error ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
count = 0xdeadbeef; count = 0;
size = 0; size = 0;
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = pGetSystemPreferredUILanguages(MUI_LANGUAGE_ID | MUI_MACHINE_LANGUAGE_SETTINGS, &count, NULL, &size); ret = pGetSystemPreferredUILanguages(MUI_LANGUAGE_ID | MUI_MACHINE_LANGUAGE_SETTINGS, &count, NULL, &size);
...@@ -5358,7 +5355,7 @@ static void test_GetSystemPreferredUILanguages(void) ...@@ -5358,7 +5355,7 @@ static void test_GetSystemPreferredUILanguages(void)
ok(count, "Expected count > 0\n"); ok(count, "Expected count > 0\n");
ok(size % 5 == 1, "Expected size (%d) %% 5 == 1\n", size); ok(size % 5 == 1, "Expected size (%d) %% 5 == 1\n", size);
count = 0xdeadbeef; count = 0;
size = 0; size = 0;
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = pGetSystemPreferredUILanguages(MUI_LANGUAGE_NAME | MUI_MACHINE_LANGUAGE_SETTINGS, &count, NULL, &size); ret = pGetSystemPreferredUILanguages(MUI_LANGUAGE_NAME | MUI_MACHINE_LANGUAGE_SETTINGS, &count, NULL, &size);
...@@ -5372,7 +5369,6 @@ static void test_GetSystemPreferredUILanguages(void) ...@@ -5372,7 +5369,6 @@ static void test_GetSystemPreferredUILanguages(void)
*/ */
/* invalid third parameter */ /* invalid third parameter */
count = 0xdeadbeef;
size = 1; size = 1;
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = pGetSystemPreferredUILanguages(MUI_LANGUAGE_ID, &count, NULL, &size); ret = pGetSystemPreferredUILanguages(MUI_LANGUAGE_ID, &count, NULL, &size);
...@@ -5385,7 +5381,7 @@ static void test_GetSystemPreferredUILanguages(void) ...@@ -5385,7 +5381,7 @@ static void test_GetSystemPreferredUILanguages(void)
* -> unhandled exception c0000005 * -> unhandled exception c0000005
*/ */
count = 0xdeadbeef; count = 0;
size_id = 0; size_id = 0;
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = pGetSystemPreferredUILanguages(MUI_LANGUAGE_ID, &count, NULL, &size_id); ret = pGetSystemPreferredUILanguages(MUI_LANGUAGE_ID, &count, NULL, &size_id);
...@@ -5393,7 +5389,7 @@ static void test_GetSystemPreferredUILanguages(void) ...@@ -5393,7 +5389,7 @@ static void test_GetSystemPreferredUILanguages(void)
ok(count, "Expected count > 0\n"); ok(count, "Expected count > 0\n");
ok(size_id % 5 == 1, "Expected size (%d) %% 5 == 1\n", size_id); ok(size_id % 5 == 1, "Expected size (%d) %% 5 == 1\n", size_id);
count = 0xdeadbeef; count = 0;
size_name = 0; size_name = 0;
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = pGetSystemPreferredUILanguages(MUI_LANGUAGE_NAME, &count, NULL, &size_name); ret = pGetSystemPreferredUILanguages(MUI_LANGUAGE_NAME, &count, NULL, &size_name);
...@@ -5415,7 +5411,7 @@ static void test_GetSystemPreferredUILanguages(void) ...@@ -5415,7 +5411,7 @@ static void test_GetSystemPreferredUILanguages(void)
return; return;
} }
count = 0xdeadbeef; count = 0;
size = size_buffer; size = size_buffer;
memset(buffer, 0x5a, size_buffer * sizeof(WCHAR)); memset(buffer, 0x5a, size_buffer * sizeof(WCHAR));
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
...@@ -5428,7 +5424,7 @@ static void test_GetSystemPreferredUILanguages(void) ...@@ -5428,7 +5424,7 @@ static void test_GetSystemPreferredUILanguages(void)
"Expected last two WCHARs being empty, got 0x%x 0x%x\n", "Expected last two WCHARs being empty, got 0x%x 0x%x\n",
buffer[size -2], buffer[size -1]); buffer[size -2], buffer[size -1]);
count = 0xdeadbeef; count = 0;
size = size_buffer; size = size_buffer;
memset(buffer, 0x5a, size_buffer * sizeof(WCHAR)); memset(buffer, 0x5a, size_buffer * sizeof(WCHAR));
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
...@@ -5441,7 +5437,7 @@ static void test_GetSystemPreferredUILanguages(void) ...@@ -5441,7 +5437,7 @@ static void test_GetSystemPreferredUILanguages(void)
"Expected last two WCHARs being empty, got 0x%x 0x%x\n", "Expected last two WCHARs being empty, got 0x%x 0x%x\n",
buffer[size -2], buffer[size -1]); buffer[size -2], buffer[size -1]);
count = 0xdeadbeef; count = 0;
size = size_buffer; size = size_buffer;
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = pGetSystemPreferredUILanguages(MUI_LANGUAGE_NAME, &count, buffer, &size); ret = pGetSystemPreferredUILanguages(MUI_LANGUAGE_NAME, &count, buffer, &size);
...@@ -5453,7 +5449,7 @@ static void test_GetSystemPreferredUILanguages(void) ...@@ -5453,7 +5449,7 @@ static void test_GetSystemPreferredUILanguages(void)
"Expected last two WCHARs being empty, got 0x%x 0x%x\n", "Expected last two WCHARs being empty, got 0x%x 0x%x\n",
buffer[size -2], buffer[size -1]); buffer[size -2], buffer[size -1]);
count = 0xdeadbeef; count = 0;
size = 0; size = 0;
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = pGetSystemPreferredUILanguages(MUI_MACHINE_LANGUAGE_SETTINGS, &count, NULL, &size); ret = pGetSystemPreferredUILanguages(MUI_MACHINE_LANGUAGE_SETTINGS, &count, NULL, &size);
...@@ -5465,7 +5461,6 @@ static void test_GetSystemPreferredUILanguages(void) ...@@ -5465,7 +5461,6 @@ static void test_GetSystemPreferredUILanguages(void)
"Expected last two WCHARs being empty, got 0x%x 0x%x\n", "Expected last two WCHARs being empty, got 0x%x 0x%x\n",
buffer[size -2], buffer[size -1]); buffer[size -2], buffer[size -1]);
count = 0xdeadbeef;
size = 1; size = 1;
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = pGetSystemPreferredUILanguages(MUI_LANGUAGE_ID, &count, buffer, &size); ret = pGetSystemPreferredUILanguages(MUI_LANGUAGE_ID, &count, buffer, &size);
...@@ -5473,7 +5468,6 @@ static void test_GetSystemPreferredUILanguages(void) ...@@ -5473,7 +5468,6 @@ static void test_GetSystemPreferredUILanguages(void)
ok(ERROR_INSUFFICIENT_BUFFER == GetLastError(), ok(ERROR_INSUFFICIENT_BUFFER == GetLastError(),
"Expected error ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError()); "Expected error ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError());
count = 0xdeadbeef;
size = size_id -1; size = size_id -1;
memset(buffer, 0x5a, size_buffer * sizeof(WCHAR)); memset(buffer, 0x5a, size_buffer * sizeof(WCHAR));
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
...@@ -5482,7 +5476,6 @@ static void test_GetSystemPreferredUILanguages(void) ...@@ -5482,7 +5476,6 @@ static void test_GetSystemPreferredUILanguages(void)
ok(ERROR_INSUFFICIENT_BUFFER == GetLastError(), ok(ERROR_INSUFFICIENT_BUFFER == GetLastError(),
"Expected error ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError()); "Expected error ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError());
count = 0xdeadbeef;
size = size_id -2; size = size_id -2;
memset(buffer, 0x5a, size_buffer * sizeof(WCHAR)); memset(buffer, 0x5a, size_buffer * sizeof(WCHAR));
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
...@@ -5526,14 +5519,12 @@ static void test_GetUserPreferredUILanguages(void) ...@@ -5526,14 +5519,12 @@ static void test_GetUserPreferredUILanguages(void)
ULONG count, size, size_id, size_name, size_buffer; ULONG count, size, size_id, size_name, size_buffer;
WCHAR *buffer; WCHAR *buffer;
if (!pGetUserPreferredUILanguages) if (!pGetUserPreferredUILanguages)
{ {
win_skip("GetUserPreferredUILanguages is not available.\n"); win_skip("GetUserPreferredUILanguages is not available.\n");
return; return;
} }
count = 0xdeadbeef;
size = 0; size = 0;
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = pGetUserPreferredUILanguages(MUI_FULL_LANGUAGE, &count, NULL, &size); ret = pGetUserPreferredUILanguages(MUI_FULL_LANGUAGE, &count, NULL, &size);
...@@ -5541,7 +5532,6 @@ static void test_GetUserPreferredUILanguages(void) ...@@ -5541,7 +5532,6 @@ static void test_GetUserPreferredUILanguages(void)
ok(ERROR_INVALID_PARAMETER == GetLastError(), ok(ERROR_INVALID_PARAMETER == GetLastError(),
"Expected error ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); "Expected error ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
count = 0xdeadbeef;
size = 0; size = 0;
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = pGetUserPreferredUILanguages(MUI_LANGUAGE_ID | MUI_FULL_LANGUAGE, &count, NULL, &size); ret = pGetUserPreferredUILanguages(MUI_LANGUAGE_ID | MUI_FULL_LANGUAGE, &count, NULL, &size);
...@@ -5549,7 +5539,6 @@ static void test_GetUserPreferredUILanguages(void) ...@@ -5549,7 +5539,6 @@ static void test_GetUserPreferredUILanguages(void)
ok(ERROR_INVALID_PARAMETER == GetLastError(), ok(ERROR_INVALID_PARAMETER == GetLastError(),
"Expected error ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); "Expected error ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
count = 0xdeadbeef;
size = 0; size = 0;
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = pGetUserPreferredUILanguages(MUI_LANGUAGE_ID | MUI_MACHINE_LANGUAGE_SETTINGS, &count, NULL, &size); ret = pGetUserPreferredUILanguages(MUI_LANGUAGE_ID | MUI_MACHINE_LANGUAGE_SETTINGS, &count, NULL, &size);
...@@ -5557,7 +5546,6 @@ static void test_GetUserPreferredUILanguages(void) ...@@ -5557,7 +5546,6 @@ static void test_GetUserPreferredUILanguages(void)
ok(ERROR_INVALID_PARAMETER == GetLastError(), ok(ERROR_INVALID_PARAMETER == GetLastError(),
"Expected error ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); "Expected error ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
count = 0xdeadbeef;
size = 1; size = 1;
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = pGetUserPreferredUILanguages(MUI_LANGUAGE_ID, &count, NULL, &size); ret = pGetUserPreferredUILanguages(MUI_LANGUAGE_ID, &count, NULL, &size);
...@@ -5565,7 +5553,7 @@ static void test_GetUserPreferredUILanguages(void) ...@@ -5565,7 +5553,7 @@ static void test_GetUserPreferredUILanguages(void)
ok(ERROR_INVALID_PARAMETER == GetLastError(), ok(ERROR_INVALID_PARAMETER == GetLastError(),
"Expected error ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); "Expected error ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
count = 0xdeadbeef; count = 0;
size_id = 0; size_id = 0;
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = pGetUserPreferredUILanguages(MUI_LANGUAGE_ID, &count, NULL, &size_id); ret = pGetUserPreferredUILanguages(MUI_LANGUAGE_ID, &count, NULL, &size_id);
...@@ -5573,7 +5561,7 @@ static void test_GetUserPreferredUILanguages(void) ...@@ -5573,7 +5561,7 @@ static void test_GetUserPreferredUILanguages(void)
ok(count, "Expected count > 0\n"); ok(count, "Expected count > 0\n");
ok(size_id % 5 == 1, "Expected size (%d) %% 5 == 1\n", size_id); ok(size_id % 5 == 1, "Expected size (%d) %% 5 == 1\n", size_id);
count = 0xdeadbeef; count = 0;
size_name = 0; size_name = 0;
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = pGetUserPreferredUILanguages(MUI_LANGUAGE_NAME, &count, NULL, &size_name); ret = pGetUserPreferredUILanguages(MUI_LANGUAGE_NAME, &count, NULL, &size_name);
...@@ -5590,7 +5578,7 @@ static void test_GetUserPreferredUILanguages(void) ...@@ -5590,7 +5578,7 @@ static void test_GetUserPreferredUILanguages(void)
buffer = HeapAlloc(GetProcessHeap(), 0, size_buffer * sizeof(WCHAR)); buffer = HeapAlloc(GetProcessHeap(), 0, size_buffer * sizeof(WCHAR));
count = 0xdeadbeef; count = 0;
size = size_buffer; size = size_buffer;
memset(buffer, 0x5a, size_buffer * sizeof(WCHAR)); memset(buffer, 0x5a, size_buffer * sizeof(WCHAR));
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
...@@ -5603,7 +5591,7 @@ static void test_GetUserPreferredUILanguages(void) ...@@ -5603,7 +5591,7 @@ static void test_GetUserPreferredUILanguages(void)
"Expected last two WCHARs being empty, got 0x%x 0x%x\n", "Expected last two WCHARs being empty, got 0x%x 0x%x\n",
buffer[size -2], buffer[size -1]); buffer[size -2], buffer[size -1]);
count = 0xdeadbeef; count = 0;
size = size_buffer; size = size_buffer;
memset(buffer, 0x5a, size_buffer * sizeof(WCHAR)); memset(buffer, 0x5a, size_buffer * sizeof(WCHAR));
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
...@@ -5616,7 +5604,7 @@ static void test_GetUserPreferredUILanguages(void) ...@@ -5616,7 +5604,7 @@ static void test_GetUserPreferredUILanguages(void)
"Expected last two WCHARs being empty, got 0x%x 0x%x\n", "Expected last two WCHARs being empty, got 0x%x 0x%x\n",
buffer[size -2], buffer[size -1]); buffer[size -2], buffer[size -1]);
count = 0xdeadbeef; count = 0;
size = size_buffer; size = size_buffer;
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = pGetUserPreferredUILanguages(MUI_LANGUAGE_NAME, &count, buffer, &size); ret = pGetUserPreferredUILanguages(MUI_LANGUAGE_NAME, &count, buffer, &size);
...@@ -5628,7 +5616,6 @@ static void test_GetUserPreferredUILanguages(void) ...@@ -5628,7 +5616,6 @@ static void test_GetUserPreferredUILanguages(void)
"Expected last two WCHARs being empty, got 0x%x 0x%x\n", "Expected last two WCHARs being empty, got 0x%x 0x%x\n",
buffer[size -2], buffer[size -1]); buffer[size -2], buffer[size -1]);
count = 0xdeadbeef;
size = 1; size = 1;
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = pGetUserPreferredUILanguages(MUI_LANGUAGE_ID, &count, buffer, &size); ret = pGetUserPreferredUILanguages(MUI_LANGUAGE_ID, &count, buffer, &size);
...@@ -5636,7 +5623,6 @@ static void test_GetUserPreferredUILanguages(void) ...@@ -5636,7 +5623,6 @@ static void test_GetUserPreferredUILanguages(void)
ok(ERROR_INSUFFICIENT_BUFFER == GetLastError(), ok(ERROR_INSUFFICIENT_BUFFER == GetLastError(),
"Expected error ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError()); "Expected error ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError());
count = 0xdeadbeef;
size = size_id -1; size = size_id -1;
memset(buffer, 0x5a, size_buffer * sizeof(WCHAR)); memset(buffer, 0x5a, size_buffer * sizeof(WCHAR));
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
...@@ -5645,7 +5631,7 @@ static void test_GetUserPreferredUILanguages(void) ...@@ -5645,7 +5631,7 @@ static void test_GetUserPreferredUILanguages(void)
ok(ERROR_INSUFFICIENT_BUFFER == GetLastError(), ok(ERROR_INSUFFICIENT_BUFFER == GetLastError(),
"Expected error ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError()); "Expected error ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError());
count = 0xdeadbeef; count = 0;
size = size_id -2; size = size_id -2;
memset(buffer, 0x5a, size_buffer * sizeof(WCHAR)); memset(buffer, 0x5a, size_buffer * sizeof(WCHAR));
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment