#1026 clipboard,event click, focus tests fail

obsolete: 8.4a3
closed-duplicate
Joe English
5
2001-11-20
2001-06-28
Larry W. Virden
No

3 different test suite scripts show failures in
the recent release.

Platform: SPARC Solaris 2.6
Compiler: SPARC Sun 5.1
Configure arguments: --prefix=/usr/tcl84
Window manager: CDE

clipboard.test

==== clipboard-6.2 Tk_ClipboardAppend procedure FAILED
==== Contents of test case:

setupbg
clipboard clear
clipboard append -f INTEGER -t TEST "16"
set result [dobg {clipboard get TEST}]
cleanupbg
set result

---- Result was:
CLIPBOARD selection doesn't exist or form "TEST" not
defined
---- Result should have been:
0x10
==== clipboard-6.2 FAILED

event.test

==== event-click-drag-1.2 click and drag in an entry
widget, this
tests tkEntryMouseSelect in
entry.tcl FAILED
==== Contents of test case:

destroy .t
set t [toplevel .t]
set e [entry $t.e]
pack $e
tkwait visibility $e
focus -force $e
_keypress_string $e "A Tcl/Tk selection test!"
set anchor 6
set selend 18

set result [list [$e get]]

# Get the x,y coords of the second T in "Tcl/Tk"
foreach {anchor_x anchor_y} [_text_ind_to_x_y $e
$anchor] break

# Click down to set the insert cursor position
event generate $e <Enter>
event generate $e <ButtonPress-1> -x $anchor_x -y
$anchor_y

# Save the position of the insert cursor
lappend result [$e index insert]

# Now drag until selend is highlighted, then click
up

set current $anchor
while {$current <= $selend} {
foreach {current_x current_y} [_text_ind_to_x_y
$e $current] break
event generate $e <B1-Motion> -x $current_x -y
$current_y
incr current
_pause 50
}

event generate $e <ButtonRelease-1> -x $current_x
-y $current_y
_pause 200

# Save the position of the insert cursor
lappend result [$e index insert]

# Save the highlighted text
lappend result [selection get]

# Now click and click and drag to the left, over
"Tcl/Tk selection"

event generate $e <ButtonPress-1> -x $current_x -y
$current_y

while {$current >= ($anchor - 4)} {
foreach {current_x current_y} [_text_ind_to_x_y
$e $current] break
event generate $e <B1-Motion> -x $current_x -y
$current_y
incr current -1
_pause 50
}

event generate $e <ButtonRelease-1> -x $current_x
-y $current_y
_pause 200

# Save the position of the insert cursor
lappend result [$e index insert]

# Save the highlighted text
lappend result [selection get]

---- Result was:
{A Tcl/Tk selection test!} 6 18 {Tk selection} 4 {l/Tk
selection}
---- Result should have been:
{A Tcl/Tk selection test!} 6 18 {Tk selection} 2
{Tcl/Tk selection}
==== event-click-drag-1.2 FAILED

filebox.test
focus.test

==== focus-5.1 ChangeXFocus procedure, don't take focus
unless have it FAILED
==== Contents of test case:

focusSetup
focus -force .t
update
set result [focus]
send [dobg {tk appname}] {focus -force .; update}
lappend result [focus]
focus .t.b2
update
lappend result [focus]

---- Result was:
.t .t {}
---- Result should have been:
.t {} {}
==== focus-5.1 FAILED

