Author: akhaldi
Date: Sun Feb 26 19:25:18 2017
New Revision: 73974
URL:
http://svn.reactos.org/svn/reactos?rev=73974&view=rev
Log:
[SCRRUN_WINETEST] Sync with Wine Staging 2.2. CORE-12823
Modified:
trunk/rostests/winetests/scrrun/dictionary.c
trunk/rostests/winetests/scrrun/filesystem.c
Modified: trunk/rostests/winetests/scrrun/dictionary.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/scrrun/dictiona…
==============================================================================
--- trunk/rostests/winetests/scrrun/dictionary.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/scrrun/dictionary.c [iso-8859-1] Sun Feb 26 19:25:18 2017
@@ -30,6 +30,37 @@
#include "scrrun.h"
+#define test_provideclassinfo(a, b) _test_provideclassinfo((IDispatch*)a, b, __LINE__)
+static void _test_provideclassinfo(IDispatch *disp, const GUID *guid, int line)
+{
+ IProvideClassInfo *classinfo;
+ TYPEATTR *attr;
+ ITypeInfo *ti;
+ IUnknown *unk;
+ HRESULT hr;
+
+ hr = IDispatch_QueryInterface(disp, &IID_IProvideClassInfo, (void
**)&classinfo);
+ ok_(__FILE__,line) (hr == S_OK, "Failed to get IProvideClassInfo, %#x.\n",
hr);
+
+ hr = IProvideClassInfo_GetClassInfo(classinfo, &ti);
+ ok_(__FILE__,line) (hr == S_OK, "GetClassInfo() failed, %#x.\n", hr);
+
+ hr = ITypeInfo_GetTypeAttr(ti, &attr);
+ ok_(__FILE__,line) (hr == S_OK, "GetTypeAttr() failed, %#x.\n", hr);
+
+ ok_(__FILE__,line) (IsEqualGUID(&attr->guid, guid), "Unexpected typeinfo
%s, expected %s\n", wine_dbgstr_guid(&attr->guid),
+ wine_dbgstr_guid(guid));
+
+ hr = IProvideClassInfo_QueryInterface(classinfo, &IID_IUnknown, (void
**)&unk);
+ ok(hr == S_OK, "Failed to QI for IUnknown.\n");
+ ok(unk == (IUnknown *)disp, "Got unk %p, original %p\n", unk, disp);
+ IUnknown_Release(unk);
+
+ IProvideClassInfo_Release(classinfo);
+ ITypeInfo_ReleaseTypeAttr(ti, attr);
+ ITypeInfo_Release(ti);
+}
+
static void test_interfaces(void)
{
static const WCHAR key_add[] = {'a', 0};
@@ -60,6 +91,8 @@
hr = IDispatch_QueryInterface(disp, &IID_IDispatchEx, (void**)&dispex);
ok(hr == E_NOINTERFACE, "got 0x%08x, expected 0x%08x\n", hr,
E_NOINTERFACE);
+ test_provideclassinfo(disp, &CLSID_Dictionary);
+
V_VT(&key) = VT_BSTR;
V_BSTR(&key) = SysAllocString(key_add);
V_VT(&value) = VT_BSTR;
Modified: trunk/rostests/winetests/scrrun/filesystem.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/scrrun/filesyst…
==============================================================================
--- trunk/rostests/winetests/scrrun/filesystem.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/scrrun/filesystem.c [iso-8859-1] Sun Feb 26 19:25:18 2017
@@ -100,6 +100,37 @@
return drive;
}
+#define test_provideclassinfo(a, b) _test_provideclassinfo((IDispatch*)a, b, __LINE__)
+static void _test_provideclassinfo(IDispatch *disp, const GUID *guid, int line)
+{
+ IProvideClassInfo *classinfo;
+ TYPEATTR *attr;
+ ITypeInfo *ti;
+ IUnknown *unk;
+ HRESULT hr;
+
+ hr = IDispatch_QueryInterface(disp, &IID_IProvideClassInfo, (void
**)&classinfo);
+ ok_(__FILE__,line) (hr == S_OK, "Failed to get IProvideClassInfo, %#x.\n",
hr);
+
+ hr = IProvideClassInfo_GetClassInfo(classinfo, &ti);
+ ok_(__FILE__,line) (hr == S_OK, "GetClassInfo() failed, %#x.\n", hr);
+
+ hr = ITypeInfo_GetTypeAttr(ti, &attr);
+ ok_(__FILE__,line) (hr == S_OK, "GetTypeAttr() failed, %#x.\n", hr);
+
+ ok_(__FILE__,line) (IsEqualGUID(&attr->guid, guid), "Unexpected typeinfo
%s, expected %s\n", wine_dbgstr_guid(&attr->guid),
+ wine_dbgstr_guid(guid));
+
+ hr = IProvideClassInfo_QueryInterface(classinfo, &IID_IUnknown, (void
**)&unk);
+ ok(hr == S_OK, "Failed to QI for IUnknown.\n");
+ ok(unk == (IUnknown *)disp, "Got unk %p, original %p.\n", unk, disp);
+ IUnknown_Release(unk);
+
+ IProvideClassInfo_Release(classinfo);
+ ITypeInfo_ReleaseTypeAttr(ti, attr);
+ ITypeInfo_Release(ti);
+}
+
static void test_interfaces(void)
{
static const WCHAR nonexistent_dirW[] = {
@@ -121,6 +152,8 @@
GetSystemDirectoryW(windows_path, MAX_PATH);
lstrcpyW(file_path, windows_path);
lstrcatW(file_path, file_kernel32W);
+
+ test_provideclassinfo(disp, &CLSID_FileSystemObject);
hr = IDispatch_QueryInterface(disp, &IID_IObjectWithSite, (void**)&site);
ok(hr == E_NOINTERFACE, "got 0x%08x, expected 0x%08x\n", hr,
E_NOINTERFACE);
@@ -927,6 +960,7 @@
hr = IFileSystem3_GetFolder(fs3, str, &folder);
ok(hr == S_OK, "got 0x%08x\n", hr);
SysFreeString(str);
+ test_provideclassinfo(folder, &CLSID_Folder);
IFolder_Release(folder);
}
@@ -978,6 +1012,7 @@
hr = IFolder_get_SubFolders(folder, &folders);
ok(hr == S_OK, "got 0x%08x\n", hr);
+ test_provideclassinfo(folders, &CLSID_Folders);
IFolder_Release(folder);
count = 0;
@@ -1153,6 +1188,7 @@
hr = IFolder_get_Files(folder, &files);
ok(hr == S_OK, "got 0x%08x\n", hr);
+ test_provideclassinfo(files, &CLSID_Files);
IFolder_Release(folder);
count = 0;
@@ -1220,6 +1256,7 @@
hr = IDispatch_QueryInterface(V_DISPATCH(&var), &IID_IFile, (void
**)&file);
ok(hr == S_OK, "got 0x%08x\n", hr);
+ test_provideclassinfo(file, &CLSID_File);
str = NULL;
hr = IFile_get_Name(file, &str);
@@ -1292,6 +1329,8 @@
hr = IFileSystem3_get_Drives(fs3, &drives);
ok(hr == S_OK, "got 0x%08x\n", hr);
+ test_provideclassinfo(drives, &CLSID_Drives);
+
hr = IDriveCollection_get__NewEnum(drives, (IUnknown**)&enumvar);
ok(hr == S_OK, "got 0x%08x\n", hr);
@@ -1418,6 +1457,8 @@
hr = IFileSystem3_CreateTextFile(fs3, nameW, VARIANT_FALSE, VARIANT_FALSE,
&stream);
ok(hr == S_OK, "got 0x%08x\n", hr);
+
+ test_provideclassinfo(stream, &CLSID_TextStream);
hr = ITextStream_Read(stream, 1, &str);
ok(hr == CTL_E_BADFILEMODE, "got 0x%08x\n", hr);
@@ -2033,6 +2074,7 @@
wine_dbgstr_w(ptr->drivespec));
SysFreeString(driveletter);
}
+ test_provideclassinfo(drive, &CLSID_Drive);
IDrive_Release(drive);
} else
ok(drive == NULL, "got %p for drive spec %s\n", drive,
wine_dbgstr_w(ptr->drivespec));