shlwapi/tests: Win64 printf format warning fixes.

This commit is contained in:
Hans Leidekker 2006-10-06 12:43:34 +02:00 committed by Alexandre Julliard
parent 6e4c1501a4
commit a8ccd5816a
6 changed files with 222 additions and 223 deletions

View File

@ -4,7 +4,6 @@ SRCDIR = @srcdir@
VPATH = @srcdir@ VPATH = @srcdir@
TESTDLL = shlwapi.dll TESTDLL = shlwapi.dll
IMPORTS = shlwapi advapi32 ole32 oleaut32 kernel32 IMPORTS = shlwapi advapi32 ole32 oleaut32 kernel32
EXTRADEFS = -DWINE_NO_LONG_AS_INT
CTESTS = \ CTESTS = \
clist.c \ clist.c \

View File

@ -312,7 +312,7 @@ static void test_CList(void)
else if (inserted) else if (inserted)
{ {
ok(inserted->ulSize==item->ulSize+sizeof(SHLWAPI_CLIST), ok(inserted->ulSize==item->ulSize+sizeof(SHLWAPI_CLIST),
"id %ld size wrong (%ld!=%ld)\n", inserted->ulId, inserted->ulSize, "id %d size wrong (%d!=%d)\n", inserted->ulId, inserted->ulSize,
item->ulSize+sizeof(SHLWAPI_CLIST)); item->ulSize+sizeof(SHLWAPI_CLIST));
} }
if (inserted) if (inserted)
@ -437,7 +437,7 @@ static void test_CList(void)
else if (inserted) else if (inserted)
{ {
ok(inserted->ulSize==item->ulSize+sizeof(SHLWAPI_CLIST), ok(inserted->ulSize==item->ulSize+sizeof(SHLWAPI_CLIST),
"id %ld size wrong (%ld!=%ld)\n", inserted->ulId, inserted->ulSize, "id %d size wrong (%d!=%d)\n", inserted->ulId, inserted->ulSize,
item->ulSize+sizeof(SHLWAPI_CLIST)); item->ulSize+sizeof(SHLWAPI_CLIST));
} }
ok(!inserted || inserted->ulId==item->ulId, "find got wrong item\n"); ok(!inserted || inserted->ulId==item->ulId, "find got wrong item\n");

View File

@ -46,8 +46,8 @@ static void test_GetAcceptLanguagesA(void)
memset(buffer, 0, sizeof(buffer)); memset(buffer, 0, sizeof(buffer));
SetLastError(ERROR_SUCCESS); SetLastError(ERROR_SUCCESS);
retval = pGetAcceptLanguagesA( buffer, &buffersize); retval = pGetAcceptLanguagesA( buffer, &buffersize);
trace("GetAcceptLanguagesA: retval %08lx, size %08lx, buffer (%s)," trace("GetAcceptLanguagesA: retval %08x, size %08x, buffer (%s),"
" last error %ld\n", retval, buffersize, buffer, GetLastError()); " last error %d\n", retval, buffersize, buffer, GetLastError());
if(retval != S_OK) { if(retval != S_OK) {
trace("GetAcceptLanguagesA: skipping tests\n"); trace("GetAcceptLanguagesA: skipping tests\n");
return; return;
@ -56,39 +56,39 @@ static void test_GetAcceptLanguagesA(void)
(ERROR_CLASS_DOES_NOT_EXIST == GetLastError()) || (ERROR_CLASS_DOES_NOT_EXIST == GetLastError()) ||
(ERROR_PROC_NOT_FOUND == GetLastError()) || (ERROR_PROC_NOT_FOUND == GetLastError()) ||
(ERROR_CALL_NOT_IMPLEMENTED == GetLastError()) || (ERROR_CALL_NOT_IMPLEMENTED == GetLastError()) ||
(ERROR_SUCCESS == GetLastError()), "last error set to %ld\n", GetLastError()); (ERROR_SUCCESS == GetLastError()), "last error set to %d\n", GetLastError());
exactsize = strlen(buffer); exactsize = strlen(buffer);
SetLastError(ERROR_SUCCESS); SetLastError(ERROR_SUCCESS);
retval = pGetAcceptLanguagesA( NULL, NULL); retval = pGetAcceptLanguagesA( NULL, NULL);
ok(retval == E_FAIL, ok(retval == E_FAIL,
"function result wrong: got %08lx; expected E_FAIL\n", retval); "function result wrong: got %08x; expected E_FAIL\n", retval);
ok(ERROR_SUCCESS == GetLastError(), "last error set to %ld\n", GetLastError()); ok(ERROR_SUCCESS == GetLastError(), "last error set to %d\n", GetLastError());
buffersize = sizeof(buffer); buffersize = sizeof(buffer);
SetLastError(ERROR_SUCCESS); SetLastError(ERROR_SUCCESS);
retval = pGetAcceptLanguagesA( NULL, &buffersize); retval = pGetAcceptLanguagesA( NULL, &buffersize);
ok(retval == E_FAIL, ok(retval == E_FAIL,
"function result wrong: got %08lx; expected E_FAIL\n", retval); "function result wrong: got %08x; expected E_FAIL\n", retval);
ok(buffersize == sizeof(buffer), ok(buffersize == sizeof(buffer),
"buffersize was changed (2nd parameter; not on Win2k)\n"); "buffersize was changed (2nd parameter; not on Win2k)\n");
ok(ERROR_SUCCESS == GetLastError(), "last error set to %ld\n", GetLastError()); ok(ERROR_SUCCESS == GetLastError(), "last error set to %d\n", GetLastError());
SetLastError(ERROR_SUCCESS); SetLastError(ERROR_SUCCESS);
retval = pGetAcceptLanguagesA( buffer, NULL); retval = pGetAcceptLanguagesA( buffer, NULL);
ok(retval == E_FAIL, ok(retval == E_FAIL,
"function result wrong: got %08lx; expected E_FAIL\n", retval); "function result wrong: got %08x; expected E_FAIL\n", retval);
ok(ERROR_SUCCESS == GetLastError(), "last error set to %ld\n", GetLastError()); ok(ERROR_SUCCESS == GetLastError(), "last error set to %d\n", GetLastError());
buffersize = 0; buffersize = 0;
memset(buffer, 0, sizeof(buffer)); memset(buffer, 0, sizeof(buffer));
SetLastError(ERROR_SUCCESS); SetLastError(ERROR_SUCCESS);
retval = pGetAcceptLanguagesA( buffer, &buffersize); retval = pGetAcceptLanguagesA( buffer, &buffersize);
ok(retval == E_FAIL, ok(retval == E_FAIL,
"function result wrong: got %08lx; expected E_FAIL\n", retval); "function result wrong: got %08x; expected E_FAIL\n", retval);
ok(buffersize == 0, ok(buffersize == 0,
"buffersize wrong(changed) got %08lx; expected 0 (2nd parameter; not on Win2k)\n", buffersize); "buffersize wrong(changed) got %08x; expected 0 (2nd parameter; not on Win2k)\n", buffersize);
ok(ERROR_SUCCESS == GetLastError(), "last error set to %ld\n", GetLastError()); ok(ERROR_SUCCESS == GetLastError(), "last error set to %d\n", GetLastError());
buffersize = buffersize2 = 1; buffersize = buffersize2 = 1;
memset(buffer, 0, sizeof(buffer)); memset(buffer, 0, sizeof(buffer));
@ -99,29 +99,29 @@ static void test_GetAcceptLanguagesA(void)
if(buffersize == exactsize) { if(buffersize == exactsize) {
ok( (ERROR_SUCCESS == GetLastError()) || (ERROR_CALL_NOT_IMPLEMENTED == GetLastError()) || ok( (ERROR_SUCCESS == GetLastError()) || (ERROR_CALL_NOT_IMPLEMENTED == GetLastError()) ||
(ERROR_PROC_NOT_FOUND == GetLastError()) || (ERROR_NO_IMPERSONATION_TOKEN == GetLastError()), (ERROR_PROC_NOT_FOUND == GetLastError()) || (ERROR_NO_IMPERSONATION_TOKEN == GetLastError()),
"last error wrong: got %08lx; expected ERROR_SUCCESS(NT4)/ERROR_CALL_NOT_IMPLEMENTED(98/ME)/" "last error wrong: got %08x; expected ERROR_SUCCESS(NT4)/ERROR_CALL_NOT_IMPLEMENTED(98/ME)/"
"ERROR_PROC_NOT_FOUND(NT4)/ERROR_NO_IMPERSONATION_TOKEN(XP)\n", GetLastError()); "ERROR_PROC_NOT_FOUND(NT4)/ERROR_NO_IMPERSONATION_TOKEN(XP)\n", GetLastError());
ok(exactsize == strlen(buffer), ok(exactsize == strlen(buffer),
"buffer content (length) wrong: got %08x, expected %08lx\n", lstrlenA(buffer), exactsize); "buffer content (length) wrong: got %08x, expected %08x\n", lstrlenA(buffer), exactsize);
} else if((buffersize +1) == buffersize2) { } else if((buffersize +1) == buffersize2) {
ok(ERROR_SUCCESS == GetLastError(), ok(ERROR_SUCCESS == GetLastError(),
"last error wrong: got %08lx; expected ERROR_SUCCESS\n", GetLastError()); "last error wrong: got %08x; expected ERROR_SUCCESS\n", GetLastError());
ok(buffersize == strlen(buffer), ok(buffersize == strlen(buffer),
"buffer content (length) wrong: got %08x, expected %08lx\n", lstrlenA(buffer), buffersize); "buffer content (length) wrong: got %08x, expected %08x\n", lstrlenA(buffer), buffersize);
} else } else
ok( 0, "retval %08lx, size %08lx, buffer (%s), last error %ld\n", ok( 0, "retval %08x, size %08x, buffer (%s), last error %d\n",
retval, buffersize, buffer, GetLastError()); retval, buffersize, buffer, GetLastError());
break; break;
case E_INVALIDARG: case E_INVALIDARG:
ok(buffersize == 0, ok(buffersize == 0,
"buffersize wrong: got %08lx, expected 0 (2nd parameter;Win2k)\n", buffersize); "buffersize wrong: got %08x, expected 0 (2nd parameter;Win2k)\n", buffersize);
ok(ERROR_INSUFFICIENT_BUFFER == GetLastError(), ok(ERROR_INSUFFICIENT_BUFFER == GetLastError(),
"last error wrong: got %08lx; expected ERROR_INSUFFICIENT_BUFFER\n", GetLastError()); "last error wrong: got %08x; expected ERROR_INSUFFICIENT_BUFFER\n", GetLastError());
ok(buffersize2 == strlen(buffer), ok(buffersize2 == strlen(buffer),
"buffer content (length) wrong: got %08x, expected %08lx\n", lstrlenA(buffer), buffersize2); "buffer content (length) wrong: got %08x, expected %08x\n", lstrlenA(buffer), buffersize2);
break; break;
default: default:
ok( 0, "retval %08lx, size %08lx, buffer (%s), last error %ld\n", ok( 0, "retval %08x, size %08x, buffer (%s), last error %d\n",
retval, buffersize, buffer, GetLastError()); retval, buffersize, buffer, GetLastError());
break; break;
} }
@ -133,25 +133,25 @@ static void test_GetAcceptLanguagesA(void)
switch(retval) { switch(retval) {
case 0L: case 0L:
ok(ERROR_SUCCESS == GetLastError(), ok(ERROR_SUCCESS == GetLastError(),
"last error wrong: got %08lx; expected ERROR_SUCCESS\n", GetLastError()); "last error wrong: got %08x; expected ERROR_SUCCESS\n", GetLastError());
if((buffersize == exactsize) /* XP */ || if((buffersize == exactsize) /* XP */ ||
((buffersize +1)== exactsize) /* 98 */) ((buffersize +1)== exactsize) /* 98 */)
ok(buffersize == strlen(buffer), ok(buffersize == strlen(buffer),
"buffer content (length) wrong: got %08x, expected %08lx\n", lstrlenA(buffer), buffersize); "buffer content (length) wrong: got %08x, expected %08x\n", lstrlenA(buffer), buffersize);
else else
ok( 0, "retval %08lx, size %08lx, buffer (%s), last error %ld\n", ok( 0, "retval %08x, size %08x, buffer (%s), last error %d\n",
retval, buffersize, buffer, GetLastError()); retval, buffersize, buffer, GetLastError());
break; break;
case E_INVALIDARG: case E_INVALIDARG:
ok(buffersize == 0, ok(buffersize == 0,
"buffersize wrong: got %08lx, expected 0 (2nd parameter;Win2k)\n", buffersize); "buffersize wrong: got %08x, expected 0 (2nd parameter;Win2k)\n", buffersize);
ok(ERROR_INSUFFICIENT_BUFFER == GetLastError(), ok(ERROR_INSUFFICIENT_BUFFER == GetLastError(),
"last error wrong: got %08lx; expected ERROR_INSUFFICIENT_BUFFER\n", GetLastError()); "last error wrong: got %08x; expected ERROR_INSUFFICIENT_BUFFER\n", GetLastError());
ok(buffersize2 == strlen(buffer), ok(buffersize2 == strlen(buffer),
"buffer content (length) wrong: got %08x, expected %08lx\n", lstrlenA(buffer), buffersize2); "buffer content (length) wrong: got %08x, expected %08x\n", lstrlenA(buffer), buffersize2);
break; break;
default: default:
ok( 0, "retval %08lx, size %08lx, buffer (%s), last error %ld\n", ok( 0, "retval %08x, size %08x, buffer (%s), last error %d\n",
retval, buffersize, buffer, GetLastError()); retval, buffersize, buffer, GetLastError());
break; break;
} }
@ -208,23 +208,23 @@ static void test_alloc_shared(void)
procid=GetCurrentProcessId(); procid=GetCurrentProcessId();
hmem=pSHAllocShared(NULL,10,procid); hmem=pSHAllocShared(NULL,10,procid);
ok(hmem!=NULL,"SHAllocShared(NULL...) failed: %ld\n", GetLastError()); ok(hmem!=NULL,"SHAllocShared(NULL...) failed: %d\n", GetLastError());
ret = pSHFreeShared(hmem, procid); ret = pSHFreeShared(hmem, procid);
ok( ret, "SHFreeShared failed: %ld\n", GetLastError()); ok( ret, "SHFreeShared failed: %d\n", GetLastError());
val=0x12345678; val=0x12345678;
hmem=pSHAllocShared(&val,4,procid); hmem=pSHAllocShared(&val,4,procid);
ok(hmem!=NULL,"SHAllocShared(NULL...) failed: %ld\n", GetLastError()); ok(hmem!=NULL,"SHAllocShared(NULL...) failed: %d\n", GetLastError());
p=(int*)pSHLockShared(hmem,procid); p=(int*)pSHLockShared(hmem,procid);
ok(p!=NULL,"SHLockShared failed: %ld\n", GetLastError()); ok(p!=NULL,"SHLockShared failed: %d\n", GetLastError());
if (p!=NULL) if (p!=NULL)
ok(*p==val,"Wrong value in shared memory: %d instead of %d\n",*p,val); ok(*p==val,"Wrong value in shared memory: %d instead of %d\n",*p,val);
ret = pSHUnlockShared(p); ret = pSHUnlockShared(p);
ok( ret, "SHUnlockShared failed: %ld\n", GetLastError()); ok( ret, "SHUnlockShared failed: %d\n", GetLastError());
ret = pSHFreeShared(hmem, procid); ret = pSHFreeShared(hmem, procid);
ok( ret, "SHFreeShared failed: %ld\n", GetLastError()); ok( ret, "SHFreeShared failed: %d\n", GetLastError());
} }
static void test_fdsa(void) static void test_fdsa(void)
@ -259,52 +259,52 @@ static void test_fdsa(void)
memset(&info, 0, sizeof(info)); memset(&info, 0, sizeof(info));
ok(pFDSA_Initialize(block_size, inc, &info, mem, init_blocks), "FDSA_Initialize rets FALSE\n"); ok(pFDSA_Initialize(block_size, inc, &info, mem, init_blocks), "FDSA_Initialize rets FALSE\n");
ok(info.num_items == 0, "num_items = %ld\n", info.num_items); ok(info.num_items == 0, "num_items = %d\n", info.num_items);
ok(info.mem == mem, "mem = %p\n", info.mem); ok(info.mem == mem, "mem = %p\n", info.mem);
ok(info.blocks_alloced == init_blocks, "blocks_alloced = %ld\n", info.blocks_alloced); ok(info.blocks_alloced == init_blocks, "blocks_alloced = %d\n", info.blocks_alloced);
ok(info.inc == inc, "inc = %d\n", info.inc); ok(info.inc == inc, "inc = %d\n", info.inc);
ok(info.block_size == block_size, "block_size = %d\n", info.block_size); ok(info.block_size == block_size, "block_size = %d\n", info.block_size);
ok(info.flags == 0, "flags = %d\n", info.flags); ok(info.flags == 0, "flags = %d\n", info.flags);
ret = pFDSA_InsertItem(&info, 1234, "1234567890"); ret = pFDSA_InsertItem(&info, 1234, "1234567890");
ok(ret == 0, "ret = %ld\n", ret); ok(ret == 0, "ret = %d\n", ret);
ok(info.num_items == 1, "num_items = %ld\n", info.num_items); ok(info.num_items == 1, "num_items = %d\n", info.num_items);
ok(info.mem == mem, "mem = %p\n", info.mem); ok(info.mem == mem, "mem = %p\n", info.mem);
ok(info.blocks_alloced == init_blocks, "blocks_alloced = %ld\n", info.blocks_alloced); ok(info.blocks_alloced == init_blocks, "blocks_alloced = %d\n", info.blocks_alloced);
ok(info.inc == inc, "inc = %d\n", info.inc); ok(info.inc == inc, "inc = %d\n", info.inc);
ok(info.block_size == block_size, "block_size = %d\n", info.block_size); ok(info.block_size == block_size, "block_size = %d\n", info.block_size);
ok(info.flags == 0, "flags = %d\n", info.flags); ok(info.flags == 0, "flags = %d\n", info.flags);
ret = pFDSA_InsertItem(&info, 1234, "abcdefghij"); ret = pFDSA_InsertItem(&info, 1234, "abcdefghij");
ok(ret == 1, "ret = %ld\n", ret); ok(ret == 1, "ret = %d\n", ret);
ret = pFDSA_InsertItem(&info, 1, "klmnopqrst"); ret = pFDSA_InsertItem(&info, 1, "klmnopqrst");
ok(ret == 1, "ret = %ld\n", ret); ok(ret == 1, "ret = %d\n", ret);
ret = pFDSA_InsertItem(&info, 0, "uvwxyzABCD"); ret = pFDSA_InsertItem(&info, 0, "uvwxyzABCD");
ok(ret == 0, "ret = %ld\n", ret); ok(ret == 0, "ret = %d\n", ret);
ok(info.mem == mem, "mem = %p\n", info.mem); ok(info.mem == mem, "mem = %p\n", info.mem);
ok(info.flags == 0, "flags = %d\n", info.flags); ok(info.flags == 0, "flags = %d\n", info.flags);
/* This next InsertItem will cause shlwapi to allocate its own mem buffer */ /* This next InsertItem will cause shlwapi to allocate its own mem buffer */
ret = pFDSA_InsertItem(&info, 0, "EFGHIJKLMN"); ret = pFDSA_InsertItem(&info, 0, "EFGHIJKLMN");
ok(ret == 0, "ret = %ld\n", ret); ok(ret == 0, "ret = %d\n", ret);
ok(info.mem != mem, "mem = %p\n", info.mem); ok(info.mem != mem, "mem = %p\n", info.mem);
ok(info.blocks_alloced == init_blocks + inc, "blocks_alloced = %ld\n", info.blocks_alloced); ok(info.blocks_alloced == init_blocks + inc, "blocks_alloced = %d\n", info.blocks_alloced);
ok(info.flags == 0x1, "flags = %d\n", info.flags); ok(info.flags == 0x1, "flags = %d\n", info.flags);
ok(!memcmp(info.mem, "EFGHIJKLMNuvwxyzABCD1234567890klmnopqrstabcdefghij", 50), "mem %s\n", (char*)info.mem); ok(!memcmp(info.mem, "EFGHIJKLMNuvwxyzABCD1234567890klmnopqrstabcdefghij", 50), "mem %s\n", (char*)info.mem);
ok(pFDSA_DeleteItem(&info, 2), "rets FALSE\n"); ok(pFDSA_DeleteItem(&info, 2), "rets FALSE\n");
ok(info.mem != mem, "mem = %p\n", info.mem); ok(info.mem != mem, "mem = %p\n", info.mem);
ok(info.blocks_alloced == init_blocks + inc, "blocks_alloced = %ld\n", info.blocks_alloced); ok(info.blocks_alloced == init_blocks + inc, "blocks_alloced = %d\n", info.blocks_alloced);
ok(info.flags == 0x1, "flags = %d\n", info.flags); ok(info.flags == 0x1, "flags = %d\n", info.flags);
ok(!memcmp(info.mem, "EFGHIJKLMNuvwxyzABCDklmnopqrstabcdefghij", 40), "mem %s\n", (char*)info.mem); ok(!memcmp(info.mem, "EFGHIJKLMNuvwxyzABCDklmnopqrstabcdefghij", 40), "mem %s\n", (char*)info.mem);
ok(pFDSA_DeleteItem(&info, 3), "rets FALSE\n"); ok(pFDSA_DeleteItem(&info, 3), "rets FALSE\n");
ok(info.mem != mem, "mem = %p\n", info.mem); ok(info.mem != mem, "mem = %p\n", info.mem);
ok(info.blocks_alloced == init_blocks + inc, "blocks_alloced = %ld\n", info.blocks_alloced); ok(info.blocks_alloced == init_blocks + inc, "blocks_alloced = %d\n", info.blocks_alloced);
ok(info.flags == 0x1, "flags = %d\n", info.flags); ok(info.flags == 0x1, "flags = %d\n", info.flags);
ok(!memcmp(info.mem, "EFGHIJKLMNuvwxyzABCDklmnopqrst", 30), "mem %s\n", (char*)info.mem); ok(!memcmp(info.mem, "EFGHIJKLMNuvwxyzABCDklmnopqrst", 30), "mem %s\n", (char*)info.mem);

