[PATCH 2/6] msi/tests: Add missing return value checks to package tests (Coverity)
Alex Henrie
alexhenrie24 at gmail.com
Sun Jan 7 23:05:16 CST 2018
Signed-off-by: Alex Henrie <alexhenrie24 at gmail.com>
---
dlls/msi/tests/package.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/dlls/msi/tests/package.c b/dlls/msi/tests/package.c
index 002e6920cf..0f03d2f9ea 100644
--- a/dlls/msi/tests/package.c
+++ b/dlls/msi/tests/package.c
@@ -3268,7 +3268,8 @@ static void test_states(void)
add_file_entry( hdb, "'psi_file', 'psi', 'psi.txt', 100, '', '1033', 8192, 1" );
add_file_entry( hdb, "'upsilon_file', 'upsilon', 'upsilon.txt', 0, '', '1033', 16384, 1" );
- MsiDatabaseCommit(hdb);
+ r = MsiDatabaseCommit(hdb);
+ ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
/* these properties must not be in the saved msi file */
add_property_entry( hdb, "'ADDLOCAL', 'one,four'");
@@ -7056,7 +7057,8 @@ static void test_shortlongsource(void)
/* CostFinalize:long */
add_directory_entry(hdb, "'SubDir7', 'TARGETDIR', 'eleven|twelve'");
- MsiDatabaseCommit(hdb);
+ r = MsiDatabaseCommit(hdb);
+ ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r );
r = package_from_db(hdb, &hpkg);
if (r == ERROR_INSTALL_PACKAGE_REJECTED)
@@ -8553,7 +8555,8 @@ static void test_MsiEnumComponentCosts(void)
add_install_execute_sequence_entry( hdb, "'CostFinalize', '', '1000'" );
add_install_execute_sequence_entry( hdb, "'InstallValidate', '', '1100'" );
- MsiDatabaseCommit( hdb );
+ r = MsiDatabaseCommit( hdb );
+ ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r );
sprintf( package, "#%u", hdb );
r = MsiOpenPackageA( package, &hpkg );
@@ -9118,6 +9121,7 @@ static INT CALLBACK externalui_message_callback(void *context, UINT message, MSI
struct externalui_message msg;
char buffer[100];
DWORD length = 100;
+ UINT r;
int i;
msg.message = message;
@@ -9132,7 +9136,8 @@ static INT CALLBACK externalui_message_callback(void *context, UINT message, MSI
for (i = 0; i <= msg.field_count; i++)
{
length = 100;
- MsiRecordGetStringA(hrecord, i, buffer, &length);
+ r = MsiRecordGetStringA(hrecord, i, buffer, &length);
+ ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
memcpy(msg.field[i], buffer, min(100, length+1));
}
--
2.15.1
More information about the wine-devel
mailing list