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
23 #include <wine/test.h>
30 void ref_count_test(LPCWSTR type_lib
)
33 ITypeInfo
*iti1
, *iti2
;
37 trace("Loading type library\n");
38 hRes
= LoadTypeLib(type_lib
, &iface
);
39 ok(hRes
== S_OK
, "Could not load type library\n");
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");
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");
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
);