[PATCH 2/2] msvcr90/tests: Tests for _set_abort_behavior
Detlef Riekenberg
wine.dev at web.de
Fri Jan 7 08:11:13 CST 2011
see http://testbot.winehq.org/JobDetails.pl?Key=8163
--
By by ... Detlef
---
dlls/msvcr90/tests/msvcr90.c | 33 +++++++++++++++++++++++++++++++++
1 files changed, 33 insertions(+), 0 deletions(-)
diff --git a/dlls/msvcr90/tests/msvcr90.c b/dlls/msvcr90/tests/msvcr90.c
index 24a6517..a5f8e7f 100644
--- a/dlls/msvcr90/tests/msvcr90.c
+++ b/dlls/msvcr90/tests/msvcr90.c
@@ -25,6 +25,11 @@
#include <errno.h>
#include "wine/test.h"
+#ifndef _WRITE_ABORT_MSG
+#define _WRITE_ABORT_MSG 1
+#define _CALL_REPORTFAULT 2
+#endif
+
#define DEFINE_EXPECT(func) \
static BOOL expect_ ## func = FALSE, called_ ## func = FALSE
@@ -67,6 +72,7 @@ static errno_t (__cdecl *p_itoa_s)(int,char*,size_t,int);
static int (__cdecl *p_wcsncat_s)(wchar_t *dst, size_t elem, const wchar_t *src, size_t count);
static void (__cdecl *p_qsort_s)(void *, size_t, size_t, int (__cdecl *)(void *, const void *, const void *), void *);
static int (__cdecl *p_controlfp_s)(unsigned int *, unsigned int, unsigned int);
+static unsigned int (__cdecl *p_set_abort_behavior)(unsigned int, unsigned int);
static void* (WINAPI *pEncodePointer)(void *);
@@ -617,6 +623,31 @@ static void test_controlfp_s(void)
ok( cur != 0xdeadbeef, "value not set\n" );
}
+static void test__set_abort_behavior(void)
+{
+ unsigned int res;
+
+ if (!p_set_abort_behavior)
+ {
+ win_skip("_set_abort_behavior not found\n");
+ return;
+ }
+
+ /* default is _WRITE_ABORT_MSG | _CALL_REPORTFAULT */
+ res = p_set_abort_behavior(0, 0);
+ ok (res == (_WRITE_ABORT_MSG | _CALL_REPORTFAULT),
+ "got 0x%x (expected 0x%x)\n", res, _WRITE_ABORT_MSG | _CALL_REPORTFAULT);
+
+ /* no internal mask */
+ p_set_abort_behavior(0xffffffff, 0xffffffff);
+ res = p_set_abort_behavior(0, 0);
+ ok (res == 0xffffffff, "got 0x%x (expected 0x%x)\n", res, 0xffffffff);
+
+ /* set to default value */
+ p_set_abort_behavior(_WRITE_ABORT_MSG | _CALL_REPORTFAULT, 0xffffffff);
+}
+
+
START_TEST(msvcr90)
{
HMODULE hcrt;
@@ -648,6 +679,7 @@ START_TEST(msvcr90)
p_wcsncat_s = (void *)GetProcAddress( hcrt,"wcsncat_s" );
p_qsort_s = (void *) GetProcAddress(hcrt, "qsort_s");
p_controlfp_s = (void *) GetProcAddress(hcrt, "_controlfp_s");
+ p_set_abort_behavior = (void *) GetProcAddress(hcrt, "_set_abort_behavior");
hkernel32 = GetModuleHandleA("kernel32.dll");
pEncodePointer = (void *) GetProcAddress(hkernel32, "EncodePointer");
@@ -660,4 +692,5 @@ START_TEST(msvcr90)
test_wcsncat_s();
test_qsort_s();
test_controlfp_s();
+ test__set_abort_behavior();
}
--
1.7.1
More information about the wine-patches
mailing list