msi/tests: Initialize a string buffer and fix some leaks.

This commit is contained in:
Hans Leidekker 2010-07-23 09:41:49 +02:00 committed by Alexandre Julliard
parent bb5ab26720
commit 148887082c
1 changed files with 4 additions and 0 deletions

View File

@ -8886,6 +8886,7 @@ static void test_createtable(void)
size = sizeof(buffer); size = sizeof(buffer);
res = MsiRecordGetString(hrec, 1, buffer, &size ); res = MsiRecordGetString(hrec, 1, buffer, &size );
todo_wine ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); todo_wine ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
MsiCloseHandle( hrec );
res = MsiViewClose( htab ); res = MsiViewClose( htab );
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
@ -8915,10 +8916,12 @@ static void test_createtable(void)
res = MsiViewGetColumnInfo( htab, MSICOLINFO_NAMES, &hrec ); res = MsiViewGetColumnInfo( htab, MSICOLINFO_NAMES, &hrec );
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
buffer[0] = 0;
size = sizeof(buffer); size = sizeof(buffer);
res = MsiRecordGetString(hrec, 1, buffer, &size ); res = MsiRecordGetString(hrec, 1, buffer, &size );
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
ok(!strcmp(buffer,"b"), "b != %s\n", buffer); ok(!strcmp(buffer,"b"), "b != %s\n", buffer);
MsiCloseHandle( hrec );
res = MsiViewClose( htab ); res = MsiViewClose( htab );
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
@ -8942,6 +8945,7 @@ static void test_createtable(void)
res = MsiViewGetColumnInfo( htab, MSICOLINFO_NAMES, &hrec ); res = MsiViewGetColumnInfo( htab, MSICOLINFO_NAMES, &hrec );
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
buffer[0] = 0;
size = sizeof(buffer); size = sizeof(buffer);
res = MsiRecordGetString(hrec, 1, buffer, &size ); res = MsiRecordGetString(hrec, 1, buffer, &size );
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);