Add AppDefaults app selection to control panel
[wine/gsoc-2012-control.git] / dlls / xmllite / tests / writer.c
blobaf4e1a860190293aaee14c743c4bfd0f9cd65d98
1 /*
2 * XMLLite IXmlWriter tests
4 * Copyright 2011 (C) Alistair Leslie-Hughes
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
20 #define COBJMACROS
22 #include <stdarg.h>
23 #include <stdio.h>
25 #include "windef.h"
26 #include "winbase.h"
27 #include "ole2.h"
28 #include "xmllite.h"
29 #include "wine/test.h"
31 static HRESULT (WINAPI *pCreateXmlWriter)(REFIID riid, void **ppvObject, IMalloc *pMalloc);
33 static void test_writer_create(void)
35 HRESULT hr;
36 IXmlWriter *writer;
38 /* crashes native */
39 if (0)
41 pCreateXmlWriter(&IID_IXmlWriter, NULL, NULL);
42 pCreateXmlWriter(NULL, (LPVOID*)&writer, NULL);
45 hr = pCreateXmlWriter(&IID_IXmlWriter, (LPVOID*)&writer, NULL);
46 ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
47 if(hr == S_OK)
49 IXmlWriter_Release(writer);
53 static BOOL init_pointers(void)
55 /* don't free module here, it's to be unloaded on exit */
56 HMODULE mod = LoadLibraryA("xmllite.dll");
58 if (!mod)
60 win_skip("xmllite library not available\n");
61 return FALSE;
64 #define MAKEFUNC(f) if (!(p##f = (void*)GetProcAddress(mod, #f))) return FALSE;
65 MAKEFUNC(CreateXmlWriter);
66 #undef MAKEFUNC
68 return TRUE;
71 START_TEST(writer)
73 HRESULT r;
75 r = CoInitialize( NULL );
76 ok( r == S_OK, "failed to init com\n");
78 if (!init_pointers())
80 CoUninitialize();
81 return;
84 test_writer_create();
86 CoUninitialize();