Nikolay Sivov : ole32/tests: A couple of tests for ReadClassStm/ ReadClassStg.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Jan 6 14:50:56 CST 2016


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

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Wed Jan  6 15:51:28 2016 +0300

ole32/tests: A couple of tests for ReadClassStm/ReadClassStg.

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ole32/tests/storage32.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/dlls/ole32/tests/storage32.c b/dlls/ole32/tests/storage32.c
index afe9332..43c0c28 100644
--- a/dlls/ole32/tests/storage32.c
+++ b/dlls/ole32/tests/storage32.c
@@ -1176,7 +1176,7 @@ static void test_writeclassstg(void)
 {
     IStorage *stg = NULL;
     HRESULT r;
-    CLSID temp_cls;
+    CLSID temp_cls, cls2;
 
     DeleteFileA(filenameA);
 
@@ -1188,6 +1188,12 @@ static void test_writeclassstg(void)
     r = ReadClassStg( NULL, NULL );
     ok(r == E_INVALIDARG, "ReadClassStg should return E_INVALIDARG instead of 0x%08X\n", r);
 
+    memset(&temp_cls, 0xcc, sizeof(temp_cls));
+    memset(&cls2, 0xcc, sizeof(cls2));
+    r = ReadClassStg( NULL, &temp_cls );
+    ok(r == E_INVALIDARG, "got 0x%08x\n", r);
+    ok(IsEqualCLSID(&temp_cls, &cls2), "got wrong clsid\n");
+
     r = ReadClassStg( stg, NULL );
     ok(r == E_INVALIDARG, "ReadClassStg should return E_INVALIDARG instead of 0x%08X\n", r);
 
@@ -1957,7 +1963,7 @@ static void test_nonroot_transacted(void)
 
 static void test_ReadClassStm(void)
 {
-    CLSID clsid;
+    CLSID clsid, clsid2;
     HRESULT hr;
     IStream *pStream;
     static const LARGE_INTEGER llZero;
@@ -1973,6 +1979,12 @@ static void test_ReadClassStm(void)
     hr = ReadClassStm(pStream, NULL);
     ok(hr == E_INVALIDARG, "ReadClassStm should have returned E_INVALIDARG instead of 0x%08x\n", hr);
 
+    memset(&clsid, 0xcc, sizeof(clsid));
+    memset(&clsid2, 0xcc, sizeof(clsid2));
+    hr = ReadClassStm(NULL, &clsid);
+    ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+    ok(IsEqualCLSID(&clsid, &clsid2), "got wrong clsid\n");
+
     /* test not rewound stream */
     hr = ReadClassStm(pStream, &clsid);
     ok(hr == STG_E_READFAULT, "ReadClassStm should have returned STG_E_READFAULT instead of 0x%08x\n", hr);




More information about the wine-cvs mailing list