OSDN Git Service

Please enter the commit message for your changes. Lines starting
[eos/base.git] / util / src / TclTk / tk8.6.12 / tests / cursor.test
1 # This file is a Tcl script to test out the procedures in the file
2 # tkCursor.c.  It is organized in the standard white-box fashion for
3 # Tcl tests.
4 #
5 # Copyright (c) 1998 Sun Microsystems, Inc.
6 # Copyright (c) 1998-1999 by Scriptics Corporation.
7 # All rights reserved.
8
9 package require tcltest 2.2
10 namespace import ::tcltest::*
11 eval tcltest::configure $argv
12 tcltest::loadTestedCommands
13
14
15 # Tests 2.3 and 2.4 need a helper file with a very specific name and
16 # controlled format.
17 proc setWincur {wincurName} {
18         upvar $wincurName wincur
19         set wincur(data_octal) {
20             000 000 002 000 001 000 040 040 000 000 007 000 007 000 060 001
21             000 000 026 000 000 000 050 000 000 000 040 000 000 000 100 000
22             000 000 001 000 001 000 000 000 000 000 000 000 000 000 000 000
23             000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000
24             000 000 377 377 377 000 000 000 000 000 000 000 000 000 000 000
25             000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000
26             000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000
27             000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000
28             000 000 000 000 000 000 000 000 000 000 160 016 000 000 170 036
29             000 000 174 076 000 000 076 174 000 000 037 370 000 000 017 360
30             000 000 007 340 000 000 007 340 000 000 017 360 000 000 037 370
31             000 000 076 174 000 000 174 076 000 000 170 036 000 000 160 016
32             000 000 000 000 000 000 377 377 377 377 377 377 377 377 377 377
33             377 377 377 377 377 377 377 377 377 377 377 377 377 377 377 377
34             377 377 377 377 377 377 377 377 377 377 377 377 377 377 377 377
35             377 377 377 377 377 377 377 377 377 377 377 377 377 377 377 377
36             377 377 377 377 377 377 017 360 377 377 007 340 377 377 003 300
37             377 377 001 200 377 377 200 001 377 377 300 003 377 377 340 007
38             377 377 360 017 377 377 360 017 377 377 340 007 377 377 300 003
39             377 377 200 001 377 377 001 200 377 377 003 300 377 377 007 340
40             377 377 017 360 377 377
41         }
42         set wincur(data_binary) {}
43         foreach wincur(num) $wincur(data_octal) {
44             append wincur(data_binary) [binary format c [scan $wincur(num) %o]]
45         }
46         set wincur(dir) [makeDirectory {dir with spaces}]
47         set wincur(file) [makeFile $wincur(data_binary) "test file.cur" $wincur(dir)]
48 }
49
50
51 test cursor-1.1 {Tk_AllocCursorFromObj - converting internal reps} -constraints {
52     testcursor
53 } -body {
54     set x watch
55     lindex $x 0
56     button .b -cursor $x
57     lindex $x 0
58     testcursor watch
59 } -cleanup {
60     destroy .b
61 } -result {{1 0}}
62 test cursor-1.2 {Tk_AllocCursorFromObj - discard stale cursor} -constraints {
63     testcursor
64 } -body {
65     set x watch
66     set result {}
67     button .b1 -cursor $x
68     destroy .b1
69     lappend result [testcursor watch]
70     button .b2 -cursor $x
71     lappend result [testcursor watch]
72 } -cleanup {
73     destroy .b2
74 } -result {{} {{1 1}}}
75 test cursor-1.3 {Tk_AllocCursorFromObj - reuse existing cursor} -constraints {
76     testcursor
77 } -body {
78     set x watch
79     set result {}
80     button .b1 -cursor $x
81     lappend result [testcursor watch]
82     button .b2 -cursor $x
83     pack .b1 .b2 -side top
84     lappend result [testcursor watch]
85 } -cleanup {
86     destroy .b1 .b2
87 } -result {{{1 1}} {{2 1}}}
88
89 test cursor-2.1 {Tk_GetCursor procedure} -body {
90     button .b -cursor bad_name
91 } -cleanup {
92     destroy .b
93 } -returnCodes error -result {bad cursor spec "bad_name"}
94 test cursor-2.2 {Tk_GetCursor procedure} -body {
95     button .b -cursor @xyzzy
96 } -cleanup {
97     destroy .b
98 } -returnCodes error -result {bad cursor spec "@xyzzy"}
99
100 test cursor-2.3 {Tk_GetCursor procedure: cursor specs are lists} -constraints {
101     win
102 } -setup {
103         unset -nocomplain wincur
104         set wincur(file) ""
105 } -body {
106         setWincur wincur
107     button .b -cursor [list @$wincur(file)]
108 } -cleanup {
109     destroy .b
110         removeDirectory $wincur(dir)
111         unset wincur
112 } -result {.b}
113 test cursor-2.4 {Tk_GetCursor procedure: cursor specs are lists} -constraints {
114     win
115 } -setup {
116         unset -nocomplain wincur
117         set wincur(file) ""
118 } -body {
119         setWincur wincur
120     button .b -cursor @[regsub -all {[][ \\{}""$#]} $wincur(file) {\\&}]
121 } -cleanup {
122     destroy .b
123         removeDirectory $wincur(dir)
124         unset wincur
125 } -result {.b}
126
127 test cursor-3.1 {Tk_FreeCursorFromObj - reference counts} -constraints {
128     testcursor
129 } -setup {
130     set x heart
131     set result {}
132 } -body {
133     button .b1 -cursor $x
134     button .b3 -cursor $x
135     button .b2 -cursor $x
136     lappend result [testcursor heart]
137     destroy .b1
138     lappend result [testcursor heart]
139     destroy .b2
140     lappend result [testcursor heart]
141     destroy .b3
142     lappend result [testcursor heart]
143 } -result {{{3 1}} {{2 1}} {{1 1}} {}}
144
145 test cursor-4.1 {FreeCursorObjProc} -constraints {
146     testcursor
147 } -setup {
148     proc copy {s} {return [string index $s 0][string range $s 1 end]}
149 } -body {
150     set x [copy heart]
151     button .b -cursor $x
152     set y [copy heart]
153     .b configure -cursor $y
154     set z [copy heart]
155     .b configure -cursor $z
156     set result {}
157     lappend result [testcursor heart]
158     set x red
159     lappend result [testcursor heart]
160     set z 32
161     lappend result [testcursor heart]
162     destroy .b
163     lappend result [testcursor heart]
164     set y bogus
165     set result
166 } -cleanup {
167     rename copy {}
168     destroy .b
169 } -result {{{1 3}} {{1 2}} {{1 1}} {}}
170
171 # -------------------------------------------------------------------------
172 test cursor-5.1 {assert consistent cursor configuration command} -setup {
173     button .b
174 } -body {
175     .b configure -cursor {watch red black}
176 } -cleanup {
177     destroy .b
178 } -result {}
179
180 # -------------------------------------------------------------------------
181 # Check for the standard set of cursors.
182 test cursor-6.1 {check cursor-font cursor X_cursor} -setup {
183         button .b -text X_cursor
184 } -body {
185         .b configure -cursor X_cursor
186 } -cleanup {
187         destroy .b
188 } -result {}
189 test cursor-6.2 {check cursor-font cursor arrow} -setup {
190         button .b -text arrow
191 } -body {
192         .b configure -cursor arrow
193 } -cleanup {
194         destroy .b
195 } -result {}
196 test cursor-6.3 {check cursor-font cursor based_arrow_down} -setup {
197         button .b -text based_arrow_down
198 } -body {
199         .b configure -cursor based_arrow_down
200 } -cleanup {
201         destroy .b
202 } -result {}
203 test cursor-6.4 {check cursor-font cursor based_arrow_up} -setup {
204         button .b -text based_arrow_up
205 } -body {
206         .b configure -cursor based_arrow_up
207 } -cleanup {
208         destroy .b
209 } -result {}
210 test cursor-6.5 {check cursor-font cursor boat} -setup {
211         button .b -text boat
212 } -body {
213         .b configure -cursor boat
214 } -cleanup {
215         destroy .b
216 } -result {}
217 test cursor-6.6 {check cursor-font cursor bogosity} -setup {
218         button .b -text bogosity
219 } -body {
220         .b configure -cursor bogosity
221 } -cleanup {
222         destroy .b
223 } -result {}
224 test cursor-6.7 {check cursor-font cursor bottom_left_corner} -setup {
225         button .b -text bottom_left_corner
226 } -body {
227         .b configure -cursor bottom_left_corner
228 } -cleanup {
229         destroy .b
230 } -result {}
231 test cursor-6.8 {check cursor-font cursor bottom_right_corner} -setup {
232         button .b -text bottom_right_corner
233 } -body {
234         .b configure -cursor bottom_right_corner
235 } -cleanup {
236         destroy .b
237 } -result {}
238 test cursor-6.9 {check cursor-font cursor bottom_side} -setup {
239         button .b -text bottom_side
240 } -body {
241         .b configure -cursor bottom_side
242 } -cleanup {
243         destroy .b
244 } -result {}
245 test cursor-6.10 {check cursor-font cursor bottom_tee} -setup {
246         button .b -text bottom_tee
247 } -body {
248         .b configure -cursor bottom_tee
249 } -cleanup {
250         destroy .b
251 } -result {}
252 test cursor-6.11 {check cursor-font cursor box_spiral} -setup {
253         button .b -text box_spiral
254 } -body {
255         .b configure -cursor box_spiral
256 } -cleanup {
257         destroy .b
258 } -result {}
259 test cursor-6.12 {check cursor-font cursor center_ptr} -setup {
260         button .b -text center_ptr
261 } -body {
262         .b configure -cursor center_ptr
263 } -cleanup {
264         destroy .b
265 } -result {}
266 test cursor-6.13 {check cursor-font cursor circle} -setup {
267         button .b -text circle
268 } -body {
269         .b configure -cursor circle
270 } -cleanup {
271         destroy .b
272 } -result {}
273 test cursor-6.14 {check cursor-font cursor clock} -setup {
274         button .b -text clock
275 } -body {
276         .b configure -cursor clock
277 } -cleanup {
278         destroy .b
279 } -result {}
280 test cursor-6.15 {check cursor-font cursor coffee_mug} -setup {
281         button .b -text coffee_mug
282 } -body {
283         .b configure -cursor coffee_mug
284 } -cleanup {
285         destroy .b
286 } -result {}
287 test cursor-6.16 {check cursor-font cursor cross} -setup {
288         button .b -text cross
289 } -body {
290         .b configure -cursor cross
291 } -cleanup {
292         destroy .b
293 } -result {}
294 test cursor-6.17 {check cursor-font cursor cross_reverse} -setup {
295         button .b -text cross_reverse
296 } -body {
297         .b configure -cursor cross_reverse
298 } -cleanup {
299         destroy .b
300 } -result {}
301 test cursor-6.18 {check cursor-font cursor crosshair} -setup {
302         button .b -text crosshair
303 } -body {
304         .b configure -cursor crosshair
305 } -cleanup {
306         destroy .b
307 } -result {}
308 test cursor-6.19 {check cursor-font cursor diamond_cross} -setup {
309         button .b -text diamond_cross
310 } -body {
311         .b configure -cursor diamond_cross
312 } -cleanup {
313         destroy .b
314 } -result {}
315 test cursor-6.20 {check cursor-font cursor dot} -setup {
316         button .b -text dot
317 } -body {
318         .b configure -cursor dot
319 } -cleanup {
320         destroy .b
321 } -result {}
322 test cursor-6.21 {check cursor-font cursor dotbox} -setup {
323         button .b -text dotbox
324 } -body {
325         .b configure -cursor dotbox
326 } -cleanup {
327         destroy .b
328 } -result {}
329 test cursor-6.22 {check cursor-font cursor double_arrow} -setup {
330         button .b -text double_arrow
331 } -body {
332         .b configure -cursor double_arrow
333 } -cleanup {
334         destroy .b
335 } -result {}
336 test cursor-6.23 {check cursor-font cursor draft_large} -setup {
337         button .b -text draft_large
338 } -body {
339         .b configure -cursor draft_large
340 } -cleanup {
341         destroy .b
342 } -result {}
343 test cursor-6.24 {check cursor-font cursor draft_small} -setup {
344         button .b -text draft_small
345 } -body {
346         .b configure -cursor draft_small
347 } -cleanup {
348         destroy .b
349 } -result {}
350 test cursor-6.25 {check cursor-font cursor draped_box} -setup {
351         button .b -text draped_box
352 } -body {
353         .b configure -cursor draped_box
354 } -cleanup {
355         destroy .b
356 } -result {}
357 test cursor-6.26 {check cursor-font cursor exchange} -setup {
358         button .b -text exchange
359 } -body {
360         .b configure -cursor exchange
361 } -cleanup {
362         destroy .b
363 } -result {}
364 test cursor-6.27 {check cursor-font cursor fleur} -setup {
365         button .b -text fleur
366 } -body {
367         .b configure -cursor fleur
368 } -cleanup {
369         destroy .b
370 } -result {}
371 test cursor-6.28 {check cursor-font cursor gobbler} -setup {
372         button .b -text gobbler
373 } -body {
374         .b configure -cursor gobbler
375 } -cleanup {
376         destroy .b
377 } -result {}
378 test cursor-6.29 {check cursor-font cursor gumby} -setup {
379         button .b -text gumby
380 } -body {
381         .b configure -cursor gumby
382 } -cleanup {
383         destroy .b
384 } -result {}
385 test cursor-6.30 {check cursor-font cursor hand1} -setup {
386         button .b -text hand1
387 } -body {
388         .b configure -cursor hand1
389 } -cleanup {
390         destroy .b
391 } -result {}
392 test cursor-6.31 {check cursor-font cursor hand2} -setup {
393         button .b -text hand2
394 } -body {
395         .b configure -cursor hand2
396 } -cleanup {
397         destroy .b
398 } -result {}
399 test cursor-6.32 {check cursor-font cursor heart} -setup {
400         button .b -text heart
401 } -body {
402         .b configure -cursor heart
403 } -cleanup {
404         destroy .b
405 } -result {}
406 test cursor-6.33 {check cursor-font cursor icon} -setup {
407         button .b -text icon
408 } -body {
409         .b configure -cursor icon
410 } -cleanup {
411         destroy .b
412 } -result {}
413 test cursor-6.34 {check cursor-font cursor iron_cross} -setup {
414         button .b -text iron_cross
415 } -body {
416         .b configure -cursor iron_cross
417 } -cleanup {
418         destroy .b
419 } -result {}
420 test cursor-6.35 {check cursor-font cursor left_ptr} -setup {
421         button .b -text left_ptr
422 } -body {
423         .b configure -cursor left_ptr
424 } -cleanup {
425         destroy .b
426 } -result {}
427 test cursor-6.36 {check cursor-font cursor left_side} -setup {
428         button .b -text left_side
429 } -body {
430         .b configure -cursor left_side
431 } -cleanup {
432         destroy .b
433 } -result {}
434 test cursor-6.37 {check cursor-font cursor left_tee} -setup {
435         button .b -text left_tee
436 } -body {
437         .b configure -cursor left_tee
438 } -cleanup {
439         destroy .b
440 } -result {}
441 test cursor-6.38 {check cursor-font cursor leftbutton} -setup {
442         button .b -text leftbutton
443 } -body {
444         .b configure -cursor leftbutton
445 } -cleanup {
446         destroy .b
447 } -result {}
448 test cursor-6.39 {check cursor-font cursor ll_angle} -setup {
449         button .b -text ll_angle
450 } -body {
451         .b configure -cursor ll_angle
452 } -cleanup {
453         destroy .b
454 } -result {}
455 test cursor-6.40 {check cursor-font cursor lr_angle} -setup {
456         button .b -text lr_angle
457 } -body {
458         .b configure -cursor lr_angle
459 } -cleanup {
460         destroy .b
461 } -result {}
462 test cursor-6.41 {check cursor-font cursor man} -setup {
463         button .b -text man
464 } -body {
465         .b configure -cursor man
466 } -cleanup {
467         destroy .b
468 } -result {}
469 test cursor-6.42 {check cursor-font cursor middlebutton} -setup {
470         button .b -text middlebutton
471 } -body {
472         .b configure -cursor middlebutton
473 } -cleanup {
474         destroy .b
475 } -result {}
476 test cursor-6.43 {check cursor-font cursor mouse} -setup {
477         button .b -text mouse
478 } -body {
479         .b configure -cursor mouse
480 } -cleanup {
481         destroy .b
482 } -result {}
483 test cursor-6.44 {check cursor-font cursor pencil} -setup {
484         button .b -text pencil
485 } -body {
486         .b configure -cursor pencil
487 } -cleanup {
488         destroy .b
489 } -result {}
490 test cursor-6.45 {check cursor-font cursor pirate} -setup {
491         button .b -text pirate
492 } -body {
493         .b configure -cursor pirate
494 } -cleanup {
495         destroy .b
496 } -result {}
497 test cursor-6.46 {check cursor-font cursor plus} -setup {
498         button .b -text plus
499 } -body {
500         .b configure -cursor plus
501 } -cleanup {
502         destroy .b
503 } -result {}
504 test cursor-6.47 {check cursor-font cursor question_arrow} -setup {
505         button .b -text question_arrow
506 } -body {
507         .b configure -cursor question_arrow
508 } -cleanup {
509         destroy .b
510 } -result {}
511 test cursor-6.48 {check cursor-font cursor right_ptr} -setup {
512         button .b -text right_ptr
513 } -body {
514         .b configure -cursor right_ptr
515 } -cleanup {
516         destroy .b
517 } -result {}
518 test cursor-6.49 {check cursor-font cursor right_side} -setup {
519         button .b -text right_side
520 } -body {
521         .b configure -cursor right_side
522 } -cleanup {
523         destroy .b
524 } -result {}
525 test cursor-6.50 {check cursor-font cursor right_tee} -setup {
526         button .b -text right_tee
527 } -body {
528         .b configure -cursor right_tee
529 } -cleanup {
530         destroy .b
531 } -result {}
532 test cursor-6.51 {check cursor-font cursor rightbutton} -setup {
533         button .b -text rightbutton
534 } -body {
535         .b configure -cursor rightbutton
536 } -cleanup {
537         destroy .b
538 } -result {}
539 test cursor-6.52 {check cursor-font cursor rtl_logo} -setup {
540         button .b -text rtl_logo
541 } -body {
542         .b configure -cursor rtl_logo
543 } -cleanup {
544         destroy .b
545 } -result {}
546 test cursor-6.53 {check cursor-font cursor sailboat} -setup {
547         button .b -text sailboat
548 } -body {
549         .b configure -cursor sailboat
550 } -cleanup {
551         destroy .b
552 } -result {}
553 test cursor-6.54 {check cursor-font cursor sb_down_arrow} -setup {
554         button .b -text sb_down_arrow
555 } -body {
556         .b configure -cursor sb_down_arrow
557 } -cleanup {
558         destroy .b
559 } -result {}
560 test cursor-6.55 {check cursor-font cursor sb_h_double_arrow} -setup {
561         button .b -text sb_h_double_arrow
562 } -body {
563         .b configure -cursor sb_h_double_arrow
564 } -cleanup {
565         destroy .b
566 } -result {}
567 test cursor-6.56 {check cursor-font cursor sb_left_arrow} -setup {
568         button .b -text sb_left_arrow
569 } -body {
570         .b configure -cursor sb_left_arrow
571 } -cleanup {
572         destroy .b
573 } -result {}
574 test cursor-6.57 {check cursor-font cursor sb_right_arrow} -setup {
575         button .b -text sb_right_arrow
576 } -body {
577         .b configure -cursor sb_right_arrow
578 } -cleanup {
579         destroy .b
580 } -result {}
581 test cursor-6.58 {check cursor-font cursor sb_up_arrow} -setup {
582         button .b -text sb_up_arrow
583 } -body {
584         .b configure -cursor sb_up_arrow
585 } -cleanup {
586         destroy .b
587 } -result {}
588 test cursor-6.59 {check cursor-font cursor sb_v_double_arrow} -setup {
589         button .b -text sb_v_double_arrow
590 } -body {
591         .b configure -cursor sb_v_double_arrow
592 } -cleanup {
593         destroy .b
594 } -result {}
595 test cursor-6.60 {check cursor-font cursor shuttle} -setup {
596         button .b -text shuttle
597 } -body {
598         .b configure -cursor shuttle
599 } -cleanup {
600         destroy .b
601 } -result {}
602 test cursor-6.61 {check cursor-font cursor sizing} -setup {
603         button .b -text sizing
604 } -body {
605         .b configure -cursor sizing
606 } -cleanup {
607         destroy .b
608 } -result {}
609 test cursor-6.62 {check cursor-font cursor spider} -setup {
610         button .b -text spider
611 } -body {
612         .b configure -cursor spider
613 } -cleanup {
614         destroy .b
615 } -result {}
616 test cursor-6.63 {check cursor-font cursor spraycan} -setup {
617         button .b -text spraycan
618 } -body {
619         .b configure -cursor spraycan
620 } -cleanup {
621         destroy .b
622 } -result {}
623 test cursor-6.64 {check cursor-font cursor star} -setup {
624         button .b -text star
625 } -body {
626         .b configure -cursor star
627 } -cleanup {
628         destroy .b
629 } -result {}
630 test cursor-6.65 {check cursor-font cursor target} -setup {
631         button .b -text target
632 } -body {
633         .b configure -cursor target
634 } -cleanup {
635         destroy .b
636 } -result {}
637 test cursor-6.66 {check cursor-font cursor tcross} -setup {
638         button .b -text tcross
639 } -body {
640         .b configure -cursor tcross
641 } -cleanup {
642         destroy .b
643 } -result {}
644 test cursor-6.67 {check cursor-font cursor top_left_arrow} -setup {
645         button .b -text top_left_arrow
646 } -body {
647         .b configure -cursor top_left_arrow
648 } -cleanup {
649         destroy .b
650 } -result {}
651 test cursor-6.68 {check cursor-font cursor top_left_corner} -setup {
652         button .b -text top_left_corner
653 } -body {
654         .b configure -cursor top_left_corner
655 } -cleanup {
656         destroy .b
657 } -result {}
658 test cursor-6.69 {check cursor-font cursor top_right_corner} -setup {
659         button .b -text top_right_corner
660 } -body {
661         .b configure -cursor top_right_corner
662 } -cleanup {
663         destroy .b
664 } -result {}
665 test cursor-6.70 {check cursor-font cursor top_side} -setup {
666         button .b -text top_side
667 } -body {
668         .b configure -cursor top_side
669 } -cleanup {
670         destroy .b
671 } -result {}
672 test cursor-6.71 {check cursor-font cursor top_tee} -setup {
673         button .b -text top_tee
674 } -body {
675         .b configure -cursor top_tee
676 } -cleanup {
677         destroy .b
678 } -result {}
679 test cursor-6.72 {check cursor-font cursor trek} -setup {
680         button .b -text trek
681 } -body {
682         .b configure -cursor trek
683 } -cleanup {
684         destroy .b
685 } -result {}
686 test cursor-6.73 {check cursor-font cursor ul_angle} -setup {
687         button .b -text ul_angle
688 } -body {
689         .b configure -cursor ul_angle
690 } -cleanup {
691         destroy .b
692 } -result {}
693 test cursor-6.74 {check cursor-font cursor umbrella} -setup {
694         button .b -text umbrella
695 } -body {
696         .b configure -cursor umbrella
697 } -cleanup {
698         destroy .b
699 } -result {}
700 test cursor-6.75 {check cursor-font cursor ur_angle} -setup {
701         button .b -text ur_angle
702 } -body {
703         .b configure -cursor ur_angle
704 } -cleanup {
705         destroy .b
706 } -result {}
707 test cursor-6.76 {check cursor-font cursor watch} -setup {
708         button .b -text watch
709 } -body {
710         .b configure -cursor watch
711 } -cleanup {
712         destroy .b
713 } -result {}
714 test cursor-6.77 {check cursor-font cursor xterm} -setup {
715         button .b -text xterm
716 } -body {
717         .b configure -cursor xterm
718 } -cleanup {
719         destroy .b
720 } -result {}
721
722 # Test cursor named "none", it is not defined in
723 # the X cursor table. It is defined in a Tk specific
724 # table of named cursors and should be available on
725 # all platforms.
726 test cursor-6.78 {test cursor named "none"} -setup {
727     button .b -text CButton
728 } -body {
729     .b configure -cursor none
730     .b cget -cursor
731 } -cleanup {
732     destroy .b
733 } -result none
734
735 test cursor-6.79 {test cursor named "none"} -setup {
736     button .b -text CButton
737 } -body {
738     .b configure -cursor none
739     .b configure -cursor {}
740     .b cget -cursor
741 } -cleanup {
742     destroy .b
743 } -result {}
744
745 test cursor-6.80 {test cursor named "none"} -setup {
746     button .b -text CButton
747 } -body {
748     .b configure -cursor none
749     .b configure -cursor {}
750     .b configure -cursor none
751     .b cget -cursor
752 } -cleanup {
753     destroy .b
754 } -result none
755
756 test cursor-6.81 {test cursor named "none"} -setup {
757     button .b -text CButton
758 } -body {
759     # Setting fg and bg does nothing for the none cursor
760     # because it displays no fg or bg pixels.
761     set results [list]
762     .b configure -cursor none
763     lappend results [.b cget -cursor]
764     .b configure -cursor {none blue}
765     lappend results [.b cget -cursor]
766     .b configure -cursor {none blue green}
767     lappend results [.b cget -cursor]
768     .b configure -cursor {}
769     lappend results [.b cget -cursor]
770     set results
771 } -cleanup {
772     destroy .b
773     unset results
774 } -result {none {none blue} {none blue green} {}}
775
776 # -------------------------------------------------------------------------
777 # Check the Windows specific cursors
778 test cursor-7.1 {check Windows cursor no} -constraints win -setup {
779         button .b -text no
780 } -body {
781         .b configure -cursor no
782 } -cleanup {
783         destroy .b
784 } -result {}
785 test cursor-7.2 {check Windows cursor starting} -constraints win -setup {
786         button .b -text starting
787 } -body {
788         .b configure -cursor starting
789 } -cleanup {
790         destroy .b
791 } -result {}
792 test cursor-7.3 {check Windows cursor size} -constraints win -setup {
793         button .b -text size
794 } -body {
795         .b configure -cursor size
796 } -cleanup {
797         destroy .b
798 } -result {}
799 test cursor-7.4 {check Windows cursor size_ne_sw} -constraints win -setup {
800         button .b -text size_ne_sw
801 } -body {
802         .b configure -cursor size_ne_sw
803 } -cleanup {
804         destroy .b
805 } -result {}
806 test cursor-7.5 {check Windows cursor size_ns} -constraints win -setup {
807         button .b -text size_ns
808 } -body {
809         .b configure -cursor size_ns
810 } -cleanup {
811         destroy .b
812 } -result {}
813 test cursor-7.6 {check Windows cursor size_nw_se} -constraints win -setup {
814         button .b -text size_nw_se
815 } -body {
816         .b configure -cursor size_nw_se
817 } -cleanup {
818         destroy .b
819 } -result {}
820 test cursor-7.7 {check Windows cursor size_we} -constraints win -setup {
821         button .b -text size_we
822 } -body {
823         .b configure -cursor size_we
824 } -cleanup {
825         destroy .b
826 } -result {}
827 test cursor-7.8 {check Windows cursor uparrow} -constraints win -setup {
828         button .b -text uparrow
829 } -body {
830         .b configure -cursor uparrow
831 } -cleanup {
832         destroy .b
833 } -result {}
834 test cursor-7.9 {check Windows cursor wait} -constraints win -setup {
835         button .b -text wait
836 } -body {
837         .b configure -cursor wait
838 } -cleanup {
839         destroy .b
840 } -result {}
841
842 # -------------------------------------------------------------------------
843
844 # cleanup
845 cleanupTests
846 return