msvcp/tests: Force dll cleanup code to get executed (for valgrind).

This commit is contained in:
Piotr Caban 2014-05-08 16:45:25 +02:00 committed by Alexandre Julliard
parent 6fb5155f30
commit 73a996de01
7 changed files with 34 additions and 10 deletions

View File

@ -93,11 +93,12 @@ static void init_thiscall_thunk(void)
#endif /* __i386__ */ #endif /* __i386__ */
static HMODULE msvcp;
#define SETNOFAIL(x,y) x = (void*)GetProcAddress(msvcp,y) #define SETNOFAIL(x,y) x = (void*)GetProcAddress(msvcp,y)
#define SET(x,y) do { SETNOFAIL(x,y); ok(x != NULL, "Export '%s' not found\n", y); } while(0) #define SET(x,y) do { SETNOFAIL(x,y); ok(x != NULL, "Export '%s' not found\n", y); } while(0)
static BOOL init(void) static BOOL init(void)
{ {
HMODULE msvcp = LoadLibraryA("msvcp100.dll"); msvcp = LoadLibraryA("msvcp100.dll");
if(!msvcp) { if(!msvcp) {
win_skip("msvcp100.dll not installed\n"); win_skip("msvcp100.dll not installed\n");
return FALSE; return FALSE;
@ -200,4 +201,6 @@ START_TEST(misc)
return; return;
test__Container_base12(); test__Container_base12();
FreeLibrary(msvcp);
} }

View File

@ -83,11 +83,12 @@ static void (__thiscall *_Yarn_char_dtor)(_Yarn_char *this);
static const char* (__thiscall *_Yarn_char_c_str)(const _Yarn_char *this); static const char* (__thiscall *_Yarn_char_c_str)(const _Yarn_char *this);
static char (__thiscall *_Yarn_char_empty)(const _Yarn_char *this); static char (__thiscall *_Yarn_char_empty)(const _Yarn_char *this);
static HMODULE msvcp;
#define SETNOFAIL(x,y) x = (void*)GetProcAddress(msvcp,y) #define SETNOFAIL(x,y) x = (void*)GetProcAddress(msvcp,y)
#define SET(x,y) do { SETNOFAIL(x,y); ok(x != NULL, "Export '%s' not found\n", y); } while(0) #define SET(x,y) do { SETNOFAIL(x,y); ok(x != NULL, "Export '%s' not found\n", y); } while(0)
static BOOL init(void) static BOOL init(void)
{ {
HMODULE msvcp = LoadLibraryA("msvcp100.dll"); msvcp = LoadLibraryA("msvcp100.dll");
if(!msvcp) { if(!msvcp) {
win_skip("msvcp100.dll not installed\n"); win_skip("msvcp100.dll not installed\n");
return FALSE; return FALSE;
@ -173,4 +174,6 @@ START_TEST(string)
return; return;
test__Yarn_char(); test__Yarn_char();
FreeLibrary(msvcp);
} }

View File

@ -565,11 +565,12 @@ static void init_thiscall_thunk(void)
#endif /* __i386__ */ #endif /* __i386__ */
static HMODULE msvcp;
#define SETNOFAIL(x,y) x = (void*)GetProcAddress(msvcp,y) #define SETNOFAIL(x,y) x = (void*)GetProcAddress(msvcp,y)
#define SET(x,y) do { SETNOFAIL(x,y); ok(x != NULL, "Export '%s' not found\n", y); } while(0) #define SET(x,y) do { SETNOFAIL(x,y); ok(x != NULL, "Export '%s' not found\n", y); } while(0)
static BOOL init(void) static BOOL init(void)
{ {
HMODULE msvcp = LoadLibraryA("msvcp60.dll"); msvcp = LoadLibraryA("msvcp60.dll");
if(!msvcp) { if(!msvcp) {
win_skip("msvcp60.dll not installed\n"); win_skip("msvcp60.dll not installed\n");
return FALSE; return FALSE;
@ -1651,4 +1652,6 @@ START_TEST(ios)
test_istream_tellg(); test_istream_tellg();
test_istream_getline(); test_istream_getline();
test_ostream_print_ushort(); test_ostream_print_ushort();
FreeLibrary(msvcp);
} }

View File

@ -149,11 +149,12 @@ static void init_thiscall_thunk(void)
#endif /* __i386__ */ #endif /* __i386__ */
static HMODULE msvcp;
#define SETNOFAIL(x,y) x = (void*)GetProcAddress(msvcp,y) #define SETNOFAIL(x,y) x = (void*)GetProcAddress(msvcp,y)
#define SET(x,y) do { SETNOFAIL(x,y); ok(x != NULL, "Export '%s' not found\n", y); } while(0) #define SET(x,y) do { SETNOFAIL(x,y); ok(x != NULL, "Export '%s' not found\n", y); } while(0)
static BOOL init(void) static BOOL init(void)
{ {
HMODULE msvcp = LoadLibraryA("msvcp60.dll"); msvcp = LoadLibraryA("msvcp60.dll");
if(!msvcp) { if(!msvcp) {
win_skip("msvcp60.dll not installed\n"); win_skip("msvcp60.dll not installed\n");
return FALSE; return FALSE;
@ -701,4 +702,6 @@ START_TEST(string)
test_basic_string_char_replace(); test_basic_string_char_replace();
test_basic_string_wchar(); test_basic_string_wchar();
test_basic_string_wchar_swap(); test_basic_string_wchar_swap();
FreeLibrary(msvcp);
} }

View File

@ -590,12 +590,13 @@ static void init_thiscall_thunk(void)
#endif /* __i386__ */ #endif /* __i386__ */
static HMODULE msvcr, msvcp;
#define SETNOFAIL(x,y) x = (void*)GetProcAddress(msvcp,y) #define SETNOFAIL(x,y) x = (void*)GetProcAddress(msvcp,y)
#define SET(x,y) do { SETNOFAIL(x,y); ok(x != NULL, "Export '%s' not found\n", y); } while(0) #define SET(x,y) do { SETNOFAIL(x,y); ok(x != NULL, "Export '%s' not found\n", y); } while(0)
static BOOL init(void) static BOOL init(void)
{ {
HMODULE msvcr = LoadLibraryA("msvcr90.dll"); msvcr = LoadLibraryA("msvcr90.dll");
HMODULE msvcp = LoadLibraryA("msvcp90.dll"); msvcp = LoadLibraryA("msvcp90.dll");
if(!msvcr || !msvcp) { if(!msvcr || !msvcp) {
win_skip("msvcp90.dll or msvcrt90.dll not installed\n"); win_skip("msvcp90.dll or msvcrt90.dll not installed\n");
return FALSE; return FALSE;
@ -1969,4 +1970,7 @@ START_TEST(ios)
test_ostream_print_ushort(); test_ostream_print_ushort();
ok(!invalid_parameter, "invalid_parameter_handler was invoked too many times\n"); ok(!invalid_parameter, "invalid_parameter_handler was invoked too many times\n");
FreeLibrary(msvcr);
FreeLibrary(msvcp);
} }

View File

@ -183,12 +183,13 @@ static void init_thiscall_thunk(void)
#endif /* __i386__ */ #endif /* __i386__ */
static HMODULE msvcr, msvcp;
#define SETNOFAIL(x,y) x = (void*)GetProcAddress(msvcp,y) #define SETNOFAIL(x,y) x = (void*)GetProcAddress(msvcp,y)
#define SET(x,y) do { SETNOFAIL(x,y); ok(x != NULL, "Export '%s' not found\n", y); } while(0) #define SET(x,y) do { SETNOFAIL(x,y); ok(x != NULL, "Export '%s' not found\n", y); } while(0)
static BOOL init(void) static BOOL init(void)
{ {
HMODULE msvcr = LoadLibraryA("msvcr90.dll"); msvcr = LoadLibraryA("msvcr90.dll");
HMODULE msvcp = LoadLibraryA("msvcp90.dll"); msvcp = LoadLibraryA("msvcp90.dll");
if(!msvcr || !msvcp) { if(!msvcr || !msvcp) {
win_skip("msvcp90.dll or msvcrt90.dll not installed\n"); win_skip("msvcp90.dll or msvcrt90.dll not installed\n");
return FALSE; return FALSE;
@ -863,4 +864,7 @@ START_TEST(misc)
test_complex(); test_complex();
ok(!invalid_parameter, "invalid_parameter_handler was invoked too many times\n"); ok(!invalid_parameter, "invalid_parameter_handler was invoked too many times\n");
FreeLibrary(msvcr);
FreeLibrary(msvcp);
} }

View File

@ -170,12 +170,13 @@ static void init_thiscall_thunk(void)
#endif /* __i386__ */ #endif /* __i386__ */
static HMODULE msvcr, msvcp;
#define SETNOFAIL(x,y) x = (void*)GetProcAddress(msvcp,y) #define SETNOFAIL(x,y) x = (void*)GetProcAddress(msvcp,y)
#define SET(x,y) do { SETNOFAIL(x,y); ok(x != NULL, "Export '%s' not found\n", y); } while(0) #define SET(x,y) do { SETNOFAIL(x,y); ok(x != NULL, "Export '%s' not found\n", y); } while(0)
static BOOL init(void) static BOOL init(void)
{ {
HMODULE msvcr = LoadLibraryA("msvcr90.dll"); msvcr = LoadLibraryA("msvcr90.dll");
HMODULE msvcp = LoadLibraryA("msvcp90.dll"); msvcp = LoadLibraryA("msvcp90.dll");
if(!msvcr || !msvcp) { if(!msvcr || !msvcp) {
win_skip("msvcp90.dll or msvcrt90.dll not installed\n"); win_skip("msvcp90.dll or msvcrt90.dll not installed\n");
return FALSE; return FALSE;
@ -784,4 +785,7 @@ START_TEST(string)
test_basic_string_char_find_last_not_of(); test_basic_string_char_find_last_not_of();
ok(!invalid_parameter, "invalid_parameter_handler was invoked too many times\n"); ok(!invalid_parameter, "invalid_parameter_handler was invoked too many times\n");
FreeLibrary(msvcr);
FreeLibrary(msvcp);
} }