diff options
author | Owen W. Taylor <otaylor@fishsoup.net> | 2010-09-20 16:12:11 -0400 |
---|---|---|
committer | Owen W. Taylor <otaylor@fishsoup.net> | 2010-09-20 16:35:41 -0400 |
commit | 14e38da150516ffe5cece04de16fb3c976caa21f (patch) | |
tree | 6f0156e23c83ffbc964567a888873d0ce97a0bc7 /tests | |
parent | 1592738d2f7261ed17612e97144663ce8bc29081 (diff) | |
download | gtk+-14e38da150516ffe5cece04de16fb3c976caa21f.tar.gz |
Only store error codes in inner-most X error trap
When an error occurs with nested traps in place, only the innermost
trap should have the error code stored in it; outer traps are
shielded by the inner trap.
https://bugzilla.gnome.org/show_bug.cgi?id=629608
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/testerrors.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/testerrors.c b/tests/testerrors.c index b8d1a8a812..d371f1b790 100755 --- a/tests/testerrors.c +++ b/tests/testerrors.c @@ -56,13 +56,22 @@ test_error_trapping (GdkDisplay *gdk_display) XSync (d, TRUE); - /* verify that we can catch with nested traps */ + /* verify that we can catch with nested traps; inner-most + * active trap gets the error */ gdk_error_trap_push (); gdk_error_trap_push (); XSetCloseDownMode (d, 12345); error = gdk_error_trap_pop (); g_assert (error == BadValue); error = gdk_error_trap_pop (); + g_assert (error == Success); + + gdk_error_trap_push (); + XSetCloseDownMode (d, 12345); + gdk_error_trap_push (); + error = gdk_error_trap_pop (); + g_assert (error == Success); + error = gdk_error_trap_pop (); g_assert (error == BadValue); /* try nested, without sync */ |