[PATCH 19/27] dlls/itss/tests: enable compilation with long types

Eric Pouech eric.pouech at gmail.com
Mon Feb 28 01:27:09 CST 2022


Signed-off-by: Eric Pouech <eric.pouech at gmail.com>

---
 dlls/itss/tests/Makefile.in |    1 
 dlls/itss/tests/protocol.c  |  130 ++++++++++++++++++++++---------------------
 2 files changed, 65 insertions(+), 66 deletions(-)

diff --git a/dlls/itss/tests/Makefile.in b/dlls/itss/tests/Makefile.in
index 8f2fd415e5c..c1e9a192a2e 100644
--- a/dlls/itss/tests/Makefile.in
+++ b/dlls/itss/tests/Makefile.in
@@ -1,4 +1,3 @@
-EXTRADEFS = -DWINE_NO_LONG_TYPES
 TESTDLL   = itss.dll
 IMPORTS   = ole32
 
diff --git a/dlls/itss/tests/protocol.c b/dlls/itss/tests/protocol.c
index 43d867b9cfb..db4c3ef2f45 100644
--- a/dlls/itss/tests/protocol.c
+++ b/dlls/itss/tests/protocol.c
@@ -139,7 +139,7 @@ static HRESULT WINAPI ProtocolSink_ReportProgress(IInternetProtocolSink *iface,
         ok(!szStatusText, "szStatusText != NULL\n");
         break;
     default:
-        ok(0, "unexpected ulStatusCode %d\n", ulStatusCode);
+        ok(0, "unexpected ulStatusCode %ld\n", ulStatusCode);
         break;
     }
 
@@ -153,9 +153,9 @@ static HRESULT WINAPI ProtocolSink_ReportData(IInternetProtocolSink *iface, DWOR
 
     ok(ulProgress == ulProgressMax, "ulProgress != ulProgressMax\n");
     if(test_protocol == ITS_PROTOCOL)
-        ok(grfBSCF == (BSCF_FIRSTDATANOTIFICATION | BSCF_DATAFULLYAVAILABLE), "grcf = %08x\n", grfBSCF);
+        ok(grfBSCF == (BSCF_FIRSTDATANOTIFICATION | BSCF_DATAFULLYAVAILABLE), "grcf = %08lx\n", grfBSCF);
     else
-        ok(grfBSCF == (BSCF_FIRSTDATANOTIFICATION | BSCF_LASTDATANOTIFICATION), "grcf = %08x\n", grfBSCF);
+        ok(grfBSCF == (BSCF_FIRSTDATANOTIFICATION | BSCF_LASTDATANOTIFICATION), "grcf = %08lx\n", grfBSCF);
 
     if(read_protocol) {
         BYTE buf[100];
@@ -163,8 +163,8 @@ static HRESULT WINAPI ProtocolSink_ReportData(IInternetProtocolSink *iface, DWOR
         HRESULT hres;
 
         hres = IInternetProtocol_Read(read_protocol, buf, sizeof(buf), &cb);
-        ok(hres == S_OK, "Read failed: %08x\n", hres);
-        ok(cb == 13, "cb=%u expected 13\n", cb);
+        ok(hres == S_OK, "Read failed: %08lx\n", hres);
+        ok(cb == 13, "cb=%lu expected 13\n", cb);
         ok(!memcmp(buf, "<html></html>", 13), "unexpected data\n");
     }
 
@@ -176,8 +176,8 @@ static HRESULT WINAPI ProtocolSink_ReportResult(IInternetProtocolSink *iface, HR
 {
     CHECK_EXPECT(ReportResult);
 
-    ok(hrResult == expect_hrResult, "expected: %08x got: %08x\n", expect_hrResult, hrResult);
-    ok(dwError == 0, "dwError = %d\n", dwError);
+    ok(hrResult == expect_hrResult, "expected: %08lx got: %08lx\n", expect_hrResult, hrResult);
+    ok(dwError == 0, "dwError = %ld\n", dwError);
     ok(!szResult, "szResult != NULL\n");
 
     return S_OK;
@@ -224,7 +224,7 @@ static HRESULT WINAPI BindInfo_GetBindInfo(IInternetBindInfo *iface, DWORD *grfB
     if(grfBINDF)
         ok(!*grfBINDF, "*grfBINDF != 0\n");
     ok(pbindinfo != NULL, "pbindinfo == NULL\n");
-    ok(pbindinfo->cbSize == sizeof(BINDINFO), "wrong size of pbindinfo: %d\n", pbindinfo->cbSize);
+    ok(pbindinfo->cbSize == sizeof(BINDINFO), "wrong size of pbindinfo: %ld\n", pbindinfo->cbSize);
 
     *grfBINDF = bindf;
     return S_OK;
@@ -258,7 +258,7 @@ static void test_protocol_fail(IInternetProtocol *protocol, LPCWSTR url, HRESULT
 
     expect_hrResult = expected_hres;
     hres = IInternetProtocol_Start(protocol, url, &protocol_sink, &bind_info, 0, 0);
-    ok(hres == expected_hres, "expected: %08x got: %08x\n", expected_hres, hres);
+    ok(hres == expected_hres, "expected: %08lx got: %08lx\n", expected_hres, hres);
 
     CHECK_CALLED(GetBindInfo);
     CHECK_CALLED(ReportResult);
@@ -324,7 +324,7 @@ static void test_protocol_url(IClassFactory *factory, LPCWSTR url, BOOL expect_m
     HRESULT hres;
 
     hres = IClassFactory_CreateInstance(factory, NULL, &IID_IInternetProtocol, (void**)&protocol);
-    ok(hres == S_OK, "Could not get IInternetProtocol: %08x\n", hres);
+    ok(hres == S_OK, "Could not get IInternetProtocol: %08lx\n", hres);
     if(FAILED(hres))
         return;
 
@@ -335,90 +335,90 @@ static void test_protocol_url(IClassFactory *factory, LPCWSTR url, BOOL expect_m
     }
 
     hres = IInternetProtocol_Read(protocol, buf, sizeof(buf), &cb);
-    ok(hres == S_OK, "Read failed: %08x\n", hres);
-    ok(cb == 13, "cb=%u expected 13\n", cb);
+    ok(hres == S_OK, "Read failed: %08lx\n", hres);
+    ok(cb == 13, "cb=%lu expected 13\n", cb);
     ok(!memcmp(buf, "<html></html>", 13), "unexpected data\n");
     ref = IInternetProtocol_Release(protocol);
-    ok(!ref, "protocol ref=%d\n", ref);
+    ok(!ref, "protocol ref=%ld\n", ref);
 
     hres = IClassFactory_CreateInstance(factory, NULL, &IID_IInternetProtocol, (void**)&protocol);
-    ok(hres == S_OK, "Could not get IInternetProtocol: %08x\n", hres);
+    ok(hres == S_OK, "Could not get IInternetProtocol: %08lx\n", hres);
     if(FAILED(hres))
         return;
 
     cb = 0xdeadbeef;
     hres = IInternetProtocol_Read(protocol, buf, sizeof(buf), &cb);
     ok(hres == (test_protocol == ITS_PROTOCOL ? INET_E_DATA_NOT_AVAILABLE : E_FAIL),
-       "Read returned %08x\n", hres);
-    ok(cb == 0xdeadbeef, "cb=%u expected 0xdeadbeef\n", cb);
+       "Read returned %08lx\n", hres);
+    ok(cb == 0xdeadbeef, "cb=%lu expected 0xdeadbeef\n", cb);
 
     protocol_start(protocol, url, expect_mime);
     hres = IInternetProtocol_Read(protocol, buf, 2, &cb);
-    ok(hres == S_OK, "Read failed: %08x\n", hres);
-    ok(cb == 2, "cb=%u expected 2\n", cb);
+    ok(hres == S_OK, "Read failed: %08lx\n", hres);
+    ok(cb == 2, "cb=%lu expected 2\n", cb);
     hres = IInternetProtocol_Read(protocol, buf, sizeof(buf), &cb);
-    ok(hres == S_OK, "Read failed: %08x\n", hres);
-    ok(cb == 11, "cb=%u, expected 11\n", cb);
+    ok(hres == S_OK, "Read failed: %08lx\n", hres);
+    ok(cb == 11, "cb=%lu, expected 11\n", cb);
     hres = IInternetProtocol_Read(protocol, buf, sizeof(buf), &cb);
-    ok(hres == S_FALSE, "Read failed: %08x expected S_FALSE\n", hres);
-    ok(cb == 0, "cb=%u expected 0\n", cb);
+    ok(hres == S_FALSE, "Read failed: %08lx expected S_FALSE\n", hres);
+    ok(cb == 0, "cb=%lu expected 0\n", cb);
     hres = IInternetProtocol_UnlockRequest(protocol);
-    ok(hres == S_OK, "UnlockRequest failed: %08x\n", hres);
+    ok(hres == S_OK, "UnlockRequest failed: %08lx\n", hres);
     ref = IInternetProtocol_Release(protocol);
-    ok(!ref, "protocol ref=%d\n", ref);
+    ok(!ref, "protocol ref=%ld\n", ref);
 
     hres = IClassFactory_CreateInstance(factory, NULL, &IID_IInternetProtocol, (void**)&protocol);
-    ok(hres == S_OK, "Could not get IInternetProtocol: %08x\n", hres);
+    ok(hres == S_OK, "Could not get IInternetProtocol: %08lx\n", hres);
     if(FAILED(hres))
         return;
 
     protocol_start(protocol, url, expect_mime);
     hres = IInternetProtocol_Read(protocol, buf, 2, &cb);
-    ok(hres == S_OK, "Read failed: %08x\n", hres);
+    ok(hres == S_OK, "Read failed: %08lx\n", hres);
     hres = IInternetProtocol_LockRequest(protocol, 0);
-    ok(hres == S_OK, "LockRequest failed: %08x\n", hres);
+    ok(hres == S_OK, "LockRequest failed: %08lx\n", hres);
     hres = IInternetProtocol_UnlockRequest(protocol);
-    ok(hres == S_OK, "UnlockRequest failed: %08x\n", hres);
+    ok(hres == S_OK, "UnlockRequest failed: %08lx\n", hres);
     hres = IInternetProtocol_Read(protocol, buf, sizeof(buf), &cb);
-    ok(hres == S_OK, "Read failed: %08x\n", hres);
-    ok(cb == 11, "cb=%u, expected 11\n", cb);
+    ok(hres == S_OK, "Read failed: %08lx\n", hres);
+    ok(cb == 11, "cb=%lu, expected 11\n", cb);
     ref = IInternetProtocol_Release(protocol);
-    ok(!ref, "protocol ref=%d\n", ref);
+    ok(!ref, "protocol ref=%ld\n", ref);
 
     hres = IClassFactory_CreateInstance(factory, NULL, &IID_IInternetProtocol, (void**)&protocol);
-    ok(hres == S_OK, "Could not get IInternetProtocol: %08x\n", hres);
+    ok(hres == S_OK, "Could not get IInternetProtocol: %08lx\n", hres);
     if(FAILED(hres))
         return;
 
     protocol_start(protocol, url, expect_mime);
     hres = IInternetProtocol_LockRequest(protocol, 0);
-    ok(hres == S_OK, "LockRequest failed: %08x\n", hres);
+    ok(hres == S_OK, "LockRequest failed: %08lx\n", hres);
     hres = IInternetProtocol_Terminate(protocol, 0);
-    ok(hres == S_OK, "Terminate failed: %08x\n", hres);
+    ok(hres == S_OK, "Terminate failed: %08lx\n", hres);
     hres = IInternetProtocol_Read(protocol, buf, 2, &cb);
-    ok(hres == S_OK, "Read failed: %08x\n", hres);
-    ok(cb == 2, "cb=%u, expected 2\n", cb);
+    ok(hres == S_OK, "Read failed: %08lx\n", hres);
+    ok(cb == 2, "cb=%lu, expected 2\n", cb);
     hres = IInternetProtocol_UnlockRequest(protocol);
-    ok(hres == S_OK, "UnlockRequest failed: %08x\n", hres);
+    ok(hres == S_OK, "UnlockRequest failed: %08lx\n", hres);
     hres = IInternetProtocol_Read(protocol, buf, 2, &cb);
-    ok(hres == S_OK, "Read failed: %08x\n", hres);
-    ok(cb == 2, "cb=%u, expected 2\n", cb);
+    ok(hres == S_OK, "Read failed: %08lx\n", hres);
+    ok(cb == 2, "cb=%lu, expected 2\n", cb);
     hres = IInternetProtocol_Terminate(protocol, 0);
-    ok(hres == S_OK, "Terminate failed: %08x\n", hres);
+    ok(hres == S_OK, "Terminate failed: %08lx\n", hres);
     hres = IInternetProtocol_Read(protocol, buf, 2, &cb);
-    ok(hres == S_OK, "Read failed: %08x\n", hres);
-    ok(cb == 2, "cb=%u expected 2\n", cb);
+    ok(hres == S_OK, "Read failed: %08lx\n", hres);
+    ok(cb == 2, "cb=%lu expected 2\n", cb);
     ref = IInternetProtocol_Release(protocol);
-    ok(!ref, "protocol ref=%d\n", ref);
+    ok(!ref, "protocol ref=%ld\n", ref);
 
     hres = IClassFactory_CreateInstance(factory, NULL, &IID_IInternetProtocol, (void**)&read_protocol);
-    ok(hres == S_OK, "Could not get IInternetProtocol: %08x\n", hres);
+    ok(hres == S_OK, "Could not get IInternetProtocol: %08lx\n", hres);
     if(FAILED(hres))
         return;
 
     protocol_start(read_protocol, url, expect_mime);
     ref = IInternetProtocol_Release(read_protocol);
-    ok(!ref, "protocol ref=%d\n", ref);
+    ok(!ref, "protocol ref=%ld\n", ref);
     read_protocol = NULL;
 }
 
@@ -461,7 +461,7 @@ static void test_its_protocol_info(IInternetProtocol *protocol)
     HRESULT hres;
 
     hres = IInternetProtocol_QueryInterface(protocol, &IID_IInternetProtocolInfo, (void**)&info);
-    ok(hres == S_OK, "Could not get IInternetProtocolInfo interface: %08x\n", hres);
+    ok(hres == S_OK, "Could not get IInternetProtocolInfo interface: %08lx\n", hres);
     if(FAILED(hres))
         return;
 
@@ -470,7 +470,7 @@ static void test_its_protocol_info(IInternetProtocol *protocol)
             hres = IInternetProtocolInfo_ParseUrl(info, blank_url1, i, 0, buf,
                     ARRAY_SIZE(buf), &size, 0);
             ok(hres == INET_E_DEFAULT_ACTION,
-               "[%d] failed: %08x, expected INET_E_DEFAULT_ACTION\n", i, hres);
+               "[%ld] failed: %08lx, expected INET_E_DEFAULT_ACTION\n", i, hres);
         }
     }
 
@@ -479,12 +479,12 @@ static void test_its_protocol_info(IInternetProtocol *protocol)
         memset(buf, 0xfe, sizeof(buf));
         hres = IInternetProtocolInfo_CombineUrl(info, combine_tests[i].base_url,
                 combine_tests[i].rel_url, combine_tests[i].flags, buf, ARRAY_SIZE(buf), &size, 0);
-        ok(hres == combine_tests[i].hres, "[%d] CombineUrl returned %08x, expected %08x\n",
+        ok(hres == combine_tests[i].hres, "[%ld] CombineUrl returned %08lx, expected %08lx\n",
            i, hres, combine_tests[i].hres);
         ok(size == (combine_tests[i].combined_url ? lstrlenW(combine_tests[i].combined_url)+1
-           : 0xdeadbeef), "[%d] unexpected size=%d\n", i, size);
+           : 0xdeadbeef), "[%ld] unexpected size=%ld\n", i, size);
         if(combine_tests[i].combined_url)
-            ok(!lstrcmpW(buf, combine_tests[i].combined_url), "[%d] unexpected result: %s\n", i, wine_dbgstr_w(buf));
+            ok(!lstrcmpW(buf, combine_tests[i].combined_url), "[%ld] unexpected result: %s\n", i, wine_dbgstr_w(buf));
         else
             ok(buf[0] == 0xfefe, "buf changed\n");
     }
