diff options
author | fvogel <fvogelnew1@free.fr> | 2016-05-01 19:58:09 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2016-05-01 19:58:09 (GMT) |
commit | e0dd525d1c6f6529f948278455342cc280d50540 (patch) | |
tree | 3178671fe099d47c123714b2321c916c16236da3 /tests | |
parent | 8949d8b37009d2dd0f9a410577f95d19d3419353 (diff) | |
parent | ede13558f13645c01b9dff12f05b15d6e0435995 (diff) | |
download | tk-e0dd525d1c6f6529f948278455342cc280d50540.zip tk-e0dd525d1c6f6529f948278455342cc280d50540.tar.gz tk-e0dd525d1c6f6529f948278455342cc280d50540.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 7f9c4c4..fc243f1 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 a02074b..146e338 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 |