winspool/tests: Avoid sizeof in traces.

This commit is contained in:
Alexandre Julliard 2010-11-17 15:08:18 +01:00
parent bbf0af4543
commit d7a0284f87
1 changed files with 13 additions and 16 deletions

View File

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