|
|
|
@ -378,7 +378,7 @@ static void test_url_part(const char* szUrl, DWORD dwPart, DWORD dwFlags, const
|
|
|
|
|
DWORD dwSize;
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
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;
|
|
|
|
|
res = UrlGetPartA("hi", szPart, &dwSize, URL_PART_SCHEME, 0);
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
dwSize = sizeof szPart;
|
|
|
|
|
szPart[0]='x'; szPart[1]=0;
|
|
|
|
|
res = UrlGetPartA("hi", szPart, &dwSize, URL_PART_QUERY, 0);
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -432,15 +432,15 @@ static void test_url_escape(const char *szUrl, DWORD dwFlags, HRESULT dwExpectRe
|
|
|
|
|
WCHAR *urlW, *expected_urlW;
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
dwEscaped = INTERNET_MAX_URL_LENGTH;
|
|
|
|
|
urlW = GetWideString(szUrl);
|
|
|
|
|
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);
|
|
|
|
|
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(expected_urlW);
|
|
|
|
|
|
|
|
|
@ -458,12 +458,12 @@ static void test_url_canonicalize(const char *szUrl, DWORD dwFlags, HRESULT dwEx
|
|
|
|
|
|
|
|
|
|
dwSize = INTERNET_MAX_URL_LENGTH;
|
|
|
|
|
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(strcmp(szReturnUrl,szExpectUrl)==0, "UrlCanonicalizeA dwFlags 0x%08lx Expected \"%s\", but got \"%s\"\n", dwFlags, szExpectUrl, szReturnUrl);
|
|
|
|
|
ok(UrlCanonicalizeA(szUrl, szReturnUrl, &dwSize, dwFlags) == dwExpectReturn, "UrlCanonicalizeA didn't return 0x%08x\n", dwExpectReturn);
|
|
|
|
|
ok(strcmp(szReturnUrl,szExpectUrl)==0, "UrlCanonicalizeA dwFlags 0x%08x Expected \"%s\", but got \"%s\"\n", dwFlags, szExpectUrl, szReturnUrl);
|
|
|
|
|
|
|
|
|
|
dwSize = INTERNET_MAX_URL_LENGTH;
|
|
|
|
|
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);
|
|
|
|
|
ok(lstrcmpW(wszReturnUrl, wszConvertedUrl)==0, "Strings didn't match between ascii and unicode UrlCanonicalize!\n");
|
|
|
|
|
FreeWideString(wszConvertedUrl);
|
|
|
|
@ -497,7 +497,7 @@ static void test_UrlCanonicalize(void)
|
|
|
|
|
|
|
|
|
|
/* move to TEST_CANONICALIZE when fixed */
|
|
|
|
|
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 {
|
|
|
|
|
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;
|
|
|
|
|
/*LimeWire online installer calls this*/
|
|
|
|
|
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 {
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
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(dwSize == dwExpectLen+1, "Got length %ld, expected %ld\n", dwSize, dwExpectLen+1);
|
|
|
|
|
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 %d, expected %d\n", dwSize, dwExpectLen+1);
|
|
|
|
|
|
|
|
|
|
dwSize--;
|
|
|
|
|
hr = UrlCombineA(szUrl1, szUrl2, szReturnUrl, &dwSize, dwFlags);
|
|
|
|
|
ok(hr == E_POINTER, "UrlCombineA returned 0x%08lx, expected 0x%08lx\n", hr, E_POINTER);
|
|
|
|
|
ok(dwSize == dwExpectLen+1, "Got length %ld, expected %ld\n", dwSize, dwExpectLen+1);
|
|
|
|
|
ok(hr == E_POINTER, "UrlCombineA returned 0x%08x, expected 0x%08x\n", hr, E_POINTER);
|
|
|
|
|
ok(dwSize == dwExpectLen+1, "Got length %d, expected %d\n", dwSize, dwExpectLen+1);
|
|
|
|
|
|
|
|
|
|
hr = UrlCombineA(szUrl1, szUrl2, szReturnUrl, &dwSize, dwFlags);
|
|
|
|
|
ok(hr == dwExpectReturn, "UrlCombineA returned 0x%08lx, expected 0x%08lx\n", hr, dwExpectReturn);
|
|
|
|
|
ok(dwSize == dwExpectLen, "Got length %ld, expected %ld\n", dwSize, dwExpectLen);
|
|
|
|
|
ok(hr == dwExpectReturn, "UrlCombineA returned 0x%08x, expected 0x%08x\n", hr, dwExpectReturn);
|
|
|
|
|
ok(dwSize == dwExpectLen, "Got length %d, expected %d\n", dwSize, dwExpectLen);
|
|
|
|
|
if(SUCCEEDED(hr)) {
|
|
|
|
|
ok(strcmp(szReturnUrl,szExpectUrl)==0, "Expected %s, but got %s\n", szExpectUrl, szReturnUrl);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dwSize = 0;
|
|
|
|
|
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(dwSize == dwExpectLen+1, "Got length %ld, expected %ld\n", dwSize, dwExpectLen+1);
|
|
|
|
|
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 %d, expected %d\n", dwSize, dwExpectLen+1);
|
|
|
|
|
|
|
|
|
|
dwSize--;
|
|
|
|
|
hr = UrlCombineW(wszUrl1, wszUrl2, wszReturnUrl, &dwSize, dwFlags);
|
|
|
|
|
ok(hr == E_POINTER, "UrlCombineA returned 0x%08lx, expected 0x%08lx\n", hr, E_POINTER);
|
|
|
|
|
ok(dwSize == dwExpectLen+1, "Got length %ld, expected %ld\n", dwSize, dwExpectLen+1);
|
|
|
|
|
ok(hr == E_POINTER, "UrlCombineA returned 0x%08x, expected 0x%08x\n", hr, E_POINTER);
|
|
|
|
|
ok(dwSize == dwExpectLen+1, "Got length %d, expected %d\n", dwSize, dwExpectLen+1);
|
|
|
|
|
|
|
|
|
|
hr = UrlCombineW(wszUrl1, wszUrl2, wszReturnUrl, &dwSize, dwFlags);
|
|
|
|
|
ok(hr == dwExpectReturn, "UrlCombineW returned 0x%08lx, expected 0x%08lx\n", hr, dwExpectReturn);
|
|
|
|
|
ok(dwSize == dwExpectLen, "Got length %ld, expected %ld\n", dwSize, dwExpectLen);
|
|
|
|
|
ok(hr == dwExpectReturn, "UrlCombineW returned 0x%08x, expected 0x%08x\n", hr, dwExpectReturn);
|
|
|
|
|
ok(dwSize == dwExpectLen, "Got length %d, expected %d\n", dwSize, dwExpectLen);
|
|
|
|
|
if(SUCCEEDED(hr)) {
|
|
|
|
|
wszConvertedUrl = GetWideString(szReturnUrl);
|
|
|
|
|
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++) {
|
|
|
|
|
len = INTERNET_MAX_URL_LENGTH;
|
|
|
|
|
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(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;
|
|
|
|
|
pathW = GetWideString(TEST_URLFROMPATH[i].path);
|
|
|
|
|
urlW = GetWideString(TEST_URLFROMPATH[i].url);
|
|
|
|
|
ret = UrlCreateFromPathW(pathW, ret_urlW, &len, 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);
|
|
|
|
|
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(pathW);
|
|
|
|
|
}
|
|
|
|
@ -661,13 +661,13 @@ static void test_UrlUnescape(void)
|
|
|
|
|
|
|
|
|
|
for(i=0; i<sizeof(TEST_URL_UNESCAPE)/sizeof(TEST_URL_UNESCAPE[0]); i++) {
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
dwEscaped = INTERNET_MAX_URL_LENGTH;
|
|
|
|
|
urlW = GetWideString(TEST_URL_UNESCAPE[i].url);
|
|
|
|
|
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);
|
|
|
|
|
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);
|
|
|
|
@ -743,25 +743,25 @@ static void test_PathCreateFromUrl(void)
|
|
|
|
|
/* Check ret_path = NULL */
|
|
|
|
|
len = sizeof(url);
|
|
|
|
|
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++) {
|
|
|
|
|
len = INTERNET_MAX_URL_LENGTH;
|
|
|
|
|
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) {
|
|
|
|
|
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;
|
|
|
|
|
pathW = GetWideString(TEST_PATHFROMURL[i].path);
|
|
|
|
|
urlW = GetWideString(TEST_PATHFROMURL[i].url);
|
|
|
|
|
ret = PathCreateFromUrlW(urlW, ret_pathW, &len, 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) {
|
|
|
|
|
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(pathW);
|
|
|
|
@ -824,16 +824,16 @@ static void test_PathIsValidCharA(void)
|
|
|
|
|
unsigned int c;
|
|
|
|
|
|
|
|
|
|
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 );
|
|
|
|
|
ok ( !ret, "PathIsValidCharA succeeded: 0x%08lx\n", (DWORD)ret );
|
|
|
|
|
ok ( !ret, "PathIsValidCharA succeeded: 0x%08x\n", (DWORD)ret );
|
|
|
|
|
|
|
|
|
|
for (c = 0; c < 0x7f; c++)
|
|
|
|
|
{
|
|
|
|
|
ret = pPathIsValidCharA( c, ~0U );
|
|
|
|
|
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] );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -841,7 +841,7 @@ static void test_PathIsValidCharA(void)
|
|
|
|
|
{
|
|
|
|
|
ret = pPathIsValidCharA( c, ~0U );
|
|
|
|
|
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 );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -852,16 +852,16 @@ static void test_PathIsValidCharW(void)
|
|
|
|
|
unsigned int c, err_count = 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 );
|
|
|
|
|
ok ( !ret, "PathIsValidCharW succeeded: 0x%08lx\n", (DWORD)ret );
|
|
|
|
|
ok ( !ret, "PathIsValidCharW succeeded: 0x%08x\n", (DWORD)ret );
|
|
|
|
|
|
|
|
|
|
for (c = 0; c < 0x7f; c++)
|
|
|
|
|
{
|
|
|
|
|
ret = pPathIsValidCharW( c, ~0U );
|
|
|
|
|
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] );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -869,7 +869,7 @@ static void test_PathIsValidCharW(void)
|
|
|
|
|
{
|
|
|
|
|
ret = pPathIsValidCharW( c, ~0U );
|
|
|
|
|
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 );
|
|
|
|
|
if (ret != 0x00000100)
|
|
|
|
|
{
|
|
|
|
@ -968,19 +968,19 @@ static void test_PathCombineA(void)
|
|
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
|
str = PathCombineA(NULL, "C:\\", "one\\two\\three");
|
|
|
|
|
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 */
|
|
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
|
str = PathCombineA(NULL, NULL, "one\\two\\three");
|
|
|
|
|
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*/
|
|
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
|
str = PathCombineA(NULL, NULL, NULL);
|
|
|
|
|
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 */
|
|
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
@ -988,7 +988,7 @@ static void test_PathCombineA(void)
|
|
|
|
|
str = PathCombineA(dest, "C:\\", NULL);
|
|
|
|
|
ok(str == dest, "Expected str == dest, got %p\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 */
|
|
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
@ -996,7 +996,7 @@ static void test_PathCombineA(void)
|
|
|
|
|
str = PathCombineA(dest, "C:\\", "");
|
|
|
|
|
ok(str == dest, "Expected str == dest, got %p\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 */
|
|
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
@ -1004,7 +1004,7 @@ static void test_PathCombineA(void)
|
|
|
|
|
str = PathCombineA(dest, "", "");
|
|
|
|
|
ok(str == dest, "Expected str == dest, got %p\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 */
|
|
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
@ -1012,7 +1012,7 @@ static void test_PathCombineA(void)
|
|
|
|
|
str = PathCombineA(dest, NULL, "one\\two\\three");
|
|
|
|
|
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(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError());
|
|
|
|
|
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
|
|
|
|
|
|
|
|
|
|
/* try NULL directory and empty file part */
|
|
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
@ -1020,7 +1020,7 @@ static void test_PathCombineA(void)
|
|
|
|
|
str = PathCombineA(dest, NULL, "");
|
|
|
|
|
ok(str == dest, "Expected str == dest, got %p\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 */
|
|
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
@ -1031,7 +1031,7 @@ static void test_PathCombineA(void)
|
|
|
|
|
{
|
|
|
|
|
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 */
|
|
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
@ -1039,7 +1039,7 @@ static void test_PathCombineA(void)
|
|
|
|
|
str = PathCombineA(dest, "C:", "one\\two\\three");
|
|
|
|
|
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(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError());
|
|
|
|
|
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
|
|
|
|
|
|
|
|
|
|
/* try directory with backslash */
|
|
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
@ -1047,7 +1047,7 @@ static void test_PathCombineA(void)
|
|
|
|
|
str = PathCombineA(dest, "C:\\", "one\\two\\three");
|
|
|
|
|
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(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 */
|
|
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
@ -1055,7 +1055,7 @@ static void test_PathCombineA(void)
|
|
|
|
|
str = PathCombineA(dest, "C:\\", "\\one\\two\\three");
|
|
|
|
|
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(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 */
|
|
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
@ -1063,7 +1063,7 @@ static void test_PathCombineA(void)
|
|
|
|
|
str = PathCombineA(dest, "C:\\", "\\one\\two\\three\\");
|
|
|
|
|
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(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError());
|
|
|
|
|
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
|
|
|
|
|
|
|
|
|
|
/* try a relative directory */
|
|
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
@ -1071,7 +1071,7 @@ static void test_PathCombineA(void)
|
|
|
|
|
str = PathCombineA(dest, "relative\\dir", "\\one\\two\\three\\");
|
|
|
|
|
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(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError());
|
|
|
|
|
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
|
|
|
|
|
|
|
|
|
|
/* try forward slashes */
|
|
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
@ -1079,7 +1079,7 @@ static void test_PathCombineA(void)
|
|
|
|
|
str = PathCombineA(dest, "C:\\", "one/two/three\\");
|
|
|
|
|
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(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError());
|
|
|
|
|
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
|
|
|
|
|
|
|
|
|
|
/* try a really weird directory */
|
|
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
@ -1087,7 +1087,7 @@ static void test_PathCombineA(void)
|
|
|
|
|
str = PathCombineA(dest, "C:\\/\\/", "\\one\\two\\three\\");
|
|
|
|
|
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(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError());
|
|
|
|
|
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
|
|
|
|
|
|
|
|
|
|
/* try periods */
|
|
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
@ -1095,7 +1095,7 @@ static void test_PathCombineA(void)
|
|
|
|
|
str = PathCombineA(dest, "C:\\", "one\\..\\two\\.\\three");
|
|
|
|
|
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(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError());
|
|
|
|
|
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
|
|
|
|
|
|
|
|
|
|
/* try .. as file */
|
|
|
|
|
/* try forward slashes */
|
|
|
|
@ -1104,7 +1104,7 @@ static void test_PathCombineA(void)
|
|
|
|
|
str = PathCombineA(dest, "C:\\", "..");
|
|
|
|
|
ok(str == dest, "Expected str == dest, got %p\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);
|
|
|
|
|
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(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 */
|
|
|
|
@ -1128,7 +1128,7 @@ static void test_PathCombineA(void)
|
|
|
|
|
{
|
|
|
|
|
ok(str == NULL, "Expected str == NULL, got %p\n", str);
|
|
|
|
|
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);
|
|
|
|
@ -1145,7 +1145,7 @@ static void test_PathCombineA(void)
|
|
|
|
|
ok(str == NULL, "Expected str == NULL, got %p\n", str);
|
|
|
|
|
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)
|
|
|
|
@ -1158,7 +1158,7 @@ static void test_PathAddBackslash(void)
|
|
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
|
str = PathAddBackslashA(NULL);
|
|
|
|
|
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 */
|
|
|
|
|
path[0] = '\0';
|
|
|
|
@ -1166,7 +1166,7 @@ static void test_PathAddBackslash(void)
|
|
|
|
|
str = PathAddBackslashA(path);
|
|
|
|
|
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(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError());
|
|
|
|
|
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
|
|
|
|
|
|
|
|
|
|
/* try a relative path */
|
|
|
|
|
lstrcpyA(path, "one\\two");
|
|
|
|
@ -1174,7 +1174,7 @@ static void test_PathAddBackslash(void)
|
|
|
|
|
str = PathAddBackslashA(path);
|
|
|
|
|
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(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError());
|
|
|
|
|
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
|
|
|
|
|
|
|
|
|
|
/* try periods */
|
|
|
|
|
lstrcpyA(path, "one\\..\\two");
|
|
|
|
@ -1182,7 +1182,7 @@ static void test_PathAddBackslash(void)
|
|
|
|
|
str = PathAddBackslashA(path);
|
|
|
|
|
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(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError());
|
|
|
|
|
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
|
|
|
|
|
|
|
|
|
|
/* try just a space */
|
|
|
|
|
lstrcpyA(path, " ");
|
|
|
|
@ -1190,7 +1190,7 @@ static void test_PathAddBackslash(void)
|
|
|
|
|
str = PathAddBackslashA(path);
|
|
|
|
|
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(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError());
|
|
|
|
|
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
|
|
|
|
|
|
|
|
|
|
/* path already has backslash */
|
|
|
|
|
lstrcpyA(path, "C:\\one\\");
|
|
|
|
@ -1198,7 +1198,7 @@ static void test_PathAddBackslash(void)
|
|
|
|
|
str = PathAddBackslashA(path);
|
|
|
|
|
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(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError());
|
|
|
|
|
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
|
|
|
|
|
|
|
|
|
|
memset(too_long, 'a', LONG_LEN);
|
|
|
|
|
too_long[LONG_LEN - 1] = '\0';
|
|
|
|
@ -1207,7 +1207,7 @@ static void test_PathAddBackslash(void)
|
|
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
|
str = PathAddBackslashA(too_long);
|
|
|
|
|
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)
|
|
|
|
@ -1223,28 +1223,28 @@ static void test_PathAppendA(void)
|
|
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
|
res = PathAppendA(path, NULL);
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
/* try empty pszMore */
|
|
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
|
res = PathAppendA(path, "");
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
/* try NULL pszPath */
|
|
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
|
res = PathAppendA(NULL, "two\\three");
|
|
|
|
|
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 */
|
|
|
|
|
path[0] = '\0';
|
|
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
|
res = PathAppendA(path, "two\\three");
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
/* try empty pszPath and empty pszMore */
|
|
|
|
@ -1252,7 +1252,7 @@ static void test_PathAppendA(void)
|
|
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
|
res = PathAppendA(path, "");
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
/* try legit params */
|
|
|
|
@ -1260,7 +1260,7 @@ static void test_PathAppendA(void)
|
|
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
|
res = PathAppendA(path, "two\\three");
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
/* try pszPath with backslash after it */
|
|
|
|
@ -1268,7 +1268,7 @@ static void test_PathAppendA(void)
|
|
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
|
res = PathAppendA(path, "two\\three");
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
/* try pszMore with backslash before it */
|
|
|
|
@ -1276,7 +1276,7 @@ static void test_PathAppendA(void)
|
|
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
|
res = PathAppendA(path, "\\two\\three");
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
/* try pszMore with backslash after it */
|
|
|
|
@ -1284,7 +1284,7 @@ static void test_PathAppendA(void)
|
|
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
|
res = PathAppendA(path, "two\\three\\");
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
/* try spaces in pszPath */
|
|
|
|
@ -1292,7 +1292,7 @@ static void test_PathAppendA(void)
|
|
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
|
res = PathAppendA(path, "two\\three");
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
/* try spaces in pszMore */
|
|
|
|
@ -1300,7 +1300,7 @@ static void test_PathAppendA(void)
|
|
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
|
res = PathAppendA(path, " two \\ three ");
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
/* pszPath is too long */
|
|
|
|
@ -1311,7 +1311,7 @@ static void test_PathAppendA(void)
|
|
|
|
|
todo_wine
|
|
|
|
|
{
|
|
|
|
|
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));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1324,7 +1324,7 @@ static void test_PathAppendA(void)
|
|
|
|
|
todo_wine
|
|
|
|
|
{
|
|
|
|
|
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));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1340,7 +1340,7 @@ static void test_PathAppendA(void)
|
|
|
|
|
ok(!res, "Expected failure\n");
|
|
|
|
|
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)
|
|
|
|
@ -1355,7 +1355,7 @@ static void test_PathCanonicalizeA(void)
|
|
|
|
|
res = PathCanonicalizeA(dest, NULL);
|
|
|
|
|
ok(!res, "Expected failure\n");
|
|
|
|
|
ok(GetLastError() == ERROR_INVALID_PARAMETER,
|
|
|
|
|
"Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
|
|
|
|
|
"Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
|
|
|
|
|
todo_wine
|
|
|
|
|
{
|
|
|
|
|
ok(!lstrcmp(dest, "test"), "Expected test, got %s\n", dest);
|
|
|
|
@ -1366,7 +1366,7 @@ static void test_PathCanonicalizeA(void)
|
|
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
|
res = PathCanonicalizeA(dest, "");
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
/* try a NULL dest */
|
|
|
|
@ -1374,14 +1374,14 @@ static void test_PathCanonicalizeA(void)
|
|
|
|
|
res = PathCanonicalizeA(NULL, "C:\\");
|
|
|
|
|
ok(!res, "Expected failure\n");
|
|
|
|
|
ok(GetLastError() == ERROR_INVALID_PARAMETER,
|
|
|
|
|
"Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
|
|
|
|
|
"Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
|
|
|
|
|
|
|
|
|
|
/* try empty dest */
|
|
|
|
|
dest[0] = '\0';
|
|
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
|
res = PathCanonicalizeA(dest, "C:\\");
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
/* try non-empty dest */
|
|
|
|
@ -1389,7 +1389,7 @@ static void test_PathCanonicalizeA(void)
|
|
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
|
res = PathCanonicalizeA(dest, "C:\\");
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
/* try a space for source */
|
|
|
|
@ -1397,7 +1397,7 @@ static void test_PathCanonicalizeA(void)
|
|
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
|
res = PathCanonicalizeA(dest, " ");
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
/* try a relative path */
|
|
|
|
@ -1405,7 +1405,7 @@ static void test_PathCanonicalizeA(void)
|
|
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
|
res = PathCanonicalizeA(dest, "one\\two");
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
/* try current dir and previous dir */
|
|
|
|
@ -1413,7 +1413,7 @@ static void test_PathCanonicalizeA(void)
|
|
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
|
res = PathCanonicalizeA(dest, "C:\\one\\.\\..\\two\\three\\..");
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
/* try simple forward slashes */
|
|
|
|
@ -1421,7 +1421,7 @@ static void test_PathCanonicalizeA(void)
|
|
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
|
res = PathCanonicalizeA(dest, "C:\\one/two/three\\four/five\\six");
|
|
|
|
|
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"),
|
|
|
|
|
"Expected C:\\one/two/three\\four/five\\six, got %s\n", dest);
|
|
|
|
|
|
|
|
|
@ -1430,7 +1430,7 @@ static void test_PathCanonicalizeA(void)
|
|
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
|
res = PathCanonicalizeA(dest, "C:\\one/.\\two");
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
/* try simple forward slashes with change dir */
|
|
|
|
@ -1438,7 +1438,7 @@ static void test_PathCanonicalizeA(void)
|
|
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
|
res = PathCanonicalizeA(dest, "C:\\one/.\\two\\..");
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
/* try forward slashes with change dirs
|
|
|
|
@ -1449,7 +1449,7 @@ static void test_PathCanonicalizeA(void)
|
|
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
|
res = PathCanonicalizeA(dest, "C:\\one/.\\..\\two/three\\..\\four/.five");
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
/* try src is too long */
|
|
|
|
@ -1461,7 +1461,7 @@ static void test_PathCanonicalizeA(void)
|
|
|
|
|
todo_wine
|
|
|
|
|
{
|
|
|
|
|
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));
|
|
|
|
|
}
|
|
|
|
@ -1476,7 +1476,7 @@ static void test_PathFindExtensionA(void)
|
|
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
|
ext = PathFindExtensionA(NULL);
|
|
|
|
|
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 */
|
|
|
|
|
path[0] = '\0';
|
|
|
|
@ -1484,7 +1484,7 @@ static void test_PathFindExtensionA(void)
|
|
|
|
|
ext = PathFindExtensionA(path);
|
|
|
|
|
ok(ext == path, "Expected ext == path, got %p\n", 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 */
|
|
|
|
|
lstrcpy(path, "file");
|
|
|
|
@ -1492,7 +1492,7 @@ static void test_PathFindExtensionA(void)
|
|
|
|
|
ext = PathFindExtensionA(path);
|
|
|
|
|
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(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError());
|
|
|
|
|
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
|
|
|
|
|
|
|
|
|
|
/* try a path with an extension */
|
|
|
|
|
lstrcpy(path, "file.txt");
|
|
|
|
@ -1501,7 +1501,7 @@ static void test_PathFindExtensionA(void)
|
|
|
|
|
ok(ext == path + lstrlen("file"),
|
|
|
|
|
"Expected ext == path + lstrlen(\"file\"), got %p\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 */
|
|
|
|
|
lstrcpy(path, "file.txt.doc");
|
|
|
|
@ -1510,7 +1510,7 @@ static void test_PathFindExtensionA(void)
|
|
|
|
|
ok(ext == path + lstrlen("file.txt"),
|
|
|
|
|
"Expected ext == path + lstrlen(\"file.txt\"), got %p\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*/
|
|
|
|
|
memset(too_long, 'a', LONG_LEN);
|
|
|
|
@ -1518,7 +1518,7 @@ static void test_PathFindExtensionA(void)
|
|
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
|
ext = PathFindExtensionA(too_long);
|
|
|
|
|
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*/
|
|
|
|
|
memset(too_long, 'a', LONG_LEN);
|
|
|
|
@ -1529,7 +1529,7 @@ static void test_PathFindExtensionA(void)
|
|
|
|
|
ext = PathFindExtensionA(too_long);
|
|
|
|
|
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(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError());
|
|
|
|
|
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void test_PathBuildRootA(void)
|
|
|
|
@ -1552,7 +1552,7 @@ static void test_PathBuildRootA(void)
|
|
|
|
|
root = PathBuildRootA(path, j);
|
|
|
|
|
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(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError());
|
|
|
|
|
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* test a negative drive number */
|
|
|
|
@ -1561,7 +1561,7 @@ static void test_PathBuildRootA(void)
|
|
|
|
|
root = PathBuildRootA(path, -1);
|
|
|
|
|
ok(root == path, "Expected root == path, got %p\n", root);
|
|
|
|
|
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 */
|
|
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
@ -1569,7 +1569,7 @@ static void test_PathBuildRootA(void)
|
|
|
|
|
root = PathBuildRootA(path, 26);
|
|
|
|
|
ok(root == path, "Expected root == path, got %p\n", root);
|
|
|
|
|
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 */
|
|
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
@ -1577,13 +1577,13 @@ static void test_PathBuildRootA(void)
|
|
|
|
|
root = PathBuildRootA(path, 0);
|
|
|
|
|
ok(root == path, "Expected root == path, got %p\n", root);
|
|
|
|
|
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 */
|
|
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
|
root = PathBuildRootA(NULL, 0);
|
|
|
|
|
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)
|
|
|
|
@ -1603,7 +1603,7 @@ static void test_PathCommonPrefixA(void)
|
|
|
|
|
ok(!lstrcmp(out, "aaa"), "Expected aaa, got %s\n", out);
|
|
|
|
|
}
|
|
|
|
|
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 */
|
|
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
@ -1616,7 +1616,7 @@ static void test_PathCommonPrefixA(void)
|
|
|
|
|
ok(!lstrcmp(out, "aaa"), "Expected aaa, got %s\n", out);
|
|
|
|
|
}
|
|
|
|
|
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 */
|
|
|
|
|
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(path1) == 0, "Expected 0 length path1, got %i\n", lstrlen(path1));
|
|
|
|
|
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 */
|
|
|
|
|
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(path2) == 0, "Expected 0 length path2, got %i\n", lstrlen(path2));
|
|
|
|
|
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 */
|
|
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
@ -1650,7 +1650,7 @@ static void test_PathCommonPrefixA(void)
|
|
|
|
|
ok(count == 3, "Expected 3, got %i\n", count);
|
|
|
|
|
ok(!lstrcmp(path1, "C:\\"), "Expected C:\\, got %s\n", path1);
|
|
|
|
|
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 */
|
|
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
@ -1662,7 +1662,7 @@ static void test_PathCommonPrefixA(void)
|
|
|
|
|
ok(!lstrcmp(path1, "C:\\"), "Expected C:\\, got %s\n", path1);
|
|
|
|
|
ok(!lstrcmp(path2, "C:\\"), "Expected C:\\, got %s\n", path2);
|
|
|
|
|
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 */
|
|
|
|
|
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(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(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError());
|
|
|
|
|
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
|
|
|
|
|
|
|
|
|
|
/* try . prefix */
|
|
|
|
|
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(path2, "one\\.three"), "Expected one\\.three, got %s\n", path2);
|
|
|
|
|
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 */
|
|
|
|
|
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(path2, "one\\..three"), "Expected one\\..three, got %s\n", path2);
|
|
|
|
|
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 */
|
|
|
|
|
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(path2, "one\\...three"), "Expected one\\...three, got %s\n", path2);
|
|
|
|
|
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 */
|
|
|
|
|
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(path2, "one\\.\\three"), "Expected one\\.\\three, got %s\n", path2);
|
|
|
|
|
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 */
|
|
|
|
|
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(path2, "one\\..\\three"), "Expected one\\..\\three, got %s\n", path2);
|
|
|
|
|
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 */
|
|
|
|
|
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(path2, "one\\...\\three"), "Expected one\\...\\three, got %s\n", path2);
|
|
|
|
|
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 */
|
|
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
@ -1758,7 +1758,7 @@ static void test_PathCommonPrefixA(void)
|
|
|
|
|
ok(!lstrcmp(path1, "same"), "Expected same, got %s\n", path1);
|
|
|
|
|
ok(!lstrcmp(path2, "same"), "Expected same, got %s\n", path2);
|
|
|
|
|
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 */
|
|
|
|
|
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(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(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError());
|
|
|
|
|
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
|
|
|
|
|
|
|
|
|
|
/* try . in the middle of a directory */
|
|
|
|
|
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(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(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError());
|
|
|
|
|
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", GetLastError());
|
|
|
|
|
|
|
|
|
|
/* try comparing a .. with the expanded path */
|
|
|
|
|
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(path2, "two"), "Expected two, got %s\n", path2);
|
|
|
|
|
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)
|
|
|
|
|