diff options
author | marha <marha@users.sourceforge.net> | 2012-08-07 07:51:02 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2012-08-07 07:51:02 +0200 |
commit | f8e35ebbe71eed74ccf68af8ccda4182f1edc7f0 (patch) | |
tree | 0451299b4aaaaf6d2423d1faf07dc9f35c9f80d8 /xorg-server/test | |
parent | 18e75aa6ae27a6e44d93babd96afbbe0cd6077c8 (diff) | |
download | vcxsrv-f8e35ebbe71eed74ccf68af8ccda4182f1edc7f0.tar.gz vcxsrv-f8e35ebbe71eed74ccf68af8ccda4182f1edc7f0.tar.bz2 vcxsrv-f8e35ebbe71eed74ccf68af8ccda4182f1edc7f0.zip |
mesa xserver xkeyboard-config git update 7 Aug 2012
Diffstat (limited to 'xorg-server/test')
-rw-r--r-- | xorg-server/test/Makefile.am | 2 | ||||
-rw-r--r-- | xorg-server/test/os.c | 36 |
2 files changed, 36 insertions, 2 deletions
diff --git a/xorg-server/test/Makefile.am b/xorg-server/test/Makefile.am index aa018c962..34f53fc1e 100644 --- a/xorg-server/test/Makefile.am +++ b/xorg-server/test/Makefile.am @@ -23,11 +23,9 @@ INCLUDES += -I$(top_srcdir)/hw/xfree86/parser \ endif TEST_LDADD=libxservertest.la $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) $(GLX_SYS_LIBS) -if XORG if SPECIAL_DTRACE_OBJECTS TEST_LDADD += $(OS_LIB) $(DIX_LIB) endif -endif xkb_LDADD=$(TEST_LDADD) input_LDADD=$(TEST_LDADD) diff --git a/xorg-server/test/os.c b/xorg-server/test/os.c index 1460a34d6..8f1107ded 100644 --- a/xorg-server/test/os.c +++ b/xorg-server/test/os.c @@ -28,6 +28,21 @@ #include <signal.h> #include "os.h" +static int last_signal = 0; +static int expect_signal = 0; + +static void sighandler(int signal) +{ + assert(expect_signal); + expect_signal = 0; + if (!last_signal) + raise(signal); + OsBlockSignals(); + OsReleaseSignals(); + last_signal = 1; + expect_signal = 1; +} + static int sig_is_blocked(int sig) { @@ -118,7 +133,27 @@ static void block_sigio_test(void) assert(sig_is_blocked(SIGIO)); OsReleaseSignals(); assert(!sig_is_blocked(SIGIO)); +#endif +} +static void block_sigio_test_nested(void) +{ +#ifdef SIG_BLOCK + /* Check for bug releasing SIGIO during SIGIO signal handling. + test case: + raise signal + → in signal handler: + raise signal + OsBlockSignals() + OsReleaseSignals() + tail guard + tail guard must be hit. + */ + sighandler_t old_handler; + old_handler = signal(SIGIO, sighandler); + expect_signal = 1; + assert(raise(SIGIO) == 0); + assert(signal(SIGIO, old_handler) == sighandler); #endif } @@ -126,5 +161,6 @@ int main(int argc, char **argv) { block_sigio_test(); + block_sigio_test_nested(); return 0; } |