OSDN Git Service

touched all tk files to ease next import
[pf3gnuchains/pf3gnuchains4x.git] / tk / tests / winClipboard.test
index 58a2b2c..aaf2967 100644 (file)
@@ -7,41 +7,80 @@
 # generates output for errors.  No output means no errors were found.
 #
 # Copyright (c) 1997 by Sun Microsystems, Inc.
-#
-# See the file "license.terms" for information on usage and redistribution
-# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+# Copyright (c) 1998-2000 by Scriptics Corporation.
+# All rights reserved.
 #
 # RCS: @(#) $Id$
 
-if {$tcl_platform(platform)!="windows"} {
-    return
-}
-
-if {[string compare test [info procs test]] == 1} {
-    source defs
+if {[lsearch [namespace children] ::tcltest] == -1} {
+    source [file join [pwd] [file dirname [info script]] defs.tcl]
 }
 
 # Note that these tests may fail if another application is grabbing the
 # clipboard (e.g. an X server)
 
-test winClipboard-1.1 {TkSelGetSelection} {
+if {[llength [info command testclipboard]] == 0} {
+    puts "\"testclipboard\" isn't defined, skipping winClipboard tests"
+    ::tcltest::cleanupTests
+    return
+}
+
+test winClipboard-1.1 {TkSelGetSelection} {pcOnly} {
     clipboard clear
     catch {selection get -selection CLIPBOARD} msg
     set msg
 } {CLIPBOARD selection doesn't exist or form "STRING" not defined}
-test winClipboard-1.2 {TkSelGetSelection} {
+test winClipboard-1.2 {TkSelGetSelection} {pcOnly} {
     clipboard clear
     clipboard append {}
     list [selection get -selection CLIPBOARD] [testclipboard]
 } {{} {}}
-test winClipboard-1.3 {TkSelGetSelection & TkWinClipboardRender} {
+test winClipboard-1.3 {TkSelGetSelection & TkWinClipboardRender} {pcOnly} {
     clipboard clear
     clipboard append abcd
+    update
     list [selection get -selection CLIPBOARD] [testclipboard]
 } {abcd abcd}
-test winClipboard-1.4 {TkSelGetSelection & TkWinClipboardRender} {
+test winClipboard-1.4 {TkSelGetSelection & TkWinClipboardRender} {pcOnly} {
     clipboard clear
     clipboard append "line 1\nline 2"
     list [selection get -selection CLIPBOARD] [testclipboard]
 } [list "line 1\nline 2" "line 1\r\nline 2"]
+test winClipboard-1.5 {TkSelGetSelection & TkWinClipboardRender} {pcOnly} {
+    clipboard clear
+    clipboard append "line 1\u00c7\nline 2"
+    list [selection get -selection CLIPBOARD] [testclipboard]
+} [list "line 1\u00c7\nline 2" [bytestring "line 1\u00c7\r\nline 2"]]
+
+test winClipboard-2.1 {TkSelUpdateClipboard reentrancy problem} {pcOnly} {
+    clipboard clear
+    clipboard append -type OUR_ACTION "action data"
+    clipboard append "string data"
+    update
+    list [selection get -selection CLIPBOARD -type OUR_ACTION] [testclipboard]
+} [list "action data" "string data"]
+test winClipboard-2.2 {TkSelUpdateClipboard reentrancy problem} {pcOnly} {
+    clipboard clear
+    clipboard append -type OUR_ACTION "new data"
+    clipboard append "more data in string"
+    update
+    list [testclipboard] [selection get -selection CLIPBOARD -type OUR_ACTION]
+} [list "more data in string" "new data"]
+
+# cleanup
+::tcltest::cleanupTests
+return
+
+
+
+
+
+
+
+
+
+
+
+
+