msi: Make opening and closing 4000 handle into two tests, not 20000.

This commit is contained in:
Mike McCormack 2006-09-01 17:30:49 +09:00 committed by Alexandre Julliard
parent bb1276425f
commit 12baa13ba5
1 changed files with 8 additions and 7 deletions

View File

@ -1371,22 +1371,23 @@ static void test_handle_limit(void)
static char szQueryBuf[256] = "SELECT * from `_Tables`"; static char szQueryBuf[256] = "SELECT * from `_Tables`";
hviews[i] = 0xdeadbeeb; hviews[i] = 0xdeadbeeb;
r = MsiDatabaseOpenView(hdb, szQueryBuf, &hviews[i]); r = MsiDatabaseOpenView(hdb, szQueryBuf, &hviews[i]);
ok( r == ERROR_SUCCESS, "failed to open query %d\n", i); if( r != ERROR_SUCCESS || hviews[i] == 0xdeadbeeb ||
ok( hviews[i] != 0xdeadbeeb, "no handle set\n"); hviews[i] == 0 || (i && (hviews[i] == hviews[i-1])))
ok( hviews[i] != 0, "%d'th handle is NULL\n", i);
if (!hviews[i])
break; break;
ok( (i == 0 || (hviews[i] != hviews[i-1])),
"got handle %p twice\n", (void *) hviews[i] );
} }
ok( i == MY_NVIEWS, "problem opening views\n");
for (i=0; i<MY_NVIEWS; i++) { for (i=0; i<MY_NVIEWS; i++) {
if (hviews[i] != 0 && hviews[i] != 0xdeadbeeb) { if (hviews[i] != 0 && hviews[i] != 0xdeadbeeb) {
r = MsiCloseHandle(hviews[i]); r = MsiCloseHandle(hviews[i]);
ok( r == ERROR_SUCCESS, "failed to close view handle %d\n", i); if (r != ERROR_SUCCESS)
break;
} }
} }
ok( i == MY_NVIEWS, "problem closing views\n");
r = MsiCloseHandle(hdb); r = MsiCloseHandle(hdb);
ok( r == ERROR_SUCCESS, "failed to close database\n"); ok( r == ERROR_SUCCESS, "failed to close database\n");
} }