Commit 45693738 authored by Alexandre Julliard's avatar Alexandre Julliard

kernel: Added a basic test for exception handling in threads.

parent ef4dfd4b
...@@ -119,6 +119,10 @@ static DWORD WINAPI threadFunc1(LPVOID p) ...@@ -119,6 +119,10 @@ static DWORD WINAPI threadFunc1(LPVOID p)
for(i=0;i<NUM_THREADS;i++) { for(i=0;i<NUM_THREADS;i++) {
while(tstruct->threadmem[i]==0) ; while(tstruct->threadmem[i]==0) ;
} }
/* lstrlenA contains an exception handler so this makes sure exceptions work in threads */
ok( lstrlenA( (char *)0xdeadbeef ) == 0, "lstrlenA: unexpected success\n" );
/* Check that noone changed our tls memory */ /* Check that noone changed our tls memory */
ok((int)TlsGetValue(tlsIndex)-1==tstruct->threadnum, ok((int)TlsGetValue(tlsIndex)-1==tstruct->threadnum,
"TlsGetValue failed\n"); "TlsGetValue failed\n");
...@@ -180,6 +184,9 @@ static VOID test_CreateThread_basic(void) ...@@ -180,6 +184,9 @@ static VOID test_CreateThread_basic(void)
DWORD i,j; DWORD i,j;
DWORD GLE, ret; DWORD GLE, ret;
/* lstrlenA contains an exception handler so this makes sure exceptions work in the main thread */
ok( lstrlenA( (char *)0xdeadbeef ) == 0, "lstrlenA: unexpected success\n" );
/* Retrieve current Thread ID for later comparisons */ /* Retrieve current Thread ID for later comparisons */
curthreadId=GetCurrentThreadId(); curthreadId=GetCurrentThreadId();
/* Allocate some local storage */ /* Allocate some local storage */
......
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