Paul Vriens : shlwapi/tests: Don't crash on NT4.

Alexandre Julliard julliard at winehq.org
Thu Oct 9 07:42:37 CDT 2008


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

Author: Paul Vriens <Paul.Vriens.Wine at gmail.com>
Date:   Wed Oct  8 17:28:54 2008 +0200

shlwapi/tests: Don't crash on NT4.

---

 dlls/shlwapi/tests/istream.c |   52 +++++++++++++++++++++++++----------------
 1 files changed, 32 insertions(+), 20 deletions(-)

diff --git a/dlls/shlwapi/tests/istream.c b/dlls/shlwapi/tests/istream.c
index 6aa4f54..66465b8 100644
--- a/dlls/shlwapi/tests/istream.c
+++ b/dlls/shlwapi/tests/istream.c
@@ -306,17 +306,23 @@ static void test_SHCreateStreamOnFileW(DWORD mode, DWORD stgm)
 
     /* invalid arguments */
 
-    stream = NULL;
-    ret = (*pSHCreateStreamOnFileW)(NULL, mode | stgm, &stream);
-    ok(ret == HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND) || /* XP */
-       ret == E_INVALIDARG /* Vista */,
-      "SHCreateStreamOnFileW: expected HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND) or E_INVALIDARG, got 0x%08x\n", ret);
-    ok(stream == NULL, "SHCreateStreamOnFileW: expected a NULL IStream object, got %p\n", stream);
+    if (0)
+    {
+        /* Crashes on NT4 */
+        stream = NULL;
+        ret = (*pSHCreateStreamOnFileW)(NULL, mode | stgm, &stream);
+        ok(ret == HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND) || /* XP */
+           ret == E_INVALIDARG /* Vista */,
+          "SHCreateStreamOnFileW: expected HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND) or E_INVALIDARG, got 0x%08x\n", ret);
+        ok(stream == NULL, "SHCreateStreamOnFileW: expected a NULL IStream object, got %p\n", stream);
+    }
 
-#if 0 /* This test crashes on WinXP SP2 */
-    ret = (*pSHCreateStreamOnFileW)(test_file, mode | stgm, NULL);
-    ok(ret == E_INVALIDARG, "SHCreateStreamOnFileW: expected E_INVALIDARG, got 0x%08x\n", ret);
-#endif
+    if (0)
+    {
+        /* This test crashes on WinXP SP2 */
+            ret = (*pSHCreateStreamOnFileW)(test_file, mode | stgm, NULL);
+            ok(ret == E_INVALIDARG, "SHCreateStreamOnFileW: expected E_INVALIDARG, got 0x%08x\n", ret);
+    }
 
     stream = NULL;
     ret = (*pSHCreateStreamOnFileW)(test_file, mode | STGM_CONVERT | stgm, &stream);
@@ -405,12 +411,16 @@ static void test_SHCreateStreamOnFileEx(DWORD mode, DWORD stgm)
 
     /* invalid arguments */
 
-    stream = NULL;
-    ret = (*pSHCreateStreamOnFileEx)(NULL, mode, 0, FALSE, NULL, &stream);
-    ok(ret == HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND) || /* XP */
-       ret == E_INVALIDARG /* Vista */,
-      "SHCreateStreamOnFileEx: expected HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND) or E_INVALIDARG, got 0x%08x\n", ret);
-    ok(stream == NULL, "SHCreateStreamOnFileEx: expected a NULL IStream object, got %p\n", stream);
+    if (0)
+    {
+        /* Crashes on NT4 */
+        stream = NULL;
+        ret = (*pSHCreateStreamOnFileEx)(NULL, mode, 0, FALSE, NULL, &stream);
+        ok(ret == HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND) || /* XP */
+           ret == E_INVALIDARG /* Vista */,
+          "SHCreateStreamOnFileEx: expected HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND) or E_INVALIDARG, got 0x%08x\n", ret);
+        ok(stream == NULL, "SHCreateStreamOnFileEx: expected a NULL IStream object, got %p\n", stream);
+    }
 
     stream = NULL;
     ret = (*pSHCreateStreamOnFileEx)(test_file, mode, 0, FALSE, template, &stream);
@@ -421,10 +431,12 @@ static void test_SHCreateStreamOnFileEx(DWORD mode, DWORD stgm)
 
     ok(stream == NULL, "SHCreateStreamOnFileEx: expected a NULL IStream object, got %p\n", stream);
 
-#if 0 /* This test crashes on WinXP SP2 */
-    ret = (*pSHCreateStreamOnFileEx)(test_file, mode, 0, FALSE, NULL, NULL);
-    ok(ret == E_INVALIDARG, "SHCreateStreamOnFileEx: expected E_INVALIDARG, got 0x%08x\n", ret);
-#endif
+    if (0)
+    {
+        /* This test crashes on WinXP SP2 */
+        ret = (*pSHCreateStreamOnFileEx)(test_file, mode, 0, FALSE, NULL, NULL);
+        ok(ret == E_INVALIDARG, "SHCreateStreamOnFileEx: expected E_INVALIDARG, got 0x%08x\n", ret);
+    }
 
     /* file does not exist */
 




More information about the wine-cvs mailing list