Commit d7a0284f authored by Alexandre Julliard's avatar Alexandre Julliard

winspool/tests: Avoid sizeof in traces.

parent bbf0af45
...@@ -2367,15 +2367,14 @@ static void test_GetPrinterData(void) ...@@ -2367,15 +2367,14 @@ static void test_GetPrinterData(void)
len = lstrlenA(buffer) + sizeof(CHAR); len = lstrlenA(buffer) + sizeof(CHAR);
/* NT4 and w2k require a buffer to save the UNICODE result also for the ANSI function */ /* NT4 and w2k require a buffer to save the UNICODE result also for the ANSI function */
ok( !res && (type == REG_SZ) && ((needed == len) || (needed == (len * sizeof(WCHAR)))), ok( !res && (type == REG_SZ) && ((needed == len) || (needed == (len * sizeof(WCHAR)))),
"got %d, type %d, needed: %d and '%s' (expected ERROR_SUCCESS, REG_SZ and %d or %d)\n", "got %d, type %d, needed: %d and '%s' (expected ERROR_SUCCESS, REG_SZ and %d)\n",
res, type, needed, buffer, len, len * sizeof(WCHAR)); res, type, needed, buffer, len);
needed = 0xdeadbeef; needed = 0xdeadbeef;
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
res = GetPrinterDataA(hprn, defaultspooldirectory, NULL, NULL, 0, &needed); res = GetPrinterDataA(hprn, defaultspooldirectory, NULL, NULL, 0, &needed);
ok( (res == ERROR_MORE_DATA) && ((needed == len) || (needed == (len * sizeof(WCHAR)))), ok( (res == ERROR_MORE_DATA) && ((needed == len) || (needed == (len * sizeof(WCHAR)))),
"got %d, needed: %d (expected ERROR_MORE_DATA and %d or %d)\n", "got %d, needed: %d (expected ERROR_MORE_DATA and %d)\n", res, needed, len);
res, needed, len, len * sizeof(WCHAR));
/* ToDo: test SPLREG_* */ /* ToDo: test SPLREG_* */
...@@ -2423,8 +2422,8 @@ static void test_GetPrinterDataEx(void) ...@@ -2423,8 +2422,8 @@ static void test_GetPrinterDataEx(void)
len = lstrlenA(buffer) + sizeof(CHAR); len = lstrlenA(buffer) + sizeof(CHAR);
/* NT4 and w2k require a buffer to save the UNICODE result also for the ANSI function */ /* NT4 and w2k require a buffer to save the UNICODE result also for the ANSI function */
ok( !res && (type == REG_SZ) && ((needed == len) || (needed == (len * sizeof(WCHAR)))), ok( !res && (type == REG_SZ) && ((needed == len) || (needed == (len * sizeof(WCHAR)))),
"got %d, type %d, needed: %d and '%s' (expected ERROR_SUCCESS, REG_SZ and %d or %d)\n", "got %d, type %d, needed: %d and '%s' (expected ERROR_SUCCESS, REG_SZ and %d)\n",
res, type, needed, buffer, len, len * sizeof(WCHAR)); res, type, needed, buffer, len);
memset(buffer, '#', sizeof(buffer)); memset(buffer, '#', sizeof(buffer));
buffer[MAX_PATH] = 0; buffer[MAX_PATH] = 0;
...@@ -2435,8 +2434,8 @@ static void test_GetPrinterDataEx(void) ...@@ -2435,8 +2434,8 @@ static void test_GetPrinterDataEx(void)
(LPBYTE) buffer, sizeof(buffer), &needed); (LPBYTE) buffer, sizeof(buffer), &needed);
len = lstrlenA(buffer) + sizeof(CHAR); len = lstrlenA(buffer) + sizeof(CHAR);
ok( !res && (type == REG_SZ) && ((needed == len) || (needed == (len * sizeof(WCHAR)))), ok( !res && (type == REG_SZ) && ((needed == len) || (needed == (len * sizeof(WCHAR)))),
"got %d, type %d, needed: %d and '%s' (expected ERROR_SUCCESS, REG_SZ and %d or %d)\n", "got %d, type %d, needed: %d and '%s' (expected ERROR_SUCCESS, REG_SZ and %d)\n",
res, type, needed, buffer, len, len * sizeof(WCHAR)); res, type, needed, buffer, len);
memset(buffer, '#', sizeof(buffer)); memset(buffer, '#', sizeof(buffer));
buffer[MAX_PATH] = 0; buffer[MAX_PATH] = 0;
...@@ -2448,8 +2447,8 @@ static void test_GetPrinterDataEx(void) ...@@ -2448,8 +2447,8 @@ static void test_GetPrinterDataEx(void)
&type, (LPBYTE) buffer, sizeof(buffer), &needed); &type, (LPBYTE) buffer, sizeof(buffer), &needed);
len = lstrlenA(buffer) + sizeof(CHAR); len = lstrlenA(buffer) + sizeof(CHAR);
ok( !res && (type == REG_SZ) && ((needed == len) || (needed == (len * sizeof(WCHAR)))), ok( !res && (type == REG_SZ) && ((needed == len) || (needed == (len * sizeof(WCHAR)))),
"got %d, type %d, needed: %d and '%s' (expected ERROR_SUCCESS, REG_SZ and %d or %d)\n", "got %d, type %d, needed: %d and '%s' (expected ERROR_SUCCESS, REG_SZ and %d)\n",
res, type, needed, buffer, len, len * sizeof(WCHAR)); res, type, needed, buffer, len);
memset(buffer, '#', sizeof(buffer)); memset(buffer, '#', sizeof(buffer));
...@@ -2461,8 +2460,8 @@ static void test_GetPrinterDataEx(void) ...@@ -2461,8 +2460,8 @@ static void test_GetPrinterDataEx(void)
(LPBYTE) buffer, sizeof(buffer), &needed); (LPBYTE) buffer, sizeof(buffer), &needed);
len = lstrlenA(buffer) + sizeof(CHAR); len = lstrlenA(buffer) + sizeof(CHAR);
ok( !res && (type == REG_SZ) && ((needed == len) || (needed == (len * sizeof(WCHAR)))), ok( !res && (type == REG_SZ) && ((needed == len) || (needed == (len * sizeof(WCHAR)))),
"got %d, type %d, needed: %d and '%s' (expected ERROR_SUCCESS, REG_SZ and %d or %d)\n", "got %d, type %d, needed: %d and '%s' (expected ERROR_SUCCESS, REG_SZ and %d)\n",
res, type, needed, buffer, len, len * sizeof(WCHAR)); res, type, needed, buffer, len);
needed = 0xdeadbeef; needed = 0xdeadbeef;
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
...@@ -2471,16 +2470,14 @@ static void test_GetPrinterDataEx(void) ...@@ -2471,16 +2470,14 @@ static void test_GetPrinterDataEx(void)
res = pGetPrinterDataExA(hprn, NULL, defaultspooldirectory, NULL, NULL, 0, &needed); res = pGetPrinterDataExA(hprn, NULL, defaultspooldirectory, NULL, NULL, 0, &needed);
ok( ((res == ERROR_MORE_DATA) || broken(res == 0xdeadbeef)) && ok( ((res == ERROR_MORE_DATA) || broken(res == 0xdeadbeef)) &&
((needed == len) || (needed == (len * sizeof(WCHAR)))), ((needed == len) || (needed == (len * sizeof(WCHAR)))),
"got %d, needed: %d (expected ERROR_MORE_DATA and %d or %d)\n", "got %d, needed: %d (expected ERROR_MORE_DATA and %d)\n", res, needed, len);
res, needed, len, len * sizeof(WCHAR));
needed = 0xdeadbeef; needed = 0xdeadbeef;
SetLastError(0xdeaddead); SetLastError(0xdeaddead);
res = pGetPrinterDataExA(hprn, NULL, defaultspooldirectory, NULL, NULL, 0, &needed); res = pGetPrinterDataExA(hprn, NULL, defaultspooldirectory, NULL, NULL, 0, &needed);
ok( ((res == ERROR_MORE_DATA) || broken(res == 0xdeaddead)) && ok( ((res == ERROR_MORE_DATA) || broken(res == 0xdeaddead)) &&
((needed == len) || (needed == (len * sizeof(WCHAR)))), ((needed == len) || (needed == (len * sizeof(WCHAR)))),
"got %d, needed: %d (expected ERROR_MORE_DATA and %d or %d)\n", "got %d, needed: %d (expected ERROR_MORE_DATA and %d)\n", res, needed, len);
res, needed, len, len * sizeof(WCHAR));
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
res = ClosePrinter(hprn); res = ClosePrinter(hprn);
......
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