diff options
author | fvogel <fvogelnew1@free.fr> | 2016-05-01 19:51:15 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2016-05-01 19:51:15 (GMT) |
commit | 220e6dbbf6f383262f989aa97c8b91f6be24d9f3 (patch) | |
tree | b4628d9dc96cf310e71ee2510074a7e570cd805b /tests | |
parent | dbda3d1f347c441a31859af78be708bf252c105d (diff) | |
parent | f45e84890c023b1ab4c8bb68667fa16df9f70971 (diff) | |
download | tk-220e6dbbf6f383262f989aa97c8b91f6be24d9f3.zip tk-220e6dbbf6f383262f989aa97c8b91f6be24d9f3.tar.gz tk-220e6dbbf6f383262f989aa97c8b91f6be24d9f3.tar.bz2 |
Fixed [b362182e45] - Generation of virtual events through Tk_HandleEvent is unsafe
Diffstat (limited to 'tests')
-rw-r--r-- | tests/listbox.test | 1 | ||||
-rw-r--r-- | tests/text.test | 27 |
2 files changed, 26 insertions, 2 deletions
diff --git a/tests/listbox.test b/tests/listbox.test index 76a4349..407420c 100644 --- a/tests/listbox.test +++ b/tests/listbox.test @@ -3170,6 +3170,7 @@ test listbox-31.2 {<<ListboxSelect>> event on lost selection} -setup { focus -force .l event generate .l <1> -x 5 -y 5 ; # <<ListboxSelect>> fires selection clear ; # <<ListboxSelect>> fires again + update set res } -cleanup { destroy .l diff --git a/tests/text.test b/tests/text.test index 641635e..f217bcf 100644 --- a/tests/text.test +++ b/tests/text.test @@ -3053,6 +3053,25 @@ test text-11a.41 {"sync" "pendingsync" and <<WidgetViewSync>>} -setup { destroy .top.yt .top } -result {Sync:0 Pending:1 Sync:1 Pending:0} +test text-11a.51 {<<WidgetViewSync>> calls TkSendVirtualEvent(), + NOT Tk_HandleEvent(). + Bug [b362182e45704dd7bbd6aed91e48122035ea3d16]} -setup { + destroy .top.t .top +} -body { + set res {} + toplevel .top + pack [text .top.t] + for {set i 1} {$i < 10000} {incr i} { + .top.t insert end "Hello world!\n" + } + bind .top.t <<WidgetViewSync>> {destroy .top.t} + .top.t tag add mytag 1.5 8000.8 ; # shall not crash + update + set res "Still doing fine!" +} -cleanup { + destroy .top.t .top +} -result {Still doing fine!} + test text-12.1 {TextWidgetCmd procedure, "index" option} -setup { text .t } -body { @@ -6280,7 +6299,7 @@ test text-27.11 {TextEditCmd procedure, set modified flag repeat} -setup { # Shouldn't require [update idle] to trigger event [Bug 1809538] lappend ::retval [.t edit modified] .t edit modified 1 - update idletasks + update lappend ::retval [.t edit modified] .t edit modified 1 ; # binding should only fire once [Bug 1799782] update idletasks @@ -6295,6 +6314,7 @@ test text-27.12 {<<Modified>> virtual event} -body { bind .t <<Modified>> "set ::retval modified" update idletasks .t insert end "nothing special\n" + update return $::retval } -cleanup { destroy .t @@ -6305,6 +6325,7 @@ test text-27.13 {<<Modified>> virtual event - insert before Modified} -body { bind .t <<Modified>> { set ::retval [.t get 1.0 end-1c] } update idletasks .t insert end "nothing special" + update return $::retval } -cleanup { destroy .t @@ -6317,6 +6338,7 @@ test text-27.14 {<<Modified>> virtual event - delete before Modified} -body { .t insert end "nothing special" .t edit modified 0 .t delete 1.0 1.2 + update set ::retval } -cleanup { destroy .t @@ -6331,7 +6353,7 @@ test text-27.14a {<<Modified>> virtual event - propagation to peers} -body { bind .tt <<Modified>> {incr ::retval} .t insert end "This increments ::retval once for each peer, i.e. twice." .t edit modified 0 ; # shall increment twice as well, not just once - update idletasks + update set ::retval } -cleanup { destroy .t .tt @@ -6343,6 +6365,7 @@ test text-27.15 {<<Selection>> virtual event} -body { update idletasks .t insert end "nothing special\n" .t tag add sel 1.0 1.1 + update set ::retval } -cleanup { destroy .t |