Commit c76de898 authored by Alexandre Julliard's avatar Alexandre Julliard

oleaut32/tests: Store the test typelib in resources instead of depending on an external file.

parent 046cfcfd
......@@ -29,3 +29,6 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
/* @makedep: tmarshal.tlb */
1 TYPELIB LOADONCALL DISCARDABLE tmarshal.tlb
/* @makedep: test_tlb.tlb */
2 TYPELIB LOADONCALL DISCARDABLE test_tlb.tlb
......@@ -1337,13 +1337,41 @@ static void test_dump_typelib(const char *name)
#endif
static const char *create_test_typelib(void)
{
static char filename[MAX_PATH];
HANDLE file;
HRSRC res;
void *ptr;
DWORD written;
GetTempFileNameA( ".", "tlb", 0, filename );
file = CreateFile( filename, GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0 );
ok( file != INVALID_HANDLE_VALUE, "file creation failed\n" );
if (file == INVALID_HANDLE_VALUE) return NULL;
res = FindResource( GetModuleHandle(0), MAKEINTRESOURCE(2), "TYPELIB" );
ok( res != 0, "couldn't find resource\n" );
ptr = LockResource( LoadResource( GetModuleHandle(0), res ));
WriteFile( file, ptr, SizeofResource( GetModuleHandle(0), res ), &written, NULL );
ok( written == SizeofResource( GetModuleHandle(0), res ), "couldn't write resource\n" );
CloseHandle( file );
return filename;
}
START_TEST(typelib)
{
const char *filename;
ref_count_test(wszStdOle2);
test_TypeComp();
test_CreateDispTypeInfo();
test_TypeInfo();
test_QueryPathOfRegTypeLib();
test_inheritance();
test_dump_typelib("test_tlb.tlb");
if ((filename = create_test_typelib()))
{
test_dump_typelib( filename );
DeleteFile( filename );
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment