wininet/tests: Test NULL pointer for InternetCanonicalizeUrlA.

This commit is contained in:
Detlef Riekenberg 2007-10-12 09:38:15 +02:00 committed by Alexandre Julliard
parent 9b43174f3f
commit a53df53f2b
1 changed files with 30 additions and 0 deletions

View File

@ -83,6 +83,36 @@ static void test_InternetCanonicalizeUrlA(void)
ok( res && (dwSize == urllen) && (lstrcmpA(url, buffer) == 0), ok( res && (dwSize == urllen) && (lstrcmpA(url, buffer) == 0),
"got %u and %u with size %u for '%s' (%d)\n", "got %u and %u with size %u for '%s' (%d)\n",
res, GetLastError(), dwSize, buffer, lstrlenA(buffer)); res, GetLastError(), dwSize, buffer, lstrlenA(buffer));
/* check NULL pointers */
memset(buffer, '#', urllen + 4);
buffer[urllen + 4] = '\0';
dwSize = urllen+1;
SetLastError(0xdeadbeef);
res = InternetCanonicalizeUrlA(NULL, buffer, &dwSize, 0);
ok( !res && (GetLastError() == ERROR_INVALID_PARAMETER),
"got %u and %u with size %u for '%s' (%d)\n",
res, GetLastError(), dwSize, buffer, lstrlenA(buffer));
memset(buffer, '#', urllen + 4);
buffer[urllen + 4] = '\0';
dwSize = urllen+1;
SetLastError(0xdeadbeef);
res = InternetCanonicalizeUrlA(url, NULL, &dwSize, 0);
ok( !res && (GetLastError() == ERROR_INVALID_PARAMETER),
"got %u and %u with size %u for '%s' (%d)\n",
res, GetLastError(), dwSize, buffer, lstrlenA(buffer));
memset(buffer, '#', urllen + 4);
buffer[urllen + 4] = '\0';
dwSize = urllen+1;
SetLastError(0xdeadbeef);
res = InternetCanonicalizeUrlA(url, buffer, NULL, 0);
ok( !res && (GetLastError() == ERROR_INVALID_PARAMETER),
"got %u and %u with size %u for '%s' (%d)\n",
res, GetLastError(), dwSize, buffer, lstrlenA(buffer));
} }
/* ############################### */ /* ############################### */