Paul Vriens : msi/tests: Make sure we only create one logfile.

Alexandre Julliard julliard at winehq.org
Tue Jun 9 10:45:26 CDT 2009


Module: wine
Branch: master
Commit: 9b6cf226077244631fc987373ea99744c6f0a51e
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=9b6cf226077244631fc987373ea99744c6f0a51e

Author: Paul Vriens <Paul.Vriens.Wine at gmail.com>
Date:   Mon Jun  8 21:01:15 2009 +0200

msi/tests: Make sure we only create one logfile.

---

 dlls/msi/tests/install.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/dlls/msi/tests/install.c b/dlls/msi/tests/install.c
index a554e34..de63ba2 100644
--- a/dlls/msi/tests/install.c
+++ b/dlls/msi/tests/install.c
@@ -5688,7 +5688,7 @@ static void test_propcase(void)
 START_TEST(install)
 {
     DWORD len;
-    char temp_path[MAX_PATH], prev_path[MAX_PATH];
+    char temp_path[MAX_PATH], prev_path[MAX_PATH], log_file[MAX_PATH];
     STATEMGRSTATUS status;
     BOOL ret = FALSE;
 
@@ -5718,9 +5718,13 @@ START_TEST(install)
     }
 
     /* Create only one log file and don't append. We have to pass something
-     * for the log mode for this to work.
+     * for the log mode for this to work. The logfile needs to have an absolute
+     * path otherwise we still end up with some extra logfiles as some tests
+     * change the current directory.
      */
-    MsiEnableLogA(INSTALLLOGMODE_FATALEXIT, "msitest.log", 0);
+    lstrcpyA(log_file, temp_path);
+    lstrcatA(log_file, "\\msitest.log");
+    MsiEnableLogA(INSTALLLOGMODE_FATALEXIT, log_file, 0);
 
     test_MsiInstallProduct();
     test_MsiSetComponentState();
@@ -5761,7 +5765,7 @@ START_TEST(install)
     test_adminimage();
     test_propcase();
 
-    DeleteFileA("msitest.log");
+    DeleteFileA(log_file);
 
     if (pSRSetRestorePointA && ret)
     {




More information about the wine-cvs mailing list