diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2012-11-06 11:38:16 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2012-11-09 13:36:10 +1000 |
commit | 0197de16f185416d353e71c4b4fc2a70a964f9f8 (patch) | |
tree | b54e229ba7311f0495293980a370461c96bd2f84 /include | |
parent | c29171c44c67622b6830a6a77991e4d9f2542321 (diff) |
xserver: install default X error handler
Xlib's default error handler prints the error and calls exit(1). Tests that
accidentally trigger an error thus quit without cleaning up properly.
Install a default error handler that prints the basic info and continue with
the test. Clients that expect to trigger errors should set a custom error
handler.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@ubuntu.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/xorg/gtest/xorg-gtest-xserver.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/xorg/gtest/xorg-gtest-xserver.h b/include/xorg/gtest/xorg-gtest-xserver.h index 8bf7996..11fc93d 100644 --- a/include/xorg/gtest/xorg-gtest-xserver.h +++ b/include/xorg/gtest/xorg-gtest-xserver.h @@ -265,6 +265,19 @@ class XServer : public xorg::testing::Process { */ static void RegisterXIOErrorHandler(); + /** + * Install a default XErrorHandler. That error handler will cause a test + * failure if called. + * + * This function is called automatically by XServer::Start(). Usually, + * you will not need to call this function unless your test does not + * instantiate and Start() an XServer object. + * + * This function will only install a new error handler if the currently + * installed XErrorHandler is not the default handler used by Xlib. + */ + static void RegisterXErrorHandler(); + private: struct Private; std::auto_ptr<Private> d_; |