Commit 69cf6a28 authored by Saulius Krasuckas's avatar Saulius Krasuckas Committed by Alexandre Julliard

Correct failing test and transform it into a bunch of another tests.

parent 03ede200
...@@ -330,6 +330,7 @@ static void InternetCrackUrl_test(void) ...@@ -330,6 +330,7 @@ static void InternetCrackUrl_test(void)
char protocol[32], hostName[1024], userName[1024]; char protocol[32], hostName[1024], userName[1024];
char password[1024], extra[1024], path[1024]; char password[1024], extra[1024], path[1024];
BOOL ret; BOOL ret;
DWORD GLE;
ZeroMemory(&urlSrc, sizeof(urlSrc)); ZeroMemory(&urlSrc, sizeof(urlSrc));
urlSrc.dwStructSize = sizeof(urlSrc); urlSrc.dwStructSize = sizeof(urlSrc);
...@@ -365,8 +366,55 @@ static void InternetCrackUrl_test(void) ...@@ -365,8 +366,55 @@ static void InternetCrackUrl_test(void)
ok(!strncmp(urlComponents.lpszHostName,TEST_URL2_SERVER,strlen(TEST_URL2_SERVER)),"lpszHostName should be %s but is %s\n", TEST_URL2_SERVER, urlComponents.lpszHostName); ok(!strncmp(urlComponents.lpszHostName,TEST_URL2_SERVER,strlen(TEST_URL2_SERVER)),"lpszHostName should be %s but is %s\n", TEST_URL2_SERVER, urlComponents.lpszHostName);
/*3. Check for %20 */ /*3. Check for %20 */
copy_compsA(&urlSrc, &urlComponents, 32, 1024, 1024, 1024, 2048, 0); copy_compsA(&urlSrc, &urlComponents, 32, 1024, 1024, 1024, 2048, 1024);
ok(InternetCrackUrlA(TEST_URL3, 0, ICU_DECODE, &urlComponents),"InternetCrackUrl failed with GLE 0x%lx\n",GetLastError()); ok(InternetCrackUrlA(TEST_URL3, 0, ICU_DECODE, &urlComponents),"InternetCrackUrl failed with GLE 0x%lx\n",GetLastError());
/* Tests for lpsz* members pointing to real strings while
* some corresponding length members are set to zero */
copy_compsA(&urlSrc, &urlComponents, 0, 1024, 1024, 1024, 2048, 1024);
ret = InternetCrackUrlA(TEST_URL3, 0, ICU_DECODE, &urlComponents);
ok(ret==1, "InternetCrackUrl returned %d with GLE=%ld (expected to return 1)\n",
ret, GetLastError());
copy_compsA(&urlSrc, &urlComponents, 32, 0, 1024, 1024, 2048, 1024);
ret = InternetCrackUrlA(TEST_URL3, 0, ICU_DECODE, &urlComponents);
ok(ret==1, "InternetCrackUrl returned %d with GLE=%ld (expected to return 1)\n",
ret, GetLastError());
copy_compsA(&urlSrc, &urlComponents, 32, 1024, 0, 1024, 2048, 1024);
ret = InternetCrackUrlA(TEST_URL3, 0, ICU_DECODE, &urlComponents);
ok(ret==1, "InternetCrackUrl returned %d with GLE=%ld (expected to return 1)\n",
ret, GetLastError());
copy_compsA(&urlSrc, &urlComponents, 32, 1024, 1024, 0, 2048, 1024);
ret = InternetCrackUrlA(TEST_URL3, 0, ICU_DECODE, &urlComponents);
ok(ret==1, "InternetCrackUrl returned %d with GLE=%ld (expected to return 1)\n",
ret, GetLastError());
copy_compsA(&urlSrc, &urlComponents, 32, 1024, 1024, 1024, 0, 1024);
ret = InternetCrackUrlA(TEST_URL3, 0, ICU_DECODE, &urlComponents);
GLE = GetLastError();
todo_wine
ok(ret==0 && (GLE==ERROR_INVALID_HANDLE || GLE==ERROR_INSUFFICIENT_BUFFER),
"InternetCrackUrl returned %d with GLE=%ld (expected to return 0 and ERROR_INVALID_HANDLE or ERROR_INSUFFICIENT_BUFFER)\n",
ret, GLE);
copy_compsA(&urlSrc, &urlComponents, 32, 1024, 1024, 1024, 2048, 0);
ret = InternetCrackUrlA(TEST_URL3, 0, ICU_DECODE, &urlComponents);
GLE = GetLastError();
todo_wine
ok(ret==0 && (GLE==ERROR_INVALID_HANDLE || GLE==ERROR_INSUFFICIENT_BUFFER),
"InternetCrackUrl returned %d with GLE=%ld (expected to return 0 and ERROR_INVALID_HANDLE or ERROR_INSUFFICIENT_BUFFER)\n",
ret, GLE);
copy_compsA(&urlSrc, &urlComponents, 0, 0, 0, 0, 0, 0);
ret = InternetCrackUrlA(TEST_URL3, 0, ICU_DECODE, &urlComponents);
GLE = GetLastError();
todo_wine
ok(ret==0 && GLE==ERROR_INVALID_PARAMETER,
"InternetCrackUrl returned %d with GLE=%ld (expected to return 0 and ERROR_INVALID_PARAMETER)\n",
ret, GLE);
} }
static void InternetCrackUrlW_test(void) static void InternetCrackUrlW_test(void)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment