Mike McCormack : msi: Delete any databases we create at the end of each test.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Jun 12 10:02:26 CDT 2006


Module: wine
Branch: refs/heads/master
Commit: f29ec238e89325ac15243c4d26151d5cc301b266
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=f29ec238e89325ac15243c4d26151d5cc301b266

Author: Mike McCormack <mike at codeweavers.com>
Date:   Mon Jun 12 13:20:46 2006 +0900

msi: Delete any databases we create at the end of each test.

---

 dlls/msi/tests/package.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/dlls/msi/tests/package.c b/dlls/msi/tests/package.c
index e23b73c..89e0403 100644
--- a/dlls/msi/tests/package.c
+++ b/dlls/msi/tests/package.c
@@ -28,6 +28,8 @@ #include <msiquery.h>
 
 #include "wine/test.h"
 
+static const char msifile[] = "winetest.msi";
+
 static UINT run_query( MSIHANDLE hdb, const char *query )
 {
     MSIHANDLE hview = 0;
@@ -92,13 +94,12 @@ static UINT set_summary_info(MSIHANDLE h
 MSIHANDLE create_package_db(void)
 {
     MSIHANDLE hdb = 0;
-    CHAR szName[] = "winetest.msi";
     UINT res;
 
-    DeleteFile(szName);
+    DeleteFile(msifile);
 
     /* create an empty database */
-    res = MsiOpenDatabase(szName, MSIDBOPEN_CREATE, &hdb );
+    res = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb );
     ok( res == ERROR_SUCCESS , "Failed to create database\n" );
     if( res != ERROR_SUCCESS )
         return hdb;
@@ -145,6 +146,7 @@ static void test_createpackage(void)
 
     res = MsiCloseHandle( hPackage);
     ok( res == ERROR_SUCCESS , "Failed to close package\n" );
+    DeleteFile(msifile);
 }
 
 static void test_getsourcepath_bad( void )
@@ -270,6 +272,7 @@ static void test_getsourcepath( void )
     }
 
     MsiCloseHandle( hpkg );
+    DeleteFile(msifile);
 }
 
 static void test_doaction( void )
@@ -293,6 +296,7 @@ static void test_doaction( void )
     ok( r == ERROR_FUNCTION_NOT_CALLED, "wrong return val\n");
 
     MsiCloseHandle( hpkg );
+    DeleteFile(msifile);
 }
 
 static void test_gettargetpath_bad(void)
@@ -324,6 +328,7 @@ static void test_gettargetpath_bad(void)
     ok( r == ERROR_DIRECTORY, "wrong return val\n");
 
     MsiCloseHandle( hpkg );
+    DeleteFile(msifile);
 }
 
 static void test_settargetpath_bad(void)
@@ -713,6 +718,7 @@ static void test_condition(void)
     ok( r == MSICONDITION_TRUE, "wrong return val\n");
 
     MsiCloseHandle( hpkg );
+    DeleteFile(msifile);
 }
 
 static BOOL check_prop_empty( MSIHANDLE hpkg, char * prop)
@@ -835,6 +841,7 @@ static void test_props(void)
     ok( sz == 3, "wrong size returned\n");
 
     MsiCloseHandle( hpkg );
+    DeleteFile(msifile);
 }
 
 START_TEST(package)




More information about the wine-cvs mailing list