This is the mail archive of the
insight@sources.redhat.com
mailing list for the Insight project.
[RFA] srcwin testsuite patch
- From: "Martin M. Hunt" <hunt at redhat dot com>
- To: insight at sources dot redhat dot com
- Date: Fri, 26 Apr 2002 11:10:47 -0700 (PDT)
- Subject: [RFA] srcwin testsuite patch
The click function was generating a ButtonPress without a ButtonRelease,
resulting in everything after that point being highlighted as selected
test. Also some more line number fixes. Should really have used the
trick of putting comments on the inportant lines and having a function
locate the correct line.
2002-04-26 Martin M. Hunt <hunt@redhat.com>
* srcwin.test (click): Take a button number as an arg.
Generate a ButtonPress event then a ButtonRelease event
for that button number.
(4.4): Fix args for click().
(5.1): Fix results again.
Index: testsuite/gdb.gdbtk/srcwin.test
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.gdbtk/srcwin.test,v
retrieving revision 1.4
diff -u -u -r1.4 srcwin.test
--- testsuite/gdb.gdbtk/srcwin.test 7 Mar 2002 21:50:39 -0000
1.4
+++ testsuite/gdb.gdbtk/srcwin.test 26 Apr 2002 18:05:31 -0000
@@ -48,7 +48,7 @@
return 1
}
-proc click {win bbox event} {
+proc click {win bbox bnum} {
if {![move_mouse_to $win $bbox]} {
return 0
}
@@ -57,7 +57,10 @@
set x [expr [lindex $bbox 0] + [lindex $bbox 2] / 2]
set y [expr [lindex $bbox 1] + [lindex $bbox 3] / 2]
- if {[catch {event generate $win $event -x $x -y $y} result]} {
+ if {[catch {event generate $win <Button-$bnum> -x $x -y $y} result]} {
+ return 0
+ }
+ if {[catch {event generate $win <ButtonRelease-$bnum> -x $x -y $y}
result]} {
return 0
}
return 1
@@ -1079,7 +1082,7 @@
set r 0
# click mouse button 1 at index 20.1
- if {![click $twin [$twin bbox 20.1] <Button-1>]} {
+ if {![click $twin [$twin bbox 20.1] 1]} {
set r "Click failed on line 20.1"
} else {
@@ -1147,9 +1150,10 @@
move_mouse_to $twin [$twin bbox 20.$index]
sleep 1
if {[winfo ismapped $balloon]} {
- if {![string compare "x=5" [$balloon.label cget -text]]} {incr r}
- gdb_immediate "continue" 1
if {![string compare "x=9" [$balloon.label cget -text]]} {incr r}
+ gdb_immediate "continue" 1
+ sleep 1
+ if {![string compare "x=13" [$balloon.label cget -text]]} {incr r}
} else {
set r -1
}