winmm/tests: Change the current directory to a place that will be writable.

Francois Gouget fgouget at codeweavers.com
Mon Feb 24 16:56:50 CST 2014


---

This should fix bug 32777.
http://bugs.winehq.com/show_bug.cgi?id=32777

 dlls/winmm/tests/mci.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/dlls/winmm/tests/mci.c b/dlls/winmm/tests/mci.c
index 6a68b41..c162fce 100644
--- a/dlls/winmm/tests/mci.c
+++ b/dlls/winmm/tests/mci.c
@@ -1297,8 +1297,14 @@ static void test_AutoOpenWAVE(HWND hwnd)
 
 START_TEST(mci)
 {
+    char curdir[MAX_PATH], tmpdir[MAX_PATH];
     MCIERROR err;
     HWND hwnd;
+
+    GetCurrentDirectoryA(MAX_PATH, curdir);
+    GetTempPathA(MAX_PATH, tmpdir);
+    SetCurrentDirectoryA(tmpdir);
+
     hwnd = CreateWindowExA(0, "static", "winmm test", WS_POPUP, 0,0,100,100,
                            0, 0, 0, NULL);
     test_mciParser(hwnd);
@@ -1315,4 +1321,6 @@ START_TEST(mci)
     ok(!err,"final close all returned %s\n", dbg_mcierr(err));
     ok(DeleteFileA("tempfile.wav") || ok_saved, "Delete tempfile.wav (cause auto-open?)\n");
     DestroyWindow(hwnd);
+
+    SetCurrentDirectoryA(curdir);
 }
-- 
1.8.5.3




More information about the wine-patches mailing list