Added YUV routines needed for v4l driver, and in the future possibly
[wine/gsoc-2012-control.git] / dlls / oleaut32 / tests / typelib.c
blob6ecf5bd6e961e8d01c88cb789b5e6a48e4afd01a
1 /*
2 * ITypeLib and ITypeInfo test
4 * Copyright 2004 Jacek Caban
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #define COBJMACROS
23 #include <wine/test.h>
24 #include <stdarg.h>
26 #include "windef.h"
27 #include "winbase.h"
28 #include "oleauto.h"
30 void ref_count_test(LPCWSTR type_lib)
32 ITypeLib *iface;
33 ITypeInfo *iti1, *iti2;
34 HRESULT hRes;
35 int ref_count;
37 trace("Loading type library\n");
38 hRes = LoadTypeLib(type_lib, &iface);
39 ok(hRes == S_OK, "Could not load type library\n");
40 if(hRes != S_OK)
41 return;
43 hRes = ITypeLib_GetTypeInfo(iface, 1, &iti1);
44 ok(hRes == S_OK, "ITypeLib_GetTypeInfo failed on index = 1\n");
45 ok(ref_count=ITypeLib_Release(iface) > 0, "ITypeLib destroyed while ITypeInfo has back pointer\n");
46 if(!ref_count)
47 return;
49 hRes = ITypeLib_GetTypeInfo(iface, 1, &iti2);
50 ok(hRes == S_OK, "ITypeLib_GetTypeInfo failed on index = 1\n");
51 ok(iti1 == iti2, "ITypeLib_GetTypeInfo returned different pointers for same indexes\n");
53 ITypeLib_AddRef(iface);
54 ITypeInfo_Release(iti2);
55 ITypeInfo_Release(iti1);
56 ok(ITypeLib_Release(iface) == 0, "ITypeLib should be destroyed here.\n");
59 START_TEST(typelib)
61 static const WCHAR type_lib_olepro32[] = {'o','l','e','p','r','o','3','2','.','d','l','l',0};
62 static const WCHAR type_lib_stdole32[] = {'s','t','d','o','l','e','3','2','.','t','l','b',0};
64 ref_count_test(type_lib_olepro32);
65 ref_count_test(type_lib_stdole32);