mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-03 00:28:29 +00:00
Added tests.
This commit is contained in:
parent
6d68a03d4f
commit
51bb3f6079
|
@ -1629,6 +1629,7 @@ dlls/mscms/Makefile
|
|||
dlls/mscms/tests/Makefile
|
||||
dlls/msdmo/Makefile
|
||||
dlls/mshtml/Makefile
|
||||
dlls/mshtml/tests/Makefile
|
||||
dlls/msi/Makefile
|
||||
dlls/msi/tests/Makefile
|
||||
dlls/msimg32/Makefile
|
||||
|
|
|
@ -18,6 +18,8 @@ C_SRCS = \
|
|||
|
||||
RC_SRCS = rsrc.rc
|
||||
|
||||
SUBDIRS = tests
|
||||
|
||||
@MAKE_DLL_RULES@
|
||||
|
||||
rsrc.res: mshtml.inf
|
||||
|
|
3
dlls/mshtml/tests/.cvsignore
Normal file
3
dlls/mshtml/tests/.cvsignore
Normal file
|
@ -0,0 +1,3 @@
|
|||
Makefile
|
||||
htmldoc.ok
|
||||
testlist.c
|
14
dlls/mshtml/tests/Makefile.in
Normal file
14
dlls/mshtml/tests/Makefile.in
Normal file
|
@ -0,0 +1,14 @@
|
|||
TOPSRCDIR = @top_srcdir@
|
||||
TOPOBJDIR = ../../..
|
||||
SRCDIR = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
TESTDLL = mshtml.dll
|
||||
IMPORTS = ole32
|
||||
EXTRALIBS = -luuid
|
||||
|
||||
CTESTS = \
|
||||
htmldoc.c
|
||||
|
||||
@MAKE_TEST_RULES@
|
||||
|
||||
### Dependencies:
|
107
dlls/mshtml/tests/htmldoc.c
Normal file
107
dlls/mshtml/tests/htmldoc.c
Normal file
|
@ -0,0 +1,107 @@
|
|||
/*
|
||||
* Copyright 2005 Jacek Caban
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#define COBJMACROS
|
||||
|
||||
#include <wine/test.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "ole2.h"
|
||||
#include "mshtml.h"
|
||||
|
||||
static void test_Persist(IUnknown *punk)
|
||||
{
|
||||
IPersistMoniker *persist_mon;
|
||||
IPersistFile *persist_file;
|
||||
GUID guid;
|
||||
HRESULT hres;
|
||||
|
||||
hres = IUnknown_QueryInterface(punk, &IID_IPersistFile, (void**)&persist_file);
|
||||
ok(hres == S_OK, "QueryInterface(IID_IPersist) failed: %08lx\n", hres);
|
||||
if(SUCCEEDED(hres)) {
|
||||
hres = IPersist_GetClassID(persist_file, NULL);
|
||||
ok(hres == E_INVALIDARG, "GetClassID returned: %08lx, expected E_INVALIDARG\n", hres);
|
||||
|
||||
hres = IPersist_GetClassID(persist_file, &guid);
|
||||
ok(hres == S_OK, "GetClassID failed: %08lx\n", hres);
|
||||
ok(IsEqualGUID(&CLSID_HTMLDocument, &guid), "guid != CLSID_HTMLDocument\n");
|
||||
|
||||
IPersist_Release(persist_file);
|
||||
}
|
||||
|
||||
hres = IUnknown_QueryInterface(punk, &IID_IPersistMoniker, (void**)&persist_mon);
|
||||
ok(hres == S_OK, "QueryInterface(IID_IPersistMoniker) failed: %08lx\n", hres);
|
||||
if(SUCCEEDED(hres)) {
|
||||
hres = IPersistMoniker_GetClassID(persist_mon, NULL);
|
||||
ok(hres == E_INVALIDARG, "GetClassID returned: %08lx, expected E_INVALIDARG\n", hres);
|
||||
|
||||
hres = IPersistMoniker_GetClassID(persist_mon, &guid);
|
||||
ok(hres == S_OK, "GetClassID failed: %08lx\n", hres);
|
||||
ok(IsEqualGUID(&CLSID_HTMLDocument, &guid), "guid != CLSID_HTMLDocument\n");
|
||||
|
||||
IPersistMoniker_Release(persist_mon);
|
||||
}
|
||||
}
|
||||
|
||||
static void test_OleObj(IUnknown *punk)
|
||||
{
|
||||
IOleObject *oleobj;
|
||||
HRESULT hres;
|
||||
GUID guid;
|
||||
|
||||
hres = IUnknown_QueryInterface(punk, &IID_IOleObject, (void**)&oleobj);
|
||||
ok(hres == S_OK, "QueryInterface(IID_IOleObject) failed: %08lx\n", hres);
|
||||
if(SUCCEEDED(hres)) {
|
||||
hres = IOleObject_GetUserClassID(oleobj, NULL);
|
||||
ok(hres == E_INVALIDARG, "GetUserClassID returned: %08lx, expected E_INVALIDARG\n", hres);
|
||||
|
||||
hres = IOleObject_GetUserClassID(oleobj, &guid);
|
||||
ok(hres == S_OK, "GetUserClassID failed: %08lx\n", hres);
|
||||
ok(IsEqualGUID(&guid, &CLSID_HTMLDocument), "guid != CLSID_HTMLDocument\n");
|
||||
|
||||
IOleObject_Release(oleobj);
|
||||
}
|
||||
}
|
||||
|
||||
static void test_HTMLDocument()
|
||||
{
|
||||
IUnknown *htmldoc_unk = NULL;
|
||||
HRESULT hres;
|
||||
|
||||
hres = CoCreateInstance(&CLSID_HTMLDocument, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER,
|
||||
&IID_IUnknown, (void**)&htmldoc_unk);
|
||||
ok(hres == S_OK, "CoCreateInstance failed: %08lx\n", hres);
|
||||
if(FAILED(hres))
|
||||
return;
|
||||
|
||||
test_Persist(htmldoc_unk);
|
||||
test_OleObj(htmldoc_unk);
|
||||
|
||||
IUnknown_Release(htmldoc_unk);
|
||||
}
|
||||
|
||||
START_TEST(htmldoc)
|
||||
{
|
||||
CoInitialize(NULL);
|
||||
|
||||
test_HTMLDocument();
|
||||
|
||||
CoUninitialize();
|
||||
}
|
Loading…
Reference in a new issue