wininet: Add more tests to InternetGetConnectedStateEx.

This commit is contained in:
Bruno Jesus 2014-10-24 19:36:47 -02:00 committed by Alexandre Julliard
parent f8445249a6
commit 3beee00a99
1 changed files with 58 additions and 0 deletions

View File

@ -1556,6 +1556,12 @@ todo_wine
sz = strlen(buffer);
ok(sz > 0, "Expected a connection name\n");
flags = 0;
res = pInternetGetConnectedStateExA(&flags, NULL, sizeof(buffer), 0);
todo_wine
ok(res == TRUE, "Expected TRUE, got %d\n", res);
ok(flags, "Expected at least one flag set\n");
/* no space for complete string this time */
buffer[0] = 0;
flags = 0;
@ -1564,6 +1570,13 @@ todo_wine
ok(flags, "Expected at least one flag set\n");
ok(sz - 1 == strlen(buffer), "Expected %u bytes, got %u\n", sz - 1, lstrlenA(buffer));
buffer[0] = 0;
flags = 0;
res = pInternetGetConnectedStateExA(&flags, buffer, sz / 2, 0);
ok(res == TRUE, "Expected TRUE, got %d\n", res);
ok(flags, "Expected at least one flag set\n");
ok(sz / 2 - 1 == strlen(buffer), "Expected %u bytes, got %u\n", sz / 2 - 1, lstrlenA(buffer));
buffer[0] = 0;
flags = 0;
res = pInternetGetConnectedStateExA(&flags, buffer, 1, 0);
@ -1571,6 +1584,22 @@ todo_wine
ok(res == TRUE, "Expected TRUE, got %d\n", res);
ok(flags, "Expected at least one flag set\n");
ok(strlen(buffer) == 0, "Expected 0 bytes, got %u\n", lstrlenA(buffer));
buffer[0] = 0;
flags = 0;
res = pInternetGetConnectedStateExA(&flags, buffer, 2, 0);
ok(res == TRUE, "Expected TRUE, got %d\n", res);
ok(flags, "Expected at least one flag set\n");
ok(strlen(buffer) == 1, "Expected 1 byte, got %u\n", lstrlenA(buffer));
flags = 0;
buffer[0] = 0xDE;
res = pInternetGetConnectedStateExA(&flags, buffer, 1, 0);
todo_wine
ok(res == TRUE, "Expected TRUE, got %d\n", res);
ok(flags, "Expected at least one flag set\n");
todo_wine
ok(strlen(buffer) == 0, "Expected 0 bytes, got %u\n", lstrlenA(buffer));
}
static void test_InternetGetConnectedStateExW(void)
@ -1623,6 +1652,12 @@ todo_wine
sz = lstrlenW(buffer);
ok(sz > 0, "Expected a connection name\n");
flags = 0;
res = pInternetGetConnectedStateExW(&flags, NULL, sizeof(buffer) / sizeof(buffer[0]), 0);
todo_wine
ok(res == TRUE, "Expected TRUE, got %d\n", res);
ok(flags, "Expected at least one flag set\n");
/* no space for complete string this time */
buffer[0] = 0;
flags = 0;
@ -1631,6 +1666,13 @@ todo_wine
ok(flags, "Expected at least one flag set\n");
ok(sz - 1 == lstrlenW(buffer), "Expected %u bytes, got %u\n", sz - 1, lstrlenW(buffer));
buffer[0] = 0;
flags = 0;
res = pInternetGetConnectedStateExW(&flags, buffer, sz / 2, 0);
ok(res == TRUE, "Expected TRUE, got %d\n", res);
ok(flags, "Expected at least one flag set\n");
ok(sz / 2 - 1 == lstrlenW(buffer), "Expected %u bytes, got %u\n", sz / 2 - 1, lstrlenW(buffer));
buffer[0] = 0;
flags = 0;
res = pInternetGetConnectedStateExW(&flags, buffer, 1, 0);
@ -1638,6 +1680,22 @@ todo_wine
ok(res == TRUE, "Expected TRUE, got %d\n", res);
ok(flags, "Expected at least one flag set\n");
ok(lstrlenW(buffer) == 0, "Expected 0 bytes, got %u\n", lstrlenW(buffer));
buffer[0] = 0;
flags = 0;
res = pInternetGetConnectedStateExW(&flags, buffer, 2, 0);
ok(res == TRUE, "Expected TRUE, got %d\n", res);
ok(flags, "Expected at least one flag set\n");
ok(lstrlenW(buffer) == 1, "Expected 1 byte, got %u\n", lstrlenW(buffer));
buffer[0] = 0xDEAD;
flags = 0;
res = pInternetGetConnectedStateExW(&flags, buffer, 1, 0);
todo_wine
ok(res == TRUE, "Expected TRUE, got %d\n", res);
ok(flags, "Expected at least one flag set\n");
todo_wine
ok(lstrlenW(buffer) == 0, "Expected 0 bytes, got %u\n", lstrlenW(buffer));
}
/* ############################### */