@@ -493,8 +493,8 @@ static void test_its_protocol_info(IInternetProtocol *protocol)
     memset(buf, 0xfe, sizeof(buf));
     hres = IInternetProtocolInfo_CombineUrl(info, L"its:test.chm::/blank.html", L"test.html", 0, buf,
             1, &size, 0);
-    ok(hres == E_OUTOFMEMORY, "CombineUrl failed: %08x\n", hres);
-    ok(size == 25, "size=%d\n", size);
+    ok(hres == E_OUTOFMEMORY, "CombineUrl failed: %08lx\n", hres);
+    ok(size == 25, "size=%ld\n", size);
     ok(buf[0] == 0xfefe, "buf changed\n");
 
     IInternetProtocolInfo_Release(info);
@@ -519,12 +519,12 @@ static void test_its_protocol(void)
     hres = CoGetClassObject(&CLSID_ITSProtocol, CLSCTX_INPROC_SERVER, NULL, &IID_IUnknown, (void**)&unk);
     ok(hres == S_OK ||
        broken(hres == REGDB_E_CLASSNOTREG), /* Some W95 and NT4 */
-       "CoGetClassObject failed: %08x\n", hres);
+       "CoGetClassObject failed: %08lx\n", hres);
     if(FAILED(hres))
         return;
 
     hres = IUnknown_QueryInterface(unk, &IID_IInternetProtocolInfo, (void**)&info);
-    ok(hres == E_NOINTERFACE, "Could not get IInternetProtocolInfo: %08x\n", hres);
+    ok(hres == E_NOINTERFACE, "Could not get IInternetProtocolInfo: %08lx\n", hres);
 
     hres = IUnknown_QueryInterface(unk, &IID_IClassFactory, (void**)&factory);
     ok(hres == S_OK, "Could not get IClassFactory interface\n");
@@ -532,7 +532,7 @@ static void test_its_protocol(void)
         IInternetProtocol *protocol;
 
         hres = IClassFactory_CreateInstance(factory, NULL, &IID_IInternetProtocol, (void**)&protocol);
-        ok(hres == S_OK, "Could not get IInternetProtocol: %08x\n", hres);
+        ok(hres == S_OK, "Could not get IInternetProtocol: %08lx\n", hres);
         if(SUCCEEDED(hres)) {
             test_its_protocol_info(protocol);
 
@@ -542,14 +542,14 @@ static void test_its_protocol(void)
 
             hres = IInternetProtocol_Start(protocol, wrong_url4, &protocol_sink, &bind_info, 0, 0);
             ok(hres == INET_E_USE_DEFAULT_PROTOCOLHANDLER,
-               "Start failed: %08x, expected INET_E_USE_DEFAULT_PROTOCOLHANDLER\n", hres);
+               "Start failed: %08lx, expected INET_E_USE_DEFAULT_PROTOCOLHANDLER\n", hres);
 
             hres = IInternetProtocol_Start(protocol, wrong_url5, &protocol_sink, &bind_info, 0, 0);
             ok(hres == INET_E_USE_DEFAULT_PROTOCOLHANDLER,
-               "Start failed: %08x, expected INET_E_USE_DEFAULT_PROTOCOLHANDLER\n", hres);
+               "Start failed: %08lx, expected INET_E_USE_DEFAULT_PROTOCOLHANDLER\n", hres);
 
             ref = IInternetProtocol_Release(protocol);
-            ok(!ref, "protocol ref=%d\n", ref);
+            ok(!ref, "protocol ref=%ld\n", ref);
 
             test_protocol_url(factory, blank_url1, TRUE);
             test_protocol_url(factory, blank_url2, TRUE);
@@ -580,7 +580,7 @@ static void test_mk_protocol(void)
                             (void**)&cf);
     ok(hres == S_OK ||
        broken(hres == REGDB_E_CLASSNOTREG), /* Some W95 and NT4 */
-       "CoGetClassObject failed: %08x\n", hres);
+       "CoGetClassObject failed: %08lx\n", hres);
     if(FAILED(hres))
         return;
 
@@ -619,7 +619,7 @@ static void delete_chm(void)
     BOOL ret;
 
     ret = DeleteFileA("test.chm");
-    ok(ret, "DeleteFileA failed: %d\n", GetLastError());
+    ok(ret, "DeleteFileA failed: %ld\n", GetLastError());
 }
 
 static const IID outer_test_iid = {0xabcabc00,0,0,{0,0,0,0,0,0,0,0x66}};
@@ -659,18 +659,18 @@ static void test_com_aggregation(const CLSID *clsid)
     HRESULT hres;
 
     hres = CoGetClassObject(clsid, CLSCTX_INPROC_SERVER, NULL, &IID_IClassFactory, (void**)&class_factory);
-    ok(hres == S_OK, "CoGetClassObject failed: %08x\n", hres);
+    ok(hres == S_OK, "CoGetClassObject failed: %08lx\n", hres);
 
     hres = IClassFactory_CreateInstance(class_factory, &outer, &IID_IUnknown, (void**)&unk);
-    ok(hres == S_OK, "CreateInstance returned: %08x\n", hres);
+    ok(hres == S_OK, "CreateInstance returned: %08lx\n", hres);
 
     hres = IUnknown_QueryInterface(unk, &IID_IInternetProtocol, (void**)&unk2);
-    ok(hres == S_OK, "Could not get IInternetProtocol iface: %08x\n", hres);
+    ok(hres == S_OK, "Could not get IInternetProtocol iface: %08lx\n", hres);
 
     SET_EXPECT(outer_QI_test);
     hres = IUnknown_QueryInterface(unk2, &outer_test_iid, (void**)&unk3);
     CHECK_CALLED(outer_QI_test);
-    ok(hres == S_OK, "Could not get IInternetProtocol iface: %08x\n", hres);
+    ok(hres == S_OK, "Could not get IInternetProtocol iface: %08lx\n", hres);
     ok(unk3 == (IUnknown*)0xdeadbeef, "unexpected unk2\n");
 
     IUnknown_Release(unk2);
@@ -678,7 +678,7 @@ static void test_com_aggregation(const CLSID *clsid)
 
     unk = (void*)0xdeadbeef;
     hres = IClassFactory_CreateInstance(class_factory, &outer, &IID_IInternetProtocol, (void**)&unk);
-    ok(hres == CLASS_E_NOAGGREGATION, "CreateInstance returned: %08x\n", hres);
+    ok(hres == CLASS_E_NOAGGREGATION, "CreateInstance returned: %08lx\n", hres);
     ok(!unk, "unk = %p\n", unk);
 
     IClassFactory_Release(class_factory);




More information about the wine-devel mailing list