From a33ac68a12ed917995b35d86bc596776056aee44 Mon Sep 17 00:00:00 2001 From: Eric Pouech Date: Mon, 28 Feb 2022 08:27:47 +0100 Subject: [PATCH] localui/tests: Enable compilation with long types. Signed-off-by: Eric Pouech Signed-off-by: Huw Davies Signed-off-by: Alexandre Julliard --- dlls/localui/tests/Makefile.in | 1 - dlls/localui/tests/localui.c | 34 +++++++++++++++++----------------- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/dlls/localui/tests/Makefile.in b/dlls/localui/tests/Makefile.in index 9e4afd20e09..8f5cb77f291 100644 --- a/dlls/localui/tests/Makefile.in +++ b/dlls/localui/tests/Makefile.in @@ -1,4 +1,3 @@ -EXTRADEFS = -DWINE_NO_LONG_TYPES TESTDLL = localui.dll IMPORTS = winspool diff --git a/dlls/localui/tests/localui.c b/dlls/localui/tests/localui.c index 23be8c779d1..28cecaabd50 100644 --- a/dlls/localui/tests/localui.c +++ b/dlls/localui/tests/localui.c @@ -68,10 +68,10 @@ static PORT_INFO_2W * find_portinfo2(LPCWSTR pPort) win_skip("The service 'Spooler' is required for many tests\n"); return NULL; } - ok(!res, "EnumPorts succeeded: got %d\n", res); + ok(!res, "EnumPorts succeeded: got %ld\n", res); pi_buffer = HeapAlloc(GetProcessHeap(), 0, pi_needed); res = EnumPortsW(NULL, 2, pi_buffer, pi_needed, &pi_needed, &pi_numports); - ok(res == 1, "EnumPorts failed: got %d\n", res); + ok(res == 1, "EnumPorts failed: got %ld\n", res); } if (pi_buffer) { pi = (PORT_INFO_2W *) pi_buffer; @@ -137,21 +137,21 @@ static void test_AddPortUI(void) res = pAddPortUI(NULL, NULL, NULL, NULL); ok( !res && ((GetLastError() == ERROR_UNKNOWN_PORT) || (GetLastError() == ERROR_INVALID_PRINTER_NAME)), - "got %d with %u (expected '0' with: ERROR_UNKNOWN_PORT or " + "got %ld with %lu (expected '0' with: ERROR_UNKNOWN_PORT or " "ERROR_INVALID_PRINTER_NAME)\n", res, GetLastError()); SetLastError(0xdeadbeef); res = pAddPortUI(NULL, NULL, L"", NULL); ok( !res && ((GetLastError() == ERROR_UNKNOWN_PORT) || (GetLastError() == ERROR_INVALID_PRINTER_NAME)), - "got %d with %u (expected '0' with: ERROR_UNKNOWN_PORT or " + "got %ld with %lu (expected '0' with: ERROR_UNKNOWN_PORT or " "ERROR_INVALID_PRINTER_NAME)\n", res, GetLastError()); SetLastError(0xdeadbeef); res = pAddPortUI(NULL, NULL, L"does_not_exist", NULL); ok( !res && ((GetLastError() == ERROR_UNKNOWN_PORT) || (GetLastError() == ERROR_INVALID_PRINTER_NAME)), - "got %d with %u (expected '0' with: ERROR_UNKNOWN_PORT or " + "got %ld with %lu (expected '0' with: ERROR_UNKNOWN_PORT or " "ERROR_INVALID_PRINTER_NAME)\n", res, GetLastError()); if (winetest_interactive) { @@ -170,7 +170,7 @@ static void test_AddPortUI(void) (GetLastError() == ERROR_CANCELLED) || (GetLastError() == ERROR_ACCESS_DENIED) || (GetLastError() == ERROR_NOT_SUPPORTED), - "got %d with %u and %p (expected '!= 0' or '0' with: " + "got %ld with %lu and %p (expected '!= 0' or '0' with: " "ERROR_CANCELLED, ERROR_ACCESS_DENIED or ERROR_NOT_SUPPORTED)\n", res, GetLastError(), new_portname); @@ -194,14 +194,14 @@ static void test_ConfigurePortUI(void) res = pConfigurePortUI(NULL, NULL, NULL); ok( !res && ((GetLastError() == ERROR_UNKNOWN_PORT) || (GetLastError() == ERROR_INVALID_PRINTER_NAME)), - "got %d with %u (expected '0' with: ERROR_UNKNOWN_PORT or " + "got %ld with %lu (expected '0' with: ERROR_UNKNOWN_PORT or " "ERROR_INVALID_PRINTER_NAME)\n", res, GetLastError()); SetLastError(0xdeadbeef); res = pConfigurePortUI(NULL, NULL, L""); ok( !res && ((GetLastError() == ERROR_UNKNOWN_PORT) || (GetLastError() == ERROR_INVALID_PRINTER_NAME)), - "got %d with %u (expected '0' with: ERROR_UNKNOWN_PORT or " + "got %ld with %lu (expected '0' with: ERROR_UNKNOWN_PORT or " "ERROR_INVALID_PRINTER_NAME)\n", res, GetLastError()); @@ -209,7 +209,7 @@ static void test_ConfigurePortUI(void) res = pConfigurePortUI(NULL, NULL, L"does_not_exist"); ok( !res && ((GetLastError() == ERROR_UNKNOWN_PORT) || (GetLastError() == ERROR_INVALID_PRINTER_NAME)), - "got %d with %u (expected '0' with: ERROR_UNKNOWN_PORT or " + "got %ld with %lu (expected '0' with: ERROR_UNKNOWN_PORT or " "ERROR_INVALID_PRINTER_NAME)\n", res, GetLastError()); if (winetest_interactive && lpt_present) { @@ -217,7 +217,7 @@ static void test_ConfigurePortUI(void) res = pConfigurePortUI(NULL, NULL, lpt_present->pPortName); ok( res || (GetLastError() == ERROR_CANCELLED) || (GetLastError() == ERROR_ACCESS_DENIED), - "got %d with %u (expected '!= 0' or '0' with: ERROR_CANCELLED or " + "got %ld with %lu (expected '!= 0' or '0' with: ERROR_CANCELLED or " "ERROR_ACCESS_DENIED)\n", res, GetLastError()); } @@ -226,7 +226,7 @@ static void test_ConfigurePortUI(void) res = pConfigurePortUI(NULL, NULL, lpt_absent); ok( !res && ((GetLastError() == ERROR_UNKNOWN_PORT) || (GetLastError() == ERROR_INVALID_PRINTER_NAME)), - "got %d with %u (expected '0' with: ERROR_UNKNOWN_PORT or " + "got %ld with %lu (expected '0' with: ERROR_UNKNOWN_PORT or " "ERROR_INVALID_PRINTER_NAME)\n", res, GetLastError()); } @@ -235,7 +235,7 @@ static void test_ConfigurePortUI(void) res = pConfigurePortUI(NULL, NULL, com_present->pPortName); ok( res || (GetLastError() == ERROR_CANCELLED) || (GetLastError() == ERROR_ACCESS_DENIED), - "got %d with %u (expected '!= 0' or '0' with: ERROR_CANCELLED or " + "got %ld with %lu (expected '!= 0' or '0' with: ERROR_CANCELLED or " "ERROR_ACCESS_DENIED)\n", res, GetLastError()); } @@ -244,7 +244,7 @@ static void test_ConfigurePortUI(void) res = pConfigurePortUI(NULL, NULL, com_absent); ok( !res && ((GetLastError() == ERROR_UNKNOWN_PORT) || (GetLastError() == ERROR_INVALID_PRINTER_NAME)), - "got %d with %u (expected '0' with: ERROR_UNKNOWN_PORT or " + "got %ld with %lu (expected '0' with: ERROR_UNKNOWN_PORT or " "ERROR_INVALID_PRINTER_NAME)\n", res, GetLastError()); } @@ -254,7 +254,7 @@ static void test_ConfigurePortUI(void) res = pConfigurePortUI(NULL, NULL, L"FILE:"); ok( !res && ((GetLastError() == ERROR_CANCELLED) || (GetLastError() == ERROR_ACCESS_DENIED)), - "got %d with %u (expected '0' with: ERROR_CANCELLED or " + "got %ld with %lu (expected '0' with: ERROR_CANCELLED or " "ERROR_ACCESS_DENIED)\n", res, GetLastError()); } } @@ -281,7 +281,7 @@ START_TEST(localui) if (pui) { numentries = (pui->dwMonitorUISize - sizeof(DWORD)) / sizeof(VOID *); ok( numentries == 3, - "dwMonitorUISize (%d) => %d Functions\n", pui->dwMonitorUISize, numentries); + "dwMonitorUISize (%ld) => %ld Functions\n", pui->dwMonitorUISize, numentries); if (numentries > 2) { pAddPortUI = pui->pfnAddPortUI; @@ -302,7 +302,7 @@ START_TEST(localui) /* "LPT1:" - "LPT9:" */ while (((lpt_present == NULL) || (lpt_absent == NULL)) && id < 9) { id++; - sprintf(bufferA, "LPT%u:", id); + sprintf(bufferA, "LPT%lu:", id); MultiByteToWideChar( CP_ACP, 0, bufferA, -1, bufferW, ARRAY_SIZE(bufferW)); pi2 = find_portinfo2(bufferW); if (pi2 && (lpt_present == NULL)) lpt_present = pi2; @@ -313,7 +313,7 @@ START_TEST(localui) /* "COM1:" - "COM9:" */ while (((com_present == NULL) || (com_absent == NULL)) && id < 9) { id++; - sprintf(bufferA, "COM%u:", id); + sprintf(bufferA, "COM%lu:", id); MultiByteToWideChar( CP_ACP, 0, bufferA, -1, bufferW, ARRAY_SIZE(bufferW)); pi2 = find_portinfo2(bufferW); if (pi2 && (com_present == NULL)) com_present = pi2;