2 * XMLLite IXmlReader tests
4 * Copyright 2010 (C) Nikolay Sivov
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
30 #include "wine/test.h"
32 DEFINE_GUID(IID_IXmlReader, 0x7279fc81, 0x709d, 0x4095, 0xb6, 0x3d, 0x69,
33 0xfe, 0x4b, 0x0d, 0x90, 0x30);
35 HRESULT WINAPI (*pCreateXmlReader)(REFIID riid, void **ppvObject, IMalloc *pMalloc);
37 static BOOL init_pointers(void)
39 /* don't free module here, it's to be unloaded on exit */
40 HMODULE mod = LoadLibraryA("xmllite.dll");
44 win_skip("xmllite library not available\n");
48 pCreateXmlReader = (void*)GetProcAddress(mod, "CreateXmlReader");
49 if (!pCreateXmlReader) return FALSE;
54 static void test_reader_create(void)
63 hr = pCreateXmlReader(&IID_IXmlReader, NULL, NULL);
64 hr = pCreateXmlReader(NULL, (LPVOID*)&reader, NULL);
67 hr = pCreateXmlReader(&IID_IXmlReader, (LPVOID*)&reader, NULL);
68 todo_wine ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
71 skip("Failed to create IXmlReader instance\n");
75 hr = CoGetMalloc(1, &imalloc);
76 ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
78 hr = IMalloc_DidAlloc(imalloc, reader);
79 ok(hr != 1, "Expected 0 or -1, got %08x\n", hr);
81 IXmlReader_Release(reader);
88 r = CoInitialize( NULL );
89 ok( r == S_OK, "failed to init com\n");