[PATCH xorg-gtest 3/7] test: restore error handler after test
Peter Hutterer
peter.hutterer at who-t.net
Thu Dec 13 17:17:36 PST 2012
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
test/xserver-test.cpp | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/test/xserver-test.cpp b/test/xserver-test.cpp
index 822bb23..5e24ae7 100644
--- a/test/xserver-test.cpp
+++ b/test/xserver-test.cpp
@@ -263,7 +263,8 @@ TEST(XServer, NondefaultErrorHandler)
pid_t pid = fork();
if (pid == 0) {
- XSetErrorHandler(_test_error_handler);
+ XErrorHandler old_handler;
+ old_handler = XSetErrorHandler(_test_error_handler);
XServer server;
server.SetOption("-logfile", LOGFILE_DIR "/xorg-error-handler-test.log");
@@ -276,6 +277,7 @@ TEST(XServer, NondefaultErrorHandler)
XColor color;
XQueryColor(dpy, 0, &color);
XSync(dpy, False);
+ XSetErrorHandler(old_handler);
exit(error_handler_triggered ? 0 : 1);
}
--
1.8.0.2
More information about the xorg-devel
mailing list