mirror of
https://github.com/reactos/reactos.git
synced 2025-05-29 22:18:13 +00:00
[SCRRUN_WINETEST] Sync with Wine Staging 2.2. CORE-12823
svn path=/trunk/; revision=73974
This commit is contained in:
parent
358d46f7c9
commit
7445284933
2 changed files with 75 additions and 0 deletions
|
@ -30,6 +30,37 @@
|
||||||
|
|
||||||
#include "scrrun.h"
|
#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 void test_interfaces(void)
|
||||||
{
|
{
|
||||||
static const WCHAR key_add[] = {'a', 0};
|
static const WCHAR key_add[] = {'a', 0};
|
||||||
|
@ -60,6 +91,8 @@ static void test_interfaces(void)
|
||||||
hr = IDispatch_QueryInterface(disp, &IID_IDispatchEx, (void**)&dispex);
|
hr = IDispatch_QueryInterface(disp, &IID_IDispatchEx, (void**)&dispex);
|
||||||
ok(hr == E_NOINTERFACE, "got 0x%08x, expected 0x%08x\n", hr, E_NOINTERFACE);
|
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_VT(&key) = VT_BSTR;
|
||||||
V_BSTR(&key) = SysAllocString(key_add);
|
V_BSTR(&key) = SysAllocString(key_add);
|
||||||
V_VT(&value) = VT_BSTR;
|
V_VT(&value) = VT_BSTR;
|
||||||
|
|
|
@ -100,6 +100,37 @@ static IDrive *get_fixed_drive(void)
|
||||||
return drive;
|
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 void test_interfaces(void)
|
||||||
{
|
{
|
||||||
static const WCHAR nonexistent_dirW[] = {
|
static const WCHAR nonexistent_dirW[] = {
|
||||||
|
@ -122,6 +153,8 @@ static void test_interfaces(void)
|
||||||
lstrcpyW(file_path, windows_path);
|
lstrcpyW(file_path, windows_path);
|
||||||
lstrcatW(file_path, file_kernel32W);
|
lstrcatW(file_path, file_kernel32W);
|
||||||
|
|
||||||
|
test_provideclassinfo(disp, &CLSID_FileSystemObject);
|
||||||
|
|
||||||
hr = IDispatch_QueryInterface(disp, &IID_IObjectWithSite, (void**)&site);
|
hr = IDispatch_QueryInterface(disp, &IID_IObjectWithSite, (void**)&site);
|
||||||
ok(hr == E_NOINTERFACE, "got 0x%08x, expected 0x%08x\n", hr, E_NOINTERFACE);
|
ok(hr == E_NOINTERFACE, "got 0x%08x, expected 0x%08x\n", hr, E_NOINTERFACE);
|
||||||
|
|
||||||
|
@ -927,6 +960,7 @@ static void test_GetFolder(void)
|
||||||
hr = IFileSystem3_GetFolder(fs3, str, &folder);
|
hr = IFileSystem3_GetFolder(fs3, str, &folder);
|
||||||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||||
SysFreeString(str);
|
SysFreeString(str);
|
||||||
|
test_provideclassinfo(folder, &CLSID_Folder);
|
||||||
IFolder_Release(folder);
|
IFolder_Release(folder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -978,6 +1012,7 @@ static void test_FolderCollection(void)
|
||||||
|
|
||||||
hr = IFolder_get_SubFolders(folder, &folders);
|
hr = IFolder_get_SubFolders(folder, &folders);
|
||||||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||||
|
test_provideclassinfo(folders, &CLSID_Folders);
|
||||||
IFolder_Release(folder);
|
IFolder_Release(folder);
|
||||||
|
|
||||||
count = 0;
|
count = 0;
|
||||||
|
@ -1153,6 +1188,7 @@ static void test_FileCollection(void)
|
||||||
|
|
||||||
hr = IFolder_get_Files(folder, &files);
|
hr = IFolder_get_Files(folder, &files);
|
||||||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||||
|
test_provideclassinfo(files, &CLSID_Files);
|
||||||
IFolder_Release(folder);
|
IFolder_Release(folder);
|
||||||
|
|
||||||
count = 0;
|
count = 0;
|
||||||
|
@ -1220,6 +1256,7 @@ static void test_FileCollection(void)
|
||||||
|
|
||||||
hr = IDispatch_QueryInterface(V_DISPATCH(&var), &IID_IFile, (void **)&file);
|
hr = IDispatch_QueryInterface(V_DISPATCH(&var), &IID_IFile, (void **)&file);
|
||||||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||||
|
test_provideclassinfo(file, &CLSID_File);
|
||||||
|
|
||||||
str = NULL;
|
str = NULL;
|
||||||
hr = IFile_get_Name(file, &str);
|
hr = IFile_get_Name(file, &str);
|
||||||
|
@ -1292,6 +1329,8 @@ static void test_DriveCollection(void)
|
||||||
hr = IFileSystem3_get_Drives(fs3, &drives);
|
hr = IFileSystem3_get_Drives(fs3, &drives);
|
||||||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||||
|
|
||||||
|
test_provideclassinfo(drives, &CLSID_Drives);
|
||||||
|
|
||||||
hr = IDriveCollection_get__NewEnum(drives, (IUnknown**)&enumvar);
|
hr = IDriveCollection_get__NewEnum(drives, (IUnknown**)&enumvar);
|
||||||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||||
|
|
||||||
|
@ -1419,6 +1458,8 @@ static void test_CreateTextFile(void)
|
||||||
hr = IFileSystem3_CreateTextFile(fs3, nameW, VARIANT_FALSE, VARIANT_FALSE, &stream);
|
hr = IFileSystem3_CreateTextFile(fs3, nameW, VARIANT_FALSE, VARIANT_FALSE, &stream);
|
||||||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||||
|
|
||||||
|
test_provideclassinfo(stream, &CLSID_TextStream);
|
||||||
|
|
||||||
hr = ITextStream_Read(stream, 1, &str);
|
hr = ITextStream_Read(stream, 1, &str);
|
||||||
ok(hr == CTL_E_BADFILEMODE, "got 0x%08x\n", hr);
|
ok(hr == CTL_E_BADFILEMODE, "got 0x%08x\n", hr);
|
||||||
|
|
||||||
|
@ -2033,6 +2074,7 @@ static void test_GetDrive(void)
|
||||||
wine_dbgstr_w(ptr->drivespec));
|
wine_dbgstr_w(ptr->drivespec));
|
||||||
SysFreeString(driveletter);
|
SysFreeString(driveletter);
|
||||||
}
|
}
|
||||||
|
test_provideclassinfo(drive, &CLSID_Drive);
|
||||||
IDrive_Release(drive);
|
IDrive_Release(drive);
|
||||||
} else
|
} else
|
||||||
ok(drive == NULL, "got %p for drive spec %s\n", drive, wine_dbgstr_w(ptr->drivespec));
|
ok(drive == NULL, "got %p for drive spec %s\n", drive, wine_dbgstr_w(ptr->drivespec));
|
||||||
|
|
Loading…
Reference in a new issue