Discussion

  • Logged In: YES
    user_id=15949

    These errors continue to occur.

     
  • Don Porter
    Don Porter
    2001-09-17

    Logged In: YES
    user_id=80530

    The event-click-drag report duplicates 413735.

    Assigning to [clipboard] Category to address tha failure.

     
  • Don Porter
    Don Porter
    2001-09-17

    • labels: 318652 --> 52. [clipboard]
    • assigned_to: nobody --> jenglish
     
  • Joe English
    Joe English
    2001-09-17

    Logged In: YES
    user_id=68433

    I cannot replicate the focus-5.1 test failure.

    I suspect that the event-click-drag-1.2 failure is caused by
    a Tk script library version mismatch: if I run

    ../unix/wish event.test

    it fails, but with

    TK_LIBRARY=../library ../unix/wish event.test

    it succeeds.

    I can (intermittently) replicate the clipboard-6.2 test
    failure
    only if 'xclipboard' is running. After shutting down
    'xclipboard'
    the test seems to always pass.

    I suspect the problem here lies with the CDE clipboard not
    understanding selection targets other than "STRING", and not
    with Tk.

    Larry, could you try the following at a 'wish' prompt:

    # The following should make the CDE clipboard manager
    exit:
    #
    selection own -selection CLIPBOARD_MANAGER .
    selection clear -selection CLIPBOARD_MANAGER

    source clipboard.test

    and see if clipboard-6.2 still fails? (This works for me).

    Possible solutions: (1) Execute the preceding at the
    beginning
    of 'clipboard.test' to force the clipboard manager (if any)
    to exit. (2) Test if a clipboard manager is running and
    skip test clipboard-6.2 if it is.

    (1) is somewhat antisocial, as it interferes with the
    users's
    desktop. (2) is problematic because there is no standard
    way to tell if a clipboard manager is actually present.
    [selection get -selection CLIPBOARD_MANAGER] does not work;
    the best test I can think of is to execute
    [selection clear -selection CLIPBOARD], then see if
    [selection get -selection CLIPBOARD] succeeds.
    If it does, a clipboard manager is _probably_ present.

     
  • Logged In: YES
    user_id=15949

    1. I tried to run
    TK_LIBRARY=../library ../unix/wish event.test
    and it continues to fail - I don't think that it is a
    version mismatch problem.

    $ TK_LIBRARY=../library ../unix/wish event.test

    ==== event-click-drag-1.2 click and drag in an entry
    widget, this
    tests tkEntryMouseSelect in
    entry.tcl FAILED
    ==== Contents of test case:

    destroy .t
    set t [toplevel .t]
    set e [entry $t.e]
    pack $e
    tkwait visibility $e
    focus -force $e
    _keypress_string $e "A Tcl/Tk selection test!"
    set anchor 6
    set selend 18

    set result [list [$e get]]

    # Get the x,y coords of the second T in "Tcl/Tk"
    foreach {anchor_x anchor_y} [_text_ind_to_x_y $e
    $anchor] break

    # Click down to set the insert cursor position
    event generate $e <Enter>
    event generate $e <ButtonPress-1> -x $anchor_x -y
    $anchor_y

    # Save the position of the insert cursor
    lappend result [$e index insert]

    # Now drag until selend is highlighted, then click up

    set current $anchor
    while {$current <= $selend} {
    foreach {current_x current_y} [_text_ind_to_x_y $e
    $current] break
    event generate $e <B1-Motion> -x $current_x -y
    $current_y
    incr current
    _pause 50
    }

    event generate $e <ButtonRelease-1> -x $current_x -y
    $current_y
    _pause 200

    # Save the position of the insert cursor
    lappend result [$e index insert]

    # Save the highlighted text
    lappend result [selection get]

    # Now click and click and drag to the left, over "Tcl/Tk
    selection"

    event generate $e <ButtonPress-1> -x $current_x -y
    $current_y

    while {$current >= ($anchor - 4)} {
    foreach {current_x current_y} [_text_ind_to_x_y $e
    $current] break
    event generate $e <B1-Motion> -x $current_x -y
    $current_y
    incr current -1
    _pause 50
    }

    event generate $e <ButtonRelease-1> -x $current_x -y
    $current_y
    _pause 200

    # Save the position of the insert cursor
    lappend result [$e index insert]

    # Save the highlighted text
    lappend result [selection get]

    ---- Result was:
    {A Tcl/Tk selection test!} 6 18 {Tk selection} 4 {l/Tk
    selection}
    ---- Result should have been:
    {A Tcl/Tk selection test!} 6 18 {Tk selection} 2 {Tcl/Tk
    selection}
    ==== event-click-drag-1.2 FAILED

    event.test: Total 10 Passed 9 Skipped
    0 Failed 1

    2. Here's the results of the clipboard test:
    $ wish
    % selection own -selection CLIPBOARD_MANAGER .
    % selection clear -selection CLIPBOARD_MANAGER
    % source clipboard.test
    clipboard.test: Total 35 Passed 35 Skipped
    0 Failed 0
    %

     
  • Logged In: YES
    user_id=15949

    1. I tried to run
    TK_LIBRARY=../library ../unix/wish event.test
    and it continues to fail - I don't think that it is a
    version mismatch problem.

    $ TK_LIBRARY=../library ../unix/wish event.test

    ==== event-click-drag-1.2 click and drag in an entry
    widget, this
    tests tkEntryMouseSelect in
    entry.tcl FAILED
    ==== Contents of test case:

    destroy .t
    set t [toplevel .t]
    set e [entry $t.e]
    pack $e
    tkwait visibility $e
    focus -force $e
    _keypress_string $e "A Tcl/Tk selection test!"
    set anchor 6
    set selend 18

    set result [list [$e get]]

    # Get the x,y coords of the second T in "Tcl/Tk"
    foreach {anchor_x anchor_y} [_text_ind_to_x_y $e
    $anchor] break

    # Click down to set the insert cursor position
    event generate $e <Enter>
    event generate $e <ButtonPress-1> -x $anchor_x -y
    $anchor_y

    # Save the position of the insert cursor
    lappend result [$e index insert]

    # Now drag until selend is highlighted, then click up

    set current $anchor
    while {$current <= $selend} {
    foreach {current_x current_y} [_text_ind_to_x_y $e
    $current] break
    event generate $e <B1-Motion> -x $current_x -y
    $current_y
    incr current
    _pause 50
    }

    event generate $e <ButtonRelease-1> -x $current_x -y
    $current_y
    _pause 200

    # Save the position of the insert cursor
    lappend result [$e index insert]

    # Save the highlighted text
    lappend result [selection get]

    # Now click and click and drag to the left, over "Tcl/Tk
    selection"

    event generate $e <ButtonPress-1> -x $current_x -y
    $current_y

    while {$current >= ($anchor - 4)} {
    foreach {current_x current_y} [_text_ind_to_x_y $e
    $current] break
    event generate $e <B1-Motion> -x $current_x -y
    $current_y
    incr current -1
    _pause 50
    }

    event generate $e <ButtonRelease-1> -x $current_x -y
    $current_y
    _pause 200

    # Save the position of the insert cursor
    lappend result [$e index insert]

    # Save the highlighted text
    lappend result [selection get]

    ---- Result was:
    {A Tcl/Tk selection test!} 6 18 {Tk selection} 4 {l/Tk
    selection}
    ---- Result should have been:
    {A Tcl/Tk selection test!} 6 18 {Tk selection} 2 {Tcl/Tk
    selection}
    ==== event-click-drag-1.2 FAILED

    event.test: Total 10 Passed 9 Skipped
    0 Failed 1

    2. Here's the results of the clipboard test:
    $ wish
    % selection own -selection CLIPBOARD_MANAGER .
    % selection clear -selection CLIPBOARD_MANAGER
    % source clipboard.test
    clipboard.test: Total 35 Passed 35 Skipped
    0 Failed 0
    %

     
  • Logged In: YES
    user_id=15949

    with the latest 8.4 alpha release of tk, I now see the
    testing stop during safe.test -by stop I mean that the test
    begins, a tk widget appears, and the code never moves on.
    (also, the clipboard, event, and focus errors continue -
    they appear before the safe.test started...)

     
  • Don Porter
    Don Porter
    2001-11-20

    • status: open --> closed-duplicate
     
  • Don Porter
    Don Porter
    2001-11-20

    Logged In: YES
    user_id=80530

    Everything in this report is now duplicated by some
    other report.