[PATCH] msvcr90: Run the tests again on w2k and below
Detlef Riekenberg
wine.dev at web.de
Fri Apr 2 16:36:45 CDT 2010
--
By by ... Detlef
---
dlls/msvcr90/tests/msvcr90.c | 25 ++++++++++++++++++++++---
1 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/dlls/msvcr90/tests/msvcr90.c b/dlls/msvcr90/tests/msvcr90.c
index 3ff7135..20f24c3 100644
--- a/dlls/msvcr90/tests/msvcr90.c
+++ b/dlls/msvcr90/tests/msvcr90.c
@@ -38,6 +38,8 @@ static char** (__cdecl *p__sys_errlist)(void);
static __int64 (__cdecl *p_strtoi64)(const char *, char **, int);
static unsigned __int64 (__cdecl *p_strtoui64)(const char *, char **, int);
+static void* (WINAPI *pEncodePointer)(void *);
+
int cb_called[4];
/* ########## */
@@ -152,6 +154,8 @@ static void test__initterm_e(void)
}
+/* Beware that _encode_pointer is a NOP before XP
+ (the parameter is returned unchanged) */
static void test__encode_pointer(void)
{
void *ptr, *res;
@@ -166,12 +170,23 @@ static void test__encode_pointer(void)
res = p_decode_pointer(res);
ok(res == ptr, "Pointers are different after encoding and decoding\n");
+ ok(p_encoded_null() == p_encode_pointer(NULL), "Error encoding null\n");
+
ptr = p_encode_pointer(p_encode_pointer);
- res = EncodePointer(p_encode_pointer);
- ok(ptr == res, "_encode_pointer produced different result than EncodePointer\n");
ok(p_decode_pointer(ptr) == p_encode_pointer, "Error decoding pointer\n");
- ok(p_encoded_null() == p_encode_pointer(NULL), "Error encoding null\n");
+ trace("NULL -> %p\n", p_encoded_null());
+ trace("%p -> %p\n", p_encode_pointer, p_encode_pointer(p_encode_pointer));
+
+ /* Not present before XP */
+ if (!pEncodePointer) {
+ win_skip("EncodePointer not found\n");
+ return;
+ }
+
+ res = pEncodePointer(p_encode_pointer);
+ ok(ptr == res, "_encode_pointer produced different result than EncodePointer\n");
+
}
static void test_error_messages(void)
@@ -231,6 +246,7 @@ static void test__strtoi64(void)
START_TEST(msvcr90)
{
HMODULE hcrt;
+ HMODULE hkernel32;
SetLastError(0xdeadbeef);
hcrt = LoadLibraryA("msvcr90.dll");
@@ -255,6 +271,9 @@ START_TEST(msvcr90)
p_strtoi64 = (void *) GetProcAddress(hcrt, "_strtoi64");
p_strtoui64 = (void *) GetProcAddress(hcrt, "_strtoui64");
+ hkernel32 = GetModuleHandleA("kernel32.dll");
+ pEncodePointer = (void *) GetProcAddress(hkernel32, "EncodePointer");
+
test__initterm_e();
test__encode_pointer();
test_error_messages();
--
1.7.0
More information about the wine-patches
mailing list