oleaut32/tests: Add tmarshal test.

This commit is contained in:
Alexandre Julliard 2007-01-22 23:18:45 +01:00
parent 8c87511109
commit aa9dcb4201
6 changed files with 1352 additions and 1 deletions

4
.gitignore vendored
View file

@ -383,6 +383,10 @@ dlls/oleaut32/oleaut32.res
dlls/oleaut32/tests/*.ok
dlls/oleaut32/tests/oleaut32_crosstest.exe
dlls/oleaut32/tests/testlist.c
dlls/oleaut32/tests/tmarshal.h
dlls/oleaut32/tests/tmarshal.res
dlls/oleaut32/tests/tmarshal.tlb
dlls/oleaut32/tests/tmarshal_i.c
dlls/olecli.dll16
dlls/olecli32/libolecli32.def
dlls/oledlg/liboledlg.def

View file

@ -4,18 +4,25 @@ SRCDIR = @srcdir@
VPATH = @srcdir@
TESTDLL = oleaut32.dll
IMPORTS = oleaut32 ole32 shlwapi rpcrt4 user32 gdi32 advapi32 kernel32
EXTRALIBS = -luuid
EXTRALIBS = -luuid -luser32
CTESTS = \
olefont.c \
olepicture.c \
safearray.c \
tmarshal.c \
typelib.c \
usrmarshal.c \
varformat.c \
vartest.c \
vartype.c
RC_SRCS = tmarshal.rc
IDL_I_SRCS = tmarshal.idl
IDL_H_SRCS = tmarshal.idl
IDL_TLB_SRCS = tmarshal.idl
@MAKE_TEST_RULES@
@DEPENDENCIES@ # everything below this line is overwritten by make depend

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,159 @@
/*
* Copyright (C) 2005 Robert Shearman
*
* 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
*
*/
#include "tmarshal_dispids.h"
import "ocidl.idl";
[
uuid(d96d8a3e-78b6-4c8d-8f27-059db959be8a),
version(1.0),
helpstring("Test Typelib")
]
library TestTypelib
{
importlib("stdole2.tlb");
typedef enum tagSTATE
{
STATE_UNWIDGETIFIED = 1,
STATE_WIDGETIFIED
} STATE;
coclass ApplicationObject2;
[
odl,
uuid(a1f8cae3-c947-4c5f-b57d-c87b9b5f3586),
oleautomation,
dual
]
interface IWidget : IDispatch
{
[propput, id(DISPID_TM_NAME)]
HRESULT Name([in] BSTR name);
[propget, id(DISPID_TM_NAME)]
HRESULT Name([out, retval] BSTR *name);
[id(DISPID_TM_DOSOMETHING)]
HRESULT DoSomething([in] double number, [out] BSTR *str1, [in, defaultvalue("")] BSTR str2, [in, optional] VARIANT *opt);
[propget, id(DISPID_TM_STATE)]
HRESULT State([out, retval] STATE *state);
[propput, id(DISPID_TM_STATE)]
HRESULT State([in] STATE state);
[id(DISPID_TM_MAP)]
HRESULT Map([in] BSTR bstrId, [out, retval] BSTR *sValue);
[id(DISPID_TM_SETOLECOLOR)]
HRESULT SetOleColor([in] OLE_COLOR val);
[id(DISPID_TM_GETOLECOLOR)]
HRESULT GetOleColor([out, retval] OLE_COLOR *pVal);
[propget, id(DISPID_TM_CLONE)]
HRESULT Clone([out, retval] IWidget **ppVal);
[propget, id(DISPID_TM_CLONEDISPATCH)]
HRESULT CloneDispatch([out, retval] IDispatch **ppVal);
[propget, id(DISPID_TM_CLONECOCLASS)]
HRESULT CloneCoclass([out, retval] ApplicationObject2 **ppVal);
[id(DISPID_VALUE)]
HRESULT Value([in] VARIANT *value, [out, retval] VARIANT *retval);
[id(DISPID_TM_ARRAY)]
HRESULT Array([in] SAFEARRAY(BSTR) values);
[id(DISPID_TM_VARARRAYPTR)]
HRESULT VariantArrayPtr([in] SAFEARRAY(VARIANT) *values);
[id(DISPID_TM_VARIANT)]
void Variant([in] VARIANT var);
[id(DISPID_TM_ERROR)]
HRESULT Error();
}
[
odl,
uuid(a028db05-30f0-4b93-b17a-41c72f831d84),
dual,
oleautomation
]
interface IKindaEnumWidget : IUnknown
{
HRESULT Next(
[out] IWidget **widget);
HRESULT Count(
[out] unsigned long *count);
HRESULT Reset();
HRESULT Clone(
[out] IKindaEnumWidget **ppenum);
}
[
odl,
uuid(a028db06-30f0-4b93-b17a-41c72f831d84),
]
interface INonOleAutomation : IUnknown
{
[id(DISPID_NOA_BSTRRET)]
BSTR BstrRet();
}
[
dllname("comm.drv"),
uuid(d377f60b-8639-4261-8ee7-75c8340d2cc9),
]
module BadModule
{
[
entry("Foo"),
]
HRESULT BadModuleFoo();
};
[
dllname("oleaut32.dll"),
uuid(d377f60c-8639-4261-8ee7-75c8340d2cc9),
]
module BadEntry
{
[
entry("Foo"),
]
HRESULT BadEntryFoo();
};
[
uuid(bb171948-10ec-407a-9a57-2f85f797ff1a),
appobject,
]
coclass ApplicationObject2
{
interface IWidget;
[source] interface IWidget;
};
};

View file

@ -0,0 +1,30 @@
/*
* Resource file for tmarshaltest
*
* Copyright 2005 Robert Shearman
*
* 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
*/
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "winnls.h"
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
#include "wine/wine_common_ver.rc"
1 TYPELIB LOADONCALL DISCARDABLE tmarshal.tlb

View file

@ -0,0 +1,34 @@
/*
* Copyright (C) 2005-2006 Robert Shearman for CodeWeavers
*
* 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 DISPID_TM_NAME 1
#define DISPID_TM_DOSOMETHING 2
#define DISPID_TM_STATE 3
#define DISPID_TM_MAP 4
#define DISPID_TM_SETOLECOLOR 5
#define DISPID_TM_GETOLECOLOR 6
#define DISPID_TM_CLONE 7
#define DISPID_TM_CLONEDISPATCH 8
#define DISPID_TM_CLONECOCLASS 9
#define DISPID_TM_ARRAY 10
#define DISPID_TM_VARARRAYPTR 11
#define DISPID_TM_VARIANT 12
#define DISPID_TM_ERROR 13
#define DISPID_NOA_BSTRRET 1