xmllite/tests: Add basic test structure for IXmlReader.

This commit is contained in:
Nikolay Sivov 2010-01-19 00:05:53 +03:00 committed by Alexandre Julliard
parent ea762fd2a4
commit 80a546cad5
7 changed files with 163 additions and 1 deletions

9
configure vendored
View File

@ -17408,6 +17408,14 @@ ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
dlls/xmllite/Makefile: dlls/xmllite/Makefile.in dlls/Makedll.rules" dlls/xmllite/Makefile: dlls/xmllite/Makefile.in dlls/Makedll.rules"
ac_config_files="$ac_config_files dlls/xmllite/Makefile" ac_config_files="$ac_config_files dlls/xmllite/Makefile"
ALL_MAKEFILES="$ALL_MAKEFILES \\
dlls/xmllite/tests/Makefile"
test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\
xmllite/tests"
ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
dlls/xmllite/tests/Makefile: dlls/xmllite/tests/Makefile.in dlls/Maketest.rules"
ac_config_files="$ac_config_files dlls/xmllite/tests/Makefile"
ALL_MAKEFILES="$ALL_MAKEFILES \\ ALL_MAKEFILES="$ALL_MAKEFILES \\
documentation/Makefile" documentation/Makefile"
test "x$enable_documentation" != xno && ALL_TOP_DIRS="$ALL_TOP_DIRS \\ test "x$enable_documentation" != xno && ALL_TOP_DIRS="$ALL_TOP_DIRS \\
@ -19218,6 +19226,7 @@ do
"dlls/xinput1_3/tests/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/xinput1_3/tests/Makefile" ;; "dlls/xinput1_3/tests/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/xinput1_3/tests/Makefile" ;;
"dlls/xinput9_1_0/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/xinput9_1_0/Makefile" ;; "dlls/xinput9_1_0/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/xinput9_1_0/Makefile" ;;
"dlls/xmllite/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/xmllite/Makefile" ;; "dlls/xmllite/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/xmllite/Makefile" ;;
"dlls/xmllite/tests/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/xmllite/tests/Makefile" ;;
"documentation/Makefile") CONFIG_FILES="$CONFIG_FILES documentation/Makefile" ;; "documentation/Makefile") CONFIG_FILES="$CONFIG_FILES documentation/Makefile" ;;
"fonts/Makefile") CONFIG_FILES="$CONFIG_FILES fonts/Makefile" ;; "fonts/Makefile") CONFIG_FILES="$CONFIG_FILES fonts/Makefile" ;;
"include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;;

View File

@ -2587,6 +2587,7 @@ WINE_CONFIG_MAKEFILE([dlls/xinput1_3/Makefile],[dlls/Makedll.rules],[dlls],[ALL_
WINE_CONFIG_MAKEFILE([dlls/xinput1_3/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/xinput1_3/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests])
WINE_CONFIG_MAKEFILE([dlls/xinput9_1_0/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/xinput9_1_0/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS])
WINE_CONFIG_MAKEFILE([dlls/xmllite/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/xmllite/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS])
WINE_CONFIG_MAKEFILE([dlls/xmllite/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests])
WINE_CONFIG_MAKEFILE([documentation/Makefile],[Make.rules],[],[ALL_TOP_DIRS]) WINE_CONFIG_MAKEFILE([documentation/Makefile],[Make.rules],[],[ALL_TOP_DIRS])
WINE_CONFIG_MAKEFILE([fonts/Makefile],[Make.rules],[],[ALL_TOP_DIRS]) WINE_CONFIG_MAKEFILE([fonts/Makefile],[Make.rules],[],[ALL_TOP_DIRS])
WINE_CONFIG_MAKEFILE([include/Makefile],[Make.rules],[],[ALL_TOP_DIRS]) WINE_CONFIG_MAKEFILE([include/Makefile],[Make.rules],[],[ALL_TOP_DIRS])

View File

@ -6,6 +6,7 @@ MODULE = xmllite.dll
IMPORTS = kernel32 IMPORTS = kernel32
C_SRCS = \ C_SRCS = \
reader.c \
xmllite_main.c xmllite_main.c
@MAKE_DLL_RULES@ @MAKE_DLL_RULES@

38
dlls/xmllite/reader.c Normal file
View File

@ -0,0 +1,38 @@
/*
* IXmlReader implementation
*
* Copyright 2010 Nikolay Sivov
*
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#define COBJMACROS
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "initguid.h"
#include "objbase.h"
#include "xmllite.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(xmllite);
HRESULT WINAPI CreateXmlReader(REFIID riid, void **pObject, IMalloc *pMalloc)
{
FIXME("(%s, %p, %p)\n", wine_dbgstr_guid(riid), pObject, pMalloc);
return E_NOTIMPL;
}

View File

@ -0,0 +1,13 @@
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../../..
SRCDIR = @srcdir@
VPATH = @srcdir@
TESTDLL = xmllite.dll
IMPORTS = kernel32 ole32
CTESTS = \
reader.c
@MAKE_TEST_RULES@
@DEPENDENCIES@ # everything below this line is overwritten by make depend

100
dlls/xmllite/tests/reader.c Normal file
View File

@ -0,0 +1,100 @@
/*
* XMLLite IXmlReader tests
*
* Copyright 2010 (C) Nikolay Sivov
*
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#define COBJMACROS
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "ole2.h"
#include "xmllite.h"
#include "initguid.h"
#include "wine/test.h"
DEFINE_GUID(IID_IXmlReader, 0x7279fc81, 0x709d, 0x4095, 0xb6, 0x3d, 0x69,
0xfe, 0x4b, 0x0d, 0x90, 0x30);
HRESULT WINAPI (*pCreateXmlReader)(REFIID riid, void **ppvObject, IMalloc *pMalloc);
static BOOL init_pointers(void)
{
/* don't free module here, it's to be unloaded on exit */
HMODULE mod = LoadLibraryA("xmllite.dll");
if (!mod)
{
win_skip("xmllite library not available\n");
return FALSE;
}
pCreateXmlReader = (void*)GetProcAddress(mod, "CreateXmlReader");
if (!pCreateXmlReader) return FALSE;
return TRUE;
}
static void test_reader_create(void)
{
HRESULT hr;
IXmlReader *reader;
IMalloc *imalloc;
/* crashes native */
if (0)
{
hr = pCreateXmlReader(&IID_IXmlReader, NULL, NULL);
hr = pCreateXmlReader(NULL, (LPVOID*)&reader, NULL);
}
hr = pCreateXmlReader(&IID_IXmlReader, (LPVOID*)&reader, NULL);
todo_wine ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
if (hr != S_OK)
{
skip("Failed to create IXmlReader instance\n");
return;
}
hr = CoGetMalloc(1, &imalloc);
ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
hr = IMalloc_DidAlloc(imalloc, reader);
ok(hr != 1, "Expected 0 or -1, got %08x\n", hr);
IXmlReader_Release(reader);
}
START_TEST(reader)
{
HRESULT r;
r = CoInitialize( NULL );
ok( r == S_OK, "failed to init com\n");
if (!init_pointers())
{
CoUninitialize();
return;
}
test_reader_create();
CoUninitialize();
}

View File

@ -1,4 +1,4 @@
@ stub CreateXmlReader @ stdcall CreateXmlReader(ptr ptr ptr)
@ stub CreateXmlReaderInputWithEncodingCodePage @ stub CreateXmlReaderInputWithEncodingCodePage
@ stub CreateXmlReaderInputWithEncodingName @ stub CreateXmlReaderInputWithEncodingName
@ stub CreateXmlWriter @ stub CreateXmlWriter