View File

@ -378,7 +378,7 @@ static void test_url_part(const char* szUrl, DWORD dwPart, DWORD dwFlags, const
DWORD dwSize; DWORD dwSize;
dwSize = INTERNET_MAX_URL_LENGTH; dwSize = INTERNET_MAX_URL_LENGTH;
ok( UrlGetPartA(szUrl, szPart, &dwSize, dwPart, dwFlags) == S_OK, "UrlGetPartA for \"%s\" part 0x%08lx didn't return S_OK but \"%s\"\n", szUrl, dwPart, szPart); ok( UrlGetPartA(szUrl, szPart, &dwSize, dwPart, dwFlags) == S_OK, "UrlGetPartA for \"%s\" part 0x%08x didn't return S_OK but \"%s\"\n", szUrl, dwPart, szPart);
dwSize = INTERNET_MAX_URL_LENGTH; dwSize = INTERNET_MAX_URL_LENGTH;
ok( UrlGetPartW(wszUrl, wszPart, &dwSize, dwPart, dwFlags) == S_OK, "UrlGetPartW didn't return S_OK\n" ); ok( UrlGetPartW(wszUrl, wszPart, &dwSize, dwPart, dwFlags) == S_OK, "UrlGetPartW didn't return S_OK\n" );
@ -405,14 +405,14 @@ static void test_UrlGetPart(void)
szPart[0]='x'; szPart[1]=0; szPart[0]='x'; szPart[1]=0;
res = UrlGetPartA("hi", szPart, &dwSize, URL_PART_SCHEME, 0); res = UrlGetPartA("hi", szPart, &dwSize, URL_PART_SCHEME, 0);
todo_wine { todo_wine {
ok (res==S_FALSE, "UrlGetPartA(\"hi\") returned %08lX\n", res); ok (res==S_FALSE, "UrlGetPartA(\"hi\") returned %08X\n", res);
ok(szPart[0]==0, "UrlGetPartA(\"hi\") return \"%s\" instead of \"\"\n", szPart); ok(szPart[0]==0, "UrlGetPartA(\"hi\") return \"%s\" instead of \"\"\n", szPart);
} }
dwSize = sizeof szPart; dwSize = sizeof szPart;
szPart[0]='x'; szPart[1]=0; szPart[0]='x'; szPart[1]=0;
res = UrlGetPartA("hi", szPart, &dwSize, URL_PART_QUERY, 0); res = UrlGetPartA("hi", szPart, &dwSize, URL_PART_QUERY, 0);
todo_wine { todo_wine {
ok (res==S_FALSE, "UrlGetPartA(\"hi\") returned %08lX\n", res); ok (res==S_FALSE, "UrlGetPartA(\"hi\") returned %08X\n", res);
ok(szPart[0]==0, "UrlGetPartA(\"hi\") return \"%s\" instead of \"\"\n", szPart); ok(szPart[0]==0, "UrlGetPartA(\"hi\") return \"%s\" instead of \"\"\n", szPart);
} }
@ -432,15 +432,15 @@ static void test_url_escape(const char *szUrl, DWORD dwFlags, HRESULT dwExpectRe
WCHAR *urlW, *expected_urlW; WCHAR *urlW, *expected_urlW;
dwEscaped=INTERNET_MAX_URL_LENGTH; dwEscaped=INTERNET_MAX_URL_LENGTH;
ok(UrlEscapeA(szUrl, szReturnUrl, &dwEscaped, dwFlags) == dwExpectReturn, "UrlEscapeA didn't return 0x%08lx from \"%s\"\n", dwExpectReturn, szUrl); ok(UrlEscapeA(szUrl, szReturnUrl, &dwEscaped, dwFlags) == dwExpectReturn, "UrlEscapeA didn't return 0x%08x from \"%s\"\n", dwExpectReturn, szUrl);
ok(strcmp(szReturnUrl,szExpectUrl)==0, "Expected \"%s\", but got \"%s\" from \"%s\"\n", szExpectUrl, szReturnUrl, szUrl); ok(strcmp(szReturnUrl,szExpectUrl)==0, "Expected \"%s\", but got \"%s\" from \"%s\"\n", szExpectUrl, szReturnUrl, szUrl);
dwEscaped = INTERNET_MAX_URL_LENGTH; dwEscaped = INTERNET_MAX_URL_LENGTH;
urlW = GetWideString(szUrl); urlW = GetWideString(szUrl);
expected_urlW = GetWideString(szExpectUrl); expected_urlW = GetWideString(szExpectUrl);
ok(UrlEscapeW(urlW, ret_urlW, &dwEscaped, dwFlags) == dwExpectReturn, "UrlEscapeW didn't return 0x%08lx from \"%s\"\n", dwExpectReturn, szUrl); ok(UrlEscapeW(urlW, ret_urlW, &dwEscaped, dwFlags) == dwExpectReturn, "UrlEscapeW didn't return 0x%08x from \"%s\"\n", dwExpectReturn, szUrl);
WideCharToMultiByte(CP_ACP,0,ret_urlW,-1,szReturnUrl,INTERNET_MAX_URL_LENGTH,0,0); WideCharToMultiByte(CP_ACP,0,ret_urlW,-1,szReturnUrl,INTERNET_MAX_URL_LENGTH,0,0);
ok(lstrcmpW(ret_urlW, expected_urlW)==0, "Expected \"%s\", but got \"%s\" from \"%s\" flags %08lx\n", szExpectUrl, szReturnUrl, szUrl, dwFlags); ok(lstrcmpW(ret_urlW, expected_urlW)==0, "Expected \"%s\", but got \"%s\" from \"%s\" flags %08x\n", szExpectUrl, szReturnUrl, szUrl, dwFlags);
FreeWideString(urlW); FreeWideString(urlW);
FreeWideString(expected_urlW); FreeWideString(expected_urlW);
@ -458,12 +458,12 @@ static void test_url_canonicalize(const char *szUrl, DWORD dwFlags, HRESULT dwEx
dwSize = INTERNET_MAX_URL_LENGTH; dwSize = INTERNET_MAX_URL_LENGTH;
ok(UrlCanonicalizeA(szUrl, NULL, &dwSize, dwFlags) != dwExpectReturn, "Unexpected return for NULL buffer\n"); ok(UrlCanonicalizeA(szUrl, NULL, &dwSize, dwFlags) != dwExpectReturn, "Unexpected return for NULL buffer\n");
ok(UrlCanonicalizeA(szUrl, szReturnUrl, &dwSize, dwFlags) == dwExpectReturn, "UrlCanonicalizeA didn't return 0x%08lx\n", dwExpectReturn); ok(UrlCanonicalizeA(szUrl, szReturnUrl, &dwSize, dwFlags) == dwExpectReturn, "UrlCanonicalizeA didn't return 0x%08x\n", dwExpectReturn);
ok(strcmp(szReturnUrl,szExpectUrl)==0, "UrlCanonicalizeA dwFlags 0x%08lx Expected \"%s\", but got \"%s\"\n", dwFlags, szExpectUrl, szReturnUrl); ok(strcmp(szReturnUrl,szExpectUrl)==0, "UrlCanonicalizeA dwFlags 0x%08x Expected \"%s\", but got \"%s\"\n", dwFlags, szExpectUrl, szReturnUrl);
dwSize = INTERNET_MAX_URL_LENGTH; dwSize = INTERNET_MAX_URL_LENGTH;
ok(UrlCanonicalizeW(wszUrl, NULL, &dwSize, dwFlags) != dwExpectReturn, "Unexpected return for NULL buffer\n"); ok(UrlCanonicalizeW(wszUrl, NULL, &dwSize, dwFlags) != dwExpectReturn, "Unexpected return for NULL buffer\n");
ok(UrlCanonicalizeW(wszUrl, wszReturnUrl, &dwSize, dwFlags) == dwExpectReturn, "UrlCanonicalizeW didn't return 0x%08lx\n", dwExpectReturn); ok(UrlCanonicalizeW(wszUrl, wszReturnUrl, &dwSize, dwFlags) == dwExpectReturn, "UrlCanonicalizeW didn't return 0x%08x\n", dwExpectReturn);
wszConvertedUrl = GetWideString(szReturnUrl); wszConvertedUrl = GetWideString(szReturnUrl);
ok(lstrcmpW(wszReturnUrl, wszConvertedUrl)==0, "Strings didn't match between ascii and unicode UrlCanonicalize!\n"); ok(lstrcmpW(wszReturnUrl, wszConvertedUrl)==0, "Strings didn't match between ascii and unicode UrlCanonicalize!\n");
FreeWideString(wszConvertedUrl); FreeWideString(wszConvertedUrl);
@ -497,7 +497,7 @@ static void test_UrlCanonicalize(void)
/* move to TEST_CANONICALIZE when fixed */ /* move to TEST_CANONICALIZE when fixed */
dwSize = sizeof szReturnUrl; dwSize = sizeof szReturnUrl;
ok(UrlCanonicalizeA("c:\\tests\\foo bar", szReturnUrl, &dwSize, 0) == S_OK, "UrlCanonicalizeA didn't return 0x%08lx\n", S_OK); ok(UrlCanonicalizeA("c:\\tests\\foo bar", szReturnUrl, &dwSize, 0) == S_OK, "UrlCanonicalizeA didn't return 0x%08x\n", S_OK);
todo_wine { todo_wine {
ok(strcmp(szReturnUrl,"file:///c:/tests/foo%20bar")==0, "UrlCanonicalizeA got %s\n", szReturnUrl); ok(strcmp(szReturnUrl,"file:///c:/tests/foo%20bar")==0, "UrlCanonicalizeA got %s\n", szReturnUrl);
} }
@ -505,7 +505,7 @@ static void test_UrlCanonicalize(void)
dwSize = sizeof szReturnUrl; dwSize = sizeof szReturnUrl;
/*LimeWire online installer calls this*/ /*LimeWire online installer calls this*/
hr = UrlCanonicalizeA("/uri-res/N2R?urn:sha1:B3K", szReturnUrl, &dwSize,URL_DONT_ESCAPE_EXTRA_INFO | URL_WININET_COMPATIBILITY /*0x82000000*/); hr = UrlCanonicalizeA("/uri-res/N2R?urn:sha1:B3K", szReturnUrl, &dwSize,URL_DONT_ESCAPE_EXTRA_INFO | URL_WININET_COMPATIBILITY /*0x82000000*/);
ok(hr==S_OK,"UrlCanonicalizeA returned 0x%08lx instead of S_OK\n", hr); ok(hr==S_OK,"UrlCanonicalizeA returned 0x%08x instead of S_OK\n", hr);
todo_wine { todo_wine {
ok(strcmp(szReturnUrl,"/uri-res/N2R?urn:sha1:B3K")==0, "UrlCanonicalizeA got \"%s\" instead of \"/uri-res/N2R?urn:sha1:B3K\"\n", szReturnUrl); ok(strcmp(szReturnUrl,"/uri-res/N2R?urn:sha1:B3K")==0, "UrlCanonicalizeA got \"%s\" instead of \"/uri-res/N2R?urn:sha1:B3K\"\n", szReturnUrl);
} }
@ -525,38 +525,38 @@ static void test_url_combine(const char *szUrl1, const char *szUrl2, DWORD dwFla
DWORD dwExpectLen = lstrlen(szExpectUrl); DWORD dwExpectLen = lstrlen(szExpectUrl);
hr = UrlCombineA(szUrl1, szUrl2, NULL, NULL, dwFlags); hr = UrlCombineA(szUrl1, szUrl2, NULL, NULL, dwFlags);
ok(hr == E_INVALIDARG, "UrlCombineA returned 0x%08lx, expected 0x%08lx\n", hr, E_INVALIDARG); ok(hr == E_INVALIDARG, "UrlCombineA returned 0x%08x, expected 0x%08x\n", hr, E_INVALIDARG);
dwSize = 0; dwSize = 0;
hr = UrlCombineA(szUrl1, szUrl2, NULL, &dwSize, dwFlags); hr = UrlCombineA(szUrl1, szUrl2, NULL, &dwSize, dwFlags);
ok(hr == E_POINTER, "Checking length of string, return was 0x%08lx, expected 0x%08lx\n", hr, E_POINTER); ok(hr == E_POINTER, "Checking length of string, return was 0x%08x, expected 0x%08x\n", hr, E_POINTER);
ok(dwSize == dwExpectLen+1, "Got length %ld, expected %ld\n", dwSize, dwExpectLen+1); ok(dwSize == dwExpectLen+1, "Got length %d, expected %d\n", dwSize, dwExpectLen+1);
dwSize--; dwSize--;
hr = UrlCombineA(szUrl1, szUrl2, szReturnUrl, &dwSize, dwFlags); hr = UrlCombineA(szUrl1, szUrl2, szReturnUrl, &dwSize, dwFlags);
ok(hr == E_POINTER, "UrlCombineA returned 0x%08lx, expected 0x%08lx\n", hr, E_POINTER); ok(hr == E_POINTER, "UrlCombineA returned 0x%08x, expected 0x%08x\n", hr, E_POINTER);
ok(dwSize == dwExpectLen+1, "Got length %ld, expected %ld\n", dwSize, dwExpectLen+1); ok(dwSize == dwExpectLen+1, "Got length %d, expected %d\n", dwSize, dwExpectLen+1);
hr = UrlCombineA(szUrl1, szUrl2, szReturnUrl, &dwSize, dwFlags); hr = UrlCombineA(szUrl1, szUrl2, szReturnUrl, &dwSize, dwFlags);
ok(hr == dwExpectReturn, "UrlCombineA returned 0x%08lx, expected 0x%08lx\n", hr, dwExpectReturn); ok(hr == dwExpectReturn, "UrlCombineA returned 0x%08x, expected 0x%08x\n", hr, dwExpectReturn);
ok(dwSize == dwExpectLen, "Got length %ld, expected %ld\n", dwSize, dwExpectLen); ok(dwSize == dwExpectLen, "Got length %d, expected %d\n", dwSize, dwExpectLen);
if(SUCCEEDED(hr)) { if(SUCCEEDED(hr)) {
ok(strcmp(szReturnUrl,szExpectUrl)==0, "Expected %s, but got %s\n", szExpectUrl, szReturnUrl); ok(strcmp(szReturnUrl,szExpectUrl)==0, "Expected %s, but got %s\n", szExpectUrl, szReturnUrl);
} }
dwSize = 0; dwSize = 0;
hr = UrlCombineW(wszUrl1, wszUrl2, NULL, &dwSize, dwFlags); hr = UrlCombineW(wszUrl1, wszUrl2, NULL, &dwSize, dwFlags);
ok(hr == E_POINTER, "Checking length of string, return was 0x%08lx, expected 0x%08lx\n", hr, E_POINTER); ok(hr == E_POINTER, "Checking length of string, return was 0x%08x, expected 0x%08x\n", hr, E_POINTER);
ok(dwSize == dwExpectLen+1, "Got length %ld, expected %ld\n", dwSize, dwExpectLen+1); ok(dwSize == dwExpectLen+1, "Got length %d, expected %d\n", dwSize, dwExpectLen+1);
dwSize--; dwSize--;
hr = UrlCombineW(wszUrl1, wszUrl2, wszReturnUrl, &dwSize, dwFlags); hr = UrlCombineW(wszUrl1, wszUrl2, wszReturnUrl, &dwSize, dwFlags);
ok(hr == E_POINTER, "UrlCombineA returned 0x%08lx, expected 0x%08lx\n", hr, E_POINTER); ok(hr == E_POINTER, "UrlCombineA returned 0x%08x, expected 0x%08x\n", hr, E_POINTER);
ok(dwSize == dwExpectLen+1, "Got length %ld, expected %ld\n", dwSize, dwExpectLen+1); ok(dwSize == dwExpectLen+1, "Got length %d, expected %d\n", dwSize, dwExpectLen+1);
hr = UrlCombineW(wszUrl1, wszUrl2, wszReturnUrl, &dwSize, dwFlags); hr = UrlCombineW(wszUrl1, wszUrl2, wszReturnUrl, &dwSize, dwFlags);
ok(hr == dwExpectReturn, "UrlCombineW returned 0x%08lx, expected 0x%08lx\n", hr, dwExpectReturn); ok(hr == dwExpectReturn, "UrlCombineW returned 0x%08x, expected 0x%08x\n", hr, dwExpectReturn);
ok(dwSize == dwExpectLen, "Got length %ld, expected %ld\n", dwSize, dwExpectLen); ok(dwSize == dwExpectLen, "Got length %d, expected %d\n", dwSize, dwExpectLen);
if(SUCCEEDED(hr)) { if(SUCCEEDED(hr)) {
wszConvertedUrl = GetWideString(szReturnUrl); wszConvertedUrl = GetWideString(szReturnUrl);
ok(lstrcmpW(wszReturnUrl, wszConvertedUrl)==0, "Strings didn't match between ascii and unicode UrlCombine!\n"); ok(lstrcmpW(wszReturnUrl, wszConvertedUrl)==0, "Strings didn't match between ascii and unicode UrlCombine!\n");
@ -588,19 +588,19 @@ static void test_UrlCreateFromPath(void)
for(i = 0; i < sizeof(TEST_URLFROMPATH) / sizeof(TEST_URLFROMPATH[0]); i++) { for(i = 0; i < sizeof(TEST_URLFROMPATH) / sizeof(TEST_URLFROMPATH[0]); i++) {
len = INTERNET_MAX_URL_LENGTH; len = INTERNET_MAX_URL_LENGTH;
ret = UrlCreateFromPathA(TEST_URLFROMPATH[i].path, ret_url, &len, 0); ret = UrlCreateFromPathA(TEST_URLFROMPATH[i].path, ret_url, &len, 0);
ok(ret == TEST_URLFROMPATH[i].ret, "ret %08lx from path %s\n", ret, TEST_URLFROMPATH[i].path); ok(ret == TEST_URLFROMPATH[i].ret, "ret %08x from path %s\n", ret, TEST_URLFROMPATH[i].path);
ok(!lstrcmpi(ret_url, TEST_URLFROMPATH[i].url), "url %s from path %s\n", ret_url, TEST_URLFROMPATH[i].path); ok(!lstrcmpi(ret_url, TEST_URLFROMPATH[i].url), "url %s from path %s\n", ret_url, TEST_URLFROMPATH[i].path);
ok(len == strlen(ret_url), "ret len %ld from path %s\n", len, TEST_URLFROMPATH[i].path); ok(len == strlen(ret_url), "ret len %d from path %s\n", len, TEST_URLFROMPATH[i].path);
len = INTERNET_MAX_URL_LENGTH; len = INTERNET_MAX_URL_LENGTH;
pathW = GetWideString(TEST_URLFROMPATH[i].path); pathW = GetWideString(TEST_URLFROMPATH[i].path);
urlW = GetWideString(TEST_URLFROMPATH[i].url); urlW = GetWideString(TEST_URLFROMPATH[i].url);
ret = UrlCreateFromPathW(pathW, ret_urlW, &len, 0); ret = UrlCreateFromPathW(pathW, ret_urlW, &len, 0);
WideCharToMultiByte(CP_ACP, 0, ret_urlW, -1, ret_url, sizeof(ret_url),0,0); WideCharToMultiByte(CP_ACP, 0, ret_urlW, -1, ret_url, sizeof(ret_url),0,0);
ok(ret == TEST_URLFROMPATH[i].ret, "ret %08lx from path L\"%s\", expected %08lx\n", ok(ret == TEST_URLFROMPATH[i].ret, "ret %08x from path L\"%s\", expected %08x\n",
ret, TEST_URLFROMPATH[i].path, TEST_URLFROMPATH[i].ret); ret, TEST_URLFROMPATH[i].path, TEST_URLFROMPATH[i].ret);
ok(!lstrcmpiW(ret_urlW, urlW), "got %s expected %s from path L\"%s\"\n", ret_url, TEST_URLFROMPATH[i].url, TEST_URLFROMPATH[i].path); ok(!lstrcmpiW(ret_urlW, urlW), "got %s expected %s from path L\"%s\"\n", ret_url, TEST_URLFROMPATH[i].url, TEST_URLFROMPATH[i].path);
ok(len == lstrlenW(ret_urlW), "ret len %ld from path L\"%s\"\n", len, TEST_URLFROMPATH[i].path); ok(len == lstrlenW(ret_urlW), "ret len %d from path L\"%s\"\n", len, TEST_URLFROMPATH[i].path);
FreeWideString(urlW); FreeWideString(urlW);
FreeWideString(pathW); FreeWideString(pathW);
} }
@ -661,13 +661,13 @@ static void test_UrlUnescape(void)
for(i=0; i<sizeof(TEST_URL_UNESCAPE)/sizeof(TEST_URL_UNESCAPE[0]); i++) { for(i=0; i<sizeof(TEST_URL_UNESCAPE)/sizeof(TEST_URL_UNESCAPE[0]); i++) {
dwEscaped=INTERNET_MAX_URL_LENGTH; dwEscaped=INTERNET_MAX_URL_LENGTH;
ok(UrlUnescapeA(TEST_URL_UNESCAPE[i].url, szReturnUrl, &dwEscaped, 0) == S_OK, "UrlEscapeA didn't return 0x%08lx from \"%s\"\n", S_OK, TEST_URL_UNESCAPE[i].url); ok(UrlUnescapeA(TEST_URL_UNESCAPE[i].url, szReturnUrl, &dwEscaped, 0) == S_OK, "UrlEscapeA didn't return 0x%08x from \"%s\"\n", S_OK, TEST_URL_UNESCAPE[i].url);
ok(strcmp(szReturnUrl,TEST_URL_UNESCAPE[i].expect)==0, "Expected \"%s\", but got \"%s\" from \"%s\"\n", TEST_URL_UNESCAPE[i].expect, szReturnUrl, TEST_URL_UNESCAPE[i].url); ok(strcmp(szReturnUrl,TEST_URL_UNESCAPE[i].expect)==0, "Expected \"%s\", but got \"%s\" from \"%s\"\n", TEST_URL_UNESCAPE[i].expect, szReturnUrl, TEST_URL_UNESCAPE[i].url);
dwEscaped = INTERNET_MAX_URL_LENGTH; dwEscaped = INTERNET_MAX_URL_LENGTH;
urlW = GetWideString(TEST_URL_UNESCAPE[i].url); urlW = GetWideString(TEST_URL_UNESCAPE[i].url);
expected_urlW = GetWideString(TEST_URL_UNESCAPE[i].expect); expected_urlW = GetWideString(TEST_URL_UNESCAPE[i].expect);
ok(UrlUnescapeW(urlW, ret_urlW, &dwEscaped, 0) == S_OK, "UrlEscapeW didn't return 0x%08lx from \"%s\"\n", S_OK, TEST_URL_UNESCAPE[i].url); ok(UrlUnescapeW(urlW, ret_urlW, &dwEscaped, 0) == S_OK, "UrlEscapeW didn't return 0x%08x from \"%s\"\n", S_OK, TEST_URL_UNESCAPE[i].url);
WideCharToMultiByte(CP_ACP,0,ret_urlW,-1,szReturnUrl,INTERNET_MAX_URL_LENGTH,0,0); WideCharToMultiByte(CP_ACP,0,ret_urlW,-1,szReturnUrl,INTERNET_MAX_URL_LENGTH,0,0);
ok(lstrcmpW(ret_urlW, expected_urlW)==0, "Expected \"%s\", but got \"%s\" from \"%s\" flags %08lx\n", TEST_URL_UNESCAPE[i].expect, szReturnUrl, TEST_URL_UNESCAPE[i].url, 0L); ok(lstrcmpW(ret_urlW, expected_urlW)==0, "Expected \"%s\", but got \"%s\" from \"%s\" flags %08lx\n", TEST_URL_UNESCAPE[i].expect, szReturnUrl, TEST_URL_UNESCAPE[i].url, 0L);
FreeWideString(urlW); FreeWideString(urlW);
@ -743,25 +743,25 @@ static void test_PathCreateFromUrl(void)
/* Check ret_path = NULL */ /* Check ret_path = NULL */
len = sizeof(url); len = sizeof(url);
ret = PathCreateFromUrlA(url, NULL, &len, 0); ret = PathCreateFromUrlA(url, NULL, &len, 0);
ok ( ret == E_INVALIDARG, "got 0x%08lx expected E_INVALIDARG\n", ret); ok ( ret == E_INVALIDARG, "got 0x%08x expected E_INVALIDARG\n", ret);
for(i = 0; i < sizeof(TEST_PATHFROMURL) / sizeof(TEST_PATHFROMURL[0]); i++) { for(i = 0; i < sizeof(TEST_PATHFROMURL) / sizeof(TEST_PATHFROMURL[0]); i++) {
len = INTERNET_MAX_URL_LENGTH; len = INTERNET_MAX_URL_LENGTH;
ret = PathCreateFromUrlA(TEST_PATHFROMURL[i].url, ret_path, &len, 0); ret = PathCreateFromUrlA(TEST_PATHFROMURL[i].url, ret_path, &len, 0);
ok(ret == TEST_PATHFROMURL[i].ret, "ret %08lx from url %s\n", ret, TEST_PATHFROMURL[i].url); ok(ret == TEST_PATHFROMURL[i].ret, "ret %08x from url %s\n", ret, TEST_PATHFROMURL[i].url);
if(TEST_PATHFROMURL[i].path) { if(TEST_PATHFROMURL[i].path) {
ok(!lstrcmpi(ret_path, TEST_PATHFROMURL[i].path), "got %s expected %s from url %s\n", ret_path, TEST_PATHFROMURL[i].path, TEST_PATHFROMURL[i].url); ok(!lstrcmpi(ret_path, TEST_PATHFROMURL[i].path), "got %s expected %s from url %s\n", ret_path, TEST_PATHFROMURL[i].path, TEST_PATHFROMURL[i].url);
ok(len == strlen(ret_path), "ret len %ld from url %s\n", len, TEST_PATHFROMURL[i].url); ok(len == strlen(ret_path), "ret len %d from url %s\n", len, TEST_PATHFROMURL[i].url);
} }
len = INTERNET_MAX_URL_LENGTH; len = INTERNET_MAX_URL_LENGTH;
pathW = GetWideString(TEST_PATHFROMURL[i].path); pathW = GetWideString(TEST_PATHFROMURL[i].path);
urlW = GetWideString(TEST_PATHFROMURL[i].url); urlW = GetWideString(TEST_PATHFROMURL[i].url);
ret = PathCreateFromUrlW(urlW, ret_pathW, &len, 0); ret = PathCreateFromUrlW(urlW, ret_pathW, &len, 0);
WideCharToMultiByte(CP_ACP, 0, ret_pathW, -1, ret_path, sizeof(ret_path),0,0); WideCharToMultiByte(CP_ACP, 0, ret_pathW, -1, ret_path, sizeof(ret_path),0,0);
ok(ret == TEST_PATHFROMURL[i].ret, "ret %08lx from url L\"%s\"\n", ret, TEST_PATHFROMURL[i].url); ok(ret == TEST_PATHFROMURL[i].ret, "ret %08x from url L\"%s\"\n", ret, TEST_PATHFROMURL[i].url);
if(TEST_PATHFROMURL[i].path) { if(TEST_PATHFROMURL[i].path) {
ok(!lstrcmpiW(ret_pathW, pathW), "got %s expected %s from url L\"%s\"\n", ret_path, TEST_PATHFROMURL[i].path, TEST_PATHFROMURL[i].url); ok(!lstrcmpiW(ret_pathW, pathW), "got %s expected %s from url L\"%s\"\n", ret_path, TEST_PATHFROMURL[i].path, TEST_PATHFROMURL[i].url);
ok(len == lstrlenW(ret_pathW), "ret len %ld from url L\"%s\"\n", len, TEST_PATHFROMURL[i].url); ok(len == lstrlenW(ret_pathW), "ret len %d from url L\"%s\"\n", len, TEST_PATHFROMURL[i].url);
} }
FreeWideString(urlW); FreeWideString(urlW);
FreeWideString(pathW); FreeWideString(pathW);
@ -824,16 +824,16 @@ static void test_PathIsValidCharA(void)
unsigned int c; unsigned int c;
ret = pPathIsValidCharA( 0x7f, 0 ); ret = pPathIsValidCharA( 0x7f, 0 );
ok ( !ret, "PathIsValidCharA succeeded: 0x%08lx\n", (DWORD)ret ); ok ( !ret, "PathIsValidCharA succeeded: 0x%08x\n", (DWORD)ret );
ret = pPathIsValidCharA( 0x7f, 1 ); ret = pPathIsValidCharA( 0x7f, 1 );
ok ( !ret, "PathIsValidCharA succeeded: 0x%08lx\n", (DWORD)ret ); ok ( !ret, "PathIsValidCharA succeeded: 0x%08x\n", (DWORD)ret );
for (c = 0; c < 0x7f; c++) for (c = 0; c < 0x7f; c++)
{ {
ret = pPathIsValidCharA( c, ~0U ); ret = pPathIsValidCharA( c, ~0U );
ok ( ret == SHELL_charclass[c] || (ret == 1 && SHELL_charclass[c] == 0xffffffff), ok ( ret == SHELL_charclass[c] || (ret == 1 && SHELL_charclass[c] == 0xffffffff),
"PathIsValidCharA failed: 0x%02x got 0x%08lx expected 0x%08lx\n", "PathIsValidCharA failed: 0x%02x got 0x%08x expected 0x%08x\n",
c, (DWORD)ret, SHELL_charclass[c] ); c, (DWORD)ret, SHELL_charclass[c] );
} }
@ -841,7 +841,7 @@ static void test_PathIsValidCharA(void)
{ {
ret = pPathIsValidCharA( c, ~0U ); ret = pPathIsValidCharA( c, ~0U );
ok ( ret == 0x00000100, ok ( ret == 0x00000100,
"PathIsValidCharA failed: 0x%02x got 0x%08lx expected 0x00000100\n", "PathIsValidCharA failed: 0x%02x got 0x%08x expected 0x00000100\n",
c, (DWORD)ret ); c, (DWORD)ret );
} }
} }
@ -852,16 +852,16 @@ static void test_PathIsValidCharW(void)
unsigned int c, err_count = 0; unsigned int c, err_count = 0;
ret = pPathIsValidCharW( 0x7f, 0 ); ret = pPathIsValidCharW( 0x7f, 0 );
ok ( !ret, "PathIsValidCharW succeeded: 0x%08lx\n", (DWORD)ret ); ok ( !ret, "PathIsValidCharW succeeded: 0x%08x\n", (DWORD)ret );
ret = pPathIsValidCharW( 0x7f, 1 ); ret = pPathIsValidCharW( 0x7f, 1 );
ok ( !ret, "PathIsValidCharW succeeded: 0x%08lx\n", (DWORD)ret ); ok ( !ret, "PathIsValidCharW succeeded: 0x%08x\n", (DWORD)ret );
for (c = 0; c < 0x7f; c++) for (c = 0; c < 0x7f; c++)
{ {
ret = pPathIsValidCharW( c, ~0U ); ret = pPathIsValidCharW( c, ~0U );
ok ( ret == SHELL_charclass[c] || (ret == 1 && SHELL_charclass[c] == 0xffffffff), ok ( ret == SHELL_charclass[c] || (ret == 1 && SHELL_charclass[c] == 0xffffffff),
"PathIsValidCharW failed: 0x%02x got 0x%08lx expected 0x%08lx\n", "PathIsValidCharW failed: 0x%02x got 0x%08x expected 0x%08x\n",
c, (DWORD)ret, SHELL_charclass[c] ); c, (DWORD)ret, SHELL_charclass[c] );
} }
@ -869,7 +869,7 @@ static void test_PathIsValidCharW(void)
{ {
ret = pPathIsValidCharW( c, ~0U ); ret = pPathIsValidCharW( c, ~0U );
ok ( ret == 0x00000100, ok ( ret == 0x00000100,
"PathIsValidCharW failed: 0x%02x got 0x%08lx expected 0x00000100\n", "PathIsValidCharW failed: 0x%02x got 0x%08x expected 0x00000100\n",
c, (DWORD)ret ); c, (DWORD)ret );
if (ret != 0x00000100) if (ret != 0x00000100)
{ {
@ -968,19 +968,19 @@ static void test_PathCombineA(void)
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
str = PathCombineA(NULL, "C:\\", "one\\two\\three"); str = PathCombineA(NULL, "C:\\", "one\\two\\three");
ok(str == NULL, "Expected NULL, got %p\n", str); ok(str == NULL, "Expected NULL, got %p\n", str);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* try NULL dest and NULL directory */ /* try NULL dest and NULL directory */
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
str = PathCombineA(NULL, NULL, "one\\two\\three"); str = PathCombineA(NULL, NULL, "one\\two\\three");
ok(str == NULL, "Expected NULL, got %p\n", str); ok(str == NULL, "Expected NULL, got %p\n", str);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* try all NULL*/ /* try all NULL*/
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
str = PathCombineA(NULL, NULL, NULL); str = PathCombineA(NULL, NULL, NULL);
ok(str == NULL, "Expected NULL, got %p\n", str); ok(str == NULL, "Expected NULL, got %p\n", str);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* try NULL file part */ /* try NULL file part */
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
@ -988,7 +988,7 @@ static void test_PathCombineA(void)
str = PathCombineA(dest, "C:\\", NULL); str = PathCombineA(dest, "C:\\", NULL);
ok(str == dest, "Expected str == dest, got %p\n", str); ok(str == dest, "Expected str == dest, got %p\n", str);
ok(!lstrcmp(str, "C:\\"), "Expected C:\\, got %s\n", str); ok(!lstrcmp(str, "C:\\"), "Expected C:\\, got %s\n", str);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* try empty file part */ /* try empty file part */
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
@ -996,7 +996,7 @@ static void test_PathCombineA(void)
str = PathCombineA(dest, "C:\\", ""); str = PathCombineA(dest, "C:\\", "");
ok(str == dest, "Expected str == dest, got %p\n", str); ok(str == dest, "Expected str == dest, got %p\n", str);
ok(!lstrcmp(str, "C:\\"), "Expected C:\\, got %s\n", str); ok(!lstrcmp(str, "C:\\"), "Expected C:\\, got %s\n", str);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* try empty directory and file part */ /* try empty directory and file part */
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
@ -1004,7 +1004,7 @@ static void test_PathCombineA(void)
str = PathCombineA(dest, "", ""); str = PathCombineA(dest, "", "");
ok(str == dest, "Expected str == dest, got %p\n", str); ok(str == dest, "Expected str == dest, got %p\n", str);
ok(!lstrcmp(str, "\\"), "Expected \\, got %s\n", str); ok(!lstrcmp(str, "\\"), "Expected \\, got %s\n", str);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* try NULL directory */ /* try NULL directory */
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
@ -1012,7 +1012,7 @@ static void test_PathCombineA(void)
str = PathCombineA(dest, NULL, "one\\two\\three"); str = PathCombineA(dest, NULL, "one\\two\\three");
ok(str == dest, "Expected str == dest, got %p\n", str); ok(str == dest, "Expected str == dest, got %p\n", str);
ok(!lstrcmp(str, "one\\two\\three"), "Expected one\\two\\three, got %s\n", str); ok(!lstrcmp(str, "one\\two\\three"), "Expected one\\two\\three, got %s\n", str);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* try NULL directory and empty file part */ /* try NULL directory and empty file part */
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
@ -1020,7 +1020,7 @@ static void test_PathCombineA(void)
str = PathCombineA(dest, NULL, ""); str = PathCombineA(dest, NULL, "");
ok(str == dest, "Expected str == dest, got %p\n", str); ok(str == dest, "Expected str == dest, got %p\n", str);
ok(!lstrcmp(str, "\\"), "Expected \\, got %s\n", str); ok(!lstrcmp(str, "\\"), "Expected \\, got %s\n", str);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* try NULL directory and file part */ /* try NULL directory and file part */
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
@ -1031,7 +1031,7 @@ static void test_PathCombineA(void)
{ {
ok(lstrlenA(dest) == 0, "Expected 0 length, got %i\n", lstrlenA(dest)); ok(lstrlenA(dest) == 0, "Expected 0 length, got %i\n", lstrlenA(dest));
} }
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* try directory without backslash */ /* try directory without backslash */
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
@ -1039,7 +1039,7 @@ static void test_PathCombineA(void)
str = PathCombineA(dest, "C:", "one\\two\\three"); str = PathCombineA(dest, "C:", "one\\two\\three");
ok(str == dest, "Expected str == dest, got %p\n", str); ok(str == dest, "Expected str == dest, got %p\n", str);
ok(!lstrcmp(str, "C:\\one\\two\\three"), "Expected C:\\one\\two\\three, got %s\n", str); ok(!lstrcmp(str, "C:\\one\\two\\three"), "Expected C:\\one\\two\\three, got %s\n", str);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* try directory with backslash */ /* try directory with backslash */
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
@ -1047,7 +1047,7 @@ static void test_PathCombineA(void)
str = PathCombineA(dest, "C:\\", "one\\two\\three"); str = PathCombineA(dest, "C:\\", "one\\two\\three");
ok(str == dest, "Expected str == dest, got %p\n", str); ok(str == dest, "Expected str == dest, got %p\n", str);
ok(!lstrcmp(str, "C:\\one\\two\\three"), "Expected C:\\one\\two\\three, got %s\n", str); ok(!lstrcmp(str, "C:\\one\\two\\three"), "Expected C:\\one\\two\\three, got %s\n", str);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* try directory with backslash and file with prepended backslash */ /* try directory with backslash and file with prepended backslash */
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
@ -1055,7 +1055,7 @@ static void test_PathCombineA(void)
str = PathCombineA(dest, "C:\\", "\\one\\two\\three"); str = PathCombineA(dest, "C:\\", "\\one\\two\\three");
ok(str == dest, "Expected str == dest, got %p\n", str); ok(str == dest, "Expected str == dest, got %p\n", str);
ok(!lstrcmp(str, "C:\\one\\two\\three"), "Expected C:\\one\\two\\three, got %s\n", str); ok(!lstrcmp(str, "C:\\one\\two\\three"), "Expected C:\\one\\two\\three, got %s\n", str);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* try previous test, with backslash appended as well */ /* try previous test, with backslash appended as well */
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
@ -1063,7 +1063,7 @@ static void test_PathCombineA(void)
str = PathCombineA(dest, "C:\\", "\\one\\two\\three\\"); str = PathCombineA(dest, "C:\\", "\\one\\two\\three\\");
ok(str == dest, "Expected str == dest, got %p\n", str); ok(str == dest, "Expected str == dest, got %p\n", str);
ok(!lstrcmp(str, "C:\\one\\two\\three\\"), "Expected C:\\one\\two\\three\\, got %s\n", str); ok(!lstrcmp(str, "C:\\one\\two\\three\\"), "Expected C:\\one\\two\\three\\, got %s\n", str);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* try a relative directory */ /* try a relative directory */
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
@ -1071,7 +1071,7 @@ static void test_PathCombineA(void)
str = PathCombineA(dest, "relative\\dir", "\\one\\two\\three\\"); str = PathCombineA(dest, "relative\\dir", "\\one\\two\\three\\");
ok(str == dest, "Expected str == dest, got %p\n", str); ok(str == dest, "Expected str == dest, got %p\n", str);
ok(!lstrcmp(str, "one\\two\\three\\"), "Expected one\\two\\three\\, got %s\n", str); ok(!lstrcmp(str, "one\\two\\three\\"), "Expected one\\two\\three\\, got %s\n", str);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* try forward slashes */ /* try forward slashes */
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
@ -1079,7 +1079,7 @@ static void test_PathCombineA(void)
str = PathCombineA(dest, "C:\\", "one/two/three\\"); str = PathCombineA(dest, "C:\\", "one/two/three\\");
ok(str == dest, "Expected str == dest, got %p\n", str); ok(str == dest, "Expected str == dest, got %p\n", str);
ok(!lstrcmp(str, "C:\\one/two/three\\"), "Expected one/two/three\\, got %s\n", str); ok(!lstrcmp(str, "C:\\one/two/three\\"), "Expected one/two/three\\, got %s\n", str);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* try a really weird directory */ /* try a really weird directory */
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
@ -1087,7 +1087,7 @@ static void test_PathCombineA(void)
str = PathCombineA(dest, "C:\\/\\/", "\\one\\two\\three\\"); str = PathCombineA(dest, "C:\\/\\/", "\\one\\two\\three\\");
ok(str == dest, "Expected str == dest, got %p\n", str); ok(str == dest, "Expected str == dest, got %p\n", str);
ok(!lstrcmp(str, "C:\\one\\two\\three\\"), "Expected C:\\one\\two\\three\\, got %s\n", str); ok(!lstrcmp(str, "C:\\one\\two\\three\\"), "Expected C:\\one\\two\\three\\, got %s\n", str);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* try periods */ /* try periods */
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
@ -1095,7 +1095,7 @@ static void test_PathCombineA(void)
str = PathCombineA(dest, "C:\\", "one\\..\\two\\.\\three"); str = PathCombineA(dest, "C:\\", "one\\..\\two\\.\\three");
ok(str == dest, "Expected str == dest, got %p\n", str); ok(str == dest, "Expected str == dest, got %p\n", str);
ok(!lstrcmp(str, "C:\\two\\three"), "Expected C:\\two\\three, got %s\n", str); ok(!lstrcmp(str, "C:\\two\\three"), "Expected C:\\two\\three, got %s\n", str);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* try .. as file */ /* try .. as file */
/* try forward slashes */ /* try forward slashes */
@ -1104,7 +1104,7 @@ static void test_PathCombineA(void)
str = PathCombineA(dest, "C:\\", ".."); str = PathCombineA(dest, "C:\\", "..");
ok(str == dest, "Expected str == dest, got %p\n", str); ok(str == dest, "Expected str == dest, got %p\n", str);
ok(!lstrcmp(str, "C:\\"), "Expected C:\\, got %s\n", str); ok(!lstrcmp(str, "C:\\"), "Expected C:\\, got %s\n", str);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
memset(too_long, 'a', LONG_LEN); memset(too_long, 'a', LONG_LEN);
too_long[LONG_LEN - 1] = '\0'; too_long[LONG_LEN - 1] = '\0';
@ -1117,7 +1117,7 @@ static void test_PathCombineA(void)
{ {
ok(str == NULL, "Expected str == NULL, got %p\n", str); ok(str == NULL, "Expected str == NULL, got %p\n", str);
ok(lstrlenA(dest) == 0, "Expected 0 length, got %i\n", lstrlenA(dest)); ok(lstrlenA(dest) == 0, "Expected 0 length, got %i\n", lstrlenA(dest));
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
} }
/* try a directory longer than MAX_PATH */ /* try a directory longer than MAX_PATH */
@ -1128,7 +1128,7 @@ static void test_PathCombineA(void)
{ {
ok(str == NULL, "Expected str == NULL, got %p\n", str); ok(str == NULL, "Expected str == NULL, got %p\n", str);
ok(lstrlenA(dest) == 0, "Expected 0 length, got %i\n", lstrlenA(dest)); ok(lstrlenA(dest) == 0, "Expected 0 length, got %i\n", lstrlenA(dest));
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
} }
memset(one, 'b', HALF_LEN); memset(one, 'b', HALF_LEN);
@ -1145,7 +1145,7 @@ static void test_PathCombineA(void)
ok(str == NULL, "Expected str == NULL, got %p\n", str); ok(str == NULL, "Expected str == NULL, got %p\n", str);
ok(lstrlenA(dest) == 0, "Expected 0 length, got %i\n", lstrlenA(dest)); ok(lstrlenA(dest) == 0, "Expected 0 length, got %i\n", lstrlenA(dest));
} }
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
} }
static void test_PathAddBackslash(void) static void test_PathAddBackslash(void)
@ -1158,7 +1158,7 @@ static void test_PathAddBackslash(void)
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
str = PathAddBackslashA(NULL); str = PathAddBackslashA(NULL);
ok(str == NULL, "Expected str == NULL, got %p\n", str); ok(str == NULL, "Expected str == NULL, got %p\n", str);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* try an empty path */ /* try an empty path */
path[0] = '\0'; path[0] = '\0';
@ -1166,7 +1166,7 @@ static void test_PathAddBackslash(void)
str = PathAddBackslashA(path); str = PathAddBackslashA(path);
ok(str == (path + lstrlenA(path)), "Expected str to point to end of path, got %p\n", str); ok(str == (path + lstrlenA(path)), "Expected str to point to end of path, got %p\n", str);
ok(lstrlenA(path) == 0, "Expected empty string, got %i\n", lstrlenA(path)); ok(lstrlenA(path) == 0, "Expected empty string, got %i\n", lstrlenA(path));
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* try a relative path */ /* try a relative path */
lstrcpyA(path, "one\\two"); lstrcpyA(path, "one\\two");
@ -1174,7 +1174,7 @@ static void test_PathAddBackslash(void)
str = PathAddBackslashA(path); str = PathAddBackslashA(path);
ok(str == (path + lstrlenA(path)), "Expected str to point to end of path, got %p\n", str); ok(str == (path + lstrlenA(path)), "Expected str to point to end of path, got %p\n", str);
ok(!lstrcmp(path, "one\\two\\"), "Expected one\\two\\, got %s\n", path); ok(!lstrcmp(path, "one\\two\\"), "Expected one\\two\\, got %s\n", path);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* try periods */ /* try periods */
lstrcpyA(path, "one\\..\\two"); lstrcpyA(path, "one\\..\\two");
@ -1182,7 +1182,7 @@ static void test_PathAddBackslash(void)
str = PathAddBackslashA(path); str = PathAddBackslashA(path);
ok(str == (path + lstrlenA(path)), "Expected str to point to end of path, got %p\n", str); ok(str == (path + lstrlenA(path)), "Expected str to point to end of path, got %p\n", str);
ok(!lstrcmp(path, "one\\..\\two\\"), "Expected one\\..\\two\\, got %s\n", path); ok(!lstrcmp(path, "one\\..\\two\\"), "Expected one\\..\\two\\, got %s\n", path);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* try just a space */ /* try just a space */
lstrcpyA(path, " "); lstrcpyA(path, " ");
@ -1190,7 +1190,7 @@ static void test_PathAddBackslash(void)
str = PathAddBackslashA(path); str = PathAddBackslashA(path);
ok(str == (path + lstrlenA(path)), "Expected str to point to end of path, got %p\n", str); ok(str == (path + lstrlenA(path)), "Expected str to point to end of path, got %p\n", str);
ok(!lstrcmp(path, " \\"), "Expected \\, got %s\n", path); ok(!lstrcmp(path, " \\"), "Expected \\, got %s\n", path);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* path already has backslash */ /* path already has backslash */
lstrcpyA(path, "C:\\one\\"); lstrcpyA(path, "C:\\one\\");
@ -1198,7 +1198,7 @@ static void test_PathAddBackslash(void)
str = PathAddBackslashA(path); str = PathAddBackslashA(path);
ok(str == (path + lstrlenA(path)), "Expected str to point to end of path, got %p\n", str); ok(str == (path + lstrlenA(path)), "Expected str to point to end of path, got %p\n", str);
ok(!lstrcmp(path, "C:\\one\\"), "Expected C:\\one\\, got %s\n", path); ok(!lstrcmp(path, "C:\\one\\"), "Expected C:\\one\\, got %s\n", path);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
memset(too_long, 'a', LONG_LEN); memset(too_long, 'a', LONG_LEN);
too_long[LONG_LEN - 1] = '\0'; too_long[LONG_LEN - 1] = '\0';
@ -1207,7 +1207,7 @@ static void test_PathAddBackslash(void)
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
str = PathAddBackslashA(too_long); str = PathAddBackslashA(too_long);
ok(str == NULL, "Expected str == NULL, got %p\n", str); ok(str == NULL, "Expected str == NULL, got %p\n", str);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
} }
static void test_PathAppendA(void) static void test_PathAppendA(void)
@ -1223,28 +1223,28 @@ static void test_PathAppendA(void)
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
res = PathAppendA(path, NULL); res = PathAppendA(path, NULL);
ok(!res, "Expected failure\n"); ok(!res, "Expected failure\n");
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
ok(!lstrcmp(path, "C:\\one"), "Expected C:\\one, got %s\n", path); ok(!lstrcmp(path, "C:\\one"), "Expected C:\\one, got %s\n", path);
/* try empty pszMore */ /* try empty pszMore */
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
res = PathAppendA(path, ""); res = PathAppendA(path, "");
ok(res, "Expected success\n"); ok(res, "Expected success\n");
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
ok(!lstrcmp(path, "C:\\one"), "Expected C:\\one, got %s\n", path); ok(!lstrcmp(path, "C:\\one"), "Expected C:\\one, got %s\n", path);
/* try NULL pszPath */ /* try NULL pszPath */
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
res = PathAppendA(NULL, "two\\three"); res = PathAppendA(NULL, "two\\three");
ok(!res, "Expected failure\n"); ok(!res, "Expected failure\n");
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* try empty pszPath */ /* try empty pszPath */
path[0] = '\0'; path[0] = '\0';
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
res = PathAppendA(path, "two\\three"); res = PathAppendA(path, "two\\three");
ok(res, "Expected success\n"); ok(res, "Expected success\n");
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
ok(!lstrcmp(path, "two\\three"), "Expected \\two\\three, got %s\n", path); ok(!lstrcmp(path, "two\\three"), "Expected \\two\\three, got %s\n", path);
/* try empty pszPath and empty pszMore */ /* try empty pszPath and empty pszMore */
@ -1252,7 +1252,7 @@ static void test_PathAppendA(void)
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
res = PathAppendA(path, ""); res = PathAppendA(path, "");
ok(res, "Expected success\n"); ok(res, "Expected success\n");
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
ok(!lstrcmp(path, "\\"), "Expected \\, got %s\n", path); ok(!lstrcmp(path, "\\"), "Expected \\, got %s\n", path);
/* try legit params */ /* try legit params */
@ -1260,7 +1260,7 @@ static void test_PathAppendA(void)
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
res = PathAppendA(path, "two\\three"); res = PathAppendA(path, "two\\three");
ok(res, "Expected success\n"); ok(res, "Expected success\n");
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
ok(!lstrcmp(path, "C:\\one\\two\\three"), "Expected C:\\one\\two\\three, got %s\n", path); ok(!lstrcmp(path, "C:\\one\\two\\three"), "Expected C:\\one\\two\\three, got %s\n", path);
/* try pszPath with backslash after it */ /* try pszPath with backslash after it */
@ -1268,7 +1268,7 @@ static void test_PathAppendA(void)
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
res = PathAppendA(path, "two\\three"); res = PathAppendA(path, "two\\three");
ok(res, "Expected success\n"); ok(res, "Expected success\n");
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
ok(!lstrcmp(path, "C:\\one\\two\\three"), "Expected C:\\one\\two\\three, got %s\n", path); ok(!lstrcmp(path, "C:\\one\\two\\three"), "Expected C:\\one\\two\\three, got %s\n", path);
/* try pszMore with backslash before it */ /* try pszMore with backslash before it */
@ -1276,7 +1276,7 @@ static void test_PathAppendA(void)
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
res = PathAppendA(path, "\\two\\three"); res = PathAppendA(path, "\\two\\three");
ok(res, "Expected success\n"); ok(res, "Expected success\n");
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
ok(!lstrcmp(path, "C:\\one\\two\\three"), "Expected C:\\one\\two\\three, got %s\n", path); ok(!lstrcmp(path, "C:\\one\\two\\three"), "Expected C:\\one\\two\\three, got %s\n", path);
/* try pszMore with backslash after it */ /* try pszMore with backslash after it */
@ -1284,7 +1284,7 @@ static void test_PathAppendA(void)
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
res = PathAppendA(path, "two\\three\\"); res = PathAppendA(path, "two\\three\\");
ok(res, "Expected success\n"); ok(res, "Expected success\n");
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
ok(!lstrcmp(path, "C:\\one\\two\\three\\"), "Expected C:\\one\\two\\three\\, got %s\n", path); ok(!lstrcmp(path, "C:\\one\\two\\three\\"), "Expected C:\\one\\two\\three\\, got %s\n", path);
/* try spaces in pszPath */ /* try spaces in pszPath */
@ -1292,7 +1292,7 @@ static void test_PathAppendA(void)
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
res = PathAppendA(path, "two\\three"); res = PathAppendA(path, "two\\three");
ok(res, "Expected success\n"); ok(res, "Expected success\n");
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
ok(!lstrcmp(path, "C: \\ one \\two\\three"), "Expected C: \\ one \\two\\three, got %s\n", path); ok(!lstrcmp(path, "C: \\ one \\two\\three"), "Expected C: \\ one \\two\\three, got %s\n", path);
/* try spaces in pszMore */ /* try spaces in pszMore */
@ -1300,7 +1300,7 @@ static void test_PathAppendA(void)
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
res = PathAppendA(path, " two \\ three "); res = PathAppendA(path, " two \\ three ");
ok(res, "Expected success\n"); ok(res, "Expected success\n");
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
ok(!lstrcmp(path, "C:\\one\\ two \\ three "), "Expected 'C:\\one\\ two \\ three ', got %s\n", path); ok(!lstrcmp(path, "C:\\one\\ two \\ three "), "Expected 'C:\\one\\ two \\ three ', got %s\n", path);
/* pszPath is too long */ /* pszPath is too long */
@ -1311,7 +1311,7 @@ static void test_PathAppendA(void)
todo_wine todo_wine
{ {
ok(!res, "Expected failure\n"); ok(!res, "Expected failure\n");
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
ok(lstrlen(too_long) == 0, "Expected length of too_long to be zero, got %i\n", lstrlen(too_long)); ok(lstrlen(too_long) == 0, "Expected length of too_long to be zero, got %i\n", lstrlen(too_long));
} }
@ -1324,7 +1324,7 @@ static void test_PathAppendA(void)
todo_wine todo_wine
{ {
ok(!res, "Expected failure\n"); ok(!res, "Expected failure\n");
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
ok(lstrlen(path) == 0, "Expected length of path to be zero, got %i\n", lstrlen(path)); ok(lstrlen(path) == 0, "Expected length of path to be zero, got %i\n", lstrlen(path));
} }
@ -1340,7 +1340,7 @@ static void test_PathAppendA(void)
ok(!res, "Expected failure\n"); ok(!res, "Expected failure\n");
ok(lstrlen(one) == 0, "Expected length of one to be zero, got %i\n", lstrlen(one)); ok(lstrlen(one) == 0, "Expected length of one to be zero, got %i\n", lstrlen(one));
} }
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
} }
static void test_PathCanonicalizeA(void) static void test_PathCanonicalizeA(void)
@ -1355,7 +1355,7 @@ static void test_PathCanonicalizeA(void)
res = PathCanonicalizeA(dest, NULL); res = PathCanonicalizeA(dest, NULL);
ok(!res, "Expected failure\n"); ok(!res, "Expected failure\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER, ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError()); "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
todo_wine todo_wine
{ {
ok(!lstrcmp(dest, "test"), "Expected test, got %s\n", dest); ok(!lstrcmp(dest, "test"), "Expected test, got %s\n", dest);
@ -1366,7 +1366,7 @@ static void test_PathCanonicalizeA(void)
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
res = PathCanonicalizeA(dest, ""); res = PathCanonicalizeA(dest, "");
ok(res, "Expected success\n"); ok(res, "Expected success\n");
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
ok(!lstrcmp(dest, "\\"), "Expected \\, got %s\n", dest); ok(!lstrcmp(dest, "\\"), "Expected \\, got %s\n", dest);
/* try a NULL dest */ /* try a NULL dest */
@ -1374,14 +1374,14 @@ static void test_PathCanonicalizeA(void)
res = PathCanonicalizeA(NULL, "C:\\"); res = PathCanonicalizeA(NULL, "C:\\");
ok(!res, "Expected failure\n"); ok(!res, "Expected failure\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER, ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError()); "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
/* try empty dest */ /* try empty dest */
dest[0] = '\0'; dest[0] = '\0';
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
res = PathCanonicalizeA(dest, "C:\\"); res = PathCanonicalizeA(dest, "C:\\");
ok(res, "Expected success\n"); ok(res, "Expected success\n");
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
ok(!lstrcmp(dest, "C:\\"), "Expected C:\\, got %s\n", dest); ok(!lstrcmp(dest, "C:\\"), "Expected C:\\, got %s\n", dest);
/* try non-empty dest */ /* try non-empty dest */
@ -1389,7 +1389,7 @@ static void test_PathCanonicalizeA(void)
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
res = PathCanonicalizeA(dest, "C:\\"); res = PathCanonicalizeA(dest, "C:\\");
ok(res, "Expected success\n"); ok(res, "Expected success\n");
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
ok(!lstrcmp(dest, "C:\\"), "Expected C:\\, got %s\n", dest); ok(!lstrcmp(dest, "C:\\"), "Expected C:\\, got %s\n", dest);
/* try a space for source */ /* try a space for source */
@ -1397,7 +1397,7 @@ static void test_PathCanonicalizeA(void)
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
res = PathCanonicalizeA(dest, " "); res = PathCanonicalizeA(dest, " ");
ok(res, "Expected success\n"); ok(res, "Expected success\n");
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
ok(!lstrcmp(dest, " "), "Expected ' ', got %s\n", dest); ok(!lstrcmp(dest, " "), "Expected ' ', got %s\n", dest);
/* try a relative path */ /* try a relative path */
@ -1405,7 +1405,7 @@ static void test_PathCanonicalizeA(void)
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
res = PathCanonicalizeA(dest, "one\\two"); res = PathCanonicalizeA(dest, "one\\two");
ok(res, "Expected success\n"); ok(res, "Expected success\n");
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
ok(!lstrcmp(dest, "one\\two"), "Expected one\\two, got %s\n", dest); ok(!lstrcmp(dest, "one\\two"), "Expected one\\two, got %s\n", dest);
/* try current dir and previous dir */ /* try current dir and previous dir */
@ -1413,7 +1413,7 @@ static void test_PathCanonicalizeA(void)
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
res = PathCanonicalizeA(dest, "C:\\one\\.\\..\\two\\three\\.."); res = PathCanonicalizeA(dest, "C:\\one\\.\\..\\two\\three\\..");
ok(res, "Expected success\n"); ok(res, "Expected success\n");
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
ok(!lstrcmp(dest, "C:\\two"), "Expected C:\\two, got %s\n", dest); ok(!lstrcmp(dest, "C:\\two"), "Expected C:\\two, got %s\n", dest);
/* try simple forward slashes */ /* try simple forward slashes */
@ -1421,7 +1421,7 @@ static void test_PathCanonicalizeA(void)
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
res = PathCanonicalizeA(dest, "C:\\one/two/three\\four/five\\six"); res = PathCanonicalizeA(dest, "C:\\one/two/three\\four/five\\six");
ok(res, "Expected success\n"); ok(res, "Expected success\n");
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
ok(!lstrcmp(dest, "C:\\one/two/three\\four/five\\six"), ok(!lstrcmp(dest, "C:\\one/two/three\\four/five\\six"),
"Expected C:\\one/two/three\\four/five\\six, got %s\n", dest); "Expected C:\\one/two/three\\four/five\\six, got %s\n", dest);
@ -1430,7 +1430,7 @@ static void test_PathCanonicalizeA(void)
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
res = PathCanonicalizeA(dest, "C:\\one/.\\two"); res = PathCanonicalizeA(dest, "C:\\one/.\\two");
ok(res, "Expected success\n"); ok(res, "Expected success\n");
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
ok(!lstrcmp(dest, "C:\\one/.\\two"), "Expected C:\\one/.\\two, got %s\n", dest); ok(!lstrcmp(dest, "C:\\one/.\\two"), "Expected C:\\one/.\\two, got %s\n", dest);
/* try simple forward slashes with change dir */ /* try simple forward slashes with change dir */
@ -1438,7 +1438,7 @@ static void test_PathCanonicalizeA(void)
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
res = PathCanonicalizeA(dest, "C:\\one/.\\two\\.."); res = PathCanonicalizeA(dest, "C:\\one/.\\two\\..");
ok(res, "Expected success\n"); ok(res, "Expected success\n");
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
ok(!lstrcmp(dest, "C:\\one/."), "Expected C:\\one/., got %s\n", dest); ok(!lstrcmp(dest, "C:\\one/."), "Expected C:\\one/., got %s\n", dest);
/* try forward slashes with change dirs /* try forward slashes with change dirs
@ -1449,7 +1449,7 @@ static void test_PathCanonicalizeA(void)
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
res = PathCanonicalizeA(dest, "C:\\one/.\\..\\two/three\\..\\four/.five"); res = PathCanonicalizeA(dest, "C:\\one/.\\..\\two/three\\..\\four/.five");
ok(res, "Expected success\n"); ok(res, "Expected success\n");
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
ok(!lstrcmp(dest, "C:\\four/.five"), "Expected C:\\four/.five, got %s\n", dest); ok(!lstrcmp(dest, "C:\\four/.five"), "Expected C:\\four/.five, got %s\n", dest);
/* try src is too long */ /* try src is too long */
@ -1461,7 +1461,7 @@ static void test_PathCanonicalizeA(void)
todo_wine todo_wine
{ {
ok(!res, "Expected failure\n"); ok(!res, "Expected failure\n");
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
} }
ok(lstrlen(too_long) == LONG_LEN - 1, "Expected length LONG_LEN - 1, got %i\n", lstrlen(too_long)); ok(lstrlen(too_long) == LONG_LEN - 1, "Expected length LONG_LEN - 1, got %i\n", lstrlen(too_long));
} }
@ -1476,7 +1476,7 @@ static void test_PathFindExtensionA(void)
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ext = PathFindExtensionA(NULL); ext = PathFindExtensionA(NULL);
ok(ext == NULL, "Expected NULL, got %p\n", ext); ok(ext == NULL, "Expected NULL, got %p\n", ext);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* try an empty path */ /* try an empty path */
path[0] = '\0'; path[0] = '\0';
@ -1484,7 +1484,7 @@ static void test_PathFindExtensionA(void)
ext = PathFindExtensionA(path); ext = PathFindExtensionA(path);
ok(ext == path, "Expected ext == path, got %p\n", ext); ok(ext == path, "Expected ext == path, got %p\n", ext);
ok(lstrlen(ext) == 0, "Expected length 0, got %i\n", lstrlen(ext)); ok(lstrlen(ext) == 0, "Expected length 0, got %i\n", lstrlen(ext));
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* try a path without an extension */ /* try a path without an extension */
lstrcpy(path, "file"); lstrcpy(path, "file");
@ -1492,7 +1492,7 @@ static void test_PathFindExtensionA(void)
ext = PathFindExtensionA(path); ext = PathFindExtensionA(path);
ok(ext == path + lstrlen(path), "Expected ext == path, got %p\n", ext); ok(ext == path + lstrlen(path), "Expected ext == path, got %p\n", ext);
ok(lstrlen(ext) == 0, "Expected length 0, got %i\n", lstrlen(ext)); ok(lstrlen(ext) == 0, "Expected length 0, got %i\n", lstrlen(ext));
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* try a path with an extension */ /* try a path with an extension */
lstrcpy(path, "file.txt"); lstrcpy(path, "file.txt");
@ -1501,7 +1501,7 @@ static void test_PathFindExtensionA(void)
ok(ext == path + lstrlen("file"), ok(ext == path + lstrlen("file"),
"Expected ext == path + lstrlen(\"file\"), got %p\n", ext); "Expected ext == path + lstrlen(\"file\"), got %p\n", ext);
ok(!lstrcmp(ext, ".txt"), "Expected .txt, got %s\n", ext); ok(!lstrcmp(ext, ".txt"), "Expected .txt, got %s\n", ext);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* try a path with two extensions */ /* try a path with two extensions */
lstrcpy(path, "file.txt.doc"); lstrcpy(path, "file.txt.doc");
@ -1510,7 +1510,7 @@ static void test_PathFindExtensionA(void)
ok(ext == path + lstrlen("file.txt"), ok(ext == path + lstrlen("file.txt"),
"Expected ext == path + lstrlen(\"file.txt\"), got %p\n", ext); "Expected ext == path + lstrlen(\"file.txt\"), got %p\n", ext);
ok(!lstrcmp(ext, ".doc"), "Expected .txt, got %s\n", ext); ok(!lstrcmp(ext, ".doc"), "Expected .txt, got %s\n", ext);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* try a path longer than MAX_PATH without an extension*/ /* try a path longer than MAX_PATH without an extension*/
memset(too_long, 'a', LONG_LEN); memset(too_long, 'a', LONG_LEN);
@ -1518,7 +1518,7 @@ static void test_PathFindExtensionA(void)
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ext = PathFindExtensionA(too_long); ext = PathFindExtensionA(too_long);
ok(ext == too_long + LONG_LEN - 1, "Expected ext == too_long + LONG_LEN - 1, got %p\n", ext); ok(ext == too_long + LONG_LEN - 1, "Expected ext == too_long + LONG_LEN - 1, got %p\n", ext);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* try a path longer than MAX_PATH with an extension*/ /* try a path longer than MAX_PATH with an extension*/
memset(too_long, 'a', LONG_LEN); memset(too_long, 'a', LONG_LEN);
@ -1529,7 +1529,7 @@ static void test_PathFindExtensionA(void)
ext = PathFindExtensionA(too_long); ext = PathFindExtensionA(too_long);
ok(ext == too_long + 300, "Expected ext == too_long + 300, got %p\n", ext); ok(ext == too_long + 300, "Expected ext == too_long + 300, got %p\n", ext);
ok(lstrlen(ext) == LONG_LEN - 301, "Expected LONG_LEN - 301, got %i\n", lstrlen(ext)); ok(lstrlen(ext) == LONG_LEN - 301, "Expected LONG_LEN - 301, got %i\n", lstrlen(ext));
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
} }
static void test_PathBuildRootA(void) static void test_PathBuildRootA(void)
@ -1552,7 +1552,7 @@ static void test_PathBuildRootA(void)
root = PathBuildRootA(path, j); root = PathBuildRootA(path, j);
ok(root == path, "Expected root == path, got %p\n", root); ok(root == path, "Expected root == path, got %p\n", root);
ok(!lstrcmp(root, root_expected[j]), "Expected %s, got %s\n", root_expected[j], root); ok(!lstrcmp(root, root_expected[j]), "Expected %s, got %s\n", root_expected[j], root);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
} }
/* test a negative drive number */ /* test a negative drive number */
@ -1561,7 +1561,7 @@ static void test_PathBuildRootA(void)
root = PathBuildRootA(path, -1); root = PathBuildRootA(path, -1);
ok(root == path, "Expected root == path, got %p\n", root); ok(root == path, "Expected root == path, got %p\n", root);
ok(!lstrcmp(path, "aaaaaaaaa"), "Expected aaaaaaaaa, got %s\n", path); ok(!lstrcmp(path, "aaaaaaaaa"), "Expected aaaaaaaaa, got %s\n", path);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* test a drive number greater than 25 */ /* test a drive number greater than 25 */
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
@ -1569,7 +1569,7 @@ static void test_PathBuildRootA(void)
root = PathBuildRootA(path, 26); root = PathBuildRootA(path, 26);
ok(root == path, "Expected root == path, got %p\n", root); ok(root == path, "Expected root == path, got %p\n", root);
ok(!lstrcmp(path, "aaaaaaaaa"), "Expected aaaaaaaaa, got %s\n", path); ok(!lstrcmp(path, "aaaaaaaaa"), "Expected aaaaaaaaa, got %s\n", path);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* length of path is less than 4 */ /* length of path is less than 4 */
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
@ -1577,13 +1577,13 @@ static void test_PathBuildRootA(void)
root = PathBuildRootA(path, 0); root = PathBuildRootA(path, 0);
ok(root == path, "Expected root == path, got %p\n", root); ok(root == path, "Expected root == path, got %p\n", root);
ok(!lstrcmp(path, "A:\\"), "Expected A:\\, got %s\n", path); ok(!lstrcmp(path, "A:\\"), "Expected A:\\, got %s\n", path);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* path is NULL */ /* path is NULL */
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
root = PathBuildRootA(NULL, 0); root = PathBuildRootA(NULL, 0);
ok(root == NULL, "Expected root == NULL, got %p\n", root); ok(root == NULL, "Expected root == NULL, got %p\n", root);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
} }
static void test_PathCommonPrefixA(void) static void test_PathCommonPrefixA(void)
@ -1603,7 +1603,7 @@ static void test_PathCommonPrefixA(void)
ok(!lstrcmp(out, "aaa"), "Expected aaa, got %s\n", out); ok(!lstrcmp(out, "aaa"), "Expected aaa, got %s\n", out);
} }
ok(!lstrcmp(path2, "C:\\"), "Expected C:\\, got %s\n", path2); ok(!lstrcmp(path2, "C:\\"), "Expected C:\\, got %s\n", path2);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* test NULL path2 */ /* test NULL path2 */
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
@ -1616,7 +1616,7 @@ static void test_PathCommonPrefixA(void)
ok(!lstrcmp(out, "aaa"), "Expected aaa, got %s\n", out); ok(!lstrcmp(out, "aaa"), "Expected aaa, got %s\n", out);
} }
ok(!lstrcmp(path1, "C:\\"), "Expected C:\\, got %s\n", path1); ok(!lstrcmp(path1, "C:\\"), "Expected C:\\, got %s\n", path1);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* test empty path1 */ /* test empty path1 */
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
@ -1628,7 +1628,7 @@ static void test_PathCommonPrefixA(void)
ok(lstrlen(out) == 0, "Expected 0 length out, got %i\n", lstrlen(out)); ok(lstrlen(out) == 0, "Expected 0 length out, got %i\n", lstrlen(out));
ok(lstrlen(path1) == 0, "Expected 0 length path1, got %i\n", lstrlen(path1)); ok(lstrlen(path1) == 0, "Expected 0 length path1, got %i\n", lstrlen(path1));
ok(!lstrcmp(path2, "C:\\"), "Expected C:\\, got %s\n", path2); ok(!lstrcmp(path2, "C:\\"), "Expected C:\\, got %s\n", path2);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* test empty path1 */ /* test empty path1 */
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
@ -1640,7 +1640,7 @@ static void test_PathCommonPrefixA(void)
ok(lstrlen(out) == 0, "Expected 0 length out, got %i\n", lstrlen(out)); ok(lstrlen(out) == 0, "Expected 0 length out, got %i\n", lstrlen(out));
ok(lstrlen(path2) == 0, "Expected 0 length path2, got %i\n", lstrlen(path2)); ok(lstrlen(path2) == 0, "Expected 0 length path2, got %i\n", lstrlen(path2));
ok(!lstrcmp(path1, "C:\\"), "Expected C:\\, got %s\n", path1); ok(!lstrcmp(path1, "C:\\"), "Expected C:\\, got %s\n", path1);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* paths are legit, out is NULL */ /* paths are legit, out is NULL */
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
@ -1650,7 +1650,7 @@ static void test_PathCommonPrefixA(void)
ok(count == 3, "Expected 3, got %i\n", count); ok(count == 3, "Expected 3, got %i\n", count);
ok(!lstrcmp(path1, "C:\\"), "Expected C:\\, got %s\n", path1); ok(!lstrcmp(path1, "C:\\"), "Expected C:\\, got %s\n", path1);
ok(!lstrcmp(path2, "C:\\"), "Expected C:\\, got %s\n", path2); ok(!lstrcmp(path2, "C:\\"), "Expected C:\\, got %s\n", path2);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* all parameters legit */ /* all parameters legit */
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
@ -1662,7 +1662,7 @@ static void test_PathCommonPrefixA(void)
ok(!lstrcmp(path1, "C:\\"), "Expected C:\\, got %s\n", path1); ok(!lstrcmp(path1, "C:\\"), "Expected C:\\, got %s\n", path1);
ok(!lstrcmp(path2, "C:\\"), "Expected C:\\, got %s\n", path2); ok(!lstrcmp(path2, "C:\\"), "Expected C:\\, got %s\n", path2);
ok(!lstrcmp(out, "C:\\"), "Expected C:\\, got %s\n", out); ok(!lstrcmp(out, "C:\\"), "Expected C:\\, got %s\n", out);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* path1 and path2 not the same, but common prefix */ /* path1 and path2 not the same, but common prefix */
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
@ -1674,7 +1674,7 @@ static void test_PathCommonPrefixA(void)
ok(!lstrcmp(path1, "C:\\one\\two"), "Expected C:\\one\\two, got %s\n", path1); ok(!lstrcmp(path1, "C:\\one\\two"), "Expected C:\\one\\two, got %s\n", path1);
ok(!lstrcmp(path2, "C:\\one\\three"), "Expected C:\\one\\three, got %s\n", path2); ok(!lstrcmp(path2, "C:\\one\\three"), "Expected C:\\one\\three, got %s\n", path2);
ok(!lstrcmp(out, "C:\\one"), "Expected C:\\one, got %s\n", out); ok(!lstrcmp(out, "C:\\one"), "Expected C:\\one, got %s\n", out);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* try . prefix */ /* try . prefix */
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
@ -1686,7 +1686,7 @@ static void test_PathCommonPrefixA(void)
ok(!lstrcmp(path1, "one\\.two"), "Expected one\\.two, got %s\n", path1); ok(!lstrcmp(path1, "one\\.two"), "Expected one\\.two, got %s\n", path1);
ok(!lstrcmp(path2, "one\\.three"), "Expected one\\.three, got %s\n", path2); ok(!lstrcmp(path2, "one\\.three"), "Expected one\\.three, got %s\n", path2);
ok(!lstrcmp(out, "one"), "Expected one, got %s\n", out); ok(!lstrcmp(out, "one"), "Expected one, got %s\n", out);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* try .. prefix */ /* try .. prefix */
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
@ -1698,7 +1698,7 @@ static void test_PathCommonPrefixA(void)
ok(!lstrcmp(path1, "one\\..two"), "Expected one\\..two, got %s\n", path1); ok(!lstrcmp(path1, "one\\..two"), "Expected one\\..two, got %s\n", path1);
ok(!lstrcmp(path2, "one\\..three"), "Expected one\\..three, got %s\n", path2); ok(!lstrcmp(path2, "one\\..three"), "Expected one\\..three, got %s\n", path2);
ok(!lstrcmp(out, "one"), "Expected one, got %s\n", out); ok(!lstrcmp(out, "one"), "Expected one, got %s\n", out);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* try ... prefix */ /* try ... prefix */
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
@ -1710,7 +1710,7 @@ static void test_PathCommonPrefixA(void)
ok(!lstrcmp(path1, "one\\...two"), "Expected one\\...two, got %s\n", path1); ok(!lstrcmp(path1, "one\\...two"), "Expected one\\...two, got %s\n", path1);
ok(!lstrcmp(path2, "one\\...three"), "Expected one\\...three, got %s\n", path2); ok(!lstrcmp(path2, "one\\...three"), "Expected one\\...three, got %s\n", path2);
ok(!lstrcmp(out, "one"), "Expected one, got %s\n", out); ok(!lstrcmp(out, "one"), "Expected one, got %s\n", out);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* try .\ prefix */ /* try .\ prefix */
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
@ -1722,7 +1722,7 @@ static void test_PathCommonPrefixA(void)
ok(!lstrcmp(path1, "one\\.\\two"), "Expected one\\.\\two, got %s\n", path1); ok(!lstrcmp(path1, "one\\.\\two"), "Expected one\\.\\two, got %s\n", path1);
ok(!lstrcmp(path2, "one\\.\\three"), "Expected one\\.\\three, got %s\n", path2); ok(!lstrcmp(path2, "one\\.\\three"), "Expected one\\.\\three, got %s\n", path2);
ok(!lstrcmp(out, "one\\."), "Expected one\\., got %s\n", out); ok(!lstrcmp(out, "one\\."), "Expected one\\., got %s\n", out);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* try ..\ prefix */ /* try ..\ prefix */
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
@ -1734,7 +1734,7 @@ static void test_PathCommonPrefixA(void)
ok(!lstrcmp(path1, "one\\..\\two"), "Expected one\\..\\two, got %s\n", path1); ok(!lstrcmp(path1, "one\\..\\two"), "Expected one\\..\\two, got %s\n", path1);
ok(!lstrcmp(path2, "one\\..\\three"), "Expected one\\..\\three, got %s\n", path2); ok(!lstrcmp(path2, "one\\..\\three"), "Expected one\\..\\three, got %s\n", path2);
ok(!lstrcmp(out, "one\\.."), "Expected one\\.., got %s\n", out); ok(!lstrcmp(out, "one\\.."), "Expected one\\.., got %s\n", out);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* try ...\\ prefix */ /* try ...\\ prefix */
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
@ -1746,7 +1746,7 @@ static void test_PathCommonPrefixA(void)
ok(!lstrcmp(path1, "one\\...\\two"), "Expected one\\...\\two, got %s\n", path1); ok(!lstrcmp(path1, "one\\...\\two"), "Expected one\\...\\two, got %s\n", path1);
ok(!lstrcmp(path2, "one\\...\\three"), "Expected one\\...\\three, got %s\n", path2); ok(!lstrcmp(path2, "one\\...\\three"), "Expected one\\...\\three, got %s\n", path2);
ok(!lstrcmp(out, "one\\..."), "Expected one\\..., got %s\n", out); ok(!lstrcmp(out, "one\\..."), "Expected one\\..., got %s\n", out);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* try prefix that is not an msdn labeled prefix type */ /* try prefix that is not an msdn labeled prefix type */
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
@ -1758,7 +1758,7 @@ static void test_PathCommonPrefixA(void)
ok(!lstrcmp(path1, "same"), "Expected same, got %s\n", path1); ok(!lstrcmp(path1, "same"), "Expected same, got %s\n", path1);
ok(!lstrcmp(path2, "same"), "Expected same, got %s\n", path2); ok(!lstrcmp(path2, "same"), "Expected same, got %s\n", path2);
ok(!lstrcmp(out, "same"), "Expected same, got %s\n", out); ok(!lstrcmp(out, "same"), "Expected same, got %s\n", out);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* try . after directory */ /* try . after directory */
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
@ -1770,7 +1770,7 @@ static void test_PathCommonPrefixA(void)
ok(!lstrcmp(path1, "one\\mid.\\two"), "Expected one\\mid.\\two, got %s\n", path1); ok(!lstrcmp(path1, "one\\mid.\\two"), "Expected one\\mid.\\two, got %s\n", path1);
ok(!lstrcmp(path2, "one\\mid.\\three"), "Expected one\\mid.\\three, got %s\n", path2); ok(!lstrcmp(path2, "one\\mid.\\three"), "Expected one\\mid.\\three, got %s\n", path2);
ok(!lstrcmp(out, "one\\mid."), "Expected one\\mid., got %s\n", out); ok(!lstrcmp(out, "one\\mid."), "Expected one\\mid., got %s\n", out);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* try . in the middle of a directory */ /* try . in the middle of a directory */
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
@ -1782,7 +1782,7 @@ static void test_PathCommonPrefixA(void)
ok(!lstrcmp(path1, "one\\mid.end\\two"), "Expected one\\mid.end\\two, got %s\n", path1); ok(!lstrcmp(path1, "one\\mid.end\\two"), "Expected one\\mid.end\\two, got %s\n", path1);
ok(!lstrcmp(path2, "one\\mid.end\\three"), "Expected one\\mid.end\\three, got %s\n", path2); ok(!lstrcmp(path2, "one\\mid.end\\three"), "Expected one\\mid.end\\three, got %s\n", path2);
ok(!lstrcmp(out, "one\\mid.end"), "Expected one\\mid.end, got %s\n", out); ok(!lstrcmp(out, "one\\mid.end"), "Expected one\\mid.end, got %s\n", out);
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
/* try comparing a .. with the expanded path */ /* try comparing a .. with the expanded path */
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
@ -1794,7 +1794,7 @@ static void test_PathCommonPrefixA(void)
ok(!lstrcmp(path1, "one\\..\\two"), "Expected one\\..\\two, got %s\n", path1); ok(!lstrcmp(path1, "one\\..\\two"), "Expected one\\..\\two, got %s\n", path1);
ok(!lstrcmp(path2, "two"), "Expected two, got %s\n", path2); ok(!lstrcmp(path2, "two"), "Expected two, got %s\n", path2);
ok(lstrlen(out) == 0, "Expected 0 length out, got %i\n", lstrlen(out)); ok(lstrlen(out) == 0, "Expected 0 length out, got %i\n", lstrlen(out));
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
} }
static void test_PathUnquoteSpaces(void) static void test_PathUnquoteSpaces(void)

View File

@ -81,7 +81,7 @@ static HKEY create_test_entries(void)
SetEnvironmentVariableA("FOO", sEnvvar2); SetEnvironmentVariableA("FOO", sEnvvar2);
ret = RegCreateKeyA(HKEY_CURRENT_USER, REG_TEST_KEY, &hKey); ret = RegCreateKeyA(HKEY_CURRENT_USER, REG_TEST_KEY, &hKey);
ok( ERROR_SUCCESS == ret, "RegCreateKeyA failed, ret=%lu\n", ret); ok( ERROR_SUCCESS == ret, "RegCreateKeyA failed, ret=%u\n", ret);
if (hKey) if (hKey)
{ {
@ -96,13 +96,13 @@ static HKEY create_test_entries(void)
nExpectedLen1 = strlen(sTestpath1) - strlen("%LONGSYSTEMVAR%") + strlen(sEnvvar1) + 1; nExpectedLen1 = strlen(sTestpath1) - strlen("%LONGSYSTEMVAR%") + strlen(sEnvvar1) + 1;
nExpectedLen2 = strlen(sTestpath2) - strlen("%FOO%") + strlen(sEnvvar2) + 1; nExpectedLen2 = strlen(sTestpath2) - strlen("%FOO%") + strlen(sEnvvar2) + 1;
/* ExpandEnvironmentStringsA on NT4 returns 2x the correct result */ /* ExpandEnvironmentStringsA on NT4 returns 2x the correct result */
trace("sExplen1 = (%ld)\n", nExpLen1); trace("sExplen1 = (%d)\n", nExpLen1);
if (nExpectedLen1 != nExpLen1) if (nExpectedLen1 != nExpLen1)
trace( "Expanding %s failed (expected %ld) - known bug in NT4\n", sTestpath1, nExpectedLen1 ); trace( "Expanding %s failed (expected %d) - known bug in NT4\n", sTestpath1, nExpectedLen1 );
trace("sExplen2 = (%ld)\n", nExpLen2); trace("sExplen2 = (%d)\n", nExpLen2);
if (nExpectedLen2 != nExpLen2) if (nExpectedLen2 != nExpLen2)
trace( "Expanding %s failed (expected %ld) - known bug in NT4\n", sTestpath2, nExpectedLen2 ); trace( "Expanding %s failed (expected %d) - known bug in NT4\n", sTestpath2, nExpectedLen2 );
/* Make sure we carry on with correct values */ /* Make sure we carry on with correct values */
nExpLen1 = nExpectedLen1; nExpLen1 = nExpectedLen1;
@ -121,17 +121,17 @@ static void test_SHGetValue(void)
dwSize = MAX_PATH; dwSize = MAX_PATH;
dwType = -1; dwType = -1;
dwRet = SHGetValueA(HKEY_CURRENT_USER, REG_TEST_KEY, "Test1", &dwType, buf, &dwSize); dwRet = SHGetValueA(HKEY_CURRENT_USER, REG_TEST_KEY, "Test1", &dwType, buf, &dwSize);
ok( ERROR_SUCCESS == dwRet, "SHGetValueA failed, ret=%lu\n", dwRet); ok( ERROR_SUCCESS == dwRet, "SHGetValueA failed, ret=%u\n", dwRet);
ok( 0 == strcmp(sExpTestpath1, buf), "Comparing of (%s) with (%s) failed\n", buf, sExpTestpath1); ok( 0 == strcmp(sExpTestpath1, buf), "Comparing of (%s) with (%s) failed\n", buf, sExpTestpath1);
ok( REG_SZ == dwType, "Expected REG_SZ, got (%lu)\n", dwType); ok( REG_SZ == dwType, "Expected REG_SZ, got (%u)\n", dwType);
strcpy(buf, sEmptyBuffer); strcpy(buf, sEmptyBuffer);
dwSize = MAX_PATH; dwSize = MAX_PATH;
dwType = -1; dwType = -1;
dwRet = SHGetValueA(HKEY_CURRENT_USER, REG_TEST_KEY, "Test2", &dwType, buf, &dwSize); dwRet = SHGetValueA(HKEY_CURRENT_USER, REG_TEST_KEY, "Test2", &dwType, buf, &dwSize);
ok( ERROR_SUCCESS == dwRet, "SHGetValueA failed, ret=%lu\n", dwRet); ok( ERROR_SUCCESS == dwRet, "SHGetValueA failed, ret=%u\n", dwRet);
ok( 0 == strcmp(sTestpath1, buf) , "Comparing of (%s) with (%s) failed\n", buf, sTestpath1); ok( 0 == strcmp(sTestpath1, buf) , "Comparing of (%s) with (%s) failed\n", buf, sTestpath1);
ok( REG_SZ == dwType , "Expected REG_SZ, got (%lu)\n", dwType); ok( REG_SZ == dwType , "Expected REG_SZ, got (%u)\n", dwType);
} }
static void test_SHGetRegPath(void) static void test_SHGetRegPath(void)
@ -144,7 +144,7 @@ static void test_SHGetRegPath(void)
strcpy(buf, sEmptyBuffer); strcpy(buf, sEmptyBuffer);
dwRet = (*pSHRegGetPathA)(HKEY_CURRENT_USER, REG_TEST_KEY, "Test1", buf, 0); dwRet = (*pSHRegGetPathA)(HKEY_CURRENT_USER, REG_TEST_KEY, "Test1", buf, 0);
ok( ERROR_SUCCESS == dwRet, "SHRegGetPathA failed, ret=%lu\n", dwRet); ok( ERROR_SUCCESS == dwRet, "SHRegGetPathA failed, ret=%u\n", dwRet);
ok( 0 == strcmp(sExpTestpath1, buf) , "Comparing (%s) with (%s) failed\n", buf, sExpTestpath1); ok( 0 == strcmp(sExpTestpath1, buf) , "Comparing (%s) with (%s) failed\n", buf, sExpTestpath1);
} }
@ -160,7 +160,7 @@ static void test_SHQUeryValueEx(void)
sTestedFunction = "RegOpenKeyExA"; sTestedFunction = "RegOpenKeyExA";
dwRet = RegOpenKeyExA(HKEY_CURRENT_USER, REG_TEST_KEY, 0, KEY_QUERY_VALUE, &hKey); dwRet = RegOpenKeyExA(HKEY_CURRENT_USER, REG_TEST_KEY, 0, KEY_QUERY_VALUE, &hKey);
ok( ERROR_SUCCESS == dwRet, "%s failed, ret=%lu\n", sTestedFunction, dwRet); ok( ERROR_SUCCESS == dwRet, "%s failed, ret=%u\n", sTestedFunction, dwRet);
/****** SHQueryValueExA ******/ /****** SHQueryValueExA ******/
@ -171,15 +171,15 @@ static void test_SHQUeryValueEx(void)
* Case 1.1 All arguments are NULL * Case 1.1 All arguments are NULL
*/ */
dwRet = SHQueryValueExA( hKey, "Test1", NULL, NULL, NULL, NULL); dwRet = SHQueryValueExA( hKey, "Test1", NULL, NULL, NULL, NULL);
ok( ERROR_SUCCESS == dwRet, "%s failed, ret=%lu\n", sTestedFunction, dwRet); ok( ERROR_SUCCESS == dwRet, "%s failed, ret=%u\n", sTestedFunction, dwRet);
/* /*
* Case 1.2 dwType is set * Case 1.2 dwType is set
*/ */
dwType = -1; dwType = -1;
dwRet = SHQueryValueExA( hKey, "Test1", NULL, &dwType, NULL, NULL); dwRet = SHQueryValueExA( hKey, "Test1", NULL, &dwType, NULL, NULL);
ok( ERROR_SUCCESS == dwRet, "%s failed, ret=%lu\n", sTestedFunction, dwRet); ok( ERROR_SUCCESS == dwRet, "%s failed, ret=%u\n", sTestedFunction, dwRet);
ok( REG_SZ == dwType , "Expected REG_SZ, got (%lu)\n", dwType); ok( REG_SZ == dwType , "Expected REG_SZ, got (%u)\n", dwType);
/* /*
* dwSize is set * dwSize is set
@ -187,16 +187,16 @@ static void test_SHQUeryValueEx(void)
*/ */
dwSize = 6; dwSize = 6;
dwRet = SHQueryValueExA( hKey, "Test1", NULL, NULL, NULL, &dwSize); dwRet = SHQueryValueExA( hKey, "Test1", NULL, NULL, NULL, &dwSize);
ok( ERROR_SUCCESS == dwRet, "%s failed, ret=%lu\n", sTestedFunction, dwRet); ok( ERROR_SUCCESS == dwRet, "%s failed, ret=%u\n", sTestedFunction, dwRet);
ok( dwSize == nUsedBuffer1, "Buffer sizes (%lu) and (%lu) are not equal\n", dwSize, nUsedBuffer1); ok( dwSize == nUsedBuffer1, "Buffer sizes (%u) and (%u) are not equal\n", dwSize, nUsedBuffer1);
/* /*
* dwExpanded > dwUnExpanded * dwExpanded > dwUnExpanded
*/ */
dwSize = 6; dwSize = 6;
dwRet = SHQueryValueExA( hKey, "Test3", NULL, NULL, NULL, &dwSize); dwRet = SHQueryValueExA( hKey, "Test3", NULL, NULL, NULL, &dwSize);
ok( ERROR_SUCCESS == dwRet, "%s failed, ret=%lu\n", sTestedFunction, dwRet); ok( ERROR_SUCCESS == dwRet, "%s failed, ret=%u\n", sTestedFunction, dwRet);
ok( dwSize >= nUsedBuffer2, "Buffer size (%lu) should be >= (%lu)\n", dwSize, nUsedBuffer2); ok( dwSize >= nUsedBuffer2, "Buffer size (%u) should be >= (%u)\n", dwSize, nUsedBuffer2);
/* /*
* Case 1 string shrinks during expanding * Case 1 string shrinks during expanding
@ -205,10 +205,10 @@ static void test_SHQUeryValueEx(void)
dwSize = 6; dwSize = 6;
dwType = -1; dwType = -1;
dwRet = SHQueryValueExA( hKey, "Test1", NULL, &dwType, buf, &dwSize); dwRet = SHQueryValueExA( hKey, "Test1", NULL, &dwType, buf, &dwSize);
ok( ERROR_MORE_DATA == dwRet, "Expected ERROR_MORE_DATA, got (%lu)\n", dwRet); ok( ERROR_MORE_DATA == dwRet, "Expected ERROR_MORE_DATA, got (%u)\n", dwRet);
ok( 0 == strcmp(sEmptyBuffer, buf) , "Comparing (%s) with (%s) failed\n", buf, sEmptyBuffer); ok( 0 == strcmp(sEmptyBuffer, buf) , "Comparing (%s) with (%s) failed\n", buf, sEmptyBuffer);
ok( dwSize == nUsedBuffer1, "Buffer sizes (%lu) and (%lu) are not equal\n", dwSize, nUsedBuffer1); ok( dwSize == nUsedBuffer1, "Buffer sizes (%u) and (%u) are not equal\n", dwSize, nUsedBuffer1);
ok( REG_SZ == dwType , "Expected REG_SZ, got (%lu)\n", dwType); ok( REG_SZ == dwType , "Expected REG_SZ, got (%u)\n", dwType);
/* /*
* string grows during expanding * string grows during expanding
@ -218,10 +218,10 @@ static void test_SHQUeryValueEx(void)
dwSize = 6; dwSize = 6;
dwType = -1; dwType = -1;
dwRet = SHQueryValueExA( hKey, "Test3", NULL, &dwType, buf, &dwSize); dwRet = SHQueryValueExA( hKey, "Test3", NULL, &dwType, buf, &dwSize);
ok( ERROR_MORE_DATA == dwRet, "Expected ERROR_MORE_DATA, got (%lu)\n", dwRet); ok( ERROR_MORE_DATA == dwRet, "Expected ERROR_MORE_DATA, got (%u)\n", dwRet);
ok( 0 == strcmp(sEmptyBuffer, buf) , "Comparing (%s) with (%s) failed\n", buf, sEmptyBuffer); ok( 0 == strcmp(sEmptyBuffer, buf) , "Comparing (%s) with (%s) failed\n", buf, sEmptyBuffer);
ok( dwSize >= nUsedBuffer2, "Buffer size (%lu) should be >= (%lu)\n", dwSize, nUsedBuffer2); ok( dwSize >= nUsedBuffer2, "Buffer size (%u) should be >= (%u)\n", dwSize, nUsedBuffer2);
ok( REG_SZ == dwType , "Expected REG_SZ, got (%lu)\n", dwType); ok( REG_SZ == dwType , "Expected REG_SZ, got (%u)\n", dwType);
/* /*
* string grows during expanding * string grows during expanding
@ -232,7 +232,7 @@ static void test_SHQUeryValueEx(void)
dwSize = strlen(sEnvvar2) - 2; dwSize = strlen(sEnvvar2) - 2;
dwType = -1; dwType = -1;
dwRet = SHQueryValueExA( hKey, "Test3", NULL, &dwType, buf, &dwSize); dwRet = SHQueryValueExA( hKey, "Test3", NULL, &dwType, buf, &dwSize);
ok( ERROR_MORE_DATA == dwRet, "Expected ERROR_MORE_DATA, got (%lu)\n", dwRet); ok( ERROR_MORE_DATA == dwRet, "Expected ERROR_MORE_DATA, got (%u)\n", dwRet);
todo_wine todo_wine
{ {
@ -240,8 +240,8 @@ static void test_SHQUeryValueEx(void)
"Expected empty or unexpanded string (win98), got (%s)\n", buf); "Expected empty or unexpanded string (win98), got (%s)\n", buf);
} }
ok( dwSize >= nUsedBuffer2, "Buffer size (%lu) should be >= (%lu)\n", dwSize, nUsedBuffer2); ok( dwSize >= nUsedBuffer2, "Buffer size (%u) should be >= (%u)\n", dwSize, nUsedBuffer2);
ok( REG_SZ == dwType , "Expected REG_SZ, got (%lu)\n", dwType); ok( REG_SZ == dwType , "Expected REG_SZ, got (%u)\n", dwType);
/* /*
* string grows during expanding * string grows during expanding
@ -252,7 +252,7 @@ static void test_SHQUeryValueEx(void)
dwSize = nExpLen2 - 4; dwSize = nExpLen2 - 4;
dwType = -1; dwType = -1;
dwRet = SHQueryValueExA( hKey, "Test3", NULL, &dwType, buf, &dwSize); dwRet = SHQueryValueExA( hKey, "Test3", NULL, &dwType, buf, &dwSize);
ok( ERROR_MORE_DATA == dwRet, "Expected ERROR_MORE_DATA, got (%lu)\n", dwRet); ok( ERROR_MORE_DATA == dwRet, "Expected ERROR_MORE_DATA, got (%u)\n", dwRet);
todo_wine todo_wine
{ {
@ -260,8 +260,8 @@ static void test_SHQUeryValueEx(void)
"Expected empty or first part of the string \"%s\", got \"%s\"\n", sEnvvar2, buf); "Expected empty or first part of the string \"%s\", got \"%s\"\n", sEnvvar2, buf);
} }
ok( dwSize >= nUsedBuffer2, "Buffer size (%lu) should be >= (%lu)\n", dwSize, nUsedBuffer2); ok( dwSize >= nUsedBuffer2, "Buffer size (%u) should be >= (%u)\n", dwSize, nUsedBuffer2);
ok( REG_SZ == dwType , "Expected REG_SZ, got (%lu)\n", dwType); ok( REG_SZ == dwType , "Expected REG_SZ, got (%u)\n", dwType);
/* /*
* The buffer is NULL but the size is set * The buffer is NULL but the size is set
@ -270,9 +270,9 @@ static void test_SHQUeryValueEx(void)
dwSize = 6; dwSize = 6;
dwType = -1; dwType = -1;
dwRet = SHQueryValueExA( hKey, "Test3", NULL, &dwType, NULL, &dwSize); dwRet = SHQueryValueExA( hKey, "Test3", NULL, &dwType, NULL, &dwSize);
ok( ERROR_SUCCESS == dwRet, "%s failed, ret=%lu\n", sTestedFunction, dwRet); ok( ERROR_SUCCESS == dwRet, "%s failed, ret=%u\n", sTestedFunction, dwRet);
ok( dwSize >= nUsedBuffer2, "Buffer size (%lu) should be >= (%lu)\n", dwSize, nUsedBuffer2); ok( dwSize >= nUsedBuffer2, "Buffer size (%u) should be >= (%u)\n", dwSize, nUsedBuffer2);
ok( REG_SZ == dwType , "Expected REG_SZ, got (%lu)\n", dwType); ok( REG_SZ == dwType , "Expected REG_SZ, got (%u)\n", dwType);
RegCloseKey(hKey); RegCloseKey(hKey);
} }
@ -294,7 +294,7 @@ static void test_SHCopyKey(void)
dwRet = RegCreateKeyA(HKEY_CURRENT_USER, REG_TEST_KEY "\\CopyDestination", &hKeyDst); dwRet = RegCreateKeyA(HKEY_CURRENT_USER, REG_TEST_KEY "\\CopyDestination", &hKeyDst);
if (dwRet || !hKeyDst) if (dwRet || !hKeyDst)
{ {
ok( 0, "Destination couldn't be created, RegCreateKeyA returned (%lu)\n", dwRet); ok( 0, "Destination couldn't be created, RegCreateKeyA returned (%u)\n", dwRet);
return; return;
} }
@ -302,7 +302,7 @@ static void test_SHCopyKey(void)
dwRet = RegOpenKeyA(HKEY_LOCAL_MACHINE, REG_CURRENT_VERSION, &hKeySrc); dwRet = RegOpenKeyA(HKEY_LOCAL_MACHINE, REG_CURRENT_VERSION, &hKeySrc);
if (dwRet || !hKeySrc) if (dwRet || !hKeySrc)
{ {
ok( 0, "Source couldn't be opened, RegOpenKeyA returned (%lu)\n", dwRet); ok( 0, "Source couldn't be opened, RegOpenKeyA returned (%u)\n", dwRet);
return; return;
} }
@ -310,7 +310,7 @@ static void test_SHCopyKey(void)
if (pSHCopyKeyA) if (pSHCopyKeyA)
{ {
dwRet = (*pSHCopyKeyA)(hKeySrc, NULL, hKeyDst, 0); dwRet = (*pSHCopyKeyA)(hKeySrc, NULL, hKeyDst, 0);
ok ( ERROR_SUCCESS == dwRet, "Copy failed, ret=(%lu)\n", dwRet); ok ( ERROR_SUCCESS == dwRet, "Copy failed, ret=(%u)\n", dwRet);
} }
RegCloseKey(hKeySrc); RegCloseKey(hKeySrc);
@ -321,7 +321,7 @@ static void test_SHCopyKey(void)
dwRet = RegOpenKeyA(HKEY_CURRENT_USER, REG_TEST_KEY "\\CopyDestination\\Setup", &hKeyDst); dwRet = RegOpenKeyA(HKEY_CURRENT_USER, REG_TEST_KEY "\\CopyDestination\\Setup", &hKeyDst);
if (dwRet || !hKeyDst) if (dwRet || !hKeyDst)
{ {
ok ( 0, "Copy couldn't be opened, RegOpenKeyA returned (%lu)\n", dwRet); ok ( 0, "Copy couldn't be opened, RegOpenKeyA returned (%u)\n", dwRet);
return; return;
} }
@ -362,7 +362,7 @@ static void test_SHDeleteKey(void)
{ {
dwRet = SHDeleteKeyA(HKEY_CURRENT_USER, REG_TEST_KEY "\\ODBC"); dwRet = SHDeleteKeyA(HKEY_CURRENT_USER, REG_TEST_KEY "\\ODBC");
ok ( ERROR_SUCCESS == dwRet, "SHDeleteKey failed, ret=(%lu)\n", dwRet); ok ( ERROR_SUCCESS == dwRet, "SHDeleteKey failed, ret=(%u)\n", dwRet);
dwRet = RegOpenKeyA(HKEY_CURRENT_USER, REG_TEST_KEY "\\ODBC", &hKeyS); dwRet = RegOpenKeyA(HKEY_CURRENT_USER, REG_TEST_KEY "\\ODBC", &hKeyS);
ok ( ERROR_FILE_NOT_FOUND == dwRet, "SHDeleteKey did not delete\n"); ok ( ERROR_FILE_NOT_FOUND == dwRet, "SHDeleteKey did not delete\n");

View File

@ -492,7 +492,7 @@ static void test_StrFormatByteSize64A(void)
StrFormatByteSize64A(result->value, szBuff, 256); StrFormatByteSize64A(result->value, szBuff, 256);
ok(!strcmp(result->byte_size_64, szBuff), ok(!strcmp(result->byte_size_64, szBuff),
"Formatted %lx%08lx wrong: got %s, expected %s\n", "Formatted %x%08x wrong: got %s, expected %s\n",
(LONG)(result->value >> 32), (LONG)result->value, szBuff, result->byte_size_64); (LONG)(result->value >> 32), (LONG)result->value, szBuff, result->byte_size_64);
result++; result++;
@ -510,7 +510,7 @@ static void test_StrFormatKBSizeW(void)
StrFormatKBSizeW(result->value, szBuffW, 256); StrFormatKBSizeW(result->value, szBuffW, 256);
WideCharToMultiByte(0,0,szBuffW,-1,szBuff,sizeof(szBuff)/sizeof(WCHAR),0,0); WideCharToMultiByte(0,0,szBuffW,-1,szBuff,sizeof(szBuff)/sizeof(WCHAR),0,0);
ok(!strcmp(result->kb_size, szBuff), ok(!strcmp(result->kb_size, szBuff),
"Formatted %lx%08lx wrong: got %s, expected %s\n", "Formatted %x%08x wrong: got %s, expected %s\n",
(LONG)(result->value >> 32), (LONG)result->value, szBuff, result->kb_size); (LONG)(result->value >> 32), (LONG)result->value, szBuff, result->kb_size);
result++; result++;
} }
@ -526,7 +526,7 @@ static void test_StrFormatKBSizeA(void)
StrFormatKBSizeA(result->value, szBuff, 256); StrFormatKBSizeA(result->value, szBuff, 256);
ok(!strcmp(result->kb_size, szBuff), ok(!strcmp(result->kb_size, szBuff),
"Formatted %lx%08lx wrong: got %s, expected %s\n", "Formatted %x%08x wrong: got %s, expected %s\n",
(LONG)(result->value >> 32), (LONG)result->value, szBuff, result->kb_size); (LONG)(result->value >> 32), (LONG)result->value, szBuff, result->kb_size);
result++; result++;
} }
@ -541,7 +541,7 @@ static void test_StrFromTimeIntervalA(void)
{ {
StrFromTimeIntervalA(szBuff, 256, result->ms, result->digits); StrFromTimeIntervalA(szBuff, 256, result->ms, result->digits);
ok(!strcmp(result->time_interval, szBuff), "Formatted %ld %d wrong\n", ok(!strcmp(result->time_interval, szBuff), "Formatted %d %d wrong\n",
result->ms, result->digits); result->ms, result->digits);
result++; result++;
} }
@ -623,7 +623,7 @@ static void test_StrRetToBSTR(void)
bstr = 0; bstr = 0;
ret = pStrRetToBSTR(&strret, NULL, &bstr); ret = pStrRetToBSTR(&strret, NULL, &bstr);
ok(ret == S_OK && bstr && !strcmpW(bstr, szTestW), ok(ret == S_OK && bstr && !strcmpW(bstr, szTestW),
"STRRET_WSTR: dup failed, ret=0x%08lx, bstr %p\n", ret, bstr); "STRRET_WSTR: dup failed, ret=0x%08x, bstr %p\n", ret, bstr);
if (bstr) if (bstr)
SysFreeString(bstr); SysFreeString(bstr);
@ -631,7 +631,7 @@ static void test_StrRetToBSTR(void)
lstrcpyA(strret.u.cStr, "Test"); lstrcpyA(strret.u.cStr, "Test");
ret = pStrRetToBSTR(&strret, NULL, &bstr); ret = pStrRetToBSTR(&strret, NULL, &bstr);
ok(ret == S_OK && bstr && !strcmpW(bstr, szTestW), ok(ret == S_OK && bstr && !strcmpW(bstr, szTestW),
"STRRET_CSTR: dup failed, ret=0x%08lx, bstr %p\n", ret, bstr); "STRRET_CSTR: dup failed, ret=0x%08x, bstr %p\n", ret, bstr);
if (bstr) if (bstr)
SysFreeString(bstr); SysFreeString(bstr);
@ -640,7 +640,7 @@ static void test_StrRetToBSTR(void)
strcpy((char*)&iidl, " Test"); strcpy((char*)&iidl, " Test");
ret = pStrRetToBSTR(&strret, iidl, &bstr); ret = pStrRetToBSTR(&strret, iidl, &bstr);
ok(ret == S_OK && bstr && !strcmpW(bstr, szTestW), ok(ret == S_OK && bstr && !strcmpW(bstr, szTestW),
"STRRET_OFFSET: dup failed, ret=0x%08lx, bstr %p\n", ret, bstr); "STRRET_OFFSET: dup failed, ret=0x%08x, bstr %p\n", ret, bstr);
if (bstr) if (bstr)
SysFreeString(bstr); SysFreeString(bstr);
@ -695,7 +695,7 @@ static void test_SHAnsiToAnsi(void)
memset(dest, '\n', sizeof(dest)); memset(dest, '\n', sizeof(dest));
dwRet = pSHAnsiToAnsi("hello", dest, sizeof(dest)/sizeof(dest[0])); dwRet = pSHAnsiToAnsi("hello", dest, sizeof(dest)/sizeof(dest[0]));
ok(dwRet == 6 && !memcmp(dest, "hello\0\n\n", sizeof(dest)), ok(dwRet == 6 && !memcmp(dest, "hello\0\n\n", sizeof(dest)),
"SHAnsiToAnsi: expected 6, \"hello\\0\\n\\n\", got %ld, \"%d,%d,%d,%d,%d,%d,%d,%d\"\n", "SHAnsiToAnsi: expected 6, \"hello\\0\\n\\n\", got %d, \"%d,%d,%d,%d,%d,%d,%d,%d\"\n",
dwRet, dest[0], dest[1], dest[2], dest[3], dest[4], dest[5], dest[6], dest[7]); dwRet, dest[0], dest[1], dest[2], dest[3], dest[4], dest[5], dest[6], dest[7]);
} }
@ -714,7 +714,7 @@ static void test_SHUnicodeToUnicode(void)
memcpy(dest, lpInit, sizeof(lpInit)); memcpy(dest, lpInit, sizeof(lpInit));
dwRet = pSHUnicodeToUnicode(lpSrc, dest, sizeof(dest)/sizeof(dest[0])); dwRet = pSHUnicodeToUnicode(lpSrc, dest, sizeof(dest)/sizeof(dest[0]));
ok(dwRet == 6 && !memcmp(dest, lpRes, sizeof(dest)), ok(dwRet == 6 && !memcmp(dest, lpRes, sizeof(dest)),
"SHUnicodeToUnicode: expected 6, \"hello\\0\\n\\n\", got %ld, \"%d,%d,%d,%d,%d,%d,%d,%d\"\n", "SHUnicodeToUnicode: expected 6, \"hello\\0\\n\\n\", got %d, \"%d,%d,%d,%d,%d,%d,%d,%d\"\n",
dwRet, dest[0], dest[1], dest[2], dest[3], dest[4], dest[5], dest[6], dest[7]); dwRet, dest[0], dest[1], dest[2], dest[3], dest[4], dest[5], dest[6], dest[7]);
} }