ReactOS 0.4.16-dev-297-gc569aee
signal.c File Reference
#include "wine/test.h"
#include <winbase.h>
#include <signal.h>
Include dependency graph for signal.c:

Go to the source code of this file.

Functions

static void __cdecl sighandler (int signum)
 
static void test_signal (void)
 
static void test___pxcptinfoptrs (void)
 
 START_TEST (signal)
 

Variables

static int test_value = 0
 

Function Documentation

◆ sighandler()

static void __cdecl sighandler ( int  signum)
static

Definition at line 27 of file signal.c.

28{
29 void **ret = __pxcptinfoptrs();
30
31 ok(ret != NULL, "ret = NULL\n");
32 if(signum == SIGABRT)
33 ok(*ret == (void*)0xdeadbeef, "*ret = %p\n", *ret);
34 else if(signum == SIGSEGV)
35 ok(*ret == NULL, "*ret = %p\n", *ret);
36 ++test_value;
37}
#define ok(value,...)
Definition: atltest.h:57
void **__cdecl __pxcptinfoptrs(void)
Definition: xcptinfo.c:6
#define SIGABRT
Definition: signal.h:28
#define SIGSEGV
Definition: signal.h:33
#define NULL
Definition: types.h:112
static int test_value
Definition: signal.c:25
int ret

Referenced by test___pxcptinfoptrs(), and test_signal().

◆ START_TEST()

START_TEST ( signal  )

Definition at line 76 of file signal.c.

77{
80}
static void test_signal(void)
Definition: signal.c:39
static void test___pxcptinfoptrs(void)
Definition: signal.c:52

◆ test___pxcptinfoptrs()

static void test___pxcptinfoptrs ( void  )
static

Definition at line 52 of file signal.c.

53{
54 void **ret = __pxcptinfoptrs();
55 int res;
56
57 ok(ret != NULL, "ret == NULL\n");
58 ok(*ret == NULL, "*ret != NULL\n");
59
60 test_value = 0;
61
62 *ret = (void*)0xdeadbeef;
64 res = raise(SIGSEGV);
65 ok(res == 0, "failed to raise SIGSEGV\n");
66 ok(*ret == (void*)0xdeadbeef, "*ret = %p\n", *ret);
67
69 res = raise(SIGABRT);
70 ok(res == 0, "failed to raise SIGBREAK\n");
71 ok(*ret == (void*)0xdeadbeef, "*ret = %p\n", *ret);
72
73 ok(test_value == 2, "test_value = %d\n", test_value);
74}
int __cdecl raise(int _SigNum)
Definition: signal.c:71
GLuint res
Definition: glext.h:9613
static void __cdecl sighandler(int signum)
Definition: signal.c:27
int signal
Definition: except.c:82

Referenced by START_TEST().

◆ test_signal()

static void test_signal ( void  )
static

Definition at line 39 of file signal.c.

40{
41 void (__cdecl *old)(int);
42 int res;
43
45 ok(old != SIG_ERR, "Failed to install signal handler for SIGBREAK\n");
46 test_value = 0;
48 ok(res == 0, "Failed to raise SIGBREAK\n");
49 ok(test_value == 1, "SIGBREAK handler not invoked\n");
50}
#define __cdecl
Definition: accygwin.h:79
#define SIG_ERR
Definition: signal.h:52
#define SIGBREAK
Definition: signal.h:40
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31

Referenced by START_TEST().

Variable Documentation

◆ test_value

int test_value = 0
static

Definition at line 25 of file signal.c.

Referenced by main(), sighandler(), test___pxcptinfoptrs(), and test_signal().