# graph.test -- # package require tcltest namespace import tcltest::* namespace eval ::TEST { interp alias {} vector {} ::graph::vector #=============================================================================== # This part tests the axis bind function of the graph BLT component. # Axis bind is an instance function of graph. # ------------------------------------------------------------------------------ # Purpose: Ensure that bindings can be created for an axis element # ------------------------------------------------------------------------------ test graph.axis.bind-1.1 { Test axis bind creation } -setup { ::graph .graph1 .graph1 axis create Axis1 pack .graph1 } -body { if {[catch {.graph1 axis bind Axis1 {puts test}}]} { return 1 } return 0 } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure that bindings can be queried for a sequence and axis element # ------------------------------------------------------------------------------ test graph.axis.bind-1.2 { Test axis bind query } -setup { ::graph .graph1 .graph1 axis create Axis1 pack .graph1 .graph1 axis bind Axis1 {puts test} } -body { .graph1 axis bind Axis1 } -cleanup { destroy .graph1 } -result {puts test} # ------------------------------------------------------------------------------ # Purpose: Ensure that bindings can be appended for a sequence and axis element # ------------------------------------------------------------------------------ test graph.axis.bind-1.3 { Test axis bind append } -setup { ::graph .graph1 .graph1 axis create Axis1 pack .graph1 .graph1 axis bind Axis1 {puts test} } -body { .graph1 axis bind Axis1 {+puts test2} .graph1 axis bind Axis1 } -cleanup { destroy .graph1 } -result "puts test\nputs test2" # ------------------------------------------------------------------------------ # Purpose: Ensure that bindings are overwritten for a sequence and axis element # ------------------------------------------------------------------------------ test graph.axis.bind-1.4 { Test axis bind overwrite } -setup { ::graph .graph1 .graph1 axis create Axis1 pack .graph1 .graph1 axis bind Axis1 {puts test} } -body { .graph1 axis bind Axis1 {+puts test2} .graph1 axis bind Axis1 } -body { .graph1 axis bind Axis1 {puts test2} .graph1 axis bind Axis1 } -cleanup { destroy .graph1 } -result {puts test2} # ------------------------------------------------------------------------------ # Purpose: Ensure that bound sequences can be queried for just a legend element # ------------------------------------------------------------------------------ test graph.axis.bind-1.5 { Test axis bind query } -setup { ::graph .graph1 .graph1 axis create Axis1 pack .graph1 .graph1 axis bind Axis1 {puts test} .graph1 axis bind Axis1 {puts test2} } -body { .graph1 axis bind Axis1 } -cleanup { destroy .graph1 } -result { } #=============================================================================== # This part tests the axis cget function of the graph BLT component. # Axis cget is an instance function of graph. # ------------------------------------------------------------------------------ # Purpose: Ensure the axis cget command works correctly when given a valid # axis configuration option name and a single axis # ------------------------------------------------------------------------------ test graph.axis.cget-1.1 { Valid Option Name, One Axis } -setup { ::graph .graph1 .graph1 axis create Axis1 .graph1 axis configure Axis1 -color black } -body { .graph1 axis cget Axis1 -color } -cleanup { destroy .graph1 } -result {black} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis cget command works correctly when given an invalid # axis configuration option name and a single axis # ------------------------------------------------------------------------------ test graph.axis.cget-1.2 { Invalid Option Name, One Axis } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { if {[catch {.graph1 axis cget Axis1 -invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis cget command works correctly when given a valid # axis configuration option name and two axis. # ------------------------------------------------------------------------------ test graph.axis.cget-1.3 { Valid Option Name, Two Axis } -setup { ::graph .graph1 .graph1 axis create Axis1 .graph1 axis create Axis2 .graph1 axis configure Axis1 Axis2 -color black } -body { list [.graph1 axis cget Axis1 -color] [.graph1 axis cget Axis2 -color] } -cleanup { destroy .graph1 } -result {black black} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis cget command works correctly when given an invalid option name. # ------------------------------------------------------------------------------ test graph.axis.cget-1.4 { Invalid Option Name } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { if {[catch {.graph1 axis cget Axis1 -invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} #=============================================================================== # This part tests the axis configure function of the graph BLT component. # Axis configure is an instance function of graph. # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -bindtags command works correctly when given a # single tag name. # ------------------------------------------------------------------------------ test graph.axis.configure-1.1 { Bindtags - single tag } -setup { ::graph .graph1 .graph1 axis bind Binding1 {puts foobar} .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -bindtags Binding1 .graph1 axis cget Axis1 -bindtags } -cleanup { destroy Binding1 .graph1 axis delete Axis1 destroy .graph1 } -result {Binding1} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -bindtags command works correctly when given # a list of tag names. # ------------------------------------------------------------------------------ test graph.axis.configure-1.2 { Bindtags - tag list } -setup { ::graph .graph1 .graph1 axis bind Binding1 {puts foo} .graph1 axis bind Binding2 {puts bar} .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -bindtags {Binding1 Binding2} .graph1 axis cget Axis1 -bindtags } -cleanup { destroy Binding1 Binding2 .graph1 axis delete Axis1 destroy .graph1 } -result {Binding1 Binding2} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -color command works correctly when given # a valid color name. # ------------------------------------------------------------------------------ test graph.axis.configure-2.1 { Valide Color } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -color blue .graph1 axis cget Axis1 -color } -cleanup { destroy .graph1 } -result {blue} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -color command works correctly when given # an invalid color name. # ------------------------------------------------------------------------------ test graph.axis.configure-2.2 { Invalid Color } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { if {[catch {.graph1 axis configure Axis1 -color invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -command command works correctly # TODO: NOT COMPLETE # ------------------------------------------------------------------------------ test graph.axis.configure-3.1 { Command } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { } -cleanup { destroy .graph1 } -result {} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -descending command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-4.1 { Descending 1 } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -descending 1 .graph1 axis cget Axis1 -descending } -cleanup { destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -descending command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-4.2 { Descending 0 } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -descending 0 .graph1 axis cget Axis1 -descending } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -descending command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-4.3 { Descending yes } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -descending yes .graph1 axis cget Axis1 -descending } -cleanup { destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -descending command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-4.4 { Descending no } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -descending no .graph1 axis cget Axis1 -descending } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -descending command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-4.5 { Descending true } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -descending true .graph1 axis cget Axis1 -descending } -cleanup { destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -descending command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-4.6 { Descending false } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -descending false .graph1 axis cget Axis1 -descending } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -descending command works correctly when given # an invalid option. # ------------------------------------------------------------------------------ test graph.axis.configure-4.7 { Descending invalid } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { if {[catch {.graph1 axis configure Axis1 -descending invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -hide command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-5.1 { Hide 1 } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -hide 1 .graph1 axis cget Axis1 -hide } -cleanup { destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -hide command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-5.2 { Hide true } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -hide true .graph1 axis cget Axis1 -hide } -cleanup { destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -hide command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-5.3 { Hide yes } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -hide yes .graph1 axis cget Axis1 -hide } -cleanup { destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -hide command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-5.4 { Hide 0 } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -hide 0 .graph1 axis cget Axis1 -hide } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -hide command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-5.5 { Hide no } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -hide no .graph1 axis cget Axis1 -hide } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -hide command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-5.6 { Hide false } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -hide false .graph1 axis cget Axis1 -hide } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -hide command works correctly when given # an invalid option. # ------------------------------------------------------------------------------ test graph.axis.configure-5.7 { Hide invalid } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { if {[catch {.graph1 axis configure Axis1 -hide invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -justify command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-6.1 { Justify Left } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -justify left .graph1 axis cget Axis1 -justify } -cleanup { destroy .graph1 } -result {left} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -justify command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-6.2 { Justify Right } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -justify right .graph1 axis cget Axis1 -justify } -cleanup { destroy .graph1 } -result {right} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -justify command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-6.3 { Justify Center } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -justify center .graph1 axis cget Axis1 -justify } -cleanup { destroy .graph1 } -result {center} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -justify command works correctly when given # an invalid option. # ------------------------------------------------------------------------------ test graph.axis.configure-6.4 { Justify invalid } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { if {[catch {.graph1 axis configure Axis1 -justify invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -limitsformat command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-7.1 { Limitsformat } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -limitsformat "Minimum Maximum" .graph1 axis cget Axis1 -limitsformat } -cleanup { destroy .graph1 } -result {Minimum Maximum} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -limitsshadow command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-9.1 { Limitsshadow } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -limitsshadow blue .graph1 axis cget Axis1 -limitsshadow } -cleanup { destroy .graph1 } -result {blue 1} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -limitsshadow command works correctly when given # an invalid color. # ------------------------------------------------------------------------------ test graph.axis.configure-9.2 { Limitsshadow invalid } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { if {[catch {.graph1 axis configure Axis1 -limitsshadow invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -limitscolor command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-10.1 { Limitscolor } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -limitscolor blue .graph1 axis cget Axis1 -limitscolor } -cleanup { destroy .graph1 } -result {blue} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -limitscolor command works correctly when given # an invalid color. # ------------------------------------------------------------------------------ test graph.axis.configure-10.2 { Limitscolor invalid } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { if {[catch {.graph1 axis configure Axis1 -limitscolor invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -limitsfont command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-11.1 { Limitsfont } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -limitsfont "*-Helvetica-Bold-R-Normal-*-14-140-*" .graph1 axis cget Axis1 -limitsfont } -cleanup { destroy .graph1 } -result {*-Helvetica-Bold-R-Normal-*-14-140-*} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -linewidth command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-12.1 { Linewidth } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -linewidth 2 .graph1 axis cget Axis1 -linewidth } -cleanup { destroy .graph1 } -result {2} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -linewidth command works correctly when given 0 # ------------------------------------------------------------------------------ test graph.axis.configure-12.2 { Linewidth zero } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -linewidth 0 .graph1 axis cget Axis1 -linewidth } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -linewidth command works correctly when given # an invalid option. # ------------------------------------------------------------------------------ test graph.axis.configure-12.3 { Linewidth invalid } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { if {[catch {.graph1 axis configure Axis1 -linewidth invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -linewidth command works correctly when given # an invalid option. # ------------------------------------------------------------------------------ test graph.axis.configure-12.4 { Linewidth invalid } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { if {[catch {.graph1 axis configure Axis1 -linewidth -2}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -logscale command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-13.1 { Logscale 1 } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -logscale 1 .graph1 axis cget Axis1 -logscale } -cleanup { destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -logscale command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-13.2 { Logscale yes } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -logscale yes .graph1 axis cget Axis1 -logscale } -cleanup { destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -logscale command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-13.3 { Logscale true } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -logscale true .graph1 axis cget Axis1 -logscale } -cleanup { destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -logscale command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-13.4 { Logscale 0 } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -logscale 0 .graph1 axis cget Axis1 -logscale } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -logscale command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-13.5 { Logscale no } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -logscale no .graph1 axis cget Axis1 -logscale } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -logscale command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-13.6 { Logscale false } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -logscale false .graph1 axis cget Axis1 -logscale } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -logscale command works correctly when given # an invalid option. # ------------------------------------------------------------------------------ test graph.axis.configure-13.7 { Logscale invalid } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { if {[catch {.graph1 axis configure Axis1 -logscale invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -loose command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-14.1 { Loose 1 } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -loose 1 .graph1 axis cget Axis1 -loose } -cleanup { destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -loose command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-14.2 { Loose yes } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -loose yes .graph1 axis cget Axis1 -loose } -cleanup { destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -loose command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-14.3 { Loose true } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -loose true .graph1 axis cget Axis1 -loose } -cleanup { destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -loose command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-14.4 { Loose 0 } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -loose 0 .graph1 axis cget Axis1 -loose } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -loose command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-14.5 { Loose no } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -loose no .graph1 axis cget Axis1 -loose } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -loose command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-14.6 { Loose false } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -loose false .graph1 axis cget Axis1 -loose } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -loose command works correctly when given # an invalid option. # ------------------------------------------------------------------------------ test graph.axis.configure-14.7 { Loose invalid } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { if {[catch {.graph1 axis configure Axis1 -loose invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -majorticks command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-15.1 { Majorticks } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -majorticks "1 3 5 7 9 11" .graph1 axis cget Axis1 -majorticks } -cleanup { destroy .graph1 } -result {1.0 3.0 5.0 7.0 9.0 11.0} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -majorticks command works correctly when given # an invalid option. # ------------------------------------------------------------------------------ test graph.axis.configure-15.2 { Majorticks invalid } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { if {[catch {.graph1 axis configure Axis1 -majorticks "1 invalid 3 4"}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -max command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-16.1 { Max } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -max 23 .graph1 axis cget Axis1 -max } -cleanup { destroy .graph1 } -result {23.0} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -max command works correctly when given # an invalid option. # ------------------------------------------------------------------------------ test graph.axis.configure-16.2 { Max invalid } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { if {[catch {.graph1 axis configure Axis1 -max invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -min command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-17.1 { Min } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -min -23 .graph1 axis cget Axis1 -min } -cleanup { destroy .graph1 } -result {-23.0} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -min command works correctly when given # an invalid option. # ------------------------------------------------------------------------------ test graph.axis.configure-17.2 { Min invalid } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { if {[catch {.graph1 axis configure Axis1 -min invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -minorticks command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-18.1 { Minorticks } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -minorticks "0.2 0.4 0.6 0.8" .graph1 axis cget Axis1 -minorticks } -cleanup { destroy .graph1 } -result {0.2 0.4 0.6 0.8} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -minorticks command works correctly when given # an invalid option. # ------------------------------------------------------------------------------ test graph.axis.configure-18.2 { Minorticks invalid } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { if {[catch {.graph1 axis configure Axis1 -minorticks "1 invalid 3 4"}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -rotate command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-19.1 { Rotate 90 } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -rotate 90.0 .graph1 axis cget Axis1 -rotate } -cleanup { destroy .graph1 } -result {90.0} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -rotate command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-19.2 { Rotate -90 } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -rotate -90.0 .graph1 axis cget Axis1 -rotate } -cleanup { destroy .graph1 } -result {270.0} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -rotate command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-19.3 { Rotate 0 (zero) } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -rotate 0.0 .graph1 axis cget Axis1 -rotate } -cleanup { destroy .graph1 } -result {0.0} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -rotate command works correctly when given # an invalid option. # ------------------------------------------------------------------------------ test graph.axis.configure-19.4 { Rotate invalid } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { if {[catch {.graph1 axis configure Axis1 -rotate invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -scrollcommand command works correctly # TODO: NOT COMPLETE # ------------------------------------------------------------------------------ test graph.axis.configure-20.1 { Scrollcommand } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -scrollcommand .graph1 axis cget Axis1 -scrollcommand } -cleanup { destroy .graph1 } -result {} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -scrollmax command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-21.1 { Scrollmax } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -scrollmax 19 .graph1 axis cget Axis1 -scrollmax } -cleanup { destroy .graph1 } -result {19.0} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -scrollmax command works correctly when given # an invalid option. # ------------------------------------------------------------------------------ test graph.axis.configure-21.2 { Scrollmax invalid } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { if {[catch {.graph1 axis configure Axis1 -scrollmax invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -scrollmin command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-22.1 { Scrollmin } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -scrollmin -19 .graph1 axis cget Axis1 -scrollmin } -cleanup { destroy .graph1 } -result {-19.0} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -scrollmin command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-22.2 { Scrollmin } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -scrollmin 0 .graph1 axis cget Axis1 -scrollmin } -cleanup { destroy .graph1 } -result {0.0} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -scrollmin command works correctly when given # an invalid option. # ------------------------------------------------------------------------------ test graph.axis.configure-22.3 { Scrollmin invalid } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { if {[catch {.graph1 axis configure Axis1 -scrollmin invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -showticks command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-23.1 { Showticks 1 } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -showticks 1 .graph1 axis cget Axis1 -showticks } -cleanup { destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -showticks command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-23.2 { Showticks yes } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -showticks yes .graph1 axis cget Axis1 -showticks } -cleanup { destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -showticks command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-23.3 { Showticks true } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -showticks true .graph1 axis cget Axis1 -showticks } -cleanup { destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -showticks command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-23.4 { Showticks 0 } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -showticks 0 .graph1 axis cget Axis1 -showticks } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -showticks command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-23.5 { Showticks no } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -showticks no .graph1 axis cget Axis1 -showticks } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -showticks command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-23.6 { Showticks false } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -showticks false .graph1 axis cget Axis1 -showticks } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -showticks command works correctly when given # an invalid option. # ------------------------------------------------------------------------------ test graph.axis.configure-23.7 { Showticks invalid } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { if {[catch {.graph1 axis configure Axis1 -showticks invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -stepsize command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-24.1 { Stepsize } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -stepsize .01 .graph1 axis cget Axis1 -stepsize } -cleanup { destroy .graph1 } -result {0.01} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -stepsize command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-24.2 { Stepsize } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -stepsize -1.0 .graph1 axis cget Axis1 -stepsize } -cleanup { destroy .graph1 } -result {-1.0} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -stepsize command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-24.3 { Stepsize } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -stepsize 0.0 .graph1 axis cget Axis1 -stepsize } -cleanup { destroy .graph1 } -result {0.0} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -stepsize command works correctly when given # an invalid option. # ------------------------------------------------------------------------------ test graph.axis.configure-24.4 { Stepsize invalid } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { if {[catch {.graph1 axis configure Axis1 -stepsize invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -subdivisions command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-25.1 { Subdivisions } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -subdivisions 6 .graph1 axis cget Axis1 -subdivisions } -cleanup { destroy .graph1 } -result {6} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -subdivisions command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-25.2 { Subdivisions } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -subdivisions 0 .graph1 axis cget Axis1 -subdivisions } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -subdivisions command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-25.3 { Subdivisions } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -subdivisions -1 .graph1 axis cget Axis1 -subdivisions } -cleanup { destroy .graph1 } -result {-1} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -subdivisions command works correctly when given # an invalid option. # ------------------------------------------------------------------------------ test graph.axis.configure-25.4 { Subdivisions invalid } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { if {[catch {.graph1 axis configure Axis1 -subdivisions invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -tickfont command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-26.1 { Tickfont } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -tickfont "*-Helvetica-Bold-R-Normal-*-14-140-*" .graph1 axis cget Axis1 -tickfont } -cleanup { destroy .graph1 } -result {*-Helvetica-Bold-R-Normal-*-14-140-*} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -ticklength command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-27.1 { Ticklength } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -ticklength 20 .graph1 axis cget Axis1 -ticklength } -cleanup { destroy .graph1 } -result {20} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -title command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-28.1 { Title } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -title "Test Title" .graph1 axis cget Axis1 -title } -cleanup { destroy .graph1 } -result {Test Title} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -titlealternate command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-29.1 { Titlealternate 1 } -setup { ::graph .graph1 .graph1 axis create Axis1 .graph1 axis configure Axis1 -title "Test Title" } -body { .graph1 axis configure Axis1 -titlealternate 1 .graph1 axis cget Axis1 -titlealternate } -cleanup { destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -titlealternate command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-29.2 { Titlealternate yes } -setup { ::graph .graph1 .graph1 axis create Axis1 .graph1 axis configure Axis1 -title "Test Title" } -body { .graph1 axis configure Axis1 -titlealternate yes .graph1 axis cget Axis1 -titlealternate } -cleanup { destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -titlealternate command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-29.3 { Titlealternate true } -setup { ::graph .graph1 .graph1 axis create Axis1 .graph1 axis configure Axis1 -title "Test Title" } -body { .graph1 axis configure Axis1 -titlealternate true .graph1 axis cget Axis1 -titlealternate } -cleanup { destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -titlealternate command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-29.4 { Titlealternate 0 } -setup { ::graph .graph1 .graph1 axis create Axis1 .graph1 axis configure Axis1 -title "Test Title" } -body { .graph1 axis configure Axis1 -titlealternate 0 .graph1 axis cget Axis1 -titlealternate } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -titlealternate command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-29.5 { Titlealternate no } -setup { ::graph .graph1 .graph1 axis create Axis1 .graph1 axis configure Axis1 -title "Test Title" } -body { .graph1 axis configure Axis1 -titlealternate no .graph1 axis cget Axis1 -titlealternate } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -titlealternate command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-29.6 { Titlealternate false } -setup { ::graph .graph1 .graph1 axis create Axis1 .graph1 axis configure Axis1 -title "Test Title" } -body { .graph1 axis configure Axis1 -titlealternate false .graph1 axis cget Axis1 -titlealternate } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -titlecolor command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-30.1 { Titlecolor } -setup { ::graph .graph1 .graph1 axis create Axis1 .graph1 axis configure Axis1 -title "Test Title" } -body { .graph1 axis configure Axis1 -titlecolor blue .graph1 axis cget Axis1 -titlecolor } -cleanup { destroy .graph1 } -result {blue} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -titlefont command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-31.1 { Titlefont } -setup { ::graph .graph1 .graph1 axis create Axis1 .graph1 axis configure Axis1 -title "Test Title" } -body { .graph1 axis configure Axis1 -titlefont "*-Helvetica-Bold-R-Normal-*-14-140-*" .graph1 axis cget Axis1 -titlefont } -cleanup { destroy .graph1 } -result {*-Helvetica-Bold-R-Normal-*-14-140-*} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -autorange command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-32.1 { Autorange } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -autorange 13.0 .graph1 axis cget Axis1 -autorange } -cleanup { destroy .graph1 } -result {13.0} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -borderwidth command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-33.1 { Borderwidth } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -borderwidth 13.0 .graph1 axis cget Axis1 -borderwidth } -cleanup { destroy .graph1 } -result {13} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -borderwidth command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-33.2 { Borderwidth (bd) } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -bd 13.0 .graph1 axis cget Axis1 -bd } -cleanup { destroy .graph1 } -result {13} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -shiftby command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-34.1 { Shiftby } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -shiftby 13.0 .graph1 axis cget Axis1 -shiftby } -cleanup { destroy .graph1 } -result {13.0} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -relief command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-35.1 { Relief - flat } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -relief flat .graph1 axis cget Axis1 -relief } -cleanup { destroy .graph1 } -result {flat} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -relief command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-35.2 { Relief - raised } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -relief groove .graph1 axis cget Axis1 -relief } -cleanup { destroy .graph1 } -result {groove} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -relief command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-35.3 { Relief - raised } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -relief raised .graph1 axis cget Axis1 -relief } -cleanup { destroy .graph1 } -result {raised} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -relief command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-35.4 { Relief - ridge } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -relief ridge .graph1 axis cget Axis1 -relief } -cleanup { destroy .graph1 } -result {ridge} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -relief command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-35.5 { Relief - solid } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -relief solid .graph1 axis cget Axis1 -relief } -cleanup { destroy .graph1 } -result {solid} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -relief command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-35.6 { Relief - sunken } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -relief sunken .graph1 axis cget Axis1 -relief } -cleanup { destroy .graph1 } -result {sunken} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -scrollincrement command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-36.1 { Scrollincrement } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -scrollincrement 15 .graph1 axis cget Axis1 -scrollincrement } -cleanup { destroy .graph1 } -result {15} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -background command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-37.1 { Background } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -background "red" .graph1 axis cget Axis1 -background } -cleanup { destroy .graph1 } -result {red} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis configure -tickdivider command works correctly # ------------------------------------------------------------------------------ test graph.axis.configure-39.1 { Tickdivider } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -tickdivider 13.0 .graph1 axis cget Axis1 -tickdivider } -cleanup { destroy .graph1 } -result {13.0} #=============================================================================== # This part tests the axis create function of the graph BLT component. # Axis create is an instance function of graph. # ------------------------------------------------------------------------------ # Purpose: Ensure the axis create command works correctly when given a unique axis # name. # ------------------------------------------------------------------------------ test graph.axis.create-1.1 { Unique Name } -setup { ::graph .graph1 } -body { .graph1 axis create Axis1 .graph1 axis names Axis1 } -cleanup { destroy .graph1 } -result {Axis1} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis create command works correctly when given a unique axis # name and a valid option and value. # ------------------------------------------------------------------------------ test graph.axis.create-1.2 { Unique Name } -setup { ::graph .graph1 } -body { .graph1 axis create Axis1 -color black .graph1 axis names Axis1 } -cleanup { destroy .graph1 } -result {Axis1} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis create command works correctly when given an existing axis # name. # ------------------------------------------------------------------------------ test graph.axis.create-1.3 { Existing Name } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { if {[catch {.graph1 axis create Axis1}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} #=============================================================================== # This part tests the axis delete function of the graph BLT component. # Axis delete is an instance function of graph. # ------------------------------------------------------------------------------ # Purpose: Ensure the axis delete command works correctly when given a single existing # user created axis name # ------------------------------------------------------------------------------ test graph.axis.delete-1.1 { Single User Axis } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis delete Axis1 .graph1 axis names Axis1 } -cleanup { destroy .graph1 } -result {} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis delete command works correctly when given a single existing # system axis name # ------------------------------------------------------------------------------ test graph.axis.delete-1.2 { Single System Axis } -setup { ::graph .graph1 } -body { .graph1 axis delete x .graph1 axis names x } -cleanup { destroy .graph1 } -result {} # ------------------------------------------------------------------------------ # Purpose: Ensure the axis delete command works correctly when given multiple existing # axis names # ------------------------------------------------------------------------------ test graph.axis.delete-1.3 { Multiple Axis } -setup { ::graph .graph1 } -body { .graph1 axis delete x y .graph1 axis names } -cleanup { destroy .graph1 } -result {x2 y2} #=============================================================================== # This part tests the axis limits function of the graph BLT component. # Axis limits is an instance function of graph. # ------------------------------------------------------------------------------ # Purpose: Ensure the axis limits command works correctly # ------------------------------------------------------------------------------ test graph.axis.limits-1.1 { User Axis } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis limits Axis1 } -cleanup { destroy .graph1 } -result {0.0 1.0} #=============================================================================== # This part tests the axis names function of the graph BLT component. # Axis names is an instance function of graph. # ------------------------------------------------------------------------------ # Purpose: Ensure the axis names command works correctly with system axis # ------------------------------------------------------------------------------ test graph.axis.names-1.1 { System Axis } -setup { ::graph .graph1 } -body { .graph1 axis names } -cleanup { destroy .graph1 } -result {x y x2 y2} # ------------------------------------------------------------------------------ # Purpose: Purpose: Ensure the axis names command works correctly with system axis # and a user created axis # ------------------------------------------------------------------------------ test graph.axis.names-1.2 { System and User Axis } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis names Axis1 } -cleanup { destroy .graph1 } -result {Axis1} # ------------------------------------------------------------------------------ # Purpose: Purpose: Ensure the axis names command works correctly after one of the # system axes has been deleted # ------------------------------------------------------------------------------ test graph.axis.names-1.3 { System and Multiple User Axis } -setup { ::graph .graph1 .graph1 axis delete x } -body { .graph1 axis names } -cleanup { destroy .graph1 } -result {y x2 y2} #=============================================================================== # This part tests the axis view function of the graph BLT component. # Axis view is an instance function of graph. # ------------------------------------------------------------------------------ # Purpose: Ensure the axis view command works correctly # ------------------------------------------------------------------------------ test graph.axis.view-1.1 { User Axis } -setup { ::graph .graph1 .graph1 axis create Axis1 } -body { .graph1 axis configure Axis1 -scrollmax 10 .graph1 axis view Axis1 } -cleanup { destroy .graph1 } -result {0.0 0.0} #=============================================================================== # This part contains the automatic tests that test the bar # function of the graph BLT component. # ------------------------------------------------------------------------------ # Purpose: Ensure that a new barchart element can be created when given a unique name. # ------------------------------------------------------------------------------ test graph.bar-1.1 { ::graph bar: unique name } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 bar create Element1 .graph1 bar names } -cleanup { destroy .graph1 } -result {Element1} # ------------------------------------------------------------------------------ # Purpose: Ensure that a new barchart element can be created when given the name of an # existing bar element. # ------------------------------------------------------------------------------ test graph.bar-1.2 { ::graph bar: existing name } -setup { ::graph .graph1 pack .graph1 .graph1 bar create Element1 } -body { if {[catch {.graph1 bar create Element1}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} #=============================================================================== # This part contains the automatic tests that test the configure # function of the graph BLT component. # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -aspect command works correctly when given a positive # integer value. # ------------------------------------------------------------------------------ test graph.configure-1.1 { ::graph configure: aspect - positive integer input } -setup { ::graph .graph1 } -body { .graph1 configure -aspect 2 .graph1 cget -aspect } -cleanup { destroy .graph1 } -result {2.0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -aspect command works correctly when given a positive # decimal value. # ------------------------------------------------------------------------------ test graph.configure-1.2 { ::graph configure: aspect - positive decimal input } -setup { ::graph .graph1 } -body { .graph1 configure -aspect 4.3 .graph1 cget -aspect } -cleanup { destroy .graph1 } -result {4.3} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -aspect command works correctly when given a negative # integer value. # ------------------------------------------------------------------------------ test graph.configure-1.3 { ::graph configure: aspect - negative integer input } -setup { ::graph .graph1 } -body { .graph1 configure -aspect -2 .graph1 cget -aspect } -cleanup { destroy .graph1 } -result {-2.0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -aspect command works correctly when given a negative # decimal value. # ------------------------------------------------------------------------------ test graph.configure-1.4 { ::graph configure: aspect - negative decimal input } -setup { ::graph .graph1 } -body { .graph1 configure -aspect -4.3 .graph1 cget -aspect } -cleanup { destroy .graph1 } -result {-4.3} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -aspect command works correctly when given string # input. # ------------------------------------------------------------------------------ test graph.configure-1.5 { ::graph configure: aspect - string input } -setup { ::graph .graph1 } -body { if {[catch {.graph1 configure -aspect invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -background command works correctly when given a valid # color name. # ------------------------------------------------------------------------------ test graph.configure-2.1 { ::graph configure: background - valid color name } -setup { ::graph .graph1 } -body { .graph1 configure -background black .graph1 cget -background } -cleanup { destroy .graph1 } -result {black} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -background command works correctly when given an # invalid color name. # ------------------------------------------------------------------------------ test graph.configure-2.2 { ::graph configure: background - invalid color name } -setup { ::graph .graph1 } -body { if {[catch {.graph1 configure -background invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -background command works correctly when given # 'SystemButtonFace' as input. # ------------------------------------------------------------------------------ test graph.configure-2.3 { ::graph configure: background - SystemButtonFace } -setup { ::graph .graph1 } -body { .graph1 configure -background SystemButtonFace .graph1 cget -background } -cleanup { destroy .graph1 } -constraints {win} -result {SystemButtonFace} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -barmode command works correctly when given 'normal' # as input. # ------------------------------------------------------------------------------ test graph.configure-3.1 { ::graph configure: barmode - normal } -setup { ::graph .graph1 } -body { .graph1 configure -barmode normal .graph1 cget -barmode } -cleanup { destroy .graph1 } -result {normal} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -barmode command works correctly when given 'infront' # as input. # ------------------------------------------------------------------------------ test graph.configure-3.2 { ::graph configure: barmode - infront } -setup { ::graph .graph1 } -body { .graph1 configure -barmode infront .graph1 cget -barmode } -cleanup { destroy .graph1 } -result {infront} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -barmode command works correctly when given 'stacked' # as input. # ------------------------------------------------------------------------------ test graph.configure-3.3 { ::graph configure: barmode - stacked } -setup { ::graph .graph1 } -body { .graph1 configure -barmode stacked .graph1 cget -barmode } -cleanup { destroy .graph1 } -result {stacked} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -barmode command works correctly when given 'overlap' # as input. # ------------------------------------------------------------------------------ test graph.configure-3.4 { ::graph configure: barmode - overlap } -setup { ::graph .graph1 } -body { .graph1 configure -barmode overlap .graph1 cget -barmode } -cleanup { destroy .graph1 } -result {overlap} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -barmode command works correctly when given 'aligned' # as input. # ------------------------------------------------------------------------------ test graph.configure-3.5 { ::graph configure: barmode - aligned } -setup { ::graph .graph1 } -body { .graph1 configure -barmode aligned .graph1 cget -barmode } -cleanup { destroy .graph1 } -result {aligned} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -barmode command works correctly when given invalid # input. # ------------------------------------------------------------------------------ test graph.configure-3.6 { ::graph configure: barmode - invalid input } -setup { ::graph .graph1 } -body { if {[catch {.graph1 configure -barmode invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -barwidth command works correctly when given a # positive integer value. # ------------------------------------------------------------------------------ test graph.configure-4.1 { ::graph configure: barwidth - positive integer input } -setup { ::graph .graph1 } -body { .graph1 configure -barwidth 2 .graph1 cget -barwidth } -cleanup { destroy .graph1 } -result {2.0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -barwidth command works correctly when given a # negative integer value. # ------------------------------------------------------------------------------ test graph.configure-4.2 { ::graph configure: barwidth - negative integer input } -setup { ::graph .graph1 } -body { .graph1 configure -barwidth -2 .graph1 cget -barwidth } -cleanup { destroy .graph1 } -result {0.1} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -barwidth command works correctly when given a # positive decimal value. # ------------------------------------------------------------------------------ test graph.configure-4.3 { ::graph configure: barwidth - positive decimal input } -setup { ::graph .graph1 } -body { .graph1 configure -barwidth 3.5 .graph1 cget -barwidth } -cleanup { destroy .graph1 } -result {3.5} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -barwidth command works correctly when given a # negative decimal value. # ------------------------------------------------------------------------------ test graph.configure-4.4 { ::graph configure: barwidth - negative decimal input } -setup { ::graph .graph1 } -body { .graph1 configure -barwidth -2.5 .graph1 cget -barwidth } -cleanup { destroy .graph1 } -result {0.1} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -barwidth command works correctly when given string # input. # ------------------------------------------------------------------------------ test graph.configure-4.5 { ::graph configure: barwidth - string input } -setup { ::graph .graph1 } -body { if {[catch {.graph1 configure -barwidth invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -barwidth command works correctly when given 0 as # input. # ------------------------------------------------------------------------------ test graph.configure-4.6 { ::graph configure: barwidth - 0 } -setup { ::graph .graph1 } -body { .graph1 configure -barwidth 0 .graph1 cget -barwidth } -cleanup { destroy .graph1 } -result {0.1} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -baseline command works correctly when given a # positive integer value. # ------------------------------------------------------------------------------ test graph.configure-5.1 { ::graph configure: baseline - positive integer input } -setup { ::graph .graph1 } -body { .graph1 configure -baseline 2 .graph1 cget -baseline } -cleanup { destroy .graph1 } -result {2.0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -baseline command works correctly when given a # negative integer value. # ------------------------------------------------------------------------------ test graph.configure-5.2 { ::graph configure: baseline - negative integer input } -setup { ::graph .graph1 } -body { .graph1 configure -baseline -2 .graph1 cget -baseline } -cleanup { destroy .graph1 } -result {-2.0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -baseline command works correctly when given a # positive decimal value. # ------------------------------------------------------------------------------ test graph.configure-5.3 { ::graph configure: baseline - positive decimal input } -setup { ::graph .graph1 } -body { .graph1 configure -baseline 3.5 .graph1 cget -baseline } -cleanup { destroy .graph1 } -result {3.5} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -baseline command works correctly when given a # negative decimal value. # ------------------------------------------------------------------------------ test graph.configure-5.4 { ::graph configure: baseline - negative decimal input } -setup { ::graph .graph1 } -body { .graph1 configure -baseline -2.5 .graph1 cget -baseline } -cleanup { destroy .graph1 } -result {-2.5} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -baseline command works correctly when given string # input. # ------------------------------------------------------------------------------ test graph.configure-5.5 { ::graph configure: baseline - string input } -setup { ::graph .graph1 } -body { if {[catch {.graph1 configure -baseline invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -baseline command works correctly when given 0 as # input. # ------------------------------------------------------------------------------ test graph.configure-5.6 { ::graph configure: baseline - 0 } -setup { ::graph .graph1 } -body { .graph1 configure -baseline 0 .graph1 cget -baseline } -cleanup { destroy .graph1 } -result {0.0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -borderwidth command works correctly when given a # positive integer value. # ------------------------------------------------------------------------------ test graph.configure-6.1 { ::graph configure: borderwidth - positive integer input } -setup { ::graph .graph1 } -body { .graph1 configure -borderwidth 2 .graph1 cget -borderwidth } -cleanup { destroy .graph1 } -result {2} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -borderwidth command works correctly when given a # negative integer value. # ------------------------------------------------------------------------------ test graph.configure-6.2 { ::graph configure: borderwidth - negative integer input } -setup { ::graph .graph1 } -body { if {[catch {.graph1 configure -borderwidth -2}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -borderwidth command works correctly when given a # positive decimal value. # ------------------------------------------------------------------------------ test graph.configure-6.3 { ::graph configure: borderwidth - positive decimal input } -setup { ::graph .graph1 } -body { .graph1 configure -borderwidth 3.5 .graph1 cget -borderwidth } -cleanup { destroy .graph1 } -result {4} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -borderwidth command works correctly when given a # negative decimal value. # ------------------------------------------------------------------------------ test graph.configure-6.4 { ::graph configure: borderwidth - negative decimal input } -setup { ::graph .graph1 } -body { if {[catch {.graph1 configure -borderwidth -2.5}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -borderwidth command works correctly when given string # input. # ------------------------------------------------------------------------------ test graph.configure-6.5 { ::graph configure: borderwidth - string input } -setup { ::graph .graph1 } -body { if {[catch {.graph1 configure -borderwidth invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -borderwidth command works correctly when given 0 as # input. # ------------------------------------------------------------------------------ test graph.configure-6.6 { ::graph configure: borderwidth - 0 } -setup { ::graph .graph1 } -body { .graph1 configure -borderwidth 0 .graph1 cget -borderwidth } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -bottommargin command works correctly when given a # positive integer value. # ------------------------------------------------------------------------------ test graph.configure-7.1 { ::graph configure: bottommargin - positive integer input } -setup { ::graph .graph1 } -body { .graph1 configure -bottommargin 2 .graph1 cget -bottommargin } -cleanup { destroy .graph1 } -result {2} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -bottommargin command works correctly when given a # negative integer value. # ------------------------------------------------------------------------------ test graph.configure-7.2 { ::graph configure: bottommargin - negative integer input } -setup { ::graph .graph1 } -body { if {[catch {.graph1 configure -bottommargin -2}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -bottommargin command works correctly when given a # positive decimal value. # ------------------------------------------------------------------------------ test graph.configure-7.3 { ::graph configure: bottommargin - positive decimal input } -setup { ::graph .graph1 } -body { .graph1 configure -bottommargin 3.5 .graph1 cget -bottommargin } -cleanup { destroy .graph1 } -result {4} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -bottommargin command works correctly when given a # negative decimal value. # ------------------------------------------------------------------------------ test graph.configure-7.4 { ::graph configure: bottommargin - negative decimal input } -setup { ::graph .graph1 } -body { if {[catch {.graph1 configure -bottommargin -2.5}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -bottommargin command works correctly when given # string input. # ------------------------------------------------------------------------------ test graph.configure-7.5 { ::graph configure: bottommargin - string input } -setup { ::graph .graph1 } -body { if {[catch {.graph1 configure -bottommargin invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -bottommargin command works correctly when given 0 as # input. # ------------------------------------------------------------------------------ test graph.configure-7.6 { ::graph configure: bottommargin - 0 } -setup { ::graph .graph1 } -body { .graph1 configure -bottommargin 0 .graph1 cget -bottommargin } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -bottomvariable command works correctly when given a # single variable name. # ------------------------------------------------------------------------------ test graph.configure-8.1 { ::graph configure: bottomvariable - single variable name } -setup { ::graph .graph1 } -body { .graph1 configure -bottomvariable var1 .graph1 cget -bottomvariable } -cleanup { destroy .graph1 } -result {var1} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -bottomvariable command works correctly when given a # list of variable names. # ------------------------------------------------------------------------------ test graph.configure-8.2 { ::graph configure: bottomvariable - list of variable names } -setup { ::graph .graph1 } -body { .graph1 configure -bottomvariable {var1 var2 var3} .graph1 cget -bottomvariable } -cleanup { destroy .graph1 } -result {var1 var2 var3} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -bufferelements command works correctly when given 1. # ------------------------------------------------------------------------------ test graph.configure-9.1 { ::graph configure: bufferelements - 1 } -setup { ::graph .graph1 } -body { .graph1 configure -bufferelements 1 .graph1 cget -bufferelements } -cleanup { destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -bufferelements command works correctly when given 0. # ------------------------------------------------------------------------------ test graph.configure-9.2 { ::graph configure: bufferelements - 0 } -setup { ::graph .graph1 } -body { .graph1 configure -bufferelements 0 .graph1 cget -bufferelements } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -bufferelements command works correctly when given # true. # ------------------------------------------------------------------------------ test graph.configure-9.3 { ::graph configure: bufferelements - true } -setup { ::graph .graph1 } -body { .graph1 configure -bufferelements true .graph1 cget -bufferelements } -cleanup { destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -bufferelements command works correctly when given # false. # ------------------------------------------------------------------------------ test graph.configure-9.4 { ::graph configure: bufferelements - false } -setup { ::graph .graph1 } -body { .graph1 configure -bufferelements false .graph1 cget -bufferelements } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -bufferelements command works correctly when given # yes. # ------------------------------------------------------------------------------ test graph.configure-9.5 { ::graph configure: bufferelements - yes } -setup { ::graph .graph1 } -body { .graph1 configure -bufferelements yes .graph1 cget -bufferelements } -cleanup { destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -bufferelements command works correctly when given no. # ------------------------------------------------------------------------------ test graph.configure-9.6 { ::graph configure: bufferelements - no } -setup { ::graph .graph1 } -body { .graph1 configure -bufferelements no .graph1 cget -bufferelements } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -bufferelements command works correctly when given an # invalid input value. # ------------------------------------------------------------------------------ test graph.configure-9.7 { ::graph configure: bufferelements - invalid input } -setup { ::graph .graph1 } -body { if {[catch {.graph1 configure -bufferelements invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -buffergraph command works correctly when given 1. # ------------------------------------------------------------------------------ test graph.configure-10.1 { ::graph configure: buffergraph - 1 } -setup { ::graph .graph1 } -body { .graph1 configure -buffergraph 1 .graph1 cget -buffergraph } -cleanup { destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -buffergraph command works correctly when given 0. # ------------------------------------------------------------------------------ test graph.configure-10.2 { ::graph configure: buffergraph - 0 } -setup { ::graph .graph1 } -body { .graph1 configure -buffergraph 0 .graph1 cget -buffergraph } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -buffergraph command works correctly when given true. # ------------------------------------------------------------------------------ test graph.configure-10.3 { ::graph configure: buffergraph - true } -setup { ::graph .graph1 } -body { .graph1 configure -buffergraph true .graph1 cget -buffergraph } -cleanup { destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -buffergraph command works correctly when given false. # ------------------------------------------------------------------------------ test graph.configure-10.4 { ::graph configure: buffergraph - false } -setup { ::graph .graph1 } -body { .graph1 configure -buffergraph false .graph1 cget -buffergraph } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -buffergraph command works correctly when given yes. # ------------------------------------------------------------------------------ test graph.configure-10.5 { ::graph configure: buffergraph - yes } -setup { ::graph .graph1 } -body { .graph1 configure -buffergraph yes .graph1 cget -buffergraph } -cleanup { destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -buffergraph command works correctly when given no. # ------------------------------------------------------------------------------ test graph.configure-10.6 { ::graph configure: buffergraph - no } -setup { ::graph .graph1 } -body { .graph1 configure -buffergraph no .graph1 cget -buffergraph } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -buffergraph command works correctly when given an # invalid input value. # ------------------------------------------------------------------------------ test graph.configure-10.7 { ::graph configure: buffergraph - invalid input } -setup { ::graph .graph1 } -body { if {[catch {.graph1 configure -buffergraph invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -cursor command works correctly when given 'crosshair' # as input. # ------------------------------------------------------------------------------ test graph.configure-11.1 { ::graph configure: cursor - crosshair } -setup { ::graph .graph1 } -body { .graph1 configure -cursor crosshair .graph1 cget -cursor } -cleanup { destroy .graph1 } -result {crosshair} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -cursor command works correctly when given 'circle' # as input. # ------------------------------------------------------------------------------ test graph.configure-11.2 { ::graph configure: cursor - circle } -setup { ::graph .graph1 } -body { .graph1 configure -cursor circle .graph1 cget -cursor } -cleanup { destroy .graph1 } -result {circle} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -cursor command works correctly when given 'cross' as # input. # ------------------------------------------------------------------------------ test graph.configure-11.3 { ::graph configure: cursor - cross } -setup { ::graph .graph1 } -body { .graph1 configure -cursor cross .graph1 cget -cursor } -cleanup { destroy .graph1 } -result {cross} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -cursor command works correctly when given 'plus' as # input. # ------------------------------------------------------------------------------ test graph.configure-11.4 { ::graph configure: cursor - plus } -setup { ::graph .graph1 } -body { .graph1 configure -cursor plus .graph1 cget -cursor } -cleanup { destroy .graph1 } -result {plus} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -cursor command works correctly when given invalid # input. # ------------------------------------------------------------------------------ test graph.configure-11.5 { ::graph configure: cursor - invalid input } -setup { ::graph .graph1 } -body { if {[catch {.graph1 configure -cursor invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -font command works correctly when given a string as # input. # ------------------------------------------------------------------------------ test graph.configure-14.1 { ::graph configure: font - name string } -setup { ::graph .graph1 } -body { .graph1 configure -font Times .graph1 cget -font } -cleanup { destroy .graph1 } -result {Times} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -font command works correctly when given a string as # input. # ------------------------------------------------------------------------------ test graph.configure-14.2 { ::graph configure: font - font string } -setup { ::graph .graph1 } -body { .graph1 configure -font *-Helvetica-*-R-Normal-*-10-120-* .graph1 cget -font } -cleanup { destroy .graph1 } -result {*-Helvetica-*-R-Normal-*-10-120-*} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -font command works correctly when given a list with a # string as input. # ------------------------------------------------------------------------------ test graph.configure-14.3 { ::graph configure: font - list with string } -setup { ::graph .graph1 } -body { .graph1 configure -font {Times} .graph1 cget -font } -cleanup { destroy .graph1 } -result {Times} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -font command works correctly when given a list with a # string and positive integer as input. # ------------------------------------------------------------------------------ test graph.configure-14.4 { ::graph configure: font - list with string and positive integer } -setup { ::graph .graph1 } -body { .graph1 configure -font {Times 10} .graph1 cget -font } -cleanup { destroy .graph1 } -result {Times 10} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -font command works correctly when given a list with a # string and negative integer as input. # ------------------------------------------------------------------------------ test graph.configure-14.5 { ::graph configure: font - list with string and negative integer } -setup { ::graph .graph1 } -body { .graph1 configure -font {Times -10} .graph1 cget -font } -cleanup { destroy .graph1 } -result {Times -10} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -font command works correctly when given a list with a # string and decimal as input. # ------------------------------------------------------------------------------ test graph.configure-14.6 { ::graph configure: font - list with string and decimal } -setup { ::graph .graph1 } -body { if {[catch {.graph1 configure -font {Times 10.5}}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -font command works correctly when given a list with 2 # strings as input. # ------------------------------------------------------------------------------ test graph.configure-14.7 { ::graph configure: font - list with 2 strings } -setup { ::graph .graph1 } -body { if {[catch {.graph1 configure -font {Times Ten}}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -foreground command works correctly when given a valid # color name. # ------------------------------------------------------------------------------ test graph.configure-15.1 { ::graph configure: foreground - valid color name } -setup { ::graph .graph1 } -body { .graph1 configure -foreground black .graph1 cget -foreground } -cleanup { destroy .graph1 } -result {black} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -foreground command works correctly when given an # invalid color name. # ------------------------------------------------------------------------------ test graph.configure-15.2 { ::graph configure: foreground - invalid color name } -setup { ::graph .graph1 } -body { if {[catch {.graph1 configure -foreground invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -foreground command works correctly when given # 'SystemButtonText' as input. # ------------------------------------------------------------------------------ test graph.configure-15.3 { ::graph configure: foreground - SystemButtonText } -setup { ::graph .graph1 } -body { .graph1 configure -foreground SystemButtonText .graph1 cget -foreground } -cleanup { destroy .graph1 } -constraints {win} -result {SystemButtonText} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -halo command works correctly when given a positive # integer value. # ------------------------------------------------------------------------------ test graph.configure-16.1 { ::graph configure: halo - positive integer input } -setup { ::graph .graph1 } -body { .graph1 configure -halo 2 .graph1 cget -halo } -cleanup { destroy .graph1 } -result {2} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -halo command works correctly when given a negative # integer value. # ------------------------------------------------------------------------------ test graph.configure-16.2 { ::graph configure: halo - negative integer input } -setup { ::graph .graph1 } -body { if {[catch {.graph1 configure -halo -2}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -halo command works correctly when given a positive # decimal value. # ------------------------------------------------------------------------------ test graph.configure-16.3 { ::graph configure: halo - positive decimal input } -setup { ::graph .graph1 } -body { .graph1 configure -halo 3.5 .graph1 cget -halo } -cleanup { destroy .graph1 } -result {4} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -halo command works correctly when given a negative # decimal value. # ------------------------------------------------------------------------------ test graph.configure-16.4 { ::graph configure: halo - negative decimal input } -setup { ::graph .graph1 } -body { if {[catch {.graph1 configure -halo -2.5}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -halo command works correctly when given a positive # inch value. # ------------------------------------------------------------------------------ test graph.configure-16.5 { ::graph configure: halo - positive inch input } -setup { ::graph .graph1 } -body { .graph1 configure -halo 3i expr {[.graph1 cget -halo] - [winfo pixels .graph1 3i]} } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -halo command works correctly when given a negative # inch value. # ------------------------------------------------------------------------------ test graph.configure-16.6 { ::graph configure: halo - negative inch input } -setup { ::graph .graph1 } -body { if {[catch {.graph1 configure -halo -2i}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -halo command works correctly when given string input. # ------------------------------------------------------------------------------ test graph.configure-16.7 { ::graph configure: halo - string input } -setup { ::graph .graph1 } -body { if {[catch {.graph1 configure -halo invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -halo command works correctly when given 0 as input. # ------------------------------------------------------------------------------ test graph.configure-16.8 { ::graph configure: halo - 0 } -setup { ::graph .graph1 } -body { .graph1 configure -halo 0 .graph1 cget -halo } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -height command works correctly when given a positive # integer value. # ------------------------------------------------------------------------------ test graph.configure-17.1 { ::graph configure: height - positive integer input } -setup { ::graph .graph1 } -body { .graph1 configure -height 2 .graph1 cget -height } -cleanup { destroy .graph1 } -result {2} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -height command works correctly when given a negative # integer value. # ------------------------------------------------------------------------------ test graph.configure-17.2 { ::graph configure: height - negative integer input } -setup { ::graph .graph1 } -body { if {[catch {.graph1 configure -height -2}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -height command works correctly when given a positive # decimal value. # ------------------------------------------------------------------------------ test graph.configure-17.3 { ::graph configure: height - positive decimal input } -setup { ::graph .graph1 } -body { .graph1 configure -height 3.5 .graph1 cget -height } -cleanup { destroy .graph1 } -result {4} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -height command works correctly when given a negative # decimal value. # ------------------------------------------------------------------------------ test graph.configure-17.4 { ::graph configure: height - negative decimal input } -setup { ::graph .graph1 } -body { if {[catch {.graph1 configure -height -2.5}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -height command works correctly when given a positive # inch value. # ------------------------------------------------------------------------------ test graph.configure-17.5 { ::graph configure: height - positive inch input } -setup { ::graph .graph1 } -body { .graph1 configure -height 3i expr {[.graph1 cget -height] - [winfo pixels .graph1 3i]} } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -height command works correctly when given a negative # inch value. # ------------------------------------------------------------------------------ test graph.configure-17.6 { ::graph configure: height - negative inch input } -setup { ::graph .graph1 } -body { if {[catch {.graph1 configure -height -2i}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -height command works correctly when given string # input. # ------------------------------------------------------------------------------ test graph.configure-17.7 { ::graph configure: height - string input } -setup { ::graph .graph1 } -body { if {[catch {.graph1 configure -height invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -height command works correctly when given 0 as input. # ------------------------------------------------------------------------------ test graph.configure-17.8 { ::graph configure: height - 0 } -setup { ::graph .graph1 } -body { .graph1 configure -height 0 .graph1 cget -height } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -highlightbackground command works correctly when # given a valid color name. # ------------------------------------------------------------------------------ test graph.configure-18.1 { ::graph configure: highlightbackground - valid color name } -setup { ::graph .graph1 } -body { .graph1 configure -highlightbackground black .graph1 cget -highlightbackground } -cleanup { destroy .graph1 } -result {black} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -highlightbackground command works correctly when # given an invalid color name. # ------------------------------------------------------------------------------ test graph.configure-18.2 { ::graph configure: highlightbackground - invalid color name } -setup { ::graph .graph1 } -body { if {[catch {.graph1 configure -highlightbackground invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -highlightbackground command works correctly when # given 'SystemButtonFace' as input. # ------------------------------------------------------------------------------ test graph.configure-18.3 { ::graph configure: highlightbackground - SystemButtonFace } -setup { ::graph .graph1 } -body { .graph1 configure -highlightbackground SystemButtonFace .graph1 cget -highlightbackground } -cleanup { destroy .graph1 } -constraints {win} -result {SystemButtonFace} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -highlightcolor command works correctly when given a # valid color name. # ------------------------------------------------------------------------------ test graph.configure-19.1 { ::graph configure: highlightcolor - valid color name } -setup { ::graph .graph1 } -body { .graph1 configure -highlightcolor black .graph1 cget -highlightcolor } -cleanup { destroy .graph1 } -result {black} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -highlightcolor command works correctly when given an # invalid color name. # ------------------------------------------------------------------------------ test graph.configure-19.2 { ::graph configure: highlightcolor - invalid color name } -setup { ::graph .graph1 } -body { if {[catch {.graph1 configure -highlightcolor invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -highlightthickness command works correctly when given # a positive integer value. # ------------------------------------------------------------------------------ test graph.configure-20.1 { ::graph configure: highlightthickness - positive integer input } -setup { ::graph .graph1 } -body { .graph1 configure -highlightthickness 2 .graph1 cget -highlightthickness } -cleanup { destroy .graph1 } -result {2} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -highlightthickness command works correctly when given # a negative integer value. # ------------------------------------------------------------------------------ test graph.configure-20.2 { ::graph configure: highlightthickness - negative integer input } -setup { ::graph .graph1 } -body { .graph1 configure -highlightthickness -2 .graph1 cget -highlightthickness } -cleanup { destroy .graph1 } -result {-2} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -highlightthickness command works correctly when given # a positive decimal value. # ------------------------------------------------------------------------------ test graph.configure-20.3 { ::graph configure: highlightthickness - positive decimal input } -setup { ::graph .graph1 } -body { .graph1 configure -highlightthickness 3.5 .graph1 cget -highlightthickness } -cleanup { destroy .graph1 } -result {4} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -highlightthickness command works correctly when given # a negative decimal value. # ------------------------------------------------------------------------------ test graph.configure-20.4 { ::graph configure: highlightthickness - negative decimal input } -setup { ::graph .graph1 } -body { .graph1 configure -highlightthickness -2.5 .graph1 cget -highlightthickness } -cleanup { destroy .graph1 } -result {-3} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -highlightthickness command works correctly when given # string input. # ------------------------------------------------------------------------------ test graph.configure-20.5 { ::graph configure: highlightthickness - string input } -setup { ::graph .graph1 } -body { if {[catch {.graph1 configure -highlightthickness invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -highlightthickness command works correctly when given # 0 as input. # ------------------------------------------------------------------------------ test graph.configure-20.6 { ::graph configure: highlightthickness - 0 } -setup { ::graph .graph1 } -body { .graph1 configure -highlightthickness 0 .graph1 cget -highlightthickness } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -invertxy command works correctly when given 1. # ------------------------------------------------------------------------------ test graph.configure-21.1 { ::graph configure: invertxy - 1 } -setup { ::graph .graph1 } -body { .graph1 configure -invertxy 1 .graph1 cget -invertxy } -cleanup { destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -invertxy command works correctly when given 0. # ------------------------------------------------------------------------------ test graph.configure-21.2 { ::graph configure: invertxy - 0 } -setup { ::graph .graph1 } -body { .graph1 configure -invertxy 0 .graph1 cget -invertxy } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -invertxy command works correctly when given true. # ------------------------------------------------------------------------------ test graph.configure-21.3 { ::graph configure: invertxy - true } -setup { ::graph .graph1 } -body { .graph1 configure -invertxy true .graph1 cget -invertxy } -cleanup { destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -invertxy command works correctly when given false. # ------------------------------------------------------------------------------ test graph.configure-21.4 { ::graph configure: invertxy - false } -setup { ::graph .graph1 } -body { .graph1 configure -invertxy false .graph1 cget -invertxy } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -invertxy command works correctly when given yes. # ------------------------------------------------------------------------------ test graph.configure-21.5 { ::graph configure: invertxy - yes } -setup { ::graph .graph1 } -body { .graph1 configure -invertxy yes .graph1 cget -invertxy } -cleanup { destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -invertxy command works correctly when given no. # ------------------------------------------------------------------------------ test graph.configure-21.6 { ::graph configure: invertxy - no } -setup { ::graph .graph1 } -body { .graph1 configure -invertxy no .graph1 cget -invertxy } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -invertxy command works correctly when given an # invalid input value. # ------------------------------------------------------------------------------ test graph.configure-21.7 { ::graph configure: invertxy - invalid input } -setup { ::graph .graph1 } -body { if {[catch {.graph1 configure -invertxy invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -justify command works correctly when given 'left'. # ------------------------------------------------------------------------------ test graph.configure-22.1 { ::graph configure: justify - left } -setup { ::graph .graph1 } -body { .graph1 configure -justify left .graph1 cget -justify } -cleanup { destroy .graph1 } -result {left} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -justify command works correctly when given 'center'. # ------------------------------------------------------------------------------ test graph.configure-22.2 { ::graph configure: justify - center } -setup { ::graph .graph1 } -body { .graph1 configure -justify center .graph1 cget -justify } -cleanup { destroy .graph1 } -result {center} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -justify command works correctly when given 'right'. # ------------------------------------------------------------------------------ test graph.configure-22.3 { ::graph configure: justify - right } -setup { ::graph .graph1 } -body { .graph1 configure -justify right .graph1 cget -justify } -cleanup { destroy .graph1 } -result {right} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -bottommargin command works correctly when given a # positive integer value. # ------------------------------------------------------------------------------ test graph.configure-23.1 { ::graph configure: leftmargin - positive integer input } -setup { ::graph .graph1 } -body { .graph1 configure -leftmargin 2 .graph1 cget -leftmargin } -cleanup { destroy .graph1 } -result {2} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -leftmargin command works correctly when given a # negative integer value. # ------------------------------------------------------------------------------ test graph.configure-23.2 { ::graph configure: leftmargin - negative integer input } -setup { ::graph .graph1 } -body { if {[catch {.graph1 configure -leftmargin -2}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -leftmargin command works correctly when given a # positive decimal value. # ------------------------------------------------------------------------------ test graph.configure-23.3 { ::graph configure: leftmargin - positive decimal input } -setup { ::graph .graph1 } -body { .graph1 configure -leftmargin 3.5 .graph1 cget -leftmargin } -cleanup { destroy .graph1 } -result {4} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -leftmargin command works correctly when given a # negative decimal value. # ------------------------------------------------------------------------------ test graph.configure-23.4 { ::graph configure: leftmargin - negative decimal input } -setup { ::graph .graph1 } -body { if {[catch {.graph1 configure -leftmargin -2.5}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -leftmargin command works correctly when given string # input. # ------------------------------------------------------------------------------ test graph.configure-23.5 { ::graph configure: leftmargin - string input } -setup { ::graph .graph1 } -body { if {[catch {.graph1 configure -leftmargin invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -leftmargin command works correctly when given 0 as # input. # ------------------------------------------------------------------------------ test graph.configure-23.6 { ::graph configure: leftmargin - 0 } -setup { ::graph .graph1 } -body { .graph1 configure -leftmargin 0 .graph1 cget -leftmargin } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -leftvariable command works correctly when given a # single variable name. # ------------------------------------------------------------------------------ test graph.configure-24.1 { ::graph configure: leftvariable - single variable name } -setup { ::graph .graph1 } -body { .graph1 configure -leftvariable var1 .graph1 cget -leftvariable } -cleanup { destroy .graph1 } -result {var1} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -leftvariable command works correctly when given a # list of variable names. # ------------------------------------------------------------------------------ test graph.configure-24.2 { ::graph configure: leftvariable - list of variable names } -setup { ::graph .graph1 } -body { .graph1 configure -leftvariable {var1 var2 var3} .graph1 cget -leftvariable } -cleanup { destroy .graph1 } -result {var1 var2 var3} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -plotbackground command works correctly when given a # valid color name. # ------------------------------------------------------------------------------ test graph.configure-25.1 { ::graph configure: plotbackground - valid color name } -setup { ::graph .graph1 } -body { .graph1 configure -plotbackground black .graph1 cget -plotbackground } -cleanup { destroy .graph1 } -result {black} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -plotbackground command works correctly when given an # invalid color name. # ------------------------------------------------------------------------------ test graph.configure-25.2 { ::graph configure: plotbackground - invalid color name } -setup { ::graph .graph1 } -body { if {[catch {.graph1 configure -plotbackground invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -plotborderwidth command works correctly when given a # positive integer value. # ------------------------------------------------------------------------------ test graph.configure-26.1 { ::graph configure: plotborderwidth - positive integer input } -setup { ::graph .graph1 } -body { .graph1 configure -plotborderwidth 2 .graph1 cget -plotborderwidth } -cleanup { destroy .graph1 } -result {2} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -plotborderwidth command works correctly when given a # negative integer value. # ------------------------------------------------------------------------------ test graph.configure-26.2 { ::graph configure: plotborderwidth - negative integer input } -setup { ::graph .graph1 } -body { if {[catch {.graph1 configure -plotborderwidth -2}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -plotborderwidth command works correctly when given a # positive decimal value. # ------------------------------------------------------------------------------ test graph.configure-26.3 { ::graph configure: plotborderwidth - positive decimal input } -setup { ::graph .graph1 } -body { .graph1 configure -plotborderwidth 3.5 .graph1 cget -plotborderwidth } -cleanup { destroy .graph1 } -result {4} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -plotborderwidth command works correctly when given a # negative decimal value. # ------------------------------------------------------------------------------ test graph.configure-26.4 { ::graph configure: plotborderwidth - negative decimal input } -setup { ::graph .graph1 } -body { if {[catch {.graph1 configure -plotborderwidth -2.5}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -plotborderwidth command works correctly when given # string input. # ------------------------------------------------------------------------------ test graph.configure-26.5 { ::graph configure: plotborderwidth - string input } -setup { ::graph .graph1 } -body { if {[catch {.graph1 configure -plotborderwidth invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -plotborderwidth command works correctly when given 0 # as input. # ------------------------------------------------------------------------------ test graph.configure-26.6 { ::graph configure: plotborderwidth - 0 } -setup { ::graph .graph1 } -body { .graph1 configure -plotborderwidth 0 .graph1 cget -plotborderwidth } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -plotpadx command works correctly when given an # integer pixel value. # ------------------------------------------------------------------------------ test graph.configure-27.1 { ::graph configure: plotpadx - integer input } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 configure -plotpadx 2 .graph1 cget -plotpadx } -cleanup { destroy .graph1 } -result {2 2} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -plotpadx command works correctly when given an # invalid integer pixel value. # ------------------------------------------------------------------------------ test graph.configure-27.2 { ::graph configure: plotpadx - invalid integer input } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 configure -plotpadx -2}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -plotpadx command works correctly when given a # decimal pixel value. # ------------------------------------------------------------------------------ test graph.configure-27.3 { ::graph configure: plotpadx - decimal input } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 configure -plotpadx 3.5 .graph1 cget -plotpadx } -cleanup { destroy .graph1 } -result {4 4} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -plotpadx command works correctly when given an # invalid decimal pixel value. # ------------------------------------------------------------------------------ test graph.configure-27.4 { ::graph configure: plotpadx - invalid decimal input } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 configure -plotpadx -2.5}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -plotpadx command works correctly when given a valid # list of numerical pixel values. # ------------------------------------------------------------------------------ test graph.configure-27.5 { ::graph legend: configure: plotpadx - valid list of values } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 configure -plotpadx {1 2.5} .graph1 cget -plotpadx } -cleanup { destroy .graph1 } -result {1 3} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -plotpadx command works correctly when given a string # as input. # ------------------------------------------------------------------------------ test graph.configure-27.6 { ::graph configure: plotpadx - string input } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 configure -plotpadx a}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -plotpadx command works correctly when given an # invalid list of numerical pixel values. # ------------------------------------------------------------------------------ test graph.configure-27.7 { ::graph legend: configure: plotpadx - invalid list of values } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 configure -plotpadx {1 a}}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -plotpadx command works correctly when given a list of # input that is too long. # ------------------------------------------------------------------------------ test graph.configure-27.8 { ::graph configure: plotpadx - invalid list length } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 configure -plotpadx {1 2 3}}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -plotpadx command works correctly when given 0 as # input. # ------------------------------------------------------------------------------ test graph.configure-27.9 { ::graph configure: plotpadx - 0 } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 configure -plotpadx 0 .graph1 cget -plotpadx } -cleanup { destroy .graph1 } -result {0 0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -plotpady command works correctly when given an # integer pixel value. # ------------------------------------------------------------------------------ test graph.configure-28.1 { ::graph configure: plotpady - integer input } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 configure -plotpady 2 .graph1 cget -plotpady } -cleanup { destroy .graph1 } -result {2 2} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -plotpady command works correctly when given an # invalid integer pixel value. # ------------------------------------------------------------------------------ test graph.configure-28.2 { ::graph configure: plotpady - invalid integer input } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 configure -plotpady -2}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -plotpady command works correctly when given a decimal # pixel value. # ------------------------------------------------------------------------------ test graph.configure-28.3 { ::graph configure: plotpady - decimal input } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 configure -plotpady 3.5 .graph1 cget -plotpady } -cleanup { destroy .graph1 } -result {4 4} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -plotpady command works correctly when given an # invalid decimal pixel value. # ------------------------------------------------------------------------------ test graph.configure-28.4 { ::graph configure: plotpady - invalid decimal input } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 configure -plotpady -2.5}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -plotpady command works correctly when given a valid # list of numerical pixel values. # ------------------------------------------------------------------------------ test graph.configure-28.5 { ::graph legend: configure: plotpady - valid list of values } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 configure -plotpady {1 2.5} .graph1 cget -plotpady } -cleanup { destroy .graph1 } -result {1 3} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -plotpady command works correctly when given a string # as input. # ------------------------------------------------------------------------------ test graph.configure-28.6 { ::graph configure: plotpady - string input } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 configure -plotpady a}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -plotpady command works correctly when given an # invalid list of numerical pixel values. # ------------------------------------------------------------------------------ test graph.configure-28.7 { ::graph legend: configure: plotpady - invalid list of values } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 configure -plotpady {1 a}}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -plotpady command works correctly when given a list of # input that is too long. # ------------------------------------------------------------------------------ test graph.configure-28.8 { ::graph configure: plotpady - invalid list length } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 configure -plotpady {1 2 3}}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -plotpady command works correctly when given 0 as # input. # ------------------------------------------------------------------------------ test graph.configure-28.9 { ::graph configure: plotpady - 0 } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 configure -plotpady 0 .graph1 cget -plotpady } -cleanup { destroy .graph1 } -result {0 0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -plotrelief command works correctly when given 'flat' # as input. # ------------------------------------------------------------------------------ test graph.configure-29.1 { ::graph configure: plotrelief - flat } -setup { ::graph .graph1 } -body { .graph1 configure -plotrelief flat .graph1 cget -plotrelief } -cleanup { destroy .graph1 } -result {flat} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -plotrelief command works correctly when given # 'groove' as input. # ------------------------------------------------------------------------------ test graph.configure-29.2 { ::graph configure: plotrelief - groove } -setup { ::graph .graph1 } -body { .graph1 configure -plotrelief groove .graph1 cget -plotrelief } -cleanup { destroy .graph1 } -result {groove} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -plotrelief command works correctly when given # 'raised' as input. # ------------------------------------------------------------------------------ test graph.configure-29.3 { ::graph configure: plotrelief - raised } -setup { ::graph .graph1 } -body { .graph1 configure -plotrelief raised .graph1 cget -plotrelief } -cleanup { destroy .graph1 } -result {raised} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -plotrelief command works correctly when given 'ridge' # as input. # ------------------------------------------------------------------------------ test graph.configure-29.4 { ::graph configure: plotrelief - ridge } -setup { ::graph .graph1 } -body { .graph1 configure -plotrelief ridge .graph1 cget -plotrelief } -cleanup { destroy .graph1 } -result {ridge} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -plotrelief command works correctly when given 'solid' # as input. # ------------------------------------------------------------------------------ test graph.configure-29.5 { ::graph configure: plotrelief - solid } -setup { ::graph .graph1 } -body { .graph1 configure -plotrelief solid .graph1 cget -plotrelief } -cleanup { destroy .graph1 } -result {solid} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -plotrelief command works correctly when given # 'sunken' as input. # ------------------------------------------------------------------------------ test graph.configure-29.6 { ::graph configure: plotrelief - sunken } -setup { ::graph .graph1 } -body { .graph1 configure -plotrelief sunken .graph1 cget -plotrelief } -cleanup { destroy .graph1 } -result {sunken} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -plotrelief command works correctly when given invalid # numerical input. # ------------------------------------------------------------------------------ test graph.configure-29.7 { ::graph configure: plotrelief - invalid numerical input } -setup { ::graph .graph1 } -body { if {[catch {.graph1 configure -plotrelief 3.5}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -plotrelief command works correctly when given invalid # string input. # ------------------------------------------------------------------------------ test graph.configure-29.8 { ::graph configure: plotrelief - invalid string input } -setup { ::graph .graph1 } -body { if {[catch {.graph1 configure -plotrelief invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -relief command works correctly when given 'flat' as # input. # ------------------------------------------------------------------------------ test graph.configure-30.1 { ::graph configure: relief - flat } -setup { ::graph .graph1 } -body { .graph1 configure -relief flat .graph1 cget -relief } -cleanup { destroy .graph1 } -result {flat} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -relief command works correctly when given 'groove' as # input. # ------------------------------------------------------------------------------ test graph.configure-30.2 { ::graph configure: relief - groove } -setup { ::graph .graph1 } -body { .graph1 configure -relief groove .graph1 cget -relief } -cleanup { destroy .graph1 } -result {groove} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -relief command works correctly when given 'raised' as # input. # ------------------------------------------------------------------------------ test graph.configure-30.3 { ::graph configure: relief - raised } -setup { ::graph .graph1 } -body { .graph1 configure -relief raised .graph1 cget -relief } -cleanup { destroy .graph1 } -result {raised} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -relief command works correctly when given 'ridge' as # input. # ------------------------------------------------------------------------------ test graph.configure-30.4 { ::graph configure: relief - ridge } -setup { ::graph .graph1 } -body { .graph1 configure -relief ridge .graph1 cget -relief } -cleanup { destroy .graph1 } -result {ridge} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -relief command works correctly when given 'solid' as # input. # ------------------------------------------------------------------------------ test graph.configure-30.5 { ::graph configure: relief - solid } -setup { ::graph .graph1 } -body { .graph1 configure -relief solid .graph1 cget -relief } -cleanup { destroy .graph1 } -result {solid} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -relief command works correctly when given 'sunken' as # input. # ------------------------------------------------------------------------------ test graph.configure-30.6 { ::graph configure: relief - sunken } -setup { ::graph .graph1 } -body { .graph1 configure -relief sunken .graph1 cget -relief } -cleanup { destroy .graph1 } -result {sunken} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -relief command works correctly when given invalid # numerical input. # ------------------------------------------------------------------------------ test graph.configure-30.7 { ::graph configure: relief - invalid numerical input } -setup { ::graph .graph1 } -body { if {[catch {.graph1 configure -relief 3.5}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -relief command works correctly when given invalid # string input. # ------------------------------------------------------------------------------ test graph.configure-30.8 { ::graph configure: relief - invalid string input } -setup { ::graph .graph1 } -body { if {[catch {.graph1 configure -relief invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -rightmargin command works correctly when given a # positive integer value. # ------------------------------------------------------------------------------ test graph.configure-31.1 { ::graph configure: rightmargin - positive integer input } -setup { ::graph .graph1 } -body { .graph1 configure -rightmargin 2 .graph1 cget -rightmargin } -cleanup { destroy .graph1 } -result {2} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -rightmargin command works correctly when given a # negative integer value. # ------------------------------------------------------------------------------ test graph.configure-31.2 { ::graph configure: rightmargin - negative integer input } -setup { ::graph .graph1 } -body { if {[catch {.graph1 configure -rightmargin -2}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -rightmargin command works correctly when given a # positive decimal value. # ------------------------------------------------------------------------------ test graph.configure-31.3 { ::graph configure: rightmargin - positive decimal input } -setup { ::graph .graph1 } -body { .graph1 configure -rightmargin 3.5 .graph1 cget -rightmargin } -cleanup { destroy .graph1 } -result {4} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -rightmargin command works correctly when given a # negative decimal value. # ------------------------------------------------------------------------------ test graph.configure-31.4 { ::graph configure: rightmargin - negative decimal input } -setup { ::graph .graph1 } -body { if {[catch {.graph1 configure -rightmargin -2.5}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -rightmargin command works correctly when given string # input. # ------------------------------------------------------------------------------ test graph.configure-31.5 { ::graph configure: rightmargin - string input } -setup { ::graph .graph1 } -body { if {[catch {.graph1 configure -rightmargin invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -rightmargin command works correctly when given 0 as # input. # ------------------------------------------------------------------------------ test graph.configure-31.6 { ::graph configure: rightmargin - 0 } -setup { ::graph .graph1 } -body { .graph1 configure -rightmargin 0 .graph1 cget -rightmargin } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -rightvariable command works correctly when given a # single variable name. # ------------------------------------------------------------------------------ test graph.configure-32.1 { ::graph configure: rightvariable - single variable name } -setup { ::graph .graph1 } -body { .graph1 configure -rightvariable var1 .graph1 cget -rightvariable } -cleanup { destroy .graph1 } -result {var1} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -rightvariable command works correctly when given a # list of variable names. # ------------------------------------------------------------------------------ test graph.configure-32.2 { ::graph configure: rightvariable - list of variable names } -setup { ::graph .graph1 } -body { .graph1 configure -rightvariable {var1 var2 var3} .graph1 cget -rightvariable } -cleanup { destroy .graph1 } -result {var1 var2 var3} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -shadow command works correctly when given a valid # color name. # ------------------------------------------------------------------------------ test graph.configure-33.1 { ::graph configure: shadow - valid color name } -setup { ::graph .graph1 } -body { .graph1 configure -shadow black .graph1 cget -shadow } -cleanup { destroy .graph1 } -result {black 1} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -shadow command works correctly when given a valid # color name and a positive integer value. # ------------------------------------------------------------------------------ test graph.configure-33.2 { ::graph configure: shadow - valid color name and positive integer value } -setup { ::graph .graph1 } -body { .graph1 configure -shadow {blue 5} .graph1 cget -shadow } -cleanup { destroy .graph1 } -result {blue 5} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -shadow command works correctly when given a valid # color name and a negative integer value. # ------------------------------------------------------------------------------ test graph.configure-33.3 { ::graph configure: shadow - valid color name and negative integer value } -setup { ::graph .graph1 } -body { if {[catch {.graph1 configure -shadow {blue -5}}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -shadow command works correctly when given a positive # color name and a decimal value. # ------------------------------------------------------------------------------ test graph.configure-33.4 { ::graph configure: shadow - valid color name and decimal value } -setup { ::graph .graph1 } -body { .graph1 configure -shadow {blue 5} .graph1 cget -shadow } -cleanup { destroy .graph1 } -result {blue 5} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -shadow command works correctly when given an invalid # color name. # ------------------------------------------------------------------------------ test graph.configure-33.5 { ::graph configure: shadow - invalid color name } -setup { ::graph .graph1 } -body { if {[catch {.graph1 configure -shadow invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -takefocus command works correctly when given a string # input. # ------------------------------------------------------------------------------ test graph.configure-34.1 { ::graph configure: takefocus - string input } -setup { ::graph .graph1 } -body { .graph1 configure -takefocus {puts foo} .graph1 cget -takefocus } -cleanup { destroy .graph1 } -result {puts foo} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -takefocus command works correctly when given a # numerical input. # ------------------------------------------------------------------------------ test graph.configure-34.2 { ::graph configure: takefocus - numerical input } -setup { ::graph .graph1 } -body { .graph1 configure -takefocus {15} .graph1 cget -takefocus } -cleanup { destroy .graph1 } -result {15} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -tile command works correctly when given an existing # image name. # ------------------------------------------------------------------------------ test graph.configure-35.1 { ::graph configure: tile - existing image name } -setup { ::graph .graph1 # the following should set Image1 to the specified name set Image1 [image create photo image.a.35.1 -data { R0lGODlhEAAQAIYAAPwCBHSi1Iyy5Hym3Hym1GSWxJS65Lza/OT2/Pz+/PT+ /KTK5DxmlJS67PT6/Pz6/Lzm/BRGhHSe1MTe/OTy/Oz2/Mzm/NTq/FSKtJS2 7PT2/MTi/LTa/AQyVOTu/Lze/LTS/JTC9MTq/Mzi/KzK/KTC/KS+/BQuRJzG /KzO/LTO/KS6/Jy2/DRmpAQOHEx+rLTK/Jy+/Iym/Jyq/GSK/GSOrIyCBHSi 5HyW/DxuxFxqhPT+dPzqbHRCBAQmPBxenBxSjBxanARGfMRyDOymNOTCnPTG fIRKDMyGNOzGlISu7GSOzIROBPTGjJSy9EyGvIxODNSORMSWTLxyFDx6tBxe lKRiJGQ6BCQWBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAA LAAAAAAQABAAAAesgACCAQIDBAWCiYoABgcICQoJCwyLgg0OCQkPmgoQEYsS E5mYFBUWFxiLGZmbGhoWGxMcHYoDChoOFR4fByAcIbSJAyIXIxYgICQkJSbB gicovCkqJSssKy0uiy8bIDAxLDIzNDU2lS031TI4OTo7PD2VPj9AQUIuQ0RF RvGVi0dIkvATpGSJPwBMkDQxwkSCkyc3DkKJImUKlSdVhBxEaOUKACVVNgrC AsBPIAAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0K qSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpo dHRwOi8vd3d3LmRldmVsY29yLmNvbQA7 }] } -body { .graph1 configure -tile $Image1 .graph1 cget -tile } -cleanup { image delete $Image1 destroy .graph1 } -result {image.a.35.1} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -tile command works correctly when given an invalid # image name. # ------------------------------------------------------------------------------ test graph.configure-35.2 { ::graph configure: tile - invalid image name } -setup { ::graph .graph1 } -body { if {[catch {.graph1 configure -tile invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -title command works correctly when given a string # input. # ------------------------------------------------------------------------------ test graph.configure-36.1 { ::graph configure: title - string input } -setup { ::graph .graph1 } -body { .graph1 configure -title "A title string" .graph1 cget -title } -cleanup { destroy .graph1 } -result {A title string} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -title command works correctly when given a numerical # input. # ------------------------------------------------------------------------------ test graph.configure-36.2 { ::graph configure: title - numerical input } -setup { ::graph .graph1 } -body { .graph1 configure -title 15 .graph1 cget -title } -cleanup { destroy .graph1 } -result {15} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -topmargin command works correctly when given a # positive integer value. # ------------------------------------------------------------------------------ test graph.configure-37.1 { ::graph configure: topmargin - positive integer input } -setup { ::graph .graph1 } -body { .graph1 configure -topmargin 2 .graph1 cget -topmargin } -cleanup { destroy .graph1 } -result {2} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -topmargin command works correctly when given a # negative integer value. # ------------------------------------------------------------------------------ test graph.configure-37.2 { ::graph configure: topmargin - negative integer input } -setup { ::graph .graph1 } -body { if {[catch {.graph1 configure -topmargin -2}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -topmargin command works correctly when given a # positive decimal value. # ------------------------------------------------------------------------------ test graph.configure-37.3 { ::graph configure: topmargin - positive decimal input } -setup { ::graph .graph1 } -body { .graph1 configure -topmargin 3.5 .graph1 cget -topmargin } -cleanup { destroy .graph1 } -result {4} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -topmargin command works correctly when given a # negative decimal value. # ------------------------------------------------------------------------------ test graph.configure-37.4 { ::graph configure: topmargin - negative decimal input } -setup { ::graph .graph1 } -body { if {[catch {.graph1 configure -topmargin -2.5}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -topmargin command works correctly when given string # input. # ------------------------------------------------------------------------------ test graph.configure-37.5 { ::graph configure: topmargin - string input } -setup { ::graph .graph1 } -body { if {[catch {.graph1 configure -topmargin invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -topmargin command works correctly when given 0 as # input. # ------------------------------------------------------------------------------ test graph.configure-37.6 { ::graph configure: topmargin - 0 } -setup { ::graph .graph1 } -body { .graph1 configure -topmargin 0 .graph1 cget -topmargin } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -topvariable command works correctly when given a # single variable name. # ------------------------------------------------------------------------------ test graph.configure-38.1 { ::graph configure: topvariable - single variable name } -setup { ::graph .graph1 } -body { .graph1 configure -topvariable var1 .graph1 cget -topvariable } -cleanup { destroy .graph1 } -result {var1} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -topvariable command works correctly when given a list # of variable names. # ------------------------------------------------------------------------------ test graph.configure-38.2 { ::graph configure: topvariable - list of variable names } -setup { ::graph .graph1 } -body { .graph1 configure -topvariable {var1 var2 var3} .graph1 cget -topvariable } -cleanup { destroy .graph1 } -result {var1 var2 var3} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -width command works correctly when given a positive # integer value. # ------------------------------------------------------------------------------ test graph.configure-39.1 { ::graph configure: width - positive integer input } -setup { ::graph .graph1 } -body { .graph1 configure -width 2 .graph1 cget -width } -cleanup { destroy .graph1 } -result {2} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -width command works correctly when given a negative # integer value. # ------------------------------------------------------------------------------ test graph.configure-39.2 { ::graph configure: width - negative integer input } -setup { ::graph .graph1 } -body { if {[catch {.graph1 configure -width -2}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -width command works correctly when given a positive # decimal value. # ------------------------------------------------------------------------------ test graph.configure-39.3 { ::graph configure: width - positive decimal input } -setup { ::graph .graph1 } -body { .graph1 configure -width 3.5 .graph1 cget -width } -cleanup { destroy .graph1 } -result {4} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -width command works correctly when given a negative # decimal value. # ------------------------------------------------------------------------------ test graph.configure-39.4 { ::graph configure: width - negative decimal input } -setup { ::graph .graph1 } -body { if {[catch {.graph1 configure -width -2.5}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -width command works correctly when given a positive # inch value. # ------------------------------------------------------------------------------ test graph.configure-39.5 { ::graph configure: width - positive inch input } -setup { ::graph .graph1 } -body { .graph1 configure -width 3i expr {[.graph1 cget -width] - [winfo pixels .graph1 3i]} } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -width command works correctly when given a negative # inch value. # ------------------------------------------------------------------------------ test graph.configure-39.6 { ::graph configure: width - negative inch input } -setup { ::graph .graph1 } -body { if {[catch {.graph1 configure -width -2i}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -width command works correctly when given string # input. # ------------------------------------------------------------------------------ test graph.configure-39.7 { ::graph configure: width - string input } -setup { ::graph .graph1 } -body { if {[catch {.graph1 configure -width invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the configure -width command works correctly when given 0 as input. # ------------------------------------------------------------------------------ test graph.configure-39.8 { ::graph configure: width - 0 } -setup { ::graph .graph1 } -body { .graph1 configure -width 0 .graph1 cget -width } -cleanup { destroy .graph1 } -result {0} #=============================================================================== # This part contains the automatic tests that test the crosshairs cget # function of the graph BLT component. # ------------------------------------------------------------------------------ # Purpose: Ensure that cget works for default values. # ------------------------------------------------------------------------------ test graph.crosshairs.cget-1.1 { ::graph crosshairs: cget - default } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 crosshairs cget -color } -cleanup { destroy .graph1 } -result {#000000} # ------------------------------------------------------------------------------ # Purpose: Ensure the crosshairs cget command works correctly when given a valid # crosshairs configuration option name. # ------------------------------------------------------------------------------ test graph.crosshairs.cget-1.2 { ::graph crosshairs: cget - valid option name } -setup { ::graph .graph1 .graph1 crosshairs configure -color black } -body { .graph1 crosshairs cget -color } -cleanup { destroy .graph1 } -result {black} # ------------------------------------------------------------------------------ # Purpose: Ensure the crosshairs cget command works correctly when given an invalid # crosshairs configuration option name. # ------------------------------------------------------------------------------ test graph.crosshairs.cget-1.3 { ::graph crosshairs: cget - invalid option name } -setup { ::graph .graph1 } -body { if {[catch {.graph1 crosshairs cget -invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} #=============================================================================== # This part contains the automatic tests that test the crosshairs configure # function of the graph BLT component. # ------------------------------------------------------------------------------ # Purpose: Ensure the crosshairs configure -color command works correctly when given a # valid color name. # ------------------------------------------------------------------------------ test graph.crosshairs.configure-1.1 { ::graph crosshairs: configure - color - valid color name } -setup { ::graph .graph1 } -body { .graph1 crosshairs configure -color black .graph1 crosshairs cget -color } -cleanup { destroy .graph1 } -result {black} # ------------------------------------------------------------------------------ # Purpose: Ensure the crosshairs configure -color command works correctly when given # an invalid color name. # ------------------------------------------------------------------------------ test graph.crosshairs.configure-1.2 { ::graph crosshairs: configure - color - invalid color name } -setup { ::graph .graph1 } -body { if {[catch {.graph1 crosshairs configure -color invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the crosshairs configure -dashes command works correctly when given # a valid dash list. # ------------------------------------------------------------------------------ test graph.crosshairs.configure-2.1 { ::graph crosshairs: configure - dashes - valid dash list } -setup { ::graph .graph1 } -body { .graph1 crosshairs configure -dashes {2 3 2 4} .graph1 crosshairs cget -dashes } -cleanup { destroy .graph1 } -result {2 3 2 4} # ------------------------------------------------------------------------------ # Purpose: Ensure the crosshairs configure -dashes command works correctly when given # an empty dash list. # ------------------------------------------------------------------------------ test graph.crosshairs.configure-2.2 { ::graph crosshairs: configure - dashes - empty dash list } -setup { ::graph .graph1 } -body { .graph1 crosshairs configure -dashes "" .graph1 crosshairs cget -dashes } -cleanup { destroy .graph1 } -result {} # ------------------------------------------------------------------------------ # Purpose: Ensure the crosshairs configure -dashes command works correctly when given # a dash list that is too long. # ------------------------------------------------------------------------------ test graph.crosshairs.configure-2.3 { ::graph crosshairs: configure - dashes - long dash list } -setup { ::graph .graph1 } -body { if {[catch {.graph1 crosshairs configure -dashes {2 3 2 4 2 3 2 4 2 3 2 4}}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the crosshairs configure -dashes command works correctly when given # an invalid numerical dash list. # ------------------------------------------------------------------------------ test graph.crosshairs.configure-2.4 { ::graph crosshairs: configure - dashes - invalid numerical dash list } -setup { ::graph .graph1 } -body { if {[catch {.graph1 crosshairs configure -dashes {2 3 2 -1 2}}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the crosshairs configure -dashes command works correctly when given # a dash list with characters. # ------------------------------------------------------------------------------ test graph.crosshairs.configure-2.5 { ::graph crosshairs: configure - dashes - dash list with characters } -setup { ::graph .graph1 } -body { if {[catch {.graph1 crosshairs configure -dashes {2 3 2 a 2}}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the crosshairs configure -hide command works correctly when given 1. # ------------------------------------------------------------------------------ test graph.crosshairs.configure-3.1 { ::graph crosshairs: configure - hide - 1 } -setup { ::graph .graph1 } -body { .graph1 crosshairs configure -hide 1 .graph1 crosshairs cget -hide } -cleanup { destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the crosshairs configure -hide command works correctly when given 0. # ------------------------------------------------------------------------------ test graph.crosshairs.configure-3.2 { ::graph crosshairs: configure - hide - 0 } -setup { ::graph .graph1 } -body { .graph1 crosshairs configure -hide 0 .graph1 crosshairs cget -hide } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the crosshairs configure -hide command works correctly when given # true. # ------------------------------------------------------------------------------ test graph.crosshairs.configure-3.3 { ::graph crosshairs: configure - hide - true } -setup { ::graph .graph1 } -body { .graph1 crosshairs configure -hide true .graph1 crosshairs cget -hide } -cleanup { destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the crosshairs configure -hide command works correctly when given # false. # ------------------------------------------------------------------------------ test graph.crosshairs.configure-3.4 { ::graph crosshairs: configure - hide - false } -setup { ::graph .graph1 } -body { .graph1 crosshairs configure -hide false .graph1 crosshairs cget -hide } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the crosshairs configure -hide command works correctly when given # yes. # ------------------------------------------------------------------------------ test graph.crosshairs.configure-3.5 { ::graph crosshairs: configure - hide - yes } -setup { ::graph .graph1 } -body { .graph1 crosshairs configure -hide yes .graph1 crosshairs cget -hide } -cleanup { destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the crosshairs configure -hide command works correctly when given # no. # ------------------------------------------------------------------------------ test graph.crosshairs.configure-3.6 { ::graph crosshairs: configure - hide - no } -setup { ::graph .graph1 } -body { .graph1 crosshairs configure -hide no .graph1 crosshairs cget -hide } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the crosshairs configure -hide command works correctly when given an # invalid input value. # ------------------------------------------------------------------------------ test graph.crosshairs.configure-3.7 { ::graph crosshairs: configure - hide - invalid input } -setup { ::graph .graph1 } -body { if {[catch {.graph1 crosshairs configure -hide invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the crosshairs configure -linewidth command works correctly when # given an integer pixel value. # ------------------------------------------------------------------------------ test graph.crosshairs.configure-4.1 { ::graph crosshairs: configure - linewidth - valid integer input } -setup { ::graph .graph1 } -body { .graph1 crosshairs configure -linewidth 2 .graph1 crosshairs cget -linewidth } -cleanup { destroy .graph1 } -result {2} # ------------------------------------------------------------------------------ # Purpose: Ensure the crosshairs configure -linewidth command works correctly when # given an invalid integer pixel value. # ------------------------------------------------------------------------------ test graph.crosshairs.configure-4.2 { ::graph crosshairs: configure - linewidth - invalid integer input } -setup { ::graph .graph1 } -body { if {[catch {.graph1 crosshairs configure -linewidth -2}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the crosshairs configure -linewidth command works correctly when # given a decimal pixel value. # ------------------------------------------------------------------------------ test graph.crosshairs.configure-4.3 { ::graph crosshairs: configure - linewidth - valid decimal input } -setup { ::graph .graph1 } -body { .graph1 crosshairs configure -linewidth 3.5 .graph1 crosshairs cget -linewidth } -cleanup { destroy .graph1 } -result {4} # ------------------------------------------------------------------------------ # Purpose: Ensure the crosshairs configure -linewidth command works correctly when # given an invalid decimal pixel value. # ------------------------------------------------------------------------------ test graph.crosshairs.configure-4.4 { ::graph crosshairs: configure - linewidth - invalid integer input } -setup { ::graph .graph1 } -body { if {[catch {.graph1 crosshairs configure -linewidth -2.5}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the crosshairs configure -linewidth command works correctly when # given a character as input. # ------------------------------------------------------------------------------ test graph.crosshairs.configure-4.5 { ::graph crosshairs: configure - linewidth - character input } -setup { ::graph .graph1 } -body { if {[catch {.graph1 crosshairs configure -linewidth a}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the crosshairs configure -linewidth command works correctly when # given 0 as input. # ------------------------------------------------------------------------------ test graph.crosshairs.configure-4.6 { ::graph crosshairs: configure - linewidth - 0 } -setup { ::graph .graph1 } -body { .graph1 crosshairs configure -linewidth 0 .graph1 crosshairs cget -linewidth } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the crosshairs configure -position command works correctly when # given valid coordinates as input. # ------------------------------------------------------------------------------ test graph.crosshairs.configure-5.1 { ::graph crosshairs: configure - position - valid coordintes } -setup { ::graph .graph1 } -body { .graph1 crosshairs configure -position @1,3 .graph1 crosshairs cget -position } -cleanup { destroy .graph1 } -result {@1,3} # ------------------------------------------------------------------------------ # Purpose: Ensure the crosshairs configure -position command works correctly when # given invalid coordinates as input. # ------------------------------------------------------------------------------ test graph.crosshairs.configure-5.2 { ::graph crosshairs: configure - position - invalid coordintes } -setup { ::graph .graph1 } -body { if {[catch {.graph1 crosshairs configure -position @1,a}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the crosshairs configure -position command works correctly when # given input that is not in coordinate form (@x,y). # ------------------------------------------------------------------------------ test graph.crosshairs.configure-5.3 { ::graph crosshairs: configure - position - not coordinate form } -setup { ::graph .graph1 } -body { if {[catch {.graph1 crosshairs configure -position 1,2}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} #=============================================================================== # This part contains the automatic tests that test the element activate # function of the graph BLT component. # ------------------------------------------------------------------------------ # Purpose: Ensure the element activate command works correctly when given a valid # element name. # ------------------------------------------------------------------------------ test graph.element.activate-1.1 { ::graph element: activate - valid element name } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element activate Element1 .graph1 element activate } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {Element1} # ------------------------------------------------------------------------------ # Purpose: Ensure the element activate command works correctly when given an invalid # element name. # ------------------------------------------------------------------------------ test graph.element.activate-1.2 { ::graph element: activate - invalid element name } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element activate invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} #=============================================================================== # This part contains the automatic tests that test the element bind # function of the graph BLT component. # ------------------------------------------------------------------------------ # Purpose: Ensure the element bind command works correctly when given a tag name, an # event sequence, and a command. # ------------------------------------------------------------------------------ test graph.element.bind-1.1 { ::graph element: bind - tag, sequence, and command } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element bind Binding1 {puts foo} .graph1 element configure Element1 -bindtags Binding1 .graph1 element cget Element1 -bindtags } -cleanup { destroy Binding1 .graph1 element delete Element1 destroy .graph1 } -result {Binding1} #=============================================================================== # This part contains the automatic tests that test the element cget # function of the graph BLT component. # ------------------------------------------------------------------------------ # Purpose: Ensure the element cget command works correctly when given a valid # element configuration option name, but no value. # ------------------------------------------------------------------------------ test graph.element.cget-1.1 { ::graph element: cget - default } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element cget Element1 -activepen } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {activeLine} # ------------------------------------------------------------------------------ # Purpose: Ensure the element cget command works correctly when given a valid # element configuration option name. # ------------------------------------------------------------------------------ test graph.element.cget-1.2 { ::graph element: cget - valid option name } -setup { ::graph .graph1 .graph1 element create Element1 .graph1 element configure Element1 -color black } -body { .graph1 element cget Element1 -color } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {black} # ------------------------------------------------------------------------------ # Purpose: Ensure the element cget command works correctly when given an invalid # element configuration option name. # ------------------------------------------------------------------------------ test graph.element.cget-1.3 { ::graph element: cget - invalid option name } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element cget Element1 -invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} #=============================================================================== # This part contains the automatic tests that test the element configure # function of the graph BLT component. # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -activepen command works correctly when given # a valid pen name. # ------------------------------------------------------------------------------ test graph.element.configure-1.1 { ::graph element configure: activepen - valid pen name } -setup { ::graph .graph1 .graph1 element create Element1 .graph1 pen create Pen1 -color blue } -body { .graph1 element configure Element1 -activepen Pen1 .graph1 element cget Element1 -activepen } -cleanup { .graph1 pen delete Pen1 .graph1 element delete Element1 destroy .graph1 } -result {Pen1} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -activepen command works correctly when given # an invalid pen name. # ------------------------------------------------------------------------------ test graph.element.configure-1.2 { ::graph element configure: activepen - invalid pen name } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -activepen invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -bindtags command works correctly when given a # single tag name. # ------------------------------------------------------------------------------ test graph.element.configure-2.1 { ::graph element configure: bindtags - single tag } -setup { ::graph .graph1 .graph1 element bind Binding1 {puts foobar} .graph1 element create Element1 } -body { .graph1 element configure Element1 -bindtags Binding1 .graph1 element cget Element1 -bindtags } -cleanup { destroy Binding1 .graph1 element delete Element1 destroy .graph1 } -result {Binding1} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -bindtags command works correctly when given # a list of tag names. # ------------------------------------------------------------------------------ test graph.element.configure-2.2 { ::graph element configure: bindtags - tag list } -setup { ::graph .graph1 .graph1 element bind Binding1 {puts foo} .graph1 element bind Binding2 {puts bar} .graph1 element create Element1 } -body { .graph1 element configure Element1 -bindtags {Binding1 Binding2} .graph1 element cget Element1 -bindtags } -cleanup { destroy Binding1 Binding2 .graph1 element delete Element1 destroy .graph1 } -result {Binding1 Binding2} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -color command works correctly when given a # valid color name. # ------------------------------------------------------------------------------ test graph.element.configure-3.1 { ::graph element configure: color - valid color name } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -color black .graph1 element cget Element1 -color } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {black} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -color command works correctly when given an # invalid color name. # ------------------------------------------------------------------------------ test graph.element.configure-3.2 { ::graph element configure: color - invalid color name } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -color invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -dashes command works correctly when given # a valid dash list. # ------------------------------------------------------------------------------ test graph.element.configure-4.1 { ::graph element configure: dashes - valid dash list } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -dashes {2 3 2 4} .graph1 element cget Element1 -dashes } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {2 3 2 4} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -dashes command works correctly when given # an empty dash list. # ------------------------------------------------------------------------------ test graph.element.configure-4.2 { ::graph element configure: dashes - empty dash list } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -dashes "" .graph1 element cget Element1 -dashes } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -dashes command works correctly when given # a dash list that is too long. # ------------------------------------------------------------------------------ test graph.element.configure-4.3 { ::graph element configure: dashes - long dash list } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -dashes {2 3 2 4 2 3 2 4 2 3 2 4}}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -dashes command works correctly when given # an invalid numerical dash list. # ------------------------------------------------------------------------------ test graph.element.configure-4.4 { ::graph element configure: dashes - invalid numerical dash list } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -dashes {2 3 2 -1 2}}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -dashes command works correctly when given # a dash list with characters. # ------------------------------------------------------------------------------ test graph.element.configure-4.5 { ::graph element configure: dashes - dash list with characters } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -dashes {2 3 2 a 2}}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -data command works correctly when given a # valid coordinate list as input. # ------------------------------------------------------------------------------ test graph.element.configure-5.1 { ::graph element configure: data - valid coordinte list } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -data {1 3 4 5} .graph1 element cget Element1 -data } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {1.0 3.0 4.0 5.0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -data command works correctly when given an # invalid coordinate list as input. # ------------------------------------------------------------------------------ test graph.element.configure-5.2 { ::graph element configure: data - invalid coordinte list } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -data {1 a 4 b}}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -data command works correctly when given input # that is not in the proper form (x1 y1 x2 y2). # ------------------------------------------------------------------------------ test graph.element.configure-5.3 { ::graph element configure: data - not proper form } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -data {1,2 3,4}}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -data command works correctly when given input # that does not have an even number of values. # ------------------------------------------------------------------------------ test graph.element.configure-5.4 { ::graph element configure: data - odd list } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -data {1 2 3}}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -fill command works correctly when given a # valid color name. # ------------------------------------------------------------------------------ test graph.element.configure-6.1 { ::graph element configure: fill - valid color name } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -fill black .graph1 element cget Element1 -fill } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {black} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -fill command works correctly when given an # invalid color name. # ------------------------------------------------------------------------------ test graph.element.configure-6.2 { ::graph element configure: fill - invalid color name } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -fill invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -fill command works correctly when given # 'defcolor' as input. # ------------------------------------------------------------------------------ test graph.element.configure-6.3 { ::graph element configure: fill - defcolor } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -fill defcolor .graph1 element cget Element1 -fill } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {defcolor} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -fill command works correctly when given "" as # input. # ------------------------------------------------------------------------------ test graph.element.configure-6.4 { ::graph element configure: fill - empty string } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -fill "" .graph1 element cget Element1 -fill } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -hide command works correctly when given 1. # ------------------------------------------------------------------------------ test graph.element.configure-7.1 { ::graph element configure: hide - 1 } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -hide 1 .graph1 element cget Element1 -hide } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -hide command works correctly when given 0. # ------------------------------------------------------------------------------ test graph.element.configure-7.2 { ::graph element configure: hide - 0 } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -hide 0 .graph1 element cget Element1 -hide } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -hide command works correctly when given true. # ------------------------------------------------------------------------------ test graph.element.configure-7.3 { ::graph element configure: hide - true } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -hide true .graph1 element cget Element1 -hide } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -hide command works correctly when given # false. # ------------------------------------------------------------------------------ test graph.element.configure-7.4 { ::graph element configure: hide - false } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -hide false .graph1 element cget Element1 -hide } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -hide command works correctly when given yes. # ------------------------------------------------------------------------------ test graph.element.configure-7.5 { ::graph element configure: hide - yes } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -hide yes .graph1 element cget Element1 -hide } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -hide command works correctly when given no. # ------------------------------------------------------------------------------ test graph.element.configure-7.6 { ::graph element configure: hide - no } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -hide no .graph1 element cget Element1 -hide } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -hide command works correctly when given an # invalid input value. # ------------------------------------------------------------------------------ test graph.element.configure-7.7 { ::graph element configure: hide - invalid input } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -hide invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -label command works correctly when given # valid text. # ------------------------------------------------------------------------------ test graph.element.configure-8.1 { ::graph element configure: label - valid text } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -label MyElement .graph1 element cget Element1 -label } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {MyElement} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -label command works correctly when given the # empty string as input. # ------------------------------------------------------------------------------ test graph.element.configure-8.2 { ::graph element configure: label - empty string } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -label "" .graph1 element cget Element1 -label } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -label command does not change the default # value when not given any input. # ------------------------------------------------------------------------------ test graph.element.configure-8.3 { ::graph element configure: label - default value } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -label .graph1 element cget Element1 -label } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {Element1} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -linewidth command works correctly when given # an integer pixel value. # ------------------------------------------------------------------------------ test graph.element.configure-9.1 { ::graph element configure: linewidth - integer input } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -linewidth 2 .graph1 element cget Element1 -linewidth } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {2} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -linewidth command works correctly when given # a decimal pixel value. # ------------------------------------------------------------------------------ test graph.element.configure-9.2 { ::graph element configure: linewidth - decimal input } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -linewidth 3.5 .graph1 element cget Element1 -linewidth } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {4} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -linewidth command works correctly when given # an invalid numerical pixel value. # ------------------------------------------------------------------------------ test graph.element.configure-9.3 { ::graph element configure: linewidth - invalid numerical input } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -linewidth -1}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -linewidth command works correctly when given # a character as input. # ------------------------------------------------------------------------------ test graph.element.configure-9.4 { ::graph element configure: linewidth - character input } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -linewidth a}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -mapx command works correctly when given valid # axis name as input. # ------------------------------------------------------------------------------ test graph.element.configure-10.1 { ::graph element configure: mapx - valid axis name } -setup { ::graph .graph1 .graph1 axis create .axis1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -mapx .axis1 .graph1 element cget Element1 -mapx } -cleanup { .graph1 element delete Element1 .graph1 axis delete .axis1 destroy .graph1 } -result {.axis1} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -mapx command works correctly when given a # non-existent axis name as input. # ------------------------------------------------------------------------------ test graph.element.configure-10.2 { ::graph element configure: mapx - non-existent axis name } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -mapx .axis1}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -mapx command works correctly when not input # is given. # ------------------------------------------------------------------------------ test graph.element.configure-10.3 { ::graph element configure: mapx - no input } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -mapx .graph1 element cget Element1 -mapx } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {x} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -mapy command works correctly when given valid # axis name as input. # ------------------------------------------------------------------------------ test graph.element.configure-11.1 { ::graph element configure: mapy - valid axis name } -setup { ::graph .graph1 .graph1 axis create .axis1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -mapy .axis1 .graph1 element cget Element1 -mapy } -cleanup { .graph1 element delete Element1 .graph1 axis delete .axis1 destroy .graph1 } -result {.axis1} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -mapy command works correctly when given a # non-existent axis name as input. # ------------------------------------------------------------------------------ test graph.element.configure-11.2 { ::graph element configure: mapy - non-existent axis name } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -mapy .axis1}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -mapy command works correctly when not input # is given. # ------------------------------------------------------------------------------ test graph.element.configure-11.3 { ::graph element configure: mapy - no input } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -mapy .graph1 element cget Element1 -mapy } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {y} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -offdash command works correctly when given a # valid color name. # ------------------------------------------------------------------------------ test graph.element.configure-12.1 { ::graph element configure: offdash - valid color name } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -offdash black .graph1 element cget Element1 -offdash } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {black} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -offdash command works correctly when given an # invalid color name. # ------------------------------------------------------------------------------ test graph.element.configure-12.2 { ::graph element configure: offdash - invalid color name } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -offdash invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -offdash command works correctly when given # 'defcolor' as input. # ------------------------------------------------------------------------------ test graph.element.configure-12.3 { ::graph element configure: offdash - defcolor } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -offdash defcolor .graph1 element cget Element1 -offdash } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {defcolor} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -offdash command works correctly when given "" # as input. # ------------------------------------------------------------------------------ test graph.element.configure-12.4 { ::graph element configure: offdash - empty string } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -offdash "" .graph1 element cget Element1 -offdash } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -outline command works correctly when given a # valid color name. # ------------------------------------------------------------------------------ test graph.element.configure-13.1 { ::graph element configure: outline - valid color name } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -outline black .graph1 element cget Element1 -outline } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {black} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -outline command works correctly when given an # invalid color name. # ------------------------------------------------------------------------------ test graph.element.configure-13.2 { ::graph element configure: outline - invalid color name } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -outline invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -outline command works correctly when given # 'defcolor' as input. # ------------------------------------------------------------------------------ test graph.element.configure-13.3 { ::graph element configure: outline - defcolor } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -outline defcolor .graph1 element cget Element1 -outline } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {defcolor} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -pen command works correctly when given # a valid pen name. # ------------------------------------------------------------------------------ test graph.element.configure-14.1 { ::graph element configure: pen - valid pen name } -setup { ::graph .graph1 .graph1 element create Element1 .graph1 pen create Pen1 -color blue } -body { .graph1 element configure Element1 -pen Pen1 .graph1 element cget Element1 -pen } -cleanup { .graph1 pen delete Pen1 .graph1 element delete Element1 destroy .graph1 } -result {Pen1} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -pen command works correctly when given # an invalid pen name. # ------------------------------------------------------------------------------ test graph.element.configure-14.2 { ::graph element configure: pen - invalid pen name } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -pen invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -outlinewidth command works correctly when # given an integer pixel value. # ------------------------------------------------------------------------------ test graph.element.configure-15.1 { ::graph element configure: outlinewidth - integer input } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -outlinewidth 2 .graph1 element cget Element1 -outlinewidth } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {2} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -outlinewidth command works correctly when # given a decimal pixel value. # ------------------------------------------------------------------------------ test graph.element.configure-15.2 { ::graph element configure: outlinewidth - decimal input } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -outlinewidth 3.5 .graph1 element cget Element1 -outlinewidth } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {4} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -outlinewidth command works correctly when # given an invalid numerical pixel value. # ------------------------------------------------------------------------------ test graph.element.configure-15.3 { ::graph element configure: outlinewidth - invalid numerical input } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -outlinewidth -1}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -outlinewidth command works correctly when # given a character as input. # ------------------------------------------------------------------------------ test graph.element.configure-15.4 { ::graph element configure: outlinewidth - character input } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -outlinewidth a}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -scalesymbols command works correctly when # given 1. # ------------------------------------------------------------------------------ test graph.element.configure-16.1 { ::graph element configure: scalesymbols - 1 } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -scalesymbols 1 .graph1 element cget Element1 -scalesymbols } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -scalesymbols command works correctly when # given 0. # ------------------------------------------------------------------------------ test graph.element.configure-16.2 { ::graph element configure: scalesymbols - 0 } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -scalesymbols 0 .graph1 element cget Element1 -scalesymbols } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -scalesymbols command works correctly when # given true. # ------------------------------------------------------------------------------ test graph.element.configure-16.3 { ::graph element configure: scalesymbols - true } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -scalesymbols true .graph1 element cget Element1 -scalesymbols } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -scalesymbols command works correctly when # given false. # ------------------------------------------------------------------------------ test graph.element.configure-16.4 { ::graph element configure: scalesymbols - false } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -scalesymbols false .graph1 element cget Element1 -scalesymbols } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -scalesymbols command works correctly when # given yes. # ------------------------------------------------------------------------------ test graph.element.configure-16.5 { ::graph element configure: scalesymbols - yes } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -scalesymbols yes .graph1 element cget Element1 -scalesymbols } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -scalesymbols command works correctly when # given no. # ------------------------------------------------------------------------------ test graph.element.configure-16.6 { ::graph element configure: scalesymbols - no } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -scalesymbols no .graph1 element cget Element1 -scalesymbols } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -scalesymbols command works correctly when # given an invalid input value. # ------------------------------------------------------------------------------ test graph.element.configure-16.7 { ::graph element configure: scalesymbols - invalid input } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -scalesymbols invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -smooth command works correctly when given # 'linear' as input. # ------------------------------------------------------------------------------ test graph.element.configure-17.1 { ::graph element configure: smooth - linear } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -smooth linear .graph1 element cget Element1 -smooth } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {linear} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -smooth command works correctly when given # 'step' as input. # ------------------------------------------------------------------------------ test graph.element.configure-17.2 { ::graph element configure: smooth - step } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -smooth step .graph1 element cget Element1 -smooth } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {step} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -smooth command works correctly when given # 'natural' as input. # ------------------------------------------------------------------------------ test graph.element.configure-17.3 { ::graph element configure: smooth - natural } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -smooth natural .graph1 element cget Element1 -smooth } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {natural} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -smooth command works correctly when given # 'quadratic' as input. # ------------------------------------------------------------------------------ test graph.element.configure-17.4 { ::graph element configure: smooth - quadratic } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -smooth quadratic .graph1 element cget Element1 -smooth } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {cubic} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -smooth command works correctly when given # 'cubic' as input. # ------------------------------------------------------------------------------ test graph.element.configure-17.5 { ::graph element configure: smooth - cubic } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -smooth cubic .graph1 element cget Element1 -smooth } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {natural} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -smooth command works correctly when given # invalid input. # ------------------------------------------------------------------------------ test graph.element.configure-17.6 { ::graph element configure: smooth - invalid input } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -smooth invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -styles command works correctly when given a # valid pen name. # ------------------------------------------------------------------------------ test graph.element.configure-18.1 { ::graph element configure: styles - valid pen name } -setup { ::graph .graph1 .graph1 element create Element1 .graph1 pen create Pen1 } -body { .graph1 element configure Element1 -styles {Pen1} .graph1 element cget Element1 -styles } -cleanup { destroy Pen1 .graph1 element delete Element1 destroy .graph1 } -result {{Pen1 0.0 1.0}} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -styles command works correctly when given an # invalid pen name. # ------------------------------------------------------------------------------ test graph.element.configure-18.2 { ::graph element configure: styles - invalid pen name } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -styles {invalid}}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -styles command works correctly when given a # valid pen name and a minimum and maximum element weight range. # ------------------------------------------------------------------------------ test graph.element.configure-18.3 { ::graph element configure: styles - pen and weights } -setup { ::graph .graph1 .graph1 element create Element1 .graph1 pen create Pen1 } -body { .graph1 element configure Element1 -styles {{Pen1 2.0 3.0}} .graph1 element cget Element1 -styles } -cleanup { destroy Pen1 .graph1 element delete Element1 destroy .graph1 } -result {{Pen1 2.0 3.0}} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -symbol command works correctly when given # 'square' as input. # ------------------------------------------------------------------------------ test graph.element.configure-19.1 { ::graph element configure: symbol - square } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -symbol square .graph1 element cget Element1 -symbol } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {square} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -symbol command works correctly when given # 'circle' as input. # ------------------------------------------------------------------------------ test graph.element.configure-19.2 { ::graph element configure: symbol - circle } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -symbol circle .graph1 element cget Element1 -symbol } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {circle} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -symbol command works correctly when given # 'diamond' as input. # ------------------------------------------------------------------------------ test graph.element.configure-19.3 { ::graph element configure: symbol - diamond } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -symbol diamond .graph1 element cget Element1 -symbol } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {diamond} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -symbol command works correctly when given # 'plus' as input. # ------------------------------------------------------------------------------ test graph.element.configure-19.4 { ::graph element configure: symbol - plus } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -symbol plus .graph1 element cget Element1 -symbol } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {plus} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -symbol command works correctly when given # 'cross' as input. # ------------------------------------------------------------------------------ test graph.element.configure-19.5 { ::graph element configure: symbol - cross } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -symbol cross .graph1 element cget Element1 -symbol } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {cross} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -symbol command works correctly when given # 'splus' as input. # ------------------------------------------------------------------------------ test graph.element.configure-19.6 { ::graph element configure: symbol - splus } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -symbol splus .graph1 element cget Element1 -symbol } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {splus} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -symbol command works correctly when given # 'scross' as input. # ------------------------------------------------------------------------------ test graph.element.configure-19.7 { ::graph element configure: symbol - scross } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -symbol scross .graph1 element cget Element1 -symbol } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {scross} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -symbol command works correctly when given # 'triangle' as input. # ------------------------------------------------------------------------------ test graph.element.configure-19.8 { ::graph element configure: symbol - triangle } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -symbol triangle .graph1 element cget Element1 -symbol } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {triangle} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -symbol command works correctly when given # "" as input. # ------------------------------------------------------------------------------ test graph.element.configure-19.9 { ::graph element configure: symbol - "" } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -symbol "" .graph1 element cget Element1 -symbol } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {none} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -symbol command works correctly when given # a valid bitmap name. # ------------------------------------------------------------------------------ test graph.element.configure-19.10 { ::graph element configure: symbol - bitmap } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -symbol warning .graph1 element cget Element1 -symbol } -cleanup { destroy Bitmap1 .graph1 element delete Element1 destroy .graph1 } -result {warning {}} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -symbol command works correctly when given an # invalid symbol name. # ------------------------------------------------------------------------------ test graph.element.configure-19.11 { ::graph element configure: symbol - invalid symbol name } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -symbol invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -trace command works correctly when given # 'increasing' as input. # ------------------------------------------------------------------------------ test graph.element.configure-20.1 { ::graph element configure: trace - increasing } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -trace increasing .graph1 element cget Element1 -trace } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {increasing} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -trace command works correctly when given # 'decreasing' as input. # ------------------------------------------------------------------------------ test graph.element.configure-20.2 { ::graph element configure: trace - decreasing } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -trace decreasing .graph1 element cget Element1 -trace } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {decreasing} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -trace command works correctly when given # 'both' as input. # ------------------------------------------------------------------------------ test graph.element.configure-20.3 { ::graph element configure: trace - both } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -trace both .graph1 element cget Element1 -trace } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {both} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -trace command works correctly when given an # invalid direction. # ------------------------------------------------------------------------------ test graph.element.configure-20.4 { ::graph element configure: trace - invalid direction } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -trace invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -weights command works correctly when given a # valid vector name. # ------------------------------------------------------------------------------ test graph.element.configure-21.1 { ::graph element configure: weights - valid vector name } -setup { ::graph .graph1 .graph1 element create Element1 ::graph::vector create Vector1 } -body { .graph1 element configure Element1 -weights Vector1 .graph1 element cget Element1 -weights } -cleanup { ::graph::vector destroy Vector1 .graph1 element delete Element1 destroy .graph1 } -result {::TEST::Vector1} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -weights command works correctly when given an # invalid vector name. # ------------------------------------------------------------------------------ test graph.element.configure-21.2 { ::graph element configure: weights - invalid vector name } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -weights invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -weights command works correctly when given a # valid list of numerical values. # ------------------------------------------------------------------------------ test graph.element.configure-21.3 { ::graph element configure: weights - valid list } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -weights {1 2 3 4} .graph1 element cget Element1 -weights } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {1.0 2.0 3.0 4.0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -weights command works correctly when given an # invalid list. # ------------------------------------------------------------------------------ test graph.element.configure-21.4 { ::graph element configure: weights - invalid list } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -weights {1 2 a}}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -xdata command works correctly when given a # valid vector name. # ------------------------------------------------------------------------------ test graph.element.configure-22.1 { ::graph element configure: xdata - valid vector name } -setup { ::graph .graph1 .graph1 element create Element1 ::graph::vector create Vector1 } -body { .graph1 element configure Element1 -xdata Vector1 .graph1 element cget Element1 -xdata } -cleanup { ::graph::vector destroy Vector1 .graph1 element delete Element1 destroy .graph1 } -result {::TEST::Vector1} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -xdata command works correctly when given an # invalid vector name. # ------------------------------------------------------------------------------ test graph.element.configure-22.2 { ::graph element configure: xdata - invalid vector name } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -xdata invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -xdata command works correctly when given a # valid list of numerical values. # ------------------------------------------------------------------------------ test graph.element.configure-22.3 { ::graph element configure: xdata - valid list } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -xdata {1 2 3 4} .graph1 element cget Element1 -xdata } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {1.0 2.0 3.0 4.0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -xdata command works correctly when given an # invalid list. # ------------------------------------------------------------------------------ test graph.element.configure-22.4 { ::graph element configure: xdata - invalid list } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -xdata {1 2 a}}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -ydata command works correctly when given a # valid vector name. # ------------------------------------------------------------------------------ test graph.element.configure-23.1 { ::graph element configure: ydata - valid vector name } -setup { ::graph .graph1 .graph1 element create Element1 ::graph::vector create Vector1 } -body { .graph1 element configure Element1 -ydata Vector1 .graph1 element cget Element1 -ydata } -cleanup { ::graph::vector destroy Vector1 .graph1 element delete Element1 destroy .graph1 } -result {::TEST::Vector1} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -ydata command works correctly when given an # invalid vector name. # ------------------------------------------------------------------------------ test graph.element.configure-23.2 { ::graph element configure: ydata - invalid vector name } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -ydata invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -ydata command works correctly when given a # valid list of numerical values. # ------------------------------------------------------------------------------ test graph.element.configure-23.3 { ::graph element configure: ydata - valid list } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -ydata {1 2 3 4} .graph1 element cget Element1 -ydata } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {1.0 2.0 3.0 4.0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -ydata command works correctly when given an # invalid list. # ------------------------------------------------------------------------------ test graph.element.configure-23.4 { ::graph element configure: ydata - invalid list } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -ydata {1 2 a}}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -x command works correctly when given a valid # vector name. # ------------------------------------------------------------------------------ test graph.element.configure-24.1 { ::graph element configure: x - valid vector name } -setup { ::graph .graph1 .graph1 element create Element1 ::graph::vector create Vector1 } -body { .graph1 element configure Element1 -x Vector1 .graph1 element cget Element1 -x } -cleanup { ::graph::vector destroy Vector1 .graph1 element delete Element1 destroy .graph1 } -result {::TEST::Vector1} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -x command works correctly when given an # invalid vector name. # ------------------------------------------------------------------------------ test graph.element.configure-24.2 { ::graph element configure: x - invalid vector name } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -x invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -x command works correctly when given a valid # list of numerical values. # ------------------------------------------------------------------------------ test graph.element.configure-24.3 { ::graph element configure: x - valid list } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -x {1 2 3 4} .graph1 element cget Element1 -x } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {1.0 2.0 3.0 4.0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -x command works correctly when given an # invalid list. # ------------------------------------------------------------------------------ test graph.element.configure-24.4 { ::graph element configure: x - invalid list } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -x {1 2 a}}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -xerror command works correctly when given a # valid vector name. # ------------------------------------------------------------------------------ test graph.element.configure-25.1 { ::graph element configure: xerror - valid vector name } -setup { ::graph .graph1 .graph1 element create Element1 ::graph::vector create Vector1 } -body { .graph1 element configure Element1 -xerror Vector1 .graph1 element cget Element1 -xerror } -cleanup { ::graph::vector destroy Vector1 .graph1 element delete Element1 destroy .graph1 } -result {::TEST::Vector1} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -xerror command works correctly when given an # invalid vector name. # ------------------------------------------------------------------------------ test graph.element.configure-25.2 { ::graph element configure: xerror - invalid vector name } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -xerror invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -xerror command works correctly when given a # valid list of numerical values. # ------------------------------------------------------------------------------ test graph.element.configure-25.3 { ::graph element configure: xerror - valid list } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -xerror {1 2 3 4} .graph1 element cget Element1 -xerror } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {1.0 2.0 3.0 4.0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -xerror command works correctly when given an # invalid list. # ------------------------------------------------------------------------------ test graph.element.configure-25.4 { ::graph element configure: xerror - invalid list } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -xerror {1 2 a}}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -xhigh command works correctly when given a # valid vector name. # ------------------------------------------------------------------------------ test graph.element.configure-26.1 { ::graph element configure: xhigh - valid vector name } -setup { ::graph .graph1 .graph1 element create Element1 ::graph::vector create Vector1 } -body { .graph1 element configure Element1 -xhigh Vector1 .graph1 element cget Element1 -xhigh } -cleanup { ::graph::vector destroy Vector1 .graph1 element delete Element1 destroy .graph1 } -result {::TEST::Vector1} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -xhigh command works correctly when given an # invalid vector name. # ------------------------------------------------------------------------------ test graph.element.configure-26.2 { ::graph element configure: xhigh - invalid vector name } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -xhigh invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -xhigh command works correctly when given a # valid list of numerical values. # ------------------------------------------------------------------------------ test graph.element.configure-26.3 { ::graph element configure: xhigh - valid list } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -xhigh {1 2 3 4} .graph1 element cget Element1 -xhigh } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {1.0 2.0 3.0 4.0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -xhigh command works correctly when given an # invalid list. # ------------------------------------------------------------------------------ test graph.element.configure-26.4 { ::graph element configure: xhigh - invalid list } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -xhigh {1 2 a}}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -xlow command works correctly when given a valid # vector name. # ------------------------------------------------------------------------------ test graph.element.configure-27.1 { ::graph element configure: xlow - valid vector name } -setup { ::graph .graph1 .graph1 element create Element1 ::graph::vector create Vector1 } -body { .graph1 element configure Element1 -xlow Vector1 .graph1 element cget Element1 -xlow } -cleanup { ::graph::vector destroy Vector1 .graph1 element delete Element1 destroy .graph1 } -result {::TEST::Vector1} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -xlow command works correctly when given an # invalid vector name. # ------------------------------------------------------------------------------ test graph.element.configure-27.2 { ::graph element configure: xlow - invalid vector name } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -xlow invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -xlow command works correctly when given a # valid list of numerical values. # ------------------------------------------------------------------------------ test graph.element.configure-27.3 { ::graph element configure: xlow - valid list } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -xlow {1 2 3 4} .graph1 element cget Element1 -xlow } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {1.0 2.0 3.0 4.0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -xlow command works correctly when given an # invalid list. # ------------------------------------------------------------------------------ test graph.element.configure-27.4 { ::graph element configure: xlow - invalid list } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -xlow {1 2 a}}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -y command works correctly when given a valid # vector name. # ------------------------------------------------------------------------------ test graph.element.configure-28.1 { ::graph element configure: y - valid vector name } -setup { ::graph .graph1 .graph1 element create Element1 ::graph::vector create Vector1 } -body { .graph1 element configure Element1 -y Vector1 .graph1 element cget Element1 -y } -cleanup { ::graph::vector destroy Vector1 .graph1 element delete Element1 destroy .graph1 } -result {::TEST::Vector1} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -y command works correctly when given an # invalid vector name. # ------------------------------------------------------------------------------ test graph.element.configure-28.2 { ::graph element configure: y - invalid vector name } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -y invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -y command works correctly when given a # valid list of numerical values. # ------------------------------------------------------------------------------ test graph.element.configure-28.3 { ::graph element configure: y - valid list } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -y {1 2 3 4} .graph1 element cget Element1 -y } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {1.0 2.0 3.0 4.0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -y command works correctly when given an # invalid list. # ------------------------------------------------------------------------------ test graph.element.configure-28.4 { ::graph element configure: y - invalid list } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -y {1 2 a}}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -y command works correctly when given a valid # vector name. # ------------------------------------------------------------------------------ test graph.element.configure-29.1 { ::graph element configure: yerror - valid vector name } -setup { ::graph .graph1 .graph1 element create Element1 ::graph::vector create Vector1 } -body { .graph1 element configure Element1 -yerror Vector1 .graph1 element cget Element1 -yerror } -cleanup { ::graph::vector destroy Vector1 .graph1 element delete Element1 destroy .graph1 } -result {::TEST::Vector1} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -yerror command works correctly when given an # invalid vector name. # ------------------------------------------------------------------------------ test graph.element.configure-29.2 { ::graph element configure: yerror - invalid vector name } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -yerror invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -yerror command works correctly when given a # valid list of numerical values. # ------------------------------------------------------------------------------ test graph.element.configure-29.3 { ::graph element configure: yerror - valid list } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -yerror {1 2 3 4} .graph1 element cget Element1 -yerror } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {1.0 2.0 3.0 4.0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -yerror command works correctly when given an # invalid list. # ------------------------------------------------------------------------------ test graph.element.configure-29.4 { ::graph element configure: yerror - invalid list } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -yerror {1 2 a}}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -y command works correctly when given a valid # vector name. # ------------------------------------------------------------------------------ test graph.element.configure-30.1 { ::graph element configure: yhigh - valid vector name } -setup { ::graph .graph1 .graph1 element create Element1 ::graph::vector create Vector1 } -body { .graph1 element configure Element1 -yhigh Vector1 .graph1 element cget Element1 -yhigh } -cleanup { ::graph::vector destroy Vector1 .graph1 element delete Element1 destroy .graph1 } -result {::TEST::Vector1} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -yhigh command works correctly when given an # invalid vector name. # ------------------------------------------------------------------------------ test graph.element.configure-30.2 { ::graph element configure: yhigh - invalid vector name } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -yhigh invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -yhigh command works correctly when given a # valid list of numerical values. # ------------------------------------------------------------------------------ test graph.element.configure-30.3 { ::graph element configure: yhigh - valid list } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -yhigh {1 2 3 4} .graph1 element cget Element1 -yhigh } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {1.0 2.0 3.0 4.0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -yhigh command works correctly when given an # invalid list. # ------------------------------------------------------------------------------ test graph.element.configure-30.4 { ::graph element configure: yhigh - invalid list } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -yhigh {1 2 a}}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -y command works correctly when given a valid # vector name. # ------------------------------------------------------------------------------ test graph.element.configure-31.1 { ::graph element configure: ylow - valid vector name } -setup { ::graph .graph1 .graph1 element create Element1 ::graph::vector create Vector1 } -body { .graph1 element configure Element1 -ylow Vector1 .graph1 element cget Element1 -ylow } -cleanup { ::graph::vector destroy Vector1 .graph1 element delete Element1 destroy .graph1 } -result {::TEST::Vector1} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -ylow command works correctly when given an # invalid vector name. # ------------------------------------------------------------------------------ test graph.element.configure-31.2 { ::graph element configure: ylow - invalid vector name } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -ylow invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -ylow command works correctly when given a # valid list of numerical values. # ------------------------------------------------------------------------------ test graph.element.configure-31.3 { ::graph element configure: ylow - valid list } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -ylow {1 2 3 4} .graph1 element cget Element1 -ylow } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {1.0 2.0 3.0 4.0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -ylow command works correctly when given an # invalid list. # ------------------------------------------------------------------------------ test graph.element.configure-31.4 { ::graph element configure: ylow - invalid list } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -ylow {1 2 a}}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -errorbarcolor command works correctly when # given a valid color name. # ------------------------------------------------------------------------------ test graph.element.configure-32.1 { ::graph element configure: errorbarcolor - valid color name } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -errorbarcolor black .graph1 element cget Element1 -errorbarcolor } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {black} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -errorbarcolor command works correctly when # given an invalid color name. # ------------------------------------------------------------------------------ test graph.element.configure-32.2 { ::graph element configure: errorbarcolor - invalid color name } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -errorbarcolor invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -errorbarwidth command works correctly when # given an integer pixel value. # ------------------------------------------------------------------------------ test graph.element.configure-33.1 { ::graph element configure: errorbarwidth - integer input } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -errorbarwidth 2 .graph1 element cget Element1 -errorbarwidth } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {2} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -errorbarwidth command works correctly when # given a decimal pixel value. # ------------------------------------------------------------------------------ test graph.element.configure-33.2 { ::graph element configure: errorbarwidth - decimal input } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -errorbarwidth 3.5 .graph1 element cget Element1 -errorbarwidth } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {4} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -errorbarwidth command works correctly when # given an invalid numerical pixel value. # ------------------------------------------------------------------------------ test graph.element.configure-33.3 { ::graph element configure: errorbarwidth - invalid numerical input } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -errorbarwidth -1}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -errorbarwidth command works correctly when # given a character as input. # ------------------------------------------------------------------------------ test graph.element.configure-33.4 { ::graph element configure: errorbarwidth - character input } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -errorbarwidth a}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -errorbarcap command works correctly when # given an integer pixel value. # ------------------------------------------------------------------------------ test graph.element.configure-34.1 { ::graph element configure: errorbarcap - integer input } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -errorbarcap 2 .graph1 element cget Element1 -errorbarcap } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {2} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -errorbarcap command works correctly when # given a decimal pixel value. # ------------------------------------------------------------------------------ test graph.element.configure-34.2 { ::graph element configure: errorbarcap - decimal input } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -errorbarcap 3.5 .graph1 element cget Element1 -errorbarcap } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {4} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -errorbarcap command works correctly when # given an invalid numerical pixel value. # ------------------------------------------------------------------------------ test graph.element.configure-34.3 { ::graph element configure: errorbarcap - invalid numerical input } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -errorbarcap -1}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -errorbarcap command works correctly when # given a character as input. # ------------------------------------------------------------------------------ test graph.element.configure-34.4 { ::graph element configure: errorbarcap - character input } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -errorbarcap a}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -maxsymbols command works correctly when # given an integer pixel value. # ------------------------------------------------------------------------------ test graph.element.configure-35.1 { ::graph element configure: maxsymbols - integer input } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -maxsymbols 2 .graph1 element cget Element1 -maxsymbols } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {2} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -maxsymbols command works correctly when # given a decimal pixel value. # ------------------------------------------------------------------------------ test graph.element.configure-35.2 { ::graph element configure: maxsymbols - decimal input } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -maxsymbols 3.5 .graph1 element cget Element1 -maxsymbols } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {4} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -maxsymbols command works correctly when # given an invalid numerical pixel value. # ------------------------------------------------------------------------------ test graph.element.configure-35.3 { ::graph element configure: maxsymbols - invalid numerical input } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -maxsymbols -1}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -maxsymbols command works correctly when # given a character as input. # ------------------------------------------------------------------------------ test graph.element.configure-35.4 { ::graph element configure: maxsymbols - character input } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -maxsymbols a}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -valueanchor command works correctly when # given 'n' as input. # ------------------------------------------------------------------------------ test graph.element.configure-36.1 { ::graph element configure: valueanchor - n } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -valueanchor n .graph1 element cget Element1 -valueanchor } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {n} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -valueanchor command works correctly when # given 'ne' as input. # ------------------------------------------------------------------------------ test graph.element.configure-36.2 { ::graph element configure: valueanchor - ne } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -valueanchor ne .graph1 element cget Element1 -valueanchor } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {ne} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -valueanchor command works correctly when # given 'e' as input. # ------------------------------------------------------------------------------ test graph.element.configure-36.3 { ::graph element configure: valueanchor - e } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -valueanchor e .graph1 element cget Element1 -valueanchor } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {e} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -valueanchor command works correctly when # given 'se' as input. # ------------------------------------------------------------------------------ test graph.element.configure-36.4 { ::graph element configure: valueanchor - se } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -valueanchor se .graph1 element cget Element1 -valueanchor } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {se} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -valueanchor command works correctly when # given 'ne' as input. # ------------------------------------------------------------------------------ test graph.element.configure-36.5 { ::graph element configure: valueanchor - s } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -valueanchor s .graph1 element cget Element1 -valueanchor } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {s} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -valueanchor command works correctly when # given 'sw' as input. # ------------------------------------------------------------------------------ test graph.element.configure-36.6 { ::graph element configure: valueanchor - sw } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -valueanchor sw .graph1 element cget Element1 -valueanchor } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {sw} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -valueanchor command works correctly when # given 'w' as input. # ------------------------------------------------------------------------------ test graph.element.configure-36.7 { ::graph element configure: valueanchor - w } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -valueanchor w .graph1 element cget Element1 -valueanchor } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {w} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -valueanchor command works correctly when # given 'nw' as input. # ------------------------------------------------------------------------------ test graph.element.configure-36.8 { ::graph element configure: valueanchor - nw } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -valueanchor nw .graph1 element cget Element1 -valueanchor } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {nw} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -valueanchor command works correctly when # given 'center' as input. # ------------------------------------------------------------------------------ test graph.element.configure-36.9 { ::graph element configure: valueanchor - center } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -valueanchor center .graph1 element cget Element1 -valueanchor } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {center} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -valueanchor command works correctly when # given invalid numerical input. # ------------------------------------------------------------------------------ test graph.element.configure-36.10 { ::graph element configure: valueanchor - invalid numerical input } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -valueanchor 3.5}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -valueanchor command works correctly when # given invalid character input. # ------------------------------------------------------------------------------ test graph.element.configure-36.11 { ::graph element configure: valueanchor - invalid character input } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -valueanchor invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -valuecolor command works correctly when given # a valid color name. # ------------------------------------------------------------------------------ test graph.element.configure-37.1 { ::graph element configure: valuecolor - valid color name } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -valuecolor black .graph1 element cget Element1 -valuecolor } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {black} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -valuecolor command works correctly when given # an invalid color name. # ------------------------------------------------------------------------------ test graph.element.configure-37.2 { ::graph element configure: valuecolor - invalid color name } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -valuecolor invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -valuerotate command works correctly when # given an integer angle. # ------------------------------------------------------------------------------ test graph.element.configure-38.1 { ::graph element configure: valuerotate - integer input } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -valuerotate 90 .graph1 element cget Element1 -valuerotate } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {90.0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -valuerotate command works correctly when # given a decimal angle. # ------------------------------------------------------------------------------ test graph.element.configure-38.2 { ::graph element configure: valuerotate - decimal input } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -valuerotate 45.5 .graph1 element cget Element1 -valuerotate } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {45.5} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -valuerotate command works correctly when # given a negative integer angle. # ------------------------------------------------------------------------------ test graph.element.configure-38.3 { ::graph element configure: valuerotate - negative integer input } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -valuerotate -90 .graph1 element cget Element1 -valuerotate } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {-90.0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -valuerotate command works correctly when # given a negative decimal angle. # ------------------------------------------------------------------------------ test graph.element.configure-38.4 { ::graph element configure: valuerotate - negative decimal input } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -valuerotate -45.5 .graph1 element cget Element1 -valuerotate } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {-45.5} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -valuerotate command works correctly when # given a character as input. # ------------------------------------------------------------------------------ test graph.element.configure-38.5 { ::graph element configure: valuerotate - character input } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -valuerotate invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -valueshadow command works correctly when # given a valid color name. # ------------------------------------------------------------------------------ test graph.element.configure-39.1 { ::graph element configure: valueshadow - valid color name } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -valueshadow black .graph1 element cget Element1 -valueshadow } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {black 1} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -valueshadow command works correctly when # given an invalid color name. # ------------------------------------------------------------------------------ test graph.element.configure-39.2 { ::graph element configure: valueshadow - invalid color name } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -valueshadow invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -valueshadow command works correctly when # given a valid color name and valid integer value. # ------------------------------------------------------------------------------ test graph.element.configure-39.3 { ::graph element configure: valueshadow - valid color name, valid integer } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -valueshadow {black 2} .graph1 element cget Element1 -valueshadow } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {black 2} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -valueshadow command works correctly when # given an invalid color name and valid integer value. # ------------------------------------------------------------------------------ test graph.element.configure-39.4 { ::graph element configure: valueshadow - invalid color name, valid integer } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -valueshadow {invalid 1}}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -valueshadow command works correctly when # given a valid color name and invalid integer value. # ------------------------------------------------------------------------------ test graph.element.configure-39.5 { ::graph element configure: valueshadow - valid color name, invalid integer } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -valueshadow {black -1}}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -valueformat command works correctly when an # input value is given. # ------------------------------------------------------------------------------ test graph.element.configure-40.1 { ::graph element configure: valueformat - input } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -valueformat formatstring .graph1 element cget Element1 -valueformat } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {formatstring} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -valuefont command works correctly when given # a string as input. # ------------------------------------------------------------------------------ test graph.element.configure-41.1 { ::graph element configure: valuefont - string } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -valuefont Times .graph1 element cget Element1 -valuefont } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {Times} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -valuefont command works correctly when given # a list with a string as input. # ------------------------------------------------------------------------------ test graph.element.configure-41.2 { ::graph element configure: valuefont - list with string } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -valuefont {Times} .graph1 element cget Element1 -valuefont } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {Times} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -valuefont command works correctly when given # a list with a string and positive integer as input. # ------------------------------------------------------------------------------ test graph.element.configure-41.3 { ::graph element configure: valuefont - list with string and positive integer } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -valuefont {Times 10} .graph1 element cget Element1 -valuefont } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {Times 10} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -valuefont command works correctly when given # a list with a string and negative integer as input. # ------------------------------------------------------------------------------ test graph.element.configure-41.4 { ::graph element configure: valuefont - list with string and negative integer } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -valuefont {Times -10} .graph1 element cget Element1 -valuefont } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {Times -10} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -valuefont command works correctly when given # a list with a string and decimal as input. # ------------------------------------------------------------------------------ test graph.element.configure-41.5 { ::graph element configure: valuefont - list with string and decimal } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -valuefont {Times 10.5}}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -valuefont command works correctly when given # a list with 2 strings as input. # ------------------------------------------------------------------------------ test graph.element.configure-41.6 { ::graph element configure: valuefont - list with 2 strings } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -valuefont {Times Ten}}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -valuefont command works correctly when given # a valid font string. # ------------------------------------------------------------------------------ test graph.element.configure-41.7 { ::graph element configure: font - valid font string } -setup { ::graph .graph1 .graph1 element create Element1 pack .graph1 } -body { .graph1 element configure Element1 -valuefont "*-Arial-Bold-R-Normal-*-12-120-*" .graph1 element cget Element1 -valuefont } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {*-Arial-Bold-R-Normal-*-12-120-*} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -labelrelief command works correctly when # given 'flat' as input. # ------------------------------------------------------------------------------ test graph.element.configure-42.1 { ::graph element configure: labelrelief - flat } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -labelrelief flat .graph1 element cget Element1 -labelrelief } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {flat} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -labelrelief command works correctly when # given 'groove' as input. # ------------------------------------------------------------------------------ test graph.element.configure-42.2 { ::graph element configure: labelrelief - groove } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -labelrelief groove .graph1 element cget Element1 -labelrelief } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {groove} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -labelrelief command works correctly when # given 'raised' as input. # ------------------------------------------------------------------------------ test graph.element.configure-42.3 { ::graph element configure: labelrelief - raised } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -labelrelief raised .graph1 element cget Element1 -labelrelief } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {raised} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -labelrelief command works correctly when # given 'ridge' as input. # ------------------------------------------------------------------------------ test graph.element.configure-42.4 { ::graph element configure: labelrelief - ridge } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -labelrelief ridge .graph1 element cget Element1 -labelrelief } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {ridge} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -labelrelief command works correctly when # given 'solid' as input. # ------------------------------------------------------------------------------ test graph.element.configure-42.5 { ::graph element configure: labelrelief - solid } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -labelrelief solid .graph1 element cget Element1 -labelrelief } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {solid} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -labelrelief command works correctly when # given 'sunken' as input. # ------------------------------------------------------------------------------ test graph.element.configure-42.6 { ::graph element configure: labelrelief - sunken } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -labelrelief sunken .graph1 element cget Element1 -labelrelief } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {sunken} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -labelrelief command works correctly when # given invalid numerical input. # ------------------------------------------------------------------------------ test graph.element.configure-42.7 { ::graph element configure: labelrelief - invalid numerical input } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -labelrelief 3.5}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -labelrelief command works correctly when # given invalid character input. # ------------------------------------------------------------------------------ test graph.element.configure-42.8 { ::graph element configure: labelrelief - invalid character input } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -labelrelief invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -areaforeground command works correctly when # given a valid color name. # ------------------------------------------------------------------------------ test graph.element.configure-43.1 { ::graph element configure: areaforeground - valid color name } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -areaforeground black .graph1 element cget Element1 -areaforeground } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {black} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -areaforeground command works correctly when # given an invalid color name. # ------------------------------------------------------------------------------ test graph.element.configure-43.2 { ::graph element configure: areaforeground - invalid color name } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -areaforeground invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -areabackground command works correctly when # given a valid color name. # ------------------------------------------------------------------------------ test graph.element.configure-44.1 { ::graph element configure: areabackground - valid color name } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -areabackground black .graph1 element cget Element1 -areabackground } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {black} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -areabackground command works correctly when # given an invalid color name. # ------------------------------------------------------------------------------ test graph.element.configure-44.2 { ::graph element configure: areabackground - invalid color name } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -areabackground invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -state command works correctly when given # 'normal' as input. # ------------------------------------------------------------------------------ test graph.element.configure-45.1 { ::graph element configure: state - normal } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -state normal .graph1 element cget Element1 -state } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {normal} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -state command works correctly when given # 'active' as input. # ------------------------------------------------------------------------------ test graph.element.configure-45.2 { ::graph element configure: state - active } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -state active .graph1 element cget Element1 -state } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {active} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -state command works correctly when given # 'disabled' as input. # ------------------------------------------------------------------------------ test graph.element.configure-45.3 { ::graph element configure: state - disabled } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -state disabled .graph1 element cget Element1 -state } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {disabled} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -state command works correctly when # given invalid numerical input. # ------------------------------------------------------------------------------ test graph.element.configure-45.4 { ::graph element configure: state - invalid numerical input } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -state 3.5}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -state command works correctly when # given invalid character input. # ------------------------------------------------------------------------------ test graph.element.configure-45.5 { ::graph element configure: state - invalid character input } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -state invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -showvalues command works correctly when given # 'none' as input. # ------------------------------------------------------------------------------ test graph.element.configure-46.1 { ::graph element configure: showvalues - none } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -showvalues none .graph1 element cget Element1 -showvalues } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {none} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -showvalues command works correctly when given # 'x' as input. # ------------------------------------------------------------------------------ test graph.element.configure-46.2 { ::graph element configure: showvalues - x } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -showvalues x .graph1 element cget Element1 -showvalues } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {x} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -showvalues command works correctly when given # 'y' as input. # ------------------------------------------------------------------------------ test graph.element.configure-46.3 { ::graph element configure: showvalues - y } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -showvalues y .graph1 element cget Element1 -showvalues } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {y} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -showvalues command works correctly when given # 'both' as input. # ------------------------------------------------------------------------------ test graph.element.configure-46.4 { ::graph element configure: showvalues - both } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -showvalues both .graph1 element cget Element1 -showvalues } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {both} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -showvalues command works correctly when given # invalid numerical input. # ------------------------------------------------------------------------------ test graph.element.configure-46.5 { ::graph element configure: showvalues - invalid numerical input } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -showvalues 3.5}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -showvalues command works correctly when given # invalid character input. # ------------------------------------------------------------------------------ test graph.element.configure-46.6 { ::graph element configure: showvalues - invalid character input } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -showvalues invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -showerrorbars command works correctly when given # 'none' as input. # ------------------------------------------------------------------------------ test graph.element.configure-47.1 { ::graph element configure: showerrorbars - none } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -showerrorbars none .graph1 element cget Element1 -showerrorbars } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {none} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -showerrorbars command works correctly when given # 'x' as input. # ------------------------------------------------------------------------------ test graph.element.configure-47.2 { ::graph element configure: showerrorbars - x } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -showerrorbars x .graph1 element cget Element1 -showerrorbars } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {x} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -showerrorbars command works correctly when given # 'y' as input. # ------------------------------------------------------------------------------ test graph.element.configure-47.3 { ::graph element configure: showerrorbars - y } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -showerrorbars y .graph1 element cget Element1 -showerrorbars } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {y} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -showerrorbars command works correctly when given # 'both' as input. # ------------------------------------------------------------------------------ test graph.element.configure-47.4 { ::graph element configure: showerrorbars - both } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -showerrorbars both .graph1 element cget Element1 -showerrorbars } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {both} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -showerrorbars command works correctly when given # invalid numerical input. # ------------------------------------------------------------------------------ test graph.element.configure-47.5 { ::graph element configure: showerrorbars - invalid numerical input } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -showerrorbars 3.5}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -showerrorbars command works correctly when given # invalid character input. # ------------------------------------------------------------------------------ test graph.element.configure-47.6 { ::graph element configure: showerrorbars - invalid character input } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -showerrorbars invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -reduce command works correctly when given an # integer value. # ------------------------------------------------------------------------------ test graph.element.configure-48.1 { ::graph element configure: reduce - integer input } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -reduce 3 .graph1 element cget Element1 -reduce } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {3.0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -reduce command works correctly when given a # decimal value. # ------------------------------------------------------------------------------ test graph.element.configure-48.2 { ::graph element configure: reduce - decimal input } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -reduce 3.5 .graph1 element cget Element1 -reduce } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {3.5} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -reduce command works correctly when given a # negative integer pixel value. # ------------------------------------------------------------------------------ test graph.element.configure-48.3 { ::graph element configure: reduce - integer input } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -reduce -3 .graph1 element cget Element1 -reduce } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {-3.0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -reduce command works correctly when given a # negative decimal pixel value. # ------------------------------------------------------------------------------ test graph.element.configure-48.4 { ::graph element configure: reduce - decimal input } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -reduce -3.5 .graph1 element cget Element1 -reduce } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {-3.5} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -reduce command works correctly when given a # character as input. # ------------------------------------------------------------------------------ test graph.element.configure-48.5 { ::graph element configure: reduce - character input } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -reduce invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -areatile command works correctly when given # an existing image name. # ------------------------------------------------------------------------------ test graph.element.configure-49.1 { ::graph element configure: areatile - existing image name } -setup { ::graph .graph1 .graph1 element create Element1 # the following should set Image1 to the designated name set Image1 [image create photo image.a.49.1 -data { R0lGODlhEAAQAIYAAPwCBHSi1Iyy5Hym3Hym1GSWxJS65Lza/OT2/Pz+/PT+ /KTK5DxmlJS67PT6/Pz6/Lzm/BRGhHSe1MTe/OTy/Oz2/Mzm/NTq/FSKtJS2 7PT2/MTi/LTa/AQyVOTu/Lze/LTS/JTC9MTq/Mzi/KzK/KTC/KS+/BQuRJzG /KzO/LTO/KS6/Jy2/DRmpAQOHEx+rLTK/Jy+/Iym/Jyq/GSK/GSOrIyCBHSi 5HyW/DxuxFxqhPT+dPzqbHRCBAQmPBxenBxSjBxanARGfMRyDOymNOTCnPTG fIRKDMyGNOzGlISu7GSOzIROBPTGjJSy9EyGvIxODNSORMSWTLxyFDx6tBxe lKRiJGQ6BCQWBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAA LAAAAAAQABAAAAesgACCAQIDBAWCiYoABgcICQoJCwyLgg0OCQkPmgoQEYsS E5mYFBUWFxiLGZmbGhoWGxMcHYoDChoOFR4fByAcIbSJAyIXIxYgICQkJSbB gicovCkqJSssKy0uiy8bIDAxLDIzNDU2lS031TI4OTo7PD2VPj9AQUIuQ0RF RvGVi0dIkvATpGSJPwBMkDQxwkSCkyc3DkKJImUKlSdVhBxEaOUKACVVNgrC AsBPIAAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0K qSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpo dHRwOi8vd3d3LmRldmVsY29yLmNvbQA7 }] } -body { .graph1 element configure Element1 -areatile $Image1 .graph1 element cget Element1 -areatile } -cleanup { image delete $Image1 .graph1 element delete Element1 destroy .graph1 } -result {image.a.49.1} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -areatile command works correctly when given # an invalid image name. # ------------------------------------------------------------------------------ test graph.element.configure-49.2 { ::graph element configure: areatile - invalid image name } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -areatile invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -areapattern command works correctly when # given an existing bitmap name. # ------------------------------------------------------------------------------ test graph.element.configure-50.1 { ::graph element configure: areapattern - existing bitmap name } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -areapattern warning .graph1 element cget Element1 -areapattern } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {warning} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -areapattern command works correctly when # given an invalid bitmap name. # ------------------------------------------------------------------------------ test graph.element.configure-50.2 { ::graph element configure: areapattern - invalid bitmap name } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -areapattern invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -pixels command works correctly when given an # integer pixel value. # ------------------------------------------------------------------------------ test graph.element.configure-51.1 { ::graph element configure: pixels - integer input } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -pixel 2 .graph1 element cget Element1 -pixel } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {2} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -pixels command works correctly when given a # decimal pixel value. # ------------------------------------------------------------------------------ test graph.element.configure-51.2 { ::graph element configure: pixels - decimal input } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element configure Element1 -pixels 3.5 .graph1 element cget Element1 -pixels } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {4} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -pixels command works correctly when given an # invalid numerical pixel value. # ------------------------------------------------------------------------------ test graph.element.configure-51.3 { ::graph element configure: pixels - invalid numerical input } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -pixels -1}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the element configure -pixels command works correctly when given a # character as input. # ------------------------------------------------------------------------------ test graph.element.configure-51.4 { ::graph element configure: pixels - character input } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element configure Element1 -pixels a}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} #=============================================================================== # This part contains the automatic tests that test the element create # function of the graph BLT component. # ------------------------------------------------------------------------------ # Purpose: Ensure the element create command works correctly when given a unique # element name. # ------------------------------------------------------------------------------ test graph.element.create-1.1 { ::graph element: create - unique name } -setup { ::graph .graph1 } -body { .graph1 element create Element1 .graph1 element names } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {Element1} # ------------------------------------------------------------------------------ # Purpose: Ensure the element create command works correctly when given an existing # element name. # ------------------------------------------------------------------------------ test graph.element.create-1.2 { ::graph element: create - existing name } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element create Element1}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} #=============================================================================== # This part contains the automatic tests that test the element deactivate # function of the graph BLT component. # ------------------------------------------------------------------------------ # Purpose: Ensure the element deactivate command works correctly when given a valid # element name. # ------------------------------------------------------------------------------ test graph.element.deactivate-1.1 { ::graph element: deactivate - valid element name } -setup { ::graph .graph1 .graph1 element create Element1 .graph1 element activate Element1 } -body { .graph1 element deactivate Element1 .graph1 element activate } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {} # ------------------------------------------------------------------------------ # Purpose: Ensure the element deactivate command works correctly when given an invalid # element name. # ------------------------------------------------------------------------------ test graph.element.deactivate-1.2 { ::graph element: deactivate - invalid element name } -setup { ::graph .graph1 .graph1 element create Element1 } -body { if {[catch {.graph1 element deactivate invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {0} #=============================================================================== # This part contains the automatic tests that test the element delete # function of the graph BLT component. # ------------------------------------------------------------------------------ # Purpose: Ensure the element delete command works correctly when given a single # element name. # ------------------------------------------------------------------------------ test graph.element.delete-1.1 { ::graph element: delete - single element name } -setup { ::graph .graph1 .graph1 element create Element1 .graph1 element create Element2 } -body { .graph1 element delete Element1 .graph1 element names } -cleanup { destroy .graph1 } -result {Element2} # ------------------------------------------------------------------------------ # Purpose: Ensure the element delete command works correctly when given multiple # element names. # ------------------------------------------------------------------------------ test graph.element.delete-1.2 { ::graph element: delete - multiple element names } -setup { ::graph .graph1 .graph1 element create Element1 .graph1 element create Element2 .graph1 element create Element3 } -body { .graph1 element delete Element1 Element2 .graph1 element names } -cleanup { destroy .graph1 } -result {Element3} # ------------------------------------------------------------------------------ # Purpose: Ensure the element delete command works correctly when given an invalid # element name. # ------------------------------------------------------------------------------ test graph.element.delete-1.3 { ::graph element: delete - invalid element name } -setup { ::graph .graph1 } -body { if {[catch {.graph1 element delete invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} #=============================================================================== # This part contains the automatic tests that test the element exists # function of the graph BLT component. # ------------------------------------------------------------------------------ # Purpose: Ensure the element exists command works correctly when given an existing # element name. # ------------------------------------------------------------------------------ test graph.element.exists-1.1 { ::graph element: exists - existing element name } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element exists Element1 } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the element exists command works correctly when given a non-existent # element name. # ------------------------------------------------------------------------------ test graph.element.exists-1.2 { ::graph element: exists - non-existent element name } -setup { ::graph .graph1 } -body { .graph1 element exists Element1 } -cleanup { destroy .graph1 } -result {0} #=============================================================================== # This part contains the automatic tests that test the element names # function of the graph BLT component. # ------------------------------------------------------------------------------ # Purpose: Ensure the element names command works correctly when no pattern is given. # ------------------------------------------------------------------------------ test RBC.element.names-1.1 { element names: no pattern } -setup { ::graph .graph1 .graph1 element create Element1 .graph1 element create Element2 } -body { .graph1 element names } -cleanup { .graph1 element delete Element2 .graph1 element delete Element1 destroy .graph1 } -result {Element2 Element1} # ------------------------------------------------------------------------------ # Purpose: Ensure the element names command works correctly when an exact pattern is # given. # ------------------------------------------------------------------------------ test RBC.element.names-1.2 { element names: exact pattern } -setup { ::graph .graph1 .graph1 element create Element1 .graph1 element create Element2 } -body { .graph1 element names Element2 } -cleanup { .graph1 element delete Element2 .graph1 element delete Element1 destroy .graph1 } -result {Element2} # ------------------------------------------------------------------------------ # Purpose: Ensure the element names command works correctly when a wildcard pattern is # given. # ------------------------------------------------------------------------------ test RBC.element.names-1.3 { element names: wildcard pattern } -setup { ::graph .graph1 .graph1 element create Element1 .graph1 element create Element2 } -body { .graph1 element names *ment* } -cleanup { .graph1 element delete Element2 .graph1 element delete Element1 destroy .graph1 } -result {Element2 Element1} # ------------------------------------------------------------------------------ # Purpose: Ensure the element names command works correctly when an incorrect pattern # is given. # ------------------------------------------------------------------------------ test RBC.element.names-1.4 { element names: incorrect pattern } -setup { ::graph .graph1 .graph1 element create Element1 .graph1 element create Element2 } -body { .graph1 element names Element } -cleanup { .graph1 element delete Element2 .graph1 element delete Element1 destroy .graph1 } -result {} #=============================================================================== # This part contains the automatic tests that test the element show # function of the graph BLT component. # ------------------------------------------------------------------------------ # Purpose: Ensure the element show command works correctly when given a single element # name. # ------------------------------------------------------------------------------ test RBC.element.show-1.1 { element show: single element name } -setup { ::graph .graph1 .graph1 element create Element1 .graph1 element create Element2 } -body { .graph1 element show Element1 .graph1 element show } -cleanup { .graph1 element delete Element2 .graph1 element delete Element1 destroy .graph1 } -result {Element1} # ------------------------------------------------------------------------------ # Purpose: Ensure the element show command works correctly when given multiple element # names. # ------------------------------------------------------------------------------ test RBC.element.show-1.2 { element show: multiple element names } -setup { ::graph .graph1 .graph1 element create Element1 .graph1 element create Element2 } -body { .graph1 element show {Element1 Element2} .graph1 element show } -cleanup { .graph1 element delete Element2 .graph1 element delete Element1 destroy .graph1 } -result {Element1 Element2} # ------------------------------------------------------------------------------ # Purpose: Ensure the element show command works correctly when given a non-existent # element name. # ------------------------------------------------------------------------------ test RBC.element.show-1.3 { element show: non-existent element name } -setup { ::graph .graph1 } -body { .graph1 element show invalid .graph1 element show } -cleanup { destroy .graph1 } -result {} #=============================================================================== # This part contains the automatic tests that test the element type # function of the graph BLT component. # ------------------------------------------------------------------------------ # Purpose: Ensure the element type command works correctly when given the name of a # valid line element. # ------------------------------------------------------------------------------ test RBC.element.type-1.1 { element type: valid line element name } -setup { ::graph .graph1 .graph1 element create Element1 } -body { .graph1 element type Element1 } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {LineElement} # ------------------------------------------------------------------------------ # Purpose: Ensure the element type command works correctly when given the name of a # valid bar element. # ------------------------------------------------------------------------------ test RBC.element.names-1.2 { element type: valid bar element name } -setup { ::graph .graph1 .graph1 bar create Element1 } -body { .graph1 element type Element1 } -cleanup { .graph1 element delete Element1 destroy .graph1 } -result {BarElement} # ------------------------------------------------------------------------------ # Purpose: Ensure the element type command works correctly when given an invalid # element name. # ------------------------------------------------------------------------------ test RBC.element.names-1.3 { element type: invalid element name } -setup { ::graph .graph1 } -body { if {[catch {.graph1 element type invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} #=============================================================================== # This part contains the automatic tests that test the grid cget # function of the graph BLT component. # ------------------------------------------------------------------------------ # Purpose: Ensure that cget works for default values. # ------------------------------------------------------------------------------ test graph.grid.cget-1.1 { ::graph grid: cget - default } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 grid cget -linewidth } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the grid cget command works correctly when given a valid # grid configuration option name. # ------------------------------------------------------------------------------ test graph.grid.cget-1.2 { ::graph grid: cget - valid option name } -setup { ::graph .graph1 .graph1 grid configure -color black } -body { .graph1 grid cget -color } -cleanup { destroy .graph1 } -result {black} # ------------------------------------------------------------------------------ # Purpose: Ensure the grid cget command works correctly when given an invalid # grid configuration option name. # ------------------------------------------------------------------------------ test graph.grid.cget-1.3 { ::graph grid: cget - invalid option name } -setup { ::graph .graph1 } -body { if {[catch {.graph1 grid cget -invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} #=============================================================================== # This part contains the automatic tests that test the grid configure # function of the graph BLT component. # ------------------------------------------------------------------------------ # Purpose: Ensure the grid configure -color command works correctly when given a valid # color name. # ------------------------------------------------------------------------------ test graph.grid.configure-1.1 { ::graph grid: configure - color - valid color name } -setup { ::graph .graph1 } -body { .graph1 grid configure -color black .graph1 grid cget -color } -cleanup { destroy .graph1 } -result {black} # ------------------------------------------------------------------------------ # Purpose: Ensure the grid configure -color command works correctly when given an # invalid color name. # ------------------------------------------------------------------------------ test graph.grid.configure-1.2 { ::graph grid: configure - color - invalid color name } -setup { ::graph .graph1 } -body { if {[catch {.graph1 grid configure -color invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the grid configure -dashes command works correctly when given a # valid dash list. # ------------------------------------------------------------------------------ test graph.grid.configure-2.1 { ::graph grid: configure - dashes - valid dash list } -setup { ::graph .graph1 } -body { .graph1 grid configure -dashes {2 3 2 4} .graph1 grid cget -dashes } -cleanup { destroy .graph1 } -result {2 3 2 4} # ------------------------------------------------------------------------------ # Purpose: Ensure the grid configure -dashes command works correctly when given an # empty dash list. # ------------------------------------------------------------------------------ test graph.grid.configure-2.2 { ::graph grid: configure - dashes - empty dash list } -setup { ::graph .graph1 } -body { .graph1 grid configure -dashes "" .graph1 grid cget -dashes } -cleanup { destroy .graph1 } -result {} # ------------------------------------------------------------------------------ # Purpose: Ensure the grid configure -dashes command works correctly when given a dash # list that is too long. # ------------------------------------------------------------------------------ test graph.grid.configure-2.3 { ::graph grid: configure - dashes - long dash list } -setup { ::graph .graph1 } -body { if {[catch {.graph1 grid configure -dashes {2 3 2 4 2 3 2 4 2 3 2 4}}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the grid configure -dashes command works correctly when given an # invalid numerical dash list. # ------------------------------------------------------------------------------ test graph.grid.configure-2.4 { ::graph grid: configure - dashes - invalid numerical dash list } -setup { ::graph .graph1 } -body { if {[catch {.graph1 grid configure -dashes {2 3 2 -1 2}}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the grid configure -dashes command works correctly when given a dash # list with characters. # ------------------------------------------------------------------------------ test graph.grid.configure-2.5 { ::graph grid: configure - dashes - dash list with characters } -setup { ::graph .graph1 } -body { if {[catch {.graph1 grid configure -dashes {2 3 2 a 2}}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the grid configure -hide command works correctly when given 1. # ------------------------------------------------------------------------------ test graph.grid.configure-3.1 { ::graph grid: configure - hide - 1 } -setup { ::graph .graph1 } -body { .graph1 grid configure -hide 1 .graph1 grid cget -hide } -cleanup { destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the grid configure -hide command works correctly when given 0. # ------------------------------------------------------------------------------ test graph.grid.configure-3.2 { ::graph grid: configure - hide - 0 } -setup { ::graph .graph1 } -body { .graph1 grid configure -hide 0 .graph1 grid cget -hide } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the grid configure -hide command works correctly when given true. # ------------------------------------------------------------------------------ test graph.grid.configure-3.3 { ::graph grid: configure - hide - true } -setup { ::graph .graph1 } -body { .graph1 grid configure -hide true .graph1 grid cget -hide } -cleanup { destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the grid configure -hide command works correctly when given false. # ------------------------------------------------------------------------------ test graph.grid.configure-3.4 { ::graph grid: configure - hide - false } -setup { ::graph .graph1 } -body { .graph1 grid configure -hide false .graph1 grid cget -hide } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the grid configure -hide command works correctly when given yes. # ------------------------------------------------------------------------------ test graph.grid.configure-3.5 { ::graph grid: configure - hide - yes } -setup { ::graph .graph1 } -body { .graph1 grid configure -hide yes .graph1 grid cget -hide } -cleanup { destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the grid configure -hide command works correctly when given no. # ------------------------------------------------------------------------------ test graph.grid.configure-3.6 { ::graph grid: configure - hide - no } -setup { ::graph .graph1 } -body { .graph1 grid configure -hide no .graph1 grid cget -hide } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the grid configure -hide command works correctly when given an # invalid input value. # ------------------------------------------------------------------------------ test graph.grid.configure-3.7 { ::graph grid: configure - hide - invalid input } -setup { ::graph .graph1 } -body { if {[catch {.graph1 grid configure -hide invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the grid configure -linewidth command works correctly when given an # integer value. # ------------------------------------------------------------------------------ test graph.grid.configure-4.1 { ::graph grid: configure - linewidth - valid integer input } -setup { ::graph .graph1 } -body { .graph1 grid configure -linewidth 2 .graph1 grid cget -linewidth } -cleanup { destroy .graph1 } -result {2} # ------------------------------------------------------------------------------ # Purpose: Ensure the grid configure -linewidth command works correctly when given an # invalid integer value. # ------------------------------------------------------------------------------ test graph.grid.configure-4.2 { ::graph grid: configure - linewidth - invalid integer input } -setup { ::graph .graph1 } -body { if {[catch {.graph1 grid configure -linewidth -2}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the grid configure -linewidth command works correctly when given a # decimal value. # ------------------------------------------------------------------------------ test graph.grid.configure-4.3 { ::graph grid: configure - linewidth - valid decimal input } -setup { ::graph .graph1 } -body { .graph1 grid configure -linewidth 3.5 .graph1 grid cget -linewidth } -cleanup { destroy .graph1 } -result {4} # ------------------------------------------------------------------------------ # Purpose: Ensure the grid configure -linewidth command works correctly when given an # invalid decimal value. # ------------------------------------------------------------------------------ test graph.grid.configure-4.4 { ::graph grid: configure - linewidth - invalid decimal input } -setup { ::graph .graph1 } -body { if {[catch {.graph1 grid configure -linewidth -2.5}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the grid configure -linewidth command works correctly when given # character input. # ------------------------------------------------------------------------------ test graph.grid.configure-4.5 { ::graph grid: configure - linewidth - character input } -setup { ::graph .graph1 } -body { if {[catch {.graph1 grid configure -linewidth a}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the grid configure -linewidth command works correctly when given 0 # as input. # ------------------------------------------------------------------------------ test graph.grid.configure-4.6 { ::graph grid: configure - linewidth - 0 } -setup { ::graph .graph1 } -body { .graph1 grid configure -linewidth 0 .graph1 grid cget -linewidth } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the grid configure -mapx command works correctly when given valid # axis name as input. # ------------------------------------------------------------------------------ test graph.grid.configure-5.1 { ::graph grid: configure - mapx - valid axis name } -setup { ::graph .graph1 .graph1 axis create .axis1 } -body { .graph1 grid configure -mapx .axis1 .graph1 grid cget -mapx } -cleanup { .graph1 axis delete .axis1 destroy .graph1 } -result {.axis1} # ------------------------------------------------------------------------------ # Purpose: Ensure the grid configure -mapx command works correctly when given a non- # existent axis name as input. # ------------------------------------------------------------------------------ test graph.grid.configure-5.2 { ::graph grid: configure - mapx - non-existent axis name } -setup { ::graph .graph1 } -body { if {[catch {.graph1 grid configure -mapx .axis1}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the grid configure -mapx command works correctly when given the # empty string as input. # ------------------------------------------------------------------------------ test graph.grid.configure-5.3 { ::graph grid: configure - mapx - empty string } -setup { ::graph .graph1 } -body { .graph1 grid configure -mapx "" .graph1 grid cget -mapx } -cleanup { destroy .graph1 } -result {} # ------------------------------------------------------------------------------ # Purpose: Ensure the grid configure -mapx command works correctly when not input is # given. # ------------------------------------------------------------------------------ test graph.grid.configure-5.4 { ::graph grid: configure - mapx - no input } -setup { ::graph .graph1 } -body { .graph1 grid configure -mapx .graph1 grid cget -mapx } -cleanup { destroy .graph1 } -result {x} # ------------------------------------------------------------------------------ # Purpose: Ensure the grid configure -mapy command works correctly when given valid # axis name as input. # ------------------------------------------------------------------------------ test graph.grid.configure-6.1 { ::graph grid: configure - mapy - valid axis name } -setup { ::graph .graph1 .graph1 axis create .axis1 } -body { .graph1 grid configure -mapy .axis1 .graph1 grid cget -mapy } -cleanup { .graph1 axis delete .axis1 destroy .graph1 } -result {.axis1} # ------------------------------------------------------------------------------ # Purpose: Ensure the grid configure -mapy command works correctly when given a non- # existent axis name as input. # ------------------------------------------------------------------------------ test graph.grid.configure-6.2 { ::graph grid: configure - mapy - non-existent axis name } -setup { ::graph .graph1 } -body { if {[catch {.graph1 grid configure -mapy .axis1}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the grid configure -mapy command works correctly when given the # empty string as input. # ------------------------------------------------------------------------------ test graph.grid.configure-6.3 { ::graph grid: configure - mapy - empty string } -setup { ::graph .graph1 } -body { .graph1 grid configure -mapy "" .graph1 grid cget -mapy } -cleanup { destroy .graph1 } -result {} # ------------------------------------------------------------------------------ # Purpose: Ensure the grid configure -mapy command works correctly when not input is # given. # ------------------------------------------------------------------------------ test graph.grid.configure-6.4 { ::graph grid: configure - mapy - no input } -setup { ::graph .graph1 } -body { .graph1 grid configure -mapy .graph1 grid cget -mapy } -cleanup { destroy .graph1 } -result {y} # ------------------------------------------------------------------------------ # Purpose: Ensure the grid configure -minor command works correctly when given 1. # ------------------------------------------------------------------------------ test graph.grid.configure-7.1 { ::graph grid: configure - minor - 1 } -setup { ::graph .graph1 } -body { .graph1 grid configure -minor 1 .graph1 grid cget -minor } -cleanup { destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the grid configure -minor command works correctly when given 0. # ------------------------------------------------------------------------------ test graph.grid.configure-7.2 { ::graph grid: configure - minor - 0 } -setup { ::graph .graph1 } -body { .graph1 grid configure -minor 0 .graph1 grid cget -minor } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the grid configure -minor command works correctly when given true. # ------------------------------------------------------------------------------ test graph.grid.configure-7.3 { ::graph grid: configure - minor - true } -setup { ::graph .graph1 } -body { .graph1 grid configure -minor true .graph1 grid cget -minor } -cleanup { destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the grid configure -minor command works correctly when given false. # ------------------------------------------------------------------------------ test graph.grid.configure-7.4 { ::graph grid: configure - minor - false } -setup { ::graph .graph1 } -body { .graph1 grid configure -minor false .graph1 grid cget -minor } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the grid configure -minor command works correctly when given yes. # ------------------------------------------------------------------------------ test graph.grid.configure-7.5 { ::graph grid: configure - minor - yes } -setup { ::graph .graph1 } -body { .graph1 grid configure -minor yes .graph1 grid cget -minor } -cleanup { destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the grid configure -minor command works correctly when given no. # ------------------------------------------------------------------------------ test graph.grid.configure-7.6 { ::graph grid: configure - minor - no } -setup { ::graph .graph1 } -body { .graph1 grid configure -minor no .graph1 grid cget -minor } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the grid configure -minor command works correctly when given an # invalid input value. # ------------------------------------------------------------------------------ test graph.grid.configure-7.7 { ::graph grid: configure - minor - invalid input } -setup { ::graph .graph1 } -body { if {[catch {.graph1 grid configure -minor invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} #=============================================================================== # This part contains the automatic tests that test the legend activate # function of the graph BLT component. # ------------------------------------------------------------------------------ # Purpose: Ensure that activating all legend elements returns all active legend # elements. # ------------------------------------------------------------------------------ test graph.legend.activate-1.1 { Test legend activate } -setup { ::graph .graph1 set X [list 1 2 3 4 5] set Y [list 2 4 6 8 10] .graph1 element create Element1 -x $X -y $Y .graph1 element create Element2 -x $Y -y $X pack .graph1 -fill both } -body { .graph1 legend activate * } -cleanup { .graph1 element delete Element2 .graph1 element delete Element1 destroy .graph1 } -result {Element2 Element1} # ------------------------------------------------------------------------------ # Purpose: Ensure that activating a subset of legend elements returns only the # activated elements. # ------------------------------------------------------------------------------ test graph.legend.activate-1.2 { Test legend activate } -setup { ::graph .graph1 set X [list 1 2 3 4 5] set Y [list 2 4 6 8 10] .graph1 element create Element1 -x $X -y $Y .graph1 element create Element2 -x $Y -y $X pack .graph1 -fill both } -body { .graph1 legend activate Element1 } -cleanup { .graph1 element delete Element2 .graph1 element delete Element1 destroy .graph1 } -result {Element1} # ------------------------------------------------------------------------------ # Purpose: Ensure that activating a legend element returns all active legend elements # not only the ones that were just activated. # ------------------------------------------------------------------------------ test graph.legend.activate-1.3 { Test legend activate } -setup { ::graph .graph1 set X [list 1 2 3 4 5] set Y [list 2 4 6 8 10] .graph1 element create Element1 -x $X -y $Y .graph1 element create Element2 -x $Y -y $X .graph1 legend activate Element2 pack .graph1 -fill both } -body { .graph1 legend activate Element1 } -cleanup { .graph1 element delete Element2 .graph1 element delete Element1 destroy .graph1 } -result {Element2 Element1} # ------------------------------------------------------------------------------ # Purpose: Ensure the graph legend activate works when given a non-existent element # name. # ------------------------------------------------------------------------------ test graph.legend.activate-1.4 { Test legend activate } -setup { ::graph .graph1 pack .graph1 -fill both } -body { .graph1 legend activate Element1 } -cleanup { destroy .graph1 } -result {} #=============================================================================== # This part contains the automatic tests that test the legend bind # function of the graph BLT component. # ------------------------------------------------------------------------------ # Purpose: Ensure that bindings can be created for a legend element. # ------------------------------------------------------------------------------ test graph.legend.bind-1.1 { Test legend bind creation } -setup { ::graph .graph1 set X [list 1 2 3 4 5] set Y [list 2 4 6 8 10] .graph1 element create Line1 -x $X -y $Y .graph1 element create Line2 -x $Y -y $X pack .graph1 -fill both } -body { if {[catch {.graph1 legend bind Line1 {puts test}}]} { return 1 } else { return 0 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure that bindings can be queried for a sequence and legend element. # ------------------------------------------------------------------------------ test graph.legend.bind-1.2 { Test legend bind query } -setup { ::graph .graph1 set X [list 1 2 3 4 5] set Y [list 2 4 6 8 10] .graph1 element create Line1 -x $X -y $Y .graph1 element create Line2 -x $Y -y $X pack .graph1 -fill both .graph1 legend bind Line1 {puts test} } -body { .graph1 legend bind Line1 } -cleanup { destroy .graph1 } -result {puts test} # ------------------------------------------------------------------------------ # Purpose: Ensure that bindings can be appended for a sequence and legend element. # ------------------------------------------------------------------------------ test graph.legend.bind-1.3 { Test legend bind append } -setup { ::graph .graph1 set X [list 1 2 3 4 5] set Y [list 2 4 6 8 10] .graph1 element create Line1 -x $X -y $Y .graph1 element create Line2 -x $Y -y $X pack .graph1 -fill both .graph1 legend bind Line1 {puts test} } -body { .graph1 legend bind Line1 {+puts test2} .graph1 legend bind Line1 } -cleanup { destroy .graph1 } -result "puts test\nputs test2" # ------------------------------------------------------------------------------ # Purpose: Ensure that bindings are overwritten for a sequence and legend element. # ------------------------------------------------------------------------------ test graph.legend.bind-1.4 { Test legend bind overwrite } -setup { ::graph .graph1 set X [list 1 2 3 4 5] set Y [list 2 4 6 8 10] .graph1 element create Line1 -x $X -y $Y .graph1 element create Line2 -x $Y -y $X pack .graph1 -fill both .graph1 legend bind Line1 {puts test} } -body { .graph1 legend bind Line1 {puts test2} .graph1 legend bind Line1 } -cleanup { destroy .graph1 } -result {puts test2} # ------------------------------------------------------------------------------ # Purpose: Ensure that bound sequences can be queried for just a legend element. # ------------------------------------------------------------------------------ test graph.legend.bind-1.5 { Test legend bind query } -setup { ::graph .graph1 set X [list 1 2 3 4 5] set Y [list 2 4 6 8 10] .graph1 element create Line1 -x $X -y $Y .graph1 element create Line2 -x $Y -y $X pack .graph1 -fill both .graph1 legend bind Line1 {puts test} .graph1 legend bind Line1 {puts test2} } -body { .graph1 legend bind Line1 } -cleanup { destroy .graph1 } -result { } # ------------------------------------------------------------------------------ # Purpose: Ensure that bindings can be created for an arbitrary tag. # ------------------------------------------------------------------------------ test graph.legend.bind-1.6 { Test legend bind creation arbitrary } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 legend bind TestBind {puts test}}]} { return 1 } return 0 } -cleanup { destroy .graph1 } -result {0} #=============================================================================== # This part contains the automatic tests that test the legend cget # function of the graph BLT component. # ------------------------------------------------------------------------------ # Purpose: Ensure that cget works for default values. # ------------------------------------------------------------------------------ # The intention is to check for a null string default value, but some # systems have non-default values. Not sure how to do this test, exactly. # ------------------------------------------------------------------------------ #test graph.legend.cget-1.1 { # Test legend cget default #} -setup { # ::graph .graph1 # pack .graph1 #} -body { # .graph1 legend cget -background #} -cleanup { # destroy .graph1 #} -result {} # ------------------------------------------------------------------------------ # Purpose: Ensure that cget works with an explicitly set option. # ------------------------------------------------------------------------------ test graph.legend.cget-1.2 { Test legend cget configured } -setup { ::graph .graph1 pack .graph1 .graph1 legend configure -background blue } -body { .graph1 legend cget -background } -cleanup { destroy .graph1 } -result {blue} # ------------------------------------------------------------------------------ # Purpose: Ensure that cget works with invalid input. # ------------------------------------------------------------------------------ test graph.legend.cget-1.3 { Test legend cget configured } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 legend cget -invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} #=============================================================================== # This part contains the automatic tests that test the legend configure # function of the graph BLT component. # ------------------------------------------------------------------------------ # Purpose: Ensure that the activebackground configuration works for valid colors. # ------------------------------------------------------------------------------ test graph.legend.configure-1.1 { ::graph legend: configure - activebackground - valid color } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -activebackground black .graph1 legend cget -activebackground } -cleanup { destroy .graph1 } -result {black} # ------------------------------------------------------------------------------ # Purpose: Ensure that the activebackground configuration works for invalid colors. # ------------------------------------------------------------------------------ test graph.legend.configure-1.2 { ::graph legend: configure - activebackground - invalid color } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 legend configure -activebackground invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure that the activeborderwidth configuration works for valid integer # input. # ------------------------------------------------------------------------------ test graph.legend.configure-2.1 { ::graph legend: configure - activeborderwidth - valid integer input } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -activeborderwidth 20 .graph1 legend cget -activeborderwidth } -cleanup { destroy .graph1 } -result {20} # ------------------------------------------------------------------------------ # Purpose: Ensure that the activeborderwidth configuration works for invalid integer # input. # ------------------------------------------------------------------------------ test graph.legend.configure-2.2 { ::graph legend: configure - activeborderwidth - invalid integer input } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 legend configure -activeborderwidth -20}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure that the activeborderwidth configuration works for valid decimal # input. # ------------------------------------------------------------------------------ test graph.legend.configure-2.3 { ::graph legend: configure - activeborderwidth - valid decimal input } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -activeborderwidth 20.5 .graph1 legend cget -activeborderwidth } -cleanup { destroy .graph1 } -result {21} # ------------------------------------------------------------------------------ # Purpose: Ensure that the activeborderwidth configuration works for invalid decimal # input. # ------------------------------------------------------------------------------ test graph.legend.configure-2.4 { ::graph legend: configure - activeborderwidth - invalid decimal input } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 legend configure -activeborderwidth -20.5}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure that the activeborderwidth configuration works for character input. # ------------------------------------------------------------------------------ test graph.legend.configure-2.5 { ::graph legend: configure - activeborderwidth - character input } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 legend configure -activeborderwidth invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure that the activeborderwidth configuration works when given 0 as # input. # ------------------------------------------------------------------------------ test graph.legend.configure-2.6 { ::graph legend: configure - activeborderwidth - 0 } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -activeborderwidth 0 .graph1 legend cget -activeborderwidth } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure that the activeforeground configuration works for valid colors. # ------------------------------------------------------------------------------ test graph.legend.configure-3.1 { ::graph legend: configure - activeforeground - valid color } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -activeforeground black .graph1 legend cget -activeforeground } -cleanup { destroy .graph1 } -result {black} # ------------------------------------------------------------------------------ # Purpose: Ensure that the activeforeground configuration works for invalid input. # ------------------------------------------------------------------------------ test graph.legend.configure-3.2 { ::graph legend: configure - activeforeground - invalid input } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 legend configure -activeforeground invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure that the activerelief configuration works for raised reliefs. # ------------------------------------------------------------------------------ test graph.legend.configure-4.1 { ::graph legend: configure - activerelief - raised } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -activerelief raised .graph1 legend cget -activerelief } -cleanup { destroy .graph1 } -result {raised} # ------------------------------------------------------------------------------ # Purpose: Ensure that the activerelief configuration works for flat reliefs. # ------------------------------------------------------------------------------ test graph.legend.configure-4.2 { ::graph legend: configure - activerelief - flat } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -activerelief flat .graph1 legend cget -activerelief } -cleanup { destroy .graph1 } -result {flat} # ------------------------------------------------------------------------------ # Purpose: Ensure that the activerelief configuration works for grooved reliefs. # ------------------------------------------------------------------------------ test graph.legend.configure-4.3 { ::graph legend: configure - activerelief - groove } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -activerelief groove .graph1 legend cget -activerelief } -cleanup { destroy .graph1 } -result {groove} # ------------------------------------------------------------------------------ # Purpose: Ensure that the activerelief configuration works for ridged reliefs. # ------------------------------------------------------------------------------ test graph.legend.configure-4.4 { ::graph legend: configure - activerelief - ridge } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -activerelief ridge .graph1 legend cget -activerelief } -cleanup { destroy .graph1 } -result {ridge} # ------------------------------------------------------------------------------ # Purpose: Ensure that the activerelief configuration works for solid reliefs. # ------------------------------------------------------------------------------ test graph.legend.configure-4.5 { ::graph legend: configure - activerelief - solid } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -activerelief solid .graph1 legend cget -activerelief } -cleanup { destroy .graph1 } -result {solid} # ------------------------------------------------------------------------------ # Purpose: Ensure that the activerelief configuration works for sunken reliefs. # ------------------------------------------------------------------------------ test graph.legend.configure-4.6 { ::graph legend: configure - activerelief - sunken } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -activerelief sunken .graph1 legend cget -activerelief } -cleanup { destroy .graph1 } -result {sunken} # ------------------------------------------------------------------------------ # Purpose: Ensure that the activerelief configuration works for invalid input. # ------------------------------------------------------------------------------ test graph.legend.configure-4.7 { ::graph legend: configure - activerelief - invalid input } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 legend configure -activerelief invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure that the anchor configuration works for center anchor. # ------------------------------------------------------------------------------ test graph.legend.configure-5.1 { ::graph legend: configure - anchor - center } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -anchor center .graph1 legend cget -anchor } -cleanup { destroy .graph1 } -result {center} # ------------------------------------------------------------------------------ # Purpose: Ensure that the anchor configuration works for north anchor. # ------------------------------------------------------------------------------ test graph.legend.configure-5.2 { ::graph legend: configure - anchor - north } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -anchor n .graph1 legend cget -anchor } -cleanup { destroy .graph1 } -result {n} # ------------------------------------------------------------------------------ # Purpose: Ensure that the anchor configuration works for northeast anchor. # ------------------------------------------------------------------------------ test graph.legend.configure-5.3 { ::graph legend: configure - anchor - northeast } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -anchor ne .graph1 legend cget -anchor } -cleanup { destroy .graph1 } -result {ne} # ------------------------------------------------------------------------------ # Purpose: Ensure that the anchor configuration works for northwest anchor. # ------------------------------------------------------------------------------ test graph.legend.configure-5.4 { ::graph legend: configure - anchor - northwest } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -anchor nw .graph1 legend cget -anchor } -cleanup { destroy .graph1 } -result {nw} # ------------------------------------------------------------------------------ # Purpose: Ensure that the anchor configuration works for south anchor. # ------------------------------------------------------------------------------ test graph.legend.configure-5.5 { ::graph legend: configure - anchor - south } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -anchor s .graph1 legend cget -anchor } -cleanup { destroy .graph1 } -result {s} # ------------------------------------------------------------------------------ # Purpose: Ensure that the anchor configuration works for southeast anchor. # ------------------------------------------------------------------------------ test graph.legend.configure-5.6 { ::graph legend: configure - anchor - southeast } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -anchor se .graph1 legend cget -anchor } -cleanup { destroy .graph1 } -result {se} # ------------------------------------------------------------------------------ # Purpose: Ensure that the anchor configuration works for southwest anchor. # ------------------------------------------------------------------------------ test graph.legend.configure-5.7 { ::graph legend: configure - anchor - southwest } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -anchor sw .graph1 legend cget -anchor } -cleanup { destroy .graph1 } -result {sw} # ------------------------------------------------------------------------------ # Purpose: Ensure that the anchor configuration works for east anchor. # ------------------------------------------------------------------------------ test graph.legend.configure-5.8 { ::graph legend: configure - anchor - east } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -anchor e .graph1 legend cget -anchor } -cleanup { destroy .graph1 } -result {e} # ------------------------------------------------------------------------------ # Purpose: Ensure that the anchor configuration works for west anchor. # ------------------------------------------------------------------------------ test graph.legend.configure-5.9 { ::graph legend: configure - anchor - west } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -anchor w .graph1 legend cget -anchor } -cleanup { destroy .graph1 } -result {w} # ------------------------------------------------------------------------------ # Purpose: Ensure that the anchor configuration works for invalid input. # ------------------------------------------------------------------------------ test graph.legend.configure-5.10 { ::graph legend: configure - anchor - invalid input } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 legend configure -anchor invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure that the background configuration works for valid colors. # ------------------------------------------------------------------------------ test graph.legend.configure-6.1 { ::graph legend: configure - background - valid color } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -background black .graph1 legend cget -background } -cleanup { destroy .graph1 } -result {black} # ------------------------------------------------------------------------------ # Purpose: Ensure that the background configuration works for invalid input. # ------------------------------------------------------------------------------ test graph.legend.configure-6.2 { ::graph legend: configure - background - invalid input } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 legend configure -background invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure that the background configuration works when given the empty string. # ------------------------------------------------------------------------------ test graph.legend.configure-6.3 { ::graph legend: configure - background - empty string } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -background "" .graph1 legend cget -background } -cleanup { destroy .graph1 } -result {} # ------------------------------------------------------------------------------ # Purpose: Ensure that the borderwidth configuration works for valid integer input. # ------------------------------------------------------------------------------ test graph.legend.configure-7.1 { ::graph legend: configure - borderwidth - valid integer input } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -borderwidth 3 .graph1 legend cget -borderwidth } -cleanup { destroy .graph1 } -result {3} # ------------------------------------------------------------------------------ # Purpose: Ensure that the borderwidth configuration works for invalid integer input. # ------------------------------------------------------------------------------ test graph.legend.configure-7.2 { ::graph legend: configure - borderwidth - invalid integer input } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 legend configure -borderwidth -3}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure that the borderwidth configuration works for valid decimal input. # ------------------------------------------------------------------------------ test graph.legend.configure-7.3 { ::graph legend: configure - borderwidth - valid decimal input } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -borderwidth 2.5 .graph1 legend cget -borderwidth } -cleanup { destroy .graph1 } -result {3} # ------------------------------------------------------------------------------ # Purpose: Ensure that the borderwidth configuration works for invalid decimal input. # ------------------------------------------------------------------------------ test graph.legend.configure-7.4 { ::graph legend: configure - borderwidth - invalid decimal input } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 legend configure -borderwidth -2.5}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure that the borderwidth configuration works for character input. # ------------------------------------------------------------------------------ test graph.legend.configure-7.5 { ::graph legend: configure - borderwidth - character input } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 legend configure -borderwidth invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure that the borderwidth configuration works when given 0 as input. # ------------------------------------------------------------------------------ test graph.legend.configure-7.6 { ::graph legend: configure - borderwidth - 0 } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -borderwidth 0 .graph1 legend cget -borderwidth } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the legend configure -font command works correctly when given a # string as input. # ------------------------------------------------------------------------------ test graph.legend.configure-8.1 { ::graph legend configure: font - string } -setup { ::graph .graph1 } -body { .graph1 legend configure -font Times .graph1 legend cget -font } -cleanup { destroy .graph1 } -result {Times} # ------------------------------------------------------------------------------ # Purpose: Ensure the legend configure -font command works correctly when given a list # with a string as input. # ------------------------------------------------------------------------------ test graph.legend.configure-8.2 { ::graph legend configure: font - list with string } -setup { ::graph .graph1 } -body { .graph1 legend configure -font {Times} .graph1 legend cget -font } -cleanup { destroy .graph1 } -result {Times} # ------------------------------------------------------------------------------ # Purpose: Ensure the legend configure -font command works correctly when given a list # with a string and positive integer as input. # ------------------------------------------------------------------------------ test graph.legend.configure-8.3 { ::graph legend configure: font - list with string and positive integer } -setup { ::graph .graph1 } -body { .graph1 legend configure -font {Times 10} .graph1 legend cget -font } -cleanup { destroy .graph1 } -result {Times 10} # ------------------------------------------------------------------------------ # Purpose: Ensure the legend configure -font command works correctly when given a list # with a string and negative integer as input. # ------------------------------------------------------------------------------ test graph.legend.configure-8.4 { ::graph legend configure: font - list with string and negative integer } -setup { ::graph .graph1 } -body { .graph1 legend configure -font {Times -10} .graph1 legend cget -font } -cleanup { destroy .graph1 } -result {Times -10} # ------------------------------------------------------------------------------ # Purpose: Ensure the legend configure -font command works correctly when given a list # with a string and decimal as input. # ------------------------------------------------------------------------------ test graph.legend.configure-8.5 { ::graph legend configure: font - list with string and decimal } -setup { ::graph .graph1 } -body { if {[catch {.graph1 legend configure -font {Times 10.5}}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the legend configure -font command works correctly when given a list # with 2 strings as input. # ------------------------------------------------------------------------------ test graph.legend.configure-8.6 { ::graph legend configure: font - list with 2 strings } -setup { ::graph .graph1 } -body { if {[catch {.graph1 legend configure -font {Times Ten}}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the legend configure -font command works correctly when given a # valid font string. # ------------------------------------------------------------------------------ test graph.legend.configure-8.7 { ::graph legend configure: font - valid font string } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -font "*-Arial-Bold-R-Normal-*-12-120-*" .graph1 legend cget -font } -cleanup { destroy .graph1 } -result {*-Arial-Bold-R-Normal-*-12-120-*} # ------------------------------------------------------------------------------ # Purpose: Ensure that the foreground configuration works for valid colors. # ------------------------------------------------------------------------------ test graph.legend.configure-9.1 { ::graph legend: configure - foreground - valid color } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -foreground white .graph1 legend cget -foreground } -cleanup { destroy .graph1 } -result {white} # ------------------------------------------------------------------------------ # Purpose: Ensure that the foreground configuration works for invalid input. # ------------------------------------------------------------------------------ test graph.legend.configure-9.2 { ::graph legend: configure - foreground - invalid input } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 legend configure -foreground invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the legend configure -hide command works correctly when given 1. # ------------------------------------------------------------------------------ test graph.legend.configure-10.1 { ::graph legend: configure - hide - 1 } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -hide 1 .graph1 legend cget -hide } -cleanup { destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the legend configure -hide command works correctly when given 0. # ------------------------------------------------------------------------------ test graph.legend.configure-10.2 { ::graph legend: configure - hide - 0 } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -hide 0 .graph1 legend cget -hide } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the legend configure -hide command works correctly when given # true. # ------------------------------------------------------------------------------ test graph.legend.configure-10.3 { ::graph legend: configure - hide - true } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -hide true .graph1 legend cget -hide } -cleanup { destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the legend configure -hide command works correctly when given # false. # ------------------------------------------------------------------------------ test graph.legend.configure-10.4 { ::graph legend: configure - hide - false } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -hide false .graph1 legend cget -hide } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the legend configure -hide command works correctly when given # yes. # ------------------------------------------------------------------------------ test graph.legend.configure-10.5 { ::graph legend: configure - hide - yes } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -hide yes .graph1 legend cget -hide } -cleanup { destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the legend configure -hide command works correctly when given # no. # ------------------------------------------------------------------------------ test graph.legend.configure-10.6 { ::graph legend: configure - hide - no } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -hide no .graph1 legend cget -hide } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the legend configure -hide command works correctly when given an # invalid input value. # ------------------------------------------------------------------------------ test graph.legend.configure-10.7 { ::graph legend: configure - hide - invalid input } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 legend configure -hide invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the legend configure -ipadx command works correctly when given an # integer pixel value. # ------------------------------------------------------------------------------ test graph.legend.configure-11.1 { ::graph legend configure: ipadx - integer input } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -ipadx 2 .graph1 legend cget -ipadx } -cleanup { destroy .graph1 } -result {2 2} # ------------------------------------------------------------------------------ # Purpose: Ensure the legend configure -ipadx command works correctly when given an # invalid integer pixel value. # ------------------------------------------------------------------------------ test graph.legend.configure-11.2 { ::graph legend configure: ipadx - invalid integer input } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 legend configure -ipadx -2}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the legend configure -ipadx command works correctly when given a # decimal pixel value. # ------------------------------------------------------------------------------ test graph.legend.configure-11.3 { ::graph legend configure: ipadx - decimal input } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -ipadx 3.5 .graph1 legend cget -ipadx } -cleanup { destroy .graph1 } -result {4 4} # ------------------------------------------------------------------------------ # Purpose: Ensure the legend configure -ipadx command works correctly when given an # invalid decimal pixel value. # ------------------------------------------------------------------------------ test graph.legend.configure-11.4 { ::graph legend configure: ipadx - invalid decimal input } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 legend configure -ipadx -2.5}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the legend configure -ipadx command works correctly when given a # valid list of numerical pixel values. # ------------------------------------------------------------------------------ test graph.legend.configure-11.5 { ::graph legend: configure: ipadx - valid list of values } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -ipadx {1 2.5} .graph1 legend cget -ipadx } -cleanup { destroy .graph1 } -result {1 3} # ------------------------------------------------------------------------------ # Purpose: Ensure the legend configure -ipadx command works correctly when given a # character as input. # ------------------------------------------------------------------------------ test graph.legend.configure-11.6 { ::graph legend configure: ipadx - character input } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 legend configure -ipadx a}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the legend configure -ipadx command works correctly when given an # invalid list of numerical pixel values. # ------------------------------------------------------------------------------ test graph.legend.configure-11.7 { ::graph legend: configure: ipadx - invalid list of values } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 legend configure -ipadx {1 a}}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the legend configure -ipadx command works correctly when given a # list of input that is too long. # ------------------------------------------------------------------------------ test graph.legend.configure-11.8 { ::graph legend configure: ipadx - invalid list length } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 legend configure -ipadx {1 2 3}}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the legend configure -ipadx command works correctly when given 0 as # input. # ------------------------------------------------------------------------------ test graph.legend.configure-11.9 { ::graph legend: configure: ipadx - 0 } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -ipadx 0 .graph1 legend cget -ipadx } -cleanup { destroy .graph1 } -result {0 0} # ------------------------------------------------------------------------------ # Purpose: Ensure the legend configure -ipady command works correctly when given an # integer pixel value. # ------------------------------------------------------------------------------ test graph.legend.configure-12.1 { ::graph legend configure: ipady - integer input } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -ipady 2 .graph1 legend cget -ipady } -cleanup { destroy .graph1 } -result {2 2} # ------------------------------------------------------------------------------ # Purpose: Ensure the legend configure -ipady command works correctly when given an # invalid integer pixel value. # ------------------------------------------------------------------------------ test graph.legend.configure-12.2 { ::graph legend configure: ipady - invalid integer input } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 legend configure -ipady -2}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the legend configure -ipady command works correctly when given a # decimal pixel value. # ------------------------------------------------------------------------------ test graph.legend.configure-12.3 { ::graph legend configure: ipady - decimal input } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -ipady 3.5 .graph1 legend cget -ipady } -cleanup { destroy .graph1 } -result {4 4} # ------------------------------------------------------------------------------ # Purpose: Ensure the legend configure -ipady command works correctly when given an # invalid decimal pixel value. # ------------------------------------------------------------------------------ test graph.legend.configure-12.4 { ::graph legend configure: ipady - invalid decimal input } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 legend configure -ipady -2.5}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the legend configure -ipady command works correctly when given a # valid list of numerical pixel values. # ------------------------------------------------------------------------------ test graph.legend.configure-12.5 { ::graph legend: configure: ipady - valid list of values } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -ipady {1 2.5} .graph1 legend cget -ipady } -cleanup { destroy .graph1 } -result {1 3} # ------------------------------------------------------------------------------ # Purpose: Ensure the legend configure -ipady command works correctly when given a # character as input. # ------------------------------------------------------------------------------ test graph.legend.configure-12.6 { ::graph legend configure: ipady - character input } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 legend configure -ipady a}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the legend configure -ipady command works correctly when given an # invalid list of numerical pixel values. # ------------------------------------------------------------------------------ test graph.legend.configure-12.7 { ::graph legend: configure: ipady - invalid list of values } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 legend configure -ipady {1 a}}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the legend configure -ipady command works correctly when given a # list of input that is too long. # ------------------------------------------------------------------------------ test graph.legend.configure-12.8 { ::graph legend configure: ipady - invalid list length } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 legend configure -ipady {1 2 3}}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the legend configure -ipady command works correctly when given 0 as # input. # ------------------------------------------------------------------------------ test graph.legend.configure-12.9 { ::graph legend: configure: ipady - 0 } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -ipady 0 .graph1 legend cget -ipady } -cleanup { destroy .graph1 } -result {0 0} # ------------------------------------------------------------------------------ # Purpose: Ensure the legend configure -padx command works correctly when given an # integer pixel value. # ------------------------------------------------------------------------------ test graph.legend.configure-13.1 { ::graph legend configure: padx - integer input } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -padx 2 .graph1 legend cget -padx } -cleanup { destroy .graph1 } -result {2 2} # ------------------------------------------------------------------------------ # Purpose: Ensure the legend configure -padx command works correctly when given an # invalid integer pixel value. # ------------------------------------------------------------------------------ test graph.legend.configure-13.2 { ::graph legend configure: padx - invalid integer input } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 legend configure -padx -2}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the legend configure -padx command works correctly when given a # decimal pixel value. # ------------------------------------------------------------------------------ test graph.legend.configure-13.3 { ::graph legend configure: padx - decimal input } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -padx 3.5 .graph1 legend cget -padx } -cleanup { destroy .graph1 } -result {4 4} # ------------------------------------------------------------------------------ # Purpose: Ensure the legend configure -padx command works correctly when given an # invalid decimal pixel value. # ------------------------------------------------------------------------------ test graph.legend.configure-13.4 { ::graph legend configure: padx - invalid decimal input } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 legend configure -padx -2.5}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the legend configure -padx command works correctly when given a # valid list of numerical pixel values. # ------------------------------------------------------------------------------ test graph.legend.configure-13.5 { ::graph legend: configure: padx - valid list of values } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -padx {1 2.5} .graph1 legend cget -padx } -cleanup { destroy .graph1 } -result {1 3} # ------------------------------------------------------------------------------ # Purpose: Ensure the legend configure -padx command works correctly when given a # character as input. # ------------------------------------------------------------------------------ test graph.legend.configure-13.6 { ::graph legend configure: padx - character input } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 legend configure -padx a}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the legend configure -padx command works correctly when given an # invalid list of numerical pixel values. # ------------------------------------------------------------------------------ test graph.legend.configure-13.7 { ::graph legend: configure: padx - invalid list of values } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 legend configure -padx {1 a}}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the legend configure -padx command works correctly when given a # list of input that is too long. # ------------------------------------------------------------------------------ test graph.legend.configure-13.8 { ::graph legend configure: padx - invalid list length } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 legend configure -padx {1 2 3}}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the legend configure -padx command works correctly when given 0 as # input. # ------------------------------------------------------------------------------ test graph.legend.configure-13.9 { ::graph legend: configure: padx - 0 } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -padx 0 .graph1 legend cget -padx } -cleanup { destroy .graph1 } -result {0 0} # ------------------------------------------------------------------------------ # Purpose: Ensure the legend configure -pady command works correctly when given an # integer pixel value. # ------------------------------------------------------------------------------ test graph.legend.configure-14.1 { ::graph legend configure: pady - integer input } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -pady 2 .graph1 legend cget -pady } -cleanup { destroy .graph1 } -result {2 2} # ------------------------------------------------------------------------------ # Purpose: Ensure the legend configure -pady command works correctly when given an # invalid integer pixel value. # ------------------------------------------------------------------------------ test graph.legend.configure-14.2 { ::graph legend configure: pady - invalid integer input } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 legend configure -pady -2}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the legend configure -pady command works correctly when given a # decimal pixel value. # ------------------------------------------------------------------------------ test graph.legend.configure-14.3 { ::graph legend configure: pady - decimal input } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -pady 3.5 .graph1 legend cget -pady } -cleanup { destroy .graph1 } -result {4 4} # ------------------------------------------------------------------------------ # Purpose: Ensure the legend configure -pady command works correctly when given an # invalid decimal pixel value. # ------------------------------------------------------------------------------ test graph.legend.configure-14.4 { ::graph legend configure: pady - invalid decimal input } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 legend configure -pady -2.5}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the legend configure -pady command works correctly when given a # valid list of numerical pixel values. # ------------------------------------------------------------------------------ test graph.legend.configure-14.5 { ::graph legend: configure: pady - valid list of values } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -pady {1 2.5} .graph1 legend cget -pady } -cleanup { destroy .graph1 } -result {1 3} # ------------------------------------------------------------------------------ # Purpose: Ensure the legend configure -pady command works correctly when given a # character as input. # ------------------------------------------------------------------------------ test graph.legend.configure-14.6 { ::graph legend configure: pady - character input } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 legend configure -pady a}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the legend configure -pady command works correctly when given an # invalid list of numerical pixel values. # ------------------------------------------------------------------------------ test graph.legend.configure-14.7 { ::graph legend: configure: pady - invalid list of values } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 legend configure -pady {1 a}}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the legend configure -pady command works correctly when given a # list of input that is too long. # ------------------------------------------------------------------------------ test graph.legend.configure-14.8 { ::graph legend configure: pady - invalid list length } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 legend configure -pady {1 2 3}}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the legend configure -pady command works correctly when given 0 as # input. # ------------------------------------------------------------------------------ test graph.legend.configure-14.9 { ::graph legend: configure: pady - 0 } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -pady 0 .graph1 legend cget -pady } -cleanup { destroy .graph1 } -result {0 0} # ------------------------------------------------------------------------------ # Purpose: Ensure that the position configuration works when given 'rightmargin' as # input. # ------------------------------------------------------------------------------ test graph.legend.configure-15.1 { ::graph legend: configure - position - rightmargin } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -position rightmargin .graph1 legend cget -position } -cleanup { destroy .graph1 } -result {rightmargin} # ------------------------------------------------------------------------------ # Purpose: Ensure that the position configuration works when given 'leftmargin' as # input. # ------------------------------------------------------------------------------ test graph.legend.configure-15.2 { ::graph legend: configure - position - leftmargin } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -position leftmargin .graph1 legend cget -position } -cleanup { destroy .graph1 } -result {leftmargin} # ------------------------------------------------------------------------------ # Purpose: Ensure that the position configuration works when given 'topmargin' as # input. # ------------------------------------------------------------------------------ test graph.legend.configure-15.3 { ::graph legend: configure - position - topmargin } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -position topmargin .graph1 legend cget -position } -cleanup { destroy .graph1 } -result {topmargin} # ------------------------------------------------------------------------------ # Purpose: Ensure that the position configuration works when given 'bottommargin' as # input. # ------------------------------------------------------------------------------ test graph.legend.configure-15.4 { ::graph legend: configure - position - bottommargin } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -position bottommargin .graph1 legend cget -position } -cleanup { destroy .graph1 } -result {bottommargin} # ------------------------------------------------------------------------------ # Purpose: Ensure that the position configuration works when given 'plotarea' as # input. # ------------------------------------------------------------------------------ test graph.legend.configure-15.5 { ::graph legend: configure - position - plotarea } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -position plotarea .graph1 legend cget -position } -cleanup { destroy .graph1 } -result {plotarea} # ------------------------------------------------------------------------------ # Purpose: Ensure that the position configuration works when given valid coordinates # as input. # ------------------------------------------------------------------------------ test graph.legend.configure-15.6 { ::graph legend: configure - position - valid coordinates } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -position "@10, 10" .graph1 legend cget -position } -cleanup { destroy .graph1 } -result {@10,10} # ------------------------------------------------------------------------------ # Purpose: Ensure that the position configuration works when given invalid coordinates # as input. # ------------------------------------------------------------------------------ test graph.legend.configure-15.7 { ::graph legend: configure - position - invalid coordinates } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 legend configure -position "10, 10"}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the legend configure -raised command works correctly when given 1. # ------------------------------------------------------------------------------ test graph.legend.configure-16.1 { ::graph legend: configure - raised - 1 } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -raised 1 .graph1 legend cget -raised } -cleanup { destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the legend configure -raised command works correctly when given 0. # ------------------------------------------------------------------------------ test graph.legend.configure-16.2 { ::graph legend: configure - raised - 0 } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -raised 0 .graph1 legend cget -raised } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the legend configure -raised command works correctly when given # true. # ------------------------------------------------------------------------------ test graph.legend.configure-16.3 { ::graph legend: configure - raised - true } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -raised true .graph1 legend cget -raised } -cleanup { destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the legend configure -raised command works correctly when given # false. # ------------------------------------------------------------------------------ test graph.legend.configure-16.4 { ::graph legend: configure - raised - false } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -raised false .graph1 legend cget -raised } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the legend configure -raised command works correctly when given # yes. # ------------------------------------------------------------------------------ test graph.legend.configure-16.5 { ::graph legend: configure - raised - yes } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -raised yes .graph1 legend cget -raised } -cleanup { destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the legend configure -raised command works correctly when given # no. # ------------------------------------------------------------------------------ test graph.legend.configure-16.6 { ::graph legend: configure - raised - no } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -raised no .graph1 legend cget -raised } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the legend configure -raised command works correctly when given an # invalid input value. # ------------------------------------------------------------------------------ test graph.legend.configure-16.7 { ::graph legend: configure - raised - invalid input } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 legend configure -raised invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure that the relief configuration works for raised reliefs. # ------------------------------------------------------------------------------ test graph.legend.configure-17.1 { ::graph legend: configure - relief - raised } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -relief raised .graph1 legend cget -relief } -cleanup { destroy .graph1 } -result {raised} # ------------------------------------------------------------------------------ # Purpose: Ensure that the relief configuration works for flat reliefs. # ------------------------------------------------------------------------------ test graph.legend.configure-17.2 { ::graph legend: configure - relief - flat } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -relief flat .graph1 legend cget -relief } -cleanup { destroy .graph1 } -result {flat} # ------------------------------------------------------------------------------ # Purpose: Ensure that the relief configuration works for grooved reliefs. # ------------------------------------------------------------------------------ test graph.legend.configure-17.3 { ::graph legend: configure - relief - groove } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -relief groove .graph1 legend cget -relief } -cleanup { destroy .graph1 } -result {groove} # ------------------------------------------------------------------------------ # Purpose: Ensure that the relief configuration works for ridged reliefs. # ------------------------------------------------------------------------------ test graph.legend.configure-17.4 { ::graph legend: configure - relief - ridge } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -relief ridge .graph1 legend cget -relief } -cleanup { destroy .graph1 } -result {ridge} # ------------------------------------------------------------------------------ # Purpose: Ensure that the relief configuration works for solid reliefs. # ------------------------------------------------------------------------------ test graph.legend.configure-17.5 { ::graph legend: configure - relief - solid } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -relief solid .graph1 legend cget -relief } -cleanup { destroy .graph1 } -result {solid} # ------------------------------------------------------------------------------ # Purpose: Ensure that the relief configuration works for sunken reliefs. # ------------------------------------------------------------------------------ test graph.legend.configure-17.6 { ::graph legend: configure - relief - sunken } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -relief sunken .graph1 legend cget -relief } -cleanup { destroy .graph1 } -result {sunken} # ------------------------------------------------------------------------------ # Purpose: Ensure that the relief configuration works for invalid input. # ------------------------------------------------------------------------------ test graph.legend.configure-17.7 { ::graph legend: configure - relief - invalid input } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 legend configure -relief invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure that the shadow configuration works for valid colors and no depth # input. # ------------------------------------------------------------------------------ test graph.legend.configure-18.1 { ::graph legend: configure - shadow - valid color, no depth } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -shadow salmon .graph1 legend cget -shadow } -cleanup { destroy .graph1 } -result {salmon 1} # ------------------------------------------------------------------------------ # Purpose: Ensure that the shadow configuration works for invalid color input and no # depth input. # ------------------------------------------------------------------------------ test graph.legend.configure-18.2 { ::graph legend: configure - shadow - invalid color, no depth } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 legend configure -shadow invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure that the shadow configuration works for a valid color and a valid # integer depth input. # ------------------------------------------------------------------------------ test graph.legend.configure-18.3 { ::graph legend: configure - shadow - valid color, valid integer depth } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -shadow {salmon 2} .graph1 legend cget -shadow } -cleanup { destroy .graph1 } -result {salmon 2} # ------------------------------------------------------------------------------ # Purpose: Ensure that the shadow configuration works for an invalid color and a valid # depth input. # ------------------------------------------------------------------------------ test graph.legend.configure-18.4 { ::graph legend: configure - shadow - invalid color, valid integer depth } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 legend configure -shadow {invalid 2}}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure that the shadow configuration works for a valid color and a valid # decimal depth input. # ------------------------------------------------------------------------------ test graph.legend.configure-18.5 { ::graph legend: configure - shadow - valid color, valid decimal depth } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -shadow {salmon 2.5} .graph1 legend cget -shadow } -cleanup { destroy .graph1 } -result {salmon 3} # ------------------------------------------------------------------------------ # Purpose: Ensure that the shadow configuration works for an invalid color and a valid # decimal depth input. # ------------------------------------------------------------------------------ test graph.legend.configure-18.6 { ::graph legend: configure - shadow - invalid color, valid decimal depth } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 legend configure -shadow {invalid 2.5}}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure that the shadow configuration works for a valid color and an invalid # integer depth input. # ------------------------------------------------------------------------------ test graph.legend.configure-18.7 { ::graph legend: configure - shadow - valid color, invalid integer depth } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 legend configure -shadow {salmon -2}}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure that the shadow configuration works for an invalid color and an # invalid depth input. # ------------------------------------------------------------------------------ test graph.legend.configure-18.8 { ::graph legend: configure - shadow - invalid color, invalid integer depth } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 legend configure -shadow {invalid -2}}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure that the shadow configuration works for a valid color and an invalid # decimal depth input. # ------------------------------------------------------------------------------ test graph.legend.configure-18.9 { ::graph legend: configure - shadow - valid color, invalid decimal depth } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 legend configure -shadow {salmon -2.5}}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure that the shadow configuration works for an invalid color and an # invalid decimal depth input. # ------------------------------------------------------------------------------ test graph.legend.configure-18.10 { ::graph legend: configure - shadow - invalid color, invalid decimal depth } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 legend configure -shadow {invalid -2.5}}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure that the shadow configuration works when given the emtpy string as # input. # ------------------------------------------------------------------------------ test graph.legend.configure-18.11 { ::graph legend: configure - shadow - empty string } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 legend configure -shadow "" .graph1 legend cget -shadow } -cleanup { destroy .graph1 } -result {} #=============================================================================== # This part contains the automatic tests that test the legend deactivate # function of the graph BLT component. # ------------------------------------------------------------------------------ # Purpose: Ensure that deactivating all legend elements works properly. # ------------------------------------------------------------------------------ test graph.legend.2.1 { Test legend deactivate } -setup { ::graph .graph1 set X [list 1 2 3 4 5] set Y [list 2 4 6 8 10] .graph1 element create Line1 -x $X -y $Y .graph1 element create Line2 -x $Y -y $X pack .graph1 -fill both .graph1 legend activate * } -body { .graph1 legend deactivate * # Displays all active elements .graph1 legend activate ThisElementDoesNotExist } -cleanup { destroy .graph1 } -result {} # ------------------------------------------------------------------------------ # Purpose: Ensure that deactivating a subset of legend elements deactivates only that # subset. # ------------------------------------------------------------------------------ test graph.legend.2.2 { Test legend deactivate } -setup { ::graph .graph1 set X [list 1 2 3 4 5] set Y [list 2 4 6 8 10] .graph1 element create Line1 -x $X -y $Y .graph1 element create Line2 -x $Y -y $X pack .graph1 -fill both .graph1 legend activate * } -body { .graph1 legend deactivate Line1 # Displays all active elements .graph1 legend activate ThisElementDoesNotExist } -cleanup { destroy .graph1 } -result {Line2} #=============================================================================== # This part contains the automatic tests that test the marker bind # function of the graph BLT component. # ------------------------------------------------------------------------------ # Purpose: Ensure that bindings can be created for a marker # ------------------------------------------------------------------------------ test graph.marker.bind-1.1 { Test marker bind creation } -setup { ::graph .graph1 .graph1 marker create text -name marker1 pack .graph1 } -body { if {[catch {.graph1 marker bind marker1 {puts test}}]} { return 1 } return 0 } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure that bindings can be queried for a sequence and marker # ------------------------------------------------------------------------------ test graph.marker.bind-1.2 { Test marker bind query } -setup { ::graph .graph1 .graph1 marker create text -name marker1 pack .graph1 .graph1 marker bind marker1 {puts test} } -body { .graph1 marker bind marker1 } -cleanup { destroy .graph1 } -result {puts test} # ------------------------------------------------------------------------------ # Purpose: Ensure that bindings can be appended for a sequence and marker # ------------------------------------------------------------------------------ test graph.marker.bind-1.3 { Test marker bind append } -setup { ::graph .graph1 .graph1 marker create text -name marker1 pack .graph1 .graph1 marker bind marker1 {puts test} } -body { .graph1 marker bind marker1 {+puts test2} .graph1 marker bind marker1 } -cleanup { destroy .graph1 } -result "puts test\nputs test2" # ------------------------------------------------------------------------------ # Purpose: Ensure that bindings are overwritten for a sequence and marker # ------------------------------------------------------------------------------ test graph.marker.bind-1.4 { Test marker bind overwrite } -setup { ::graph .graph1 .graph1 marker create text -name marker1 pack .graph1 .graph1 marker bind marker1 {puts test} } -body { .graph1 marker bind marker1 {+puts test2} .graph1 marker bind marker1 } -body { .graph1 marker bind marker1 {puts test2} .graph1 marker bind marker1 } -cleanup { destroy .graph1 } -result {puts test2} # ------------------------------------------------------------------------------ # Purpose: Ensure that bound sequences can be queried for just a marker # ------------------------------------------------------------------------------ test graph.marker.bind-1.5 { Test marker bind query } -setup { ::graph .graph1 .graph1 marker create text -name marker1 pack .graph1 .graph1 marker bind marker1 {puts test} .graph1 marker bind marker1 {puts test2} } -body { .graph1 marker bind marker1 } -cleanup { destroy .graph1 } -result { } #=============================================================================== # This part contains the automatic tests that test the bitmap marker configure # function of the graph BLT component. # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -background command works correctly for bitmap # markers when given a valid color name. # ------------------------------------------------------------------------------ test graph.marker.configure.bitmap-1.1 { ::graph marker configure bitmap: background - valid color name } -setup { ::graph .graph1 .graph1 marker create bitmap -name Marker1 } -body { .graph1 marker configure Marker1 -background black .graph1 marker cget Marker1 -background } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {black} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -background command works correctly for bitmap # markers when given an invalid color name. # ------------------------------------------------------------------------------ test graph.marker.configure.bitmap-1.2 { ::graph marker configure bitmap: background - invalid color name } -setup { ::graph .graph1 .graph1 marker create bitmap -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -background invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure configuring bitmap changes the coresponding option value pair # ------------------------------------------------------------------------------ test graph.marker.configure.bitmap-2.1 { Configure Bitmap } -setup { ::graph .graph1 .graph1 marker create bitmap -name marker1 } -body { .graph1 marker configure marker1 \ -bitmap @[file join [file dirname [info script]] greenback.xbm] .graph1 marker cget marker1 -bitmap } -cleanup { .graph1 marker delete marker1 destroy .graph1 } -match glob -result {@*greenback.xbm} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -fill command works correctly for bitmap # markers when given a valid color name. # ------------------------------------------------------------------------------ test graph.marker.configure.bitmap-3.1 { ::graph marker configure bitmap: fill - valid color name } -setup { ::graph .graph1 .graph1 marker create bitmap -name Marker1 } -body { .graph1 marker configure Marker1 -fill black .graph1 marker cget Marker1 -fill } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {black} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -fill command works correctly for bitmap # markers when given an invalid color name. # ------------------------------------------------------------------------------ test graph.marker.configure.bitmap-3.2 { ::graph marker configure bitmap: fill - invalid color name } -setup { ::graph .graph1 .graph1 marker create bitmap -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -fill invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -foreground command works correctly for bitmap # markers when given a valid color name. # ------------------------------------------------------------------------------ test graph.marker.configure.bitmap-4.1 { ::graph marker configure bitmap: foreground - valid color name } -setup { ::graph .graph1 .graph1 marker create bitmap -name Marker1 } -body { .graph1 marker configure Marker1 -foreground black .graph1 marker cget Marker1 -foreground } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {black} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -foreground command works correctly for bitmap # markers when given an invalid color name. # ------------------------------------------------------------------------------ test graph.marker.configure.bitmap-4.2 { ::graph marker configure bitmap: foreground - invalid color name } -setup { ::graph .graph1 .graph1 marker create bitmap -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -foreground invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -outline command works correctly for bitmap # markers when given a valid color name. # ------------------------------------------------------------------------------ test graph.marker.configure.bitmap-5.1 { ::graph marker configure bitmap: outline - valid color name } -setup { ::graph .graph1 .graph1 marker create bitmap -name Marker1 } -body { .graph1 marker configure Marker1 -outline black .graph1 marker cget Marker1 -outline } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {black} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -outline command works correctly for bitmap # markers when given an invalid color name. # ------------------------------------------------------------------------------ test graph.marker.configure.bitmap-5.2 { ::graph marker configure bitmap: outline - invalid color name } -setup { ::graph .graph1 .graph1 marker create bitmap -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -outline invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -rotate command works correctly when given an # integer angle. # ------------------------------------------------------------------------------ test graph.marker.configure.bitmap-6.1 { ::graph marker configure bitmap: rotate - integer input } -setup { ::graph .graph1 .graph1 marker create bitmap -name Marker1 } -body { .graph1 marker configure Marker1 -rotate 90 .graph1 marker cget Marker1 -rotate } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {90.0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -rotate command works correctly when given a # decimal angle. # ------------------------------------------------------------------------------ test graph.marker.configure.bitmap-6.2 { ::graph marker configure bitmap: rotate - decimal input } -setup { ::graph .graph1 .graph1 marker create bitmap -name Marker1 } -body { .graph1 marker configure Marker1 -rotate 45.5 .graph1 marker cget Marker1 -rotate } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {45.5} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -rotate command works correctly when given a # negative integer angle. # ------------------------------------------------------------------------------ test graph.marker.configure.bitmap-6.3 { ::graph marker configure bitmap: rotate - negative integer input } -setup { ::graph .graph1 .graph1 marker create bitmap -name Marker1 } -body { .graph1 marker configure Marker1 -rotate -90 .graph1 marker cget Marker1 -rotate } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {-90.0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -rotate command works correctly when given a # negative decimal angle. # ------------------------------------------------------------------------------ test graph.marker.configure.bitmap-6.4 { ::graph marker configure bitmap: rotate - negative decimal input } -setup { ::graph .graph1 .graph1 marker create bitmap -name Marker1 } -body { .graph1 marker configure Marker1 -rotate -45.5 .graph1 marker cget Marker1 -rotate } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {-45.5} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -rotate command works correctly when given a # character as input. # ------------------------------------------------------------------------------ test graph.marker.configure.bitmap-6.5 { ::graph marker configure bitmap: rotate - character input } -setup { ::graph .graph1 .graph1 marker create bitmap -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -rotate invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -anchor command works correctly for bitmap # markers when given 'n' as input. # ------------------------------------------------------------------------------ test graph.marker.configure.bitmap-7.1 { ::graph marker configure bitmap: anchor - n } -setup { ::graph .graph1 .graph1 marker create bitmap -name Marker1 } -body { .graph1 marker configure Marker1 -anchor n .graph1 marker cget Marker1 -anchor } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {n} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -anchor command works correctly for bitmap # markers when given 'ne' as input. # ------------------------------------------------------------------------------ test graph.marker.configure.bitmap-7.2 { ::graph marker configure bitmap: anchor - ne } -setup { ::graph .graph1 .graph1 marker create bitmap -name Marker1 } -body { .graph1 marker configure Marker1 -anchor ne .graph1 marker cget Marker1 -anchor } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {ne} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -anchor command works correctly for bitmap # markers when given 'e' as input. # ------------------------------------------------------------------------------ test graph.marker.configure.bitmap-7.3 { ::graph marker configure bitmap: anchor - e } -setup { ::graph .graph1 .graph1 marker create bitmap -name Marker1 } -body { .graph1 marker configure Marker1 -anchor e .graph1 marker cget Marker1 -anchor } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {e} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -anchor command works correctly for bitmap # markers when given 'se' as input. # ------------------------------------------------------------------------------ test graph.marker.configure.bitmap-7.4 { ::graph marker configure bitmap: anchor - se } -setup { ::graph .graph1 .graph1 marker create bitmap -name Marker1 } -body { .graph1 marker configure Marker1 -anchor se .graph1 marker cget Marker1 -anchor } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {se} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -anchor command works correctly for bitmap # markers when given 's' as input. # ------------------------------------------------------------------------------ test graph.marker.configure.bitmap-7.5 { ::graph marker configure bitmap: anchor - s } -setup { ::graph .graph1 .graph1 marker create bitmap -name Marker1 } -body { .graph1 marker configure Marker1 -anchor s .graph1 marker cget Marker1 -anchor } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {s} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -anchor command works correctly for bitmap # markers when given 'sw' as input. # ------------------------------------------------------------------------------ test graph.marker.configure.bitmap-7.6 { ::graph marker configure bitmap: anchor - sw } -setup { ::graph .graph1 .graph1 marker create bitmap -name Marker1 } -body { .graph1 marker configure Marker1 -anchor sw .graph1 marker cget Marker1 -anchor } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {sw} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -anchor command works correctly for bitmap # markers when given 'w' as input. # ------------------------------------------------------------------------------ test graph.marker.configure.bitmap-7.7 { ::graph marker configure bitmap: anchor - w } -setup { ::graph .graph1 .graph1 marker create bitmap -name Marker1 } -body { .graph1 marker configure Marker1 -anchor w .graph1 marker cget Marker1 -anchor } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {w} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -anchor command works correctly for bitmap # markers when given 'nw' as input. # ------------------------------------------------------------------------------ test graph.marker.configure.bitmap-7.8 { ::graph marker configure bitmap: anchor - nw } -setup { ::graph .graph1 .graph1 marker create bitmap -name Marker1 } -body { .graph1 marker configure Marker1 -anchor nw .graph1 marker cget Marker1 -anchor } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {nw} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -anchor command works correctly for bitmap # markers when given 'center' as input. # ------------------------------------------------------------------------------ test graph.marker.configure.bitmap-7.9 { ::graph marker configure bitmap: anchor - center } -setup { ::graph .graph1 .graph1 marker create bitmap -name Marker1 } -body { .graph1 marker configure Marker1 -anchor center .graph1 marker cget Marker1 -anchor } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {center} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -anchor command works correctly for bitmap # markers when given invalid numerical input. # ------------------------------------------------------------------------------ test graph.marker.configure.bitmap-7.10 { ::graph marker configure bitmap: anchor - invalid numerical input } -setup { ::graph .graph1 .graph1 marker create bitmap -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -anchor 3.5}]} { return 0 } else { return 1 } } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -anchor command works correctly for bitmap # markers when given invalid character input. # ------------------------------------------------------------------------------ test graph.marker.configure.bitmap-7.11 { ::graph marker configure bitmap: anchor - invalid character input } -setup { ::graph .graph1 .graph1 marker create bitmap -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -anchor invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} #=============================================================================== # This part contains the automatic tests that test the common flags for # the marker configure function of the graph BLT component. # ------------------------------------------------------------------------------ # Purpose: Ensure configuring coords changes the coresponding option value pair # ------------------------------------------------------------------------------ test graph.marker.configure.common-1.1 { Configure Coords } -setup { ::graph .graph1 .graph1 marker create text -name marker1 } -body { .graph1 marker configure marker1 -coords {0.8 2} .graph1 marker cget marker1 -coords } -cleanup { .graph1 marker delete marker1 destroy .graph1 } -result {0.8 2.0} # ------------------------------------------------------------------------------ # Purpose: Ensure configuring element changes the coresponding option value pair # ------------------------------------------------------------------------------ test graph.marker.configure.common-2.1 { Configure Element } -setup { ::graph .graph1 .graph1 marker create line -name marker1 } -body { .graph1 marker configure marker1 -element elemName .graph1 marker cget marker1 -element } -cleanup { .graph1 marker delete marker1 destroy .graph1 } -result {elemName} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -hide command works correctly when given 1. # ------------------------------------------------------------------------------ test graph.marker.configure.common-3.1 { ::graph marker configure: hide - 1 } -setup { ::graph .graph1 .graph1 marker create line -name Marker1 } -body { .graph1 marker configure Marker1 -hide 1 .graph1 marker cget Marker1 -hide } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -hide command works correctly when given 0. # ------------------------------------------------------------------------------ test graph.marker.configure.common-3.2 { ::graph marker configure: hide - 0 } -setup { ::graph .graph1 .graph1 marker create line -name Marker1 } -body { .graph1 marker configure Marker1 -hide 0 .graph1 marker cget Marker1 -hide } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -hide command works correctly when given true. # ------------------------------------------------------------------------------ test graph.marker.configure.common-3.3 { ::graph marker configure: hide - true } -setup { ::graph .graph1 .graph1 marker create line -name Marker1 } -body { .graph1 marker configure Marker1 -hide true .graph1 marker cget Marker1 -hide } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -hide command works correctly when given false. # ------------------------------------------------------------------------------ test graph.marker.configure.common-3.4 { ::graph marker configure: hide - false } -setup { ::graph .graph1 .graph1 marker create line -name Marker1 } -body { .graph1 marker configure Marker1 -hide false .graph1 marker cget Marker1 -hide } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -hide command works correctly when given yes. # ------------------------------------------------------------------------------ test graph.marker.configure.common-3.5 { ::graph marker configure: hide - yes } -setup { ::graph .graph1 .graph1 marker create line -name Marker1 } -body { .graph1 marker configure Marker1 -hide yes .graph1 marker cget Marker1 -hide } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -hide command works correctly when given no. # ------------------------------------------------------------------------------ test graph.marker.configure.common-3.6 { ::graph marker configure: hide - no } -setup { ::graph .graph1 .graph1 marker create line -name Marker1 } -body { .graph1 marker configure Marker1 -hide no .graph1 marker cget Marker1 -hide } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -hide command works correctly when given an # invalid input value. # ------------------------------------------------------------------------------ test graph.marker.configure.common-3.7 { ::graph marker configure: hide - invalid input } -setup { ::graph .graph1 .graph1 marker create line -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -hide invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -under command works correctly when given 1. # ------------------------------------------------------------------------------ test graph.marker.configure.common-4.1 { ::graph marker configure: under - 1 } -setup { ::graph .graph1 .graph1 marker create line -name Marker1 } -body { .graph1 marker configure Marker1 -under 1 .graph1 marker cget Marker1 -under } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -under command works correctly when given 0. # ------------------------------------------------------------------------------ test graph.marker.configure.common-4.2 { ::graph marker configure: under - 0 } -setup { ::graph .graph1 .graph1 marker create line -name Marker1 } -body { .graph1 marker configure Marker1 -under 0 .graph1 marker cget Marker1 -under } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -under command works correctly when given true. # ------------------------------------------------------------------------------ test graph.marker.configure.common-4.3 { ::graph marker configure: under - true } -setup { ::graph .graph1 .graph1 marker create line -name Marker1 } -body { .graph1 marker configure Marker1 -under true .graph1 marker cget Marker1 -under } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -under command works correctly when given false. # ------------------------------------------------------------------------------ test graph.marker.configure.common-4.4 { ::graph marker configure: under - false } -setup { ::graph .graph1 .graph1 marker create line -name Marker1 } -body { .graph1 marker configure Marker1 -under false .graph1 marker cget Marker1 -under } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -under command works correctly when given yes. # ------------------------------------------------------------------------------ test graph.marker.configure.common-4.5 { ::graph marker configure: under - yes } -setup { ::graph .graph1 .graph1 marker create line -name Marker1 } -body { .graph1 marker configure Marker1 -under yes .graph1 marker cget Marker1 -under } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -under command works correctly when given no. # ------------------------------------------------------------------------------ test graph.marker.configure.common-4.6 { ::graph marker configure: under - no } -setup { ::graph .graph1 .graph1 marker create line -name Marker1 } -body { .graph1 marker configure Marker1 -under no .graph1 marker cget Marker1 -under } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -under command works correctly when given an # invalid input value. # ------------------------------------------------------------------------------ test graph.marker.configure.common-4.7 { ::graph marker configure: under - invalid input } -setup { ::graph .graph1 .graph1 marker create line -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -under invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -xoffset command works correctly when given # an integer pixel value. # ------------------------------------------------------------------------------ test graph.marker.configure.common-5.1 { ::graph marker configure: xoffset - integer input } -setup { ::graph .graph1 .graph1 marker create line -name Marker1 } -body { .graph1 marker configure Marker1 -xoffset 2 .graph1 marker cget Marker1 -xoffset } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {2} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -xoffset command works correctly when given # an invalid integer pixel value. # ------------------------------------------------------------------------------ test graph.marker.configure.common-5.2 { ::graph marker configure: xoffset - negative integer input } -setup { ::graph .graph1 .graph1 marker create line -name Marker1 } -body { .graph1 marker configure Marker1 -xoffset -1 .graph1 marker cget Marker1 -xoffset } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {-1} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -xoffset command works correctly when given # a decimal pixel value. # ------------------------------------------------------------------------------ test graph.marker.configure.common-5.3 { ::graph marker configure: xoffset - decimal input } -setup { ::graph .graph1 .graph1 marker create line -name Marker1 } -body { .graph1 marker configure Marker1 -xoffset 3.5 .graph1 marker cget Marker1 -xoffset } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {4} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -xoffset command works correctly when given # an invalid decimal pixel value. # ------------------------------------------------------------------------------ test graph.marker.configure.common-5.4 { ::graph marker configure: xoffset - invalid decimal input } -setup { ::graph .graph1 .graph1 marker create line -name Marker1 } -body { .graph1 marker configure Marker1 -xoffset -3.5 .graph1 marker cget Marker1 -xoffset } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {-4} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -xoffset command works correctly when given # a character as input. # ------------------------------------------------------------------------------ test graph.marker.configure.common-5.5 { ::graph marker configure: xoffset - character input } -setup { ::graph .graph1 .graph1 marker create line -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -xoffset a}]} { return 0 } else { return 1 } } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -xoffset command works correctly when given # 0 as input. # ------------------------------------------------------------------------------ test graph.marker.configure.common-5.6 { ::graph marker configure: xoffset - zero } -setup { ::graph .graph1 .graph1 marker create line -name Marker1 } -body { .graph1 marker configure Marker1 -xoffset 0 .graph1 marker cget Marker1 -xoffset } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -yoffset command works correctly when given # an integer pixel value. # ------------------------------------------------------------------------------ test graph.marker.configure.common-6.1 { ::graph marker configure: yoffset - integer input } -setup { ::graph .graph1 .graph1 marker create line -name Marker1 } -body { .graph1 marker configure Marker1 -yoffset 2 .graph1 marker cget Marker1 -yoffset } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {2} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -yoffset command works correctly when given # an invalid integer pixel value. # ------------------------------------------------------------------------------ test graph.marker.configure.common-6.2 { ::graph marker configure: yoffset - negative integer input } -setup { ::graph .graph1 .graph1 marker create line -name Marker1 } -body { .graph1 marker configure Marker1 -yoffset -1 .graph1 marker cget Marker1 -yoffset } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {-1} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -yoffset command works correctly when given # a decimal pixel value. # ------------------------------------------------------------------------------ test graph.marker.configure.common-6.3 { ::graph marker configure: yoffset - decimal input } -setup { ::graph .graph1 .graph1 marker create line -name Marker1 } -body { .graph1 marker configure Marker1 -yoffset 3.5 .graph1 marker cget Marker1 -yoffset } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {4} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -yoffset command works correctly when given # an invalid decimal pixel value. # ------------------------------------------------------------------------------ test graph.marker.configure.common-6.4 { ::graph marker configure: yoffset - invalid decimal input } -setup { ::graph .graph1 .graph1 marker create line -name Marker1 } -body { .graph1 marker configure Marker1 -yoffset -3.5 .graph1 marker cget Marker1 -yoffset } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {-4} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -yoffset command works correctly when given # a character as input. # ------------------------------------------------------------------------------ test graph.marker.configure.common-6.5 { ::graph marker configure: yoffset - character input } -setup { ::graph .graph1 .graph1 marker create line -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -yoffset a}]} { return 0 } else { return 1 } } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -yoffset command works correctly when given # 0 as input. # ------------------------------------------------------------------------------ test graph.marker.configure.common-6.6 { ::graph marker configure: yoffset - zero } -setup { ::graph .graph1 .graph1 marker create line -name Marker1 } -body { .graph1 marker configure Marker1 -yoffset 0 .graph1 marker cget Marker1 -yoffset } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure configuring mapx changes the coresponding option value pair # ------------------------------------------------------------------------------ test graph.marker.configure.common-7.1 { Mapx } -setup { ::graph .graph1 .graph1 marker create text -name marker1 } -body { .graph1 marker configure marker1 -mapx x2 .graph1 marker cget marker1 -mapx } -cleanup { .graph1 marker delete marker1 destroy .graph1 } -result {x2} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -mapx command works correctly when given valid # axis name as input. # ------------------------------------------------------------------------------ test graph.marker.configure.common-7.1 { ::graph marker configure: mapx - valid axis name } -setup { ::graph .graph1 .graph1 axis create .axis1 .graph1 marker create text -name Marker1 } -body { .graph1 marker configure Marker1 -mapx .axis1 .graph1 marker cget Marker1 -mapx } -cleanup { .graph1 marker delete Marker1 .graph1 axis delete .axis1 destroy .graph1 } -result {.axis1} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -mapx command works correctly when given a non- # existent axis name as input. # ------------------------------------------------------------------------------ test graph.marker.configure.common-7.2 { ::graph marker configure: mapx - non-existent axis name } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -mapx .axis1}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -mapx command works correctly when not input is # given. # ------------------------------------------------------------------------------ test graph.marker.configure.common-7.3 { ::graph marker configure: mapx - no input } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { .graph1 marker configure Marker1 -mapx .graph1 marker cget Marker1 -mapx } -cleanup { destroy .graph1 } -result {x} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -mapy command works correctly when given valid # axis name as input. # ------------------------------------------------------------------------------ test graph.marker.configure.common-8.1 { ::graph marker configure: mapy - valid axis name } -setup { ::graph .graph1 .graph1 axis create .axis1 .graph1 marker create text -name Marker1 } -body { .graph1 marker configure Marker1 -mapy .axis1 .graph1 marker cget Marker1 -mapy } -cleanup { .graph1 marker delete Marker1 .graph1 axis delete .axis1 destroy .graph1 } -result {.axis1} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -mapy command works correctly when given a non- # existent axis name as input. # ------------------------------------------------------------------------------ test graph.marker.configure.common-8.2 { ::graph marker configure: mapy - non-existent axis name } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -mapy .axis1}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -mapy command works correctly when no input is # given. # ------------------------------------------------------------------------------ test graph.marker.configure.common-8.3 { ::graph marker configure: mapy - no input } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { .graph1 marker configure Marker1 -mapy .graph1 marker cget Marker1 -mapy } -cleanup { destroy .graph1 } -result {y} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -name command works correctly when given a # string name. # ------------------------------------------------------------------------------ test graph.marker.configure.common-9.1 { ::graph marker configure: name - string name } -setup { ::graph .graph1 } -body { .graph1 marker create text -name myMarker .graph1 marker names } -cleanup { destroy .graph1 } -result {myMarker} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -state command works correctly when given # 'normal' as input. # ------------------------------------------------------------------------------ test graph.marker.configure.common-10.1 { ::graph marker configure: state - normal } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { .graph1 marker configure Marker1 -state normal .graph1 marker cget Marker1 -state } -cleanup { destroy .graph1 } -result {normal} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -state command works correctly when given # 'active' as input. # ------------------------------------------------------------------------------ test graph.marker.configure.common-10.2 { ::graph marker configure: state - active } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { .graph1 marker configure Marker1 -state active .graph1 marker cget Marker1 -state } -cleanup { destroy .graph1 } -result {active} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -state command works correctly when given # 'disabled' as input. # ------------------------------------------------------------------------------ test graph.marker.configure.common-10.3 { ::graph marker configure: state - disabled } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { .graph1 marker configure Marker1 -state disabled .graph1 marker cget Marker1 -state } -cleanup { destroy .graph1 } -result {disabled} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -state command works correctly when given # invalid numerical input. # ------------------------------------------------------------------------------ test graph.marker.configure.common-10.4 { ::graph marker configure: state - invalid numerical input } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -state 3.5}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -state command works correctly when given # invalid character input. # ------------------------------------------------------------------------------ test graph.marker.configure.common-10.5 { ::graph marker configure: state - invalid character input } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -state invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -bindtags command works correctly when given a # single tag name. # ------------------------------------------------------------------------------ test graph.marker.configure.common-11.1 { ::graph marker configure: bindtags - single tag } -setup { ::graph .graph1 .graph1 marker bind Binding1 {puts foobar} .graph1 marker create text -name Marker1 } -body { .graph1 marker configure Marker1 -bindtags Binding1 .graph1 marker cget Marker1 -bindtags } -cleanup { destroy Binding1 destroy .graph1 } -result {Binding1} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -bindtags command works correctly when given a # list of tag names. # ------------------------------------------------------------------------------ test graph.marker.configure.common-11.2 { ::graph marker configure: bindtags - tag list } -setup { ::graph .graph1 .graph1 marker bind Binding1 {puts foo} .graph1 marker bind Binding2 {puts bar} .graph1 marker create text -name Marker1 } -body { .graph1 marker configure Marker1 -bindtags {Binding1 Binding2} .graph1 marker cget Marker1 -bindtags } -cleanup { destroy Binding1 Binding2 destroy .graph1 } -result {Binding1 Binding2} #=============================================================================== # This part contains the automatic tests that test the image marker configure # function of the graph BLT component. # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -anchor command works correctly for image # markers when given 'n' as input. # ------------------------------------------------------------------------------ test graph.marker.configure.image-1.1 { ::graph marker configure image: anchor - n } -setup { ::graph .graph1 .graph1 marker create image -name Marker1 } -body { .graph1 marker configure Marker1 -anchor n .graph1 marker cget Marker1 -anchor } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {n} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -anchor command works correctly for image # markers when given 'ne' as input. # ------------------------------------------------------------------------------ test graph.marker.configure.image-1.2 { ::graph marker configure image: anchor - ne } -setup { ::graph .graph1 .graph1 marker create image -name Marker1 } -body { .graph1 marker configure Marker1 -anchor ne .graph1 marker cget Marker1 -anchor } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {ne} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -anchor command works correctly for image # markers when given 'e' as input. # ------------------------------------------------------------------------------ test graph.marker.configure.image-1.3 { ::graph marker configure image: anchor - e } -setup { ::graph .graph1 .graph1 marker create image -name Marker1 } -body { .graph1 marker configure Marker1 -anchor e .graph1 marker cget Marker1 -anchor } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {e} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -anchor command works correctly for image # markers when given 'se' as input. # ------------------------------------------------------------------------------ test graph.marker.configure.image-1.4 { ::graph marker configure image: anchor - se } -setup { ::graph .graph1 .graph1 marker create image -name Marker1 } -body { .graph1 marker configure Marker1 -anchor se .graph1 marker cget Marker1 -anchor } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {se} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -anchor command works correctly for image # markers when given 's' as input. # ------------------------------------------------------------------------------ test graph.marker.configure.image-1.5 { ::graph marker configure image: anchor - s } -setup { ::graph .graph1 .graph1 marker create image -name Marker1 } -body { .graph1 marker configure Marker1 -anchor s .graph1 marker cget Marker1 -anchor } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {s} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -anchor command works correctly for image # markers when given 'sw' as input. # ------------------------------------------------------------------------------ test graph.marker.configure.image-1.6 { ::graph marker configure image: anchor - sw } -setup { ::graph .graph1 .graph1 marker create image -name Marker1 } -body { .graph1 marker configure Marker1 -anchor sw .graph1 marker cget Marker1 -anchor } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {sw} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -anchor command works correctly for image # markers when given 'w' as input. # ------------------------------------------------------------------------------ test graph.marker.configure.image-1.7 { ::graph marker configure image: anchor - w } -setup { ::graph .graph1 .graph1 marker create image -name Marker1 } -body { .graph1 marker configure Marker1 -anchor w .graph1 marker cget Marker1 -anchor } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {w} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -anchor command works correctly for image # markers when given 'nw' as input. # ------------------------------------------------------------------------------ test graph.marker.configure.image-1.8 { ::graph marker configure image: anchor - nw } -setup { ::graph .graph1 .graph1 marker create image -name Marker1 } -body { .graph1 marker configure Marker1 -anchor nw .graph1 marker cget Marker1 -anchor } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {nw} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -anchor command works correctly for image # markers when given 'center' as input. # ------------------------------------------------------------------------------ test graph.marker.configure.image-1.9 { ::graph marker configure image: anchor - center } -setup { ::graph .graph1 .graph1 marker create image -name Marker1 } -body { .graph1 marker configure Marker1 -anchor center .graph1 marker cget Marker1 -anchor } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {center} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -anchor command works correctly for image # markers when given invalid numerical input. # ------------------------------------------------------------------------------ test graph.marker.configure.image-1.10 { ::graph marker configure image: anchor - invalid numerical input } -setup { ::graph .graph1 .graph1 marker create image -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -anchor 3.5}]} { return 0 } else { return 1 } } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -anchor command works correctly for image # markers when given invalid character input. # ------------------------------------------------------------------------------ test graph.marker.configure.image-1.11 { ::graph marker configure image: anchor - invalid character input } -setup { ::graph .graph1 .graph1 marker create image -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -anchor invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure configuring image changes the coresponding option value pair # ------------------------------------------------------------------------------ test graph.marker.configure.image-2.1 { ::graph marker configure image: image - valid image name } -setup { ::graph .graph1 .graph1 marker create image -name marker1 # the following should set Image1 to the designated name set Image1 [image create photo image.a.2.1 -data { R0lGODlhEAAQAIYAAPwCBHSi1Iyy5Hym3Hym1GSWxJS65Lza/OT2/Pz+/PT+ /KTK5DxmlJS67PT6/Pz6/Lzm/BRGhHSe1MTe/OTy/Oz2/Mzm/NTq/FSKtJS2 7PT2/MTi/LTa/AQyVOTu/Lze/LTS/JTC9MTq/Mzi/KzK/KTC/KS+/BQuRJzG /KzO/LTO/KS6/Jy2/DRmpAQOHEx+rLTK/Jy+/Iym/Jyq/GSK/GSOrIyCBHSi 5HyW/DxuxFxqhPT+dPzqbHRCBAQmPBxenBxSjBxanARGfMRyDOymNOTCnPTG fIRKDMyGNOzGlISu7GSOzIROBPTGjJSy9EyGvIxODNSORMSWTLxyFDx6tBxe lKRiJGQ6BCQWBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAA LAAAAAAQABAAAAesgACCAQIDBAWCiYoABgcICQoJCwyLgg0OCQkPmgoQEYsS E5mYFBUWFxiLGZmbGhoWGxMcHYoDChoOFR4fByAcIbSJAyIXIxYgICQkJSbB gicovCkqJSssKy0uiy8bIDAxLDIzNDU2lS031TI4OTo7PD2VPj9AQUIuQ0RF RvGVi0dIkvATpGSJPwBMkDQxwkSCkyc3DkKJImUKlSdVhBxEaOUKACVVNgrC AsBPIAAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0K qSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpo dHRwOi8vd3d3LmRldmVsY29yLmNvbQA7 }] } -body { .graph1 marker configure marker1 -image $Image1 .graph1 marker cget marker1 -image } -cleanup { image delete $Image1 .graph1 marker delete marker1 destroy .graph1 } -result {image.a.2.1} #=============================================================================== # This part contains the automatic tests that test the line marker configure # function of the graph BLT component. # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -dashes command works correctly when given a # valid dash list. # ------------------------------------------------------------------------------ test graph.marker.configure.line-1.1 { ::graph marker configure: dashes - valid dash list } -setup { ::graph .graph1 .graph1 marker create line -name Marker1 } -body { .graph1 marker configure Marker1 -dashes {2 3 2 4} .graph1 marker cget Marker1 -dashes } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {2 3 2 4} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -dashes command works correctly when given an # empty dash list. # ------------------------------------------------------------------------------ test graph.marker.configure.line-1.2 { ::graph marker configure: dashes - empty dash list } -setup { ::graph .graph1 .graph1 marker create line -name Marker1 } -body { .graph1 marker configure Marker1 -dashes "" .graph1 marker cget Marker1 -dashes } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -dashes command works correctly when given a # dash list that is too long. # ------------------------------------------------------------------------------ test graph.marker.configure.line-1.3 { ::graph marker configure: dashes - long dash list } -setup { ::graph .graph1 .graph1 marker create line -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -dashes {2 3 2 4 2 3 2 4 2 3 2 4}}]} { return 0 } else { return 1 } } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -dashes command works correctly when given an # invalid numerical dash list. # ------------------------------------------------------------------------------ test graph.marker.configure.line-1.4 { ::graph marker configure: dashes - invalid numerical dash list } -setup { ::graph .graph1 .graph1 marker create line -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -dashes {2 3 2 -1 2}}]} { return 0 } else { return 1 } } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -dashes command works correctly when given a # dash list with characters. # ------------------------------------------------------------------------------ test graph.marker.configure.line-1.5 { ::graph marker configure: dashes - dash list with characters } -setup { ::graph .graph1 .graph1 marker create line -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -dashes {2 3 2 a 2}}]} { return 0 } else { return 1 } } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -fill command works correctly for line markers # when given a valid color name. # ------------------------------------------------------------------------------ test graph.marker.configure.line-2.1 { ::graph marker configure line: fill - valid color name } -setup { ::graph .graph1 .graph1 marker create line -name Marker1 } -body { .graph1 marker configure Marker1 -fill black .graph1 marker cget Marker1 -fill } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {black} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -fill command works correctly for line markers # when given an invalid color name. # ------------------------------------------------------------------------------ test graph.marker.configure.line-2.2 { ::graph marker configure line: fill - invalid color name } -setup { ::graph .graph1 .graph1 marker create line -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -fill invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -linewidth command works correctly when given # an integer pixel value. # ------------------------------------------------------------------------------ test graph.marker.configure.line-3.1 { ::graph marker configure: linewidth - integer input } -setup { ::graph .graph1 .graph1 marker create line -name Marker1 } -body { .graph1 marker configure Marker1 -linewidth 2 .graph1 marker cget Marker1 -linewidth } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {2} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -linewidth command works correctly when given # an invalid integer pixel value. # ------------------------------------------------------------------------------ test graph.marker.configure.line-3.2 { ::graph marker configure: linewidth - invalid integer input } -setup { ::graph .graph1 .graph1 marker create line -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -linewidth -1}]} { return 0 } else { return 1 } } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -linewidth command works correctly when given # a decimal pixel value. # ------------------------------------------------------------------------------ test graph.marker.configure.line-3.3 { ::graph marker configure: linewidth - decimal input } -setup { ::graph .graph1 .graph1 marker create line -name Marker1 } -body { .graph1 marker configure Marker1 -linewidth 3.5 .graph1 marker cget Marker1 -linewidth } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {4} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -linewidth command works correctly when given # an invalid decimal pixel value. # ------------------------------------------------------------------------------ test graph.marker.configure.line-3.4 { ::graph marker configure: linewidth - invalid decimal input } -setup { ::graph .graph1 .graph1 marker create line -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -linewidth -3.5}]} { return 0 } else { return 1 } } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -linewidth command works correctly when given # a character as input. # ------------------------------------------------------------------------------ test graph.marker.configure.line-3.5 { ::graph marker configure: linewidth - character input } -setup { ::graph .graph1 .graph1 marker create line -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -linewidth a}]} { return 0 } else { return 1 } } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -linewidth command works correctly when given # 0 as input. # ------------------------------------------------------------------------------ test graph.marker.configure.line-3.6 { ::graph marker configure: linewidth - zero } -setup { ::graph .graph1 .graph1 marker create line -name Marker1 } -body { .graph1 marker configure Marker1 -linewidth 0 .graph1 marker cget Marker1 -linewidth } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -outline command works correctly for line # markers when given a valid color name. # ------------------------------------------------------------------------------ test graph.marker.configure.line-4.1 { ::graph marker configure line: outline - valid color name } -setup { ::graph .graph1 .graph1 marker create line -name Marker1 } -body { .graph1 marker configure Marker1 -outline black .graph1 marker cget Marker1 -outline } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {black} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -outline command works correctly for line # markers when given an invalid color name. # ------------------------------------------------------------------------------ test graph.marker.configure.line-4.2 { ::graph marker configure line: outline - invalid color name } -setup { ::graph .graph1 .graph1 marker create line -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -outline invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -xor command works correctly when given 1. # ------------------------------------------------------------------------------ test graph.marker.configure.line-5.1 { ::graph marker configure: xor - 1 } -setup { ::graph .graph1 .graph1 marker create line -name Marker1 } -body { .graph1 marker configure Marker1 -xor 1 .graph1 marker cget Marker1 -xor } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -xor command works correctly when given 0. # ------------------------------------------------------------------------------ test graph.marker.configure.line-5.2 { ::graph marker configure: xor - 0 } -setup { ::graph .graph1 .graph1 marker create line -name Marker1 } -body { .graph1 marker configure Marker1 -xor 0 .graph1 marker cget Marker1 -xor } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -xor command works correctly when given true. # ------------------------------------------------------------------------------ test graph.marker.configure.line-5.3 { ::graph marker configure: xor - true } -setup { ::graph .graph1 .graph1 marker create line -name Marker1 } -body { .graph1 marker configure Marker1 -xor true .graph1 marker cget Marker1 -xor } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -xor command works correctly when given false. # ------------------------------------------------------------------------------ test graph.marker.configure.line-5.4 { ::graph marker configure: xor - false } -setup { ::graph .graph1 .graph1 marker create line -name Marker1 } -body { .graph1 marker configure Marker1 -xor false .graph1 marker cget Marker1 -xor } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -xor command works correctly when given yes. # ------------------------------------------------------------------------------ test graph.marker.configure.line-5.5 { ::graph marker configure: xor - yes } -setup { ::graph .graph1 .graph1 marker create line -name Marker1 } -body { .graph1 marker configure Marker1 -xor yes .graph1 marker cget Marker1 -xor } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -xor command works correctly when given no. # ------------------------------------------------------------------------------ test graph.marker.configure.line-5.6 { ::graph marker configure: xor - no } -setup { ::graph .graph1 .graph1 marker create line -name Marker1 } -body { .graph1 marker configure Marker1 -xor no .graph1 marker cget Marker1 -xor } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -xor command works correctly when given an # invalid input value. # ------------------------------------------------------------------------------ test graph.marker.configure.line-5.7 { ::graph marker configure: xor - invalid input } -setup { ::graph .graph1 .graph1 marker create line -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -xor invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -cap command works correctly when given 'butt'. # ------------------------------------------------------------------------------ test graph.marker.configure.line-6.1 { ::graph marker configure: cap - butt } -setup { ::graph .graph1 .graph1 marker create line -name Marker1 } -body { .graph1 marker configure Marker1 -cap butt .graph1 marker cget Marker1 -cap } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {butt} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -cap command works correctly when given # 'projecting'. # ------------------------------------------------------------------------------ test graph.marker.configure.line-6.2 { ::graph marker configure: cap - projecting } -setup { ::graph .graph1 .graph1 marker create line -name Marker1 } -body { .graph1 marker configure Marker1 -cap projecting .graph1 marker cget Marker1 -cap } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {projecting} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -cap command works correctly when given # 'round'. # ------------------------------------------------------------------------------ test graph.marker.configure.line-6.3 { ::graph marker configure: cap - round } -setup { ::graph .graph1 .graph1 marker create line -name Marker1 } -body { .graph1 marker configure Marker1 -cap round .graph1 marker cget Marker1 -cap } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {round} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -dashoffset command works correctly when given # an integer pixel value. # ------------------------------------------------------------------------------ test graph.marker.configure.common-7.1 { ::graph marker configure: dashoffset - integer input } -setup { ::graph .graph1 .graph1 marker create line -name Marker1 } -body { .graph1 marker configure Marker1 -dashoffset 2 .graph1 marker cget Marker1 -dashoffset } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {2} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -dashoffset command works correctly when given # an invalid integer pixel value. # ------------------------------------------------------------------------------ test graph.marker.configure.common-7.2 { ::graph marker configure: dashoffset - negative integer input } -setup { ::graph .graph1 .graph1 marker create line -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -dashoffset -1}]} { return 0 } else { return 1 } } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -dashoffset command works correctly when given # a decimal pixel value. # ------------------------------------------------------------------------------ test graph.marker.configure.common-7.3 { ::graph marker configure: dashoffset - decimal input } -setup { ::graph .graph1 .graph1 marker create line -name Marker1 } -body { .graph1 marker configure Marker1 -dashoffset 3.5 .graph1 marker cget Marker1 -dashoffset } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {4} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -dashoffset command works correctly when given # an invalid decimal pixel value. # ------------------------------------------------------------------------------ test graph.marker.configure.common-7.4 { ::graph marker configure: dashoffset - invalid decimal input } -setup { ::graph .graph1 .graph1 marker create line -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -dashoffset -3.5}]} { return 0 } else { return 1 } } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -dashoffset command works correctly when given # a character as input. # ------------------------------------------------------------------------------ test graph.marker.configure.common-7.5 { ::graph marker configure: dashoffset - character input } -setup { ::graph .graph1 .graph1 marker create line -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -dashoffset a}]} { return 0 } else { return 1 } } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -dashoffset command works correctly when given # 0 as input. # ------------------------------------------------------------------------------ test graph.marker.configure.common-7.6 { ::graph marker configure: dashoffset - zero } -setup { ::graph .graph1 .graph1 marker create line -name Marker1 } -body { .graph1 marker configure Marker1 -dashoffset 0 .graph1 marker cget Marker1 -dashoffset } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -join command works correctly when given # 'bevel'. # ------------------------------------------------------------------------------ test graph.marker.configure.line-8.1 { ::graph marker configure: join - bevel } -setup { ::graph .graph1 .graph1 marker create line -name Marker1 } -body { .graph1 marker configure Marker1 -join bevel .graph1 marker cget Marker1 -join } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {bevel} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -join command works correctly when given # 'miter'. # ------------------------------------------------------------------------------ test graph.marker.configure.line-8.2 { ::graph marker configure: join - miter } -setup { ::graph .graph1 .graph1 marker create line -name Marker1 } -body { .graph1 marker configure Marker1 -join miter .graph1 marker cget Marker1 -join } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {miter} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -join command works correctly when given # 'round'. # ------------------------------------------------------------------------------ test graph.marker.configure.line-8.3 { ::graph marker configure: join - round } -setup { ::graph .graph1 .graph1 marker create line -name Marker1 } -body { .graph1 marker configure Marker1 -join round .graph1 marker cget Marker1 -join } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {round} #=============================================================================== # This part contains the automatic tests that test the polygon marker configure # function of the graph BLT component. # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -dashes command works correctly when given a # valid dash list. # ------------------------------------------------------------------------------ test graph.marker.configure.polygon-1.1 { ::graph marker configure: dashes - valid dash list } -setup { ::graph .graph1 .graph1 marker create polygon -name Marker1 } -body { .graph1 marker configure Marker1 -dashes {2 3 2 4} .graph1 marker cget Marker1 -dashes } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {2 3 2 4} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -dashes command works correctly when given an # empty dash list. # ------------------------------------------------------------------------------ test graph.marker.configure.polygon-1.2 { ::graph marker configure: dashes - empty dash list } -setup { ::graph .graph1 .graph1 marker create polygon -name Marker1 } -body { .graph1 marker configure Marker1 -dashes "" .graph1 marker cget Marker1 -dashes } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -dashes command works correctly when given a # dash list that is too long. # ------------------------------------------------------------------------------ test graph.marker.configure.polygon-1.3 { ::graph marker configure: dashes - long dash list } -setup { ::graph .graph1 .graph1 marker create polygon -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -dashes {2 3 2 4 2 3 2 4 2 3 2 4}}]} { return 0 } else { return 1 } } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -dashes command works correctly when given an # invalid numerical dash list. # ------------------------------------------------------------------------------ test graph.marker.configure.polygon-1.4 { ::graph marker configure: dashes - invalid numerical dash list } -setup { ::graph .graph1 .graph1 marker create polygon -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -dashes {2 3 2 -1 2}}]} { return 0 } else { return 1 } } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -dashes command works correctly when given a # dash list with characters. # ------------------------------------------------------------------------------ test graph.marker.configure.polygon-1.5 { ::graph marker configure: dashes - dash list with characters } -setup { ::graph .graph1 .graph1 marker create polygon -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -dashes {2 3 2 a 2}}]} { return 0 } else { return 1 } } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -fill command works correctly for polygon # polygon when given a valid color name. # ------------------------------------------------------------------------------ test graph.marker.configure.polygon-2.1 { ::graph marker configure polygon: fill - valid color name } -setup { ::graph .graph1 .graph1 marker create polygon -name Marker1 } -body { .graph1 marker configure Marker1 -fill black .graph1 marker cget Marker1 -fill } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {black {}} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -fill command works correctly for polygon # markers when given an invalid color name. # ------------------------------------------------------------------------------ test graph.marker.configure.polygon-2.2 { ::graph marker configure polygon: fill - invalid color name } -setup { ::graph .graph1 .graph1 marker create polygon -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -fill invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -linewidth command works correctly when given # an integer pixel value. # ------------------------------------------------------------------------------ test graph.marker.configure.polygon-3.1 { ::graph marker configure: linewidth - integer input } -setup { ::graph .graph1 .graph1 marker create polygon -name Marker1 } -body { .graph1 marker configure Marker1 -linewidth 2 .graph1 marker cget Marker1 -linewidth } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {2} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -linewidth command works correctly when given # an invalid integer pixel value. # ------------------------------------------------------------------------------ test graph.marker.configure.polygon-3.2 { ::graph marker configure: linewidth - invalid integer input } -setup { ::graph .graph1 .graph1 marker create polygon -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -linewidth -1}]} { return 0 } else { return 1 } } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -linewidth command works correctly when given # a decimal pixel value. # ------------------------------------------------------------------------------ test graph.marker.configure.polygon-3.3 { ::graph marker configure: linewidth - decimal input } -setup { ::graph .graph1 .graph1 marker create polygon -name Marker1 } -body { .graph1 marker configure Marker1 -linewidth 3.5 .graph1 marker cget Marker1 -linewidth } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {4} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -linewidth command works correctly when given # an invalid decimal pixel value. # ------------------------------------------------------------------------------ test graph.marker.configure.polygon-3.4 { ::graph marker configure: linewidth - invalid decimal input } -setup { ::graph .graph1 .graph1 marker create polygon -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -linewidth -1.5}]} { return 0 } else { return 1 } } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -linewidth command works correctly when given # a character as input. # ------------------------------------------------------------------------------ test graph.marker.configure.polygon-3.5 { ::graph marker configure: linewidth - character input } -setup { ::graph .graph1 .graph1 marker create polygon -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -linewidth a}]} { return 0 } else { return 1 } } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -linewidth command works correctly when given # 0 as input. # ------------------------------------------------------------------------------ test graph.marker.configure.polygon-3.6 { ::graph marker configure: linewidth - zero } -setup { ::graph .graph1 .graph1 marker create polygon -name Marker1 } -body { .graph1 marker configure Marker1 -linewidth 0 .graph1 marker cget Marker1 -linewidth } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -outline command works correctly for polygon # polygon when given a valid color name. # ------------------------------------------------------------------------------ test graph.marker.configure.polygon-4.1 { ::graph marker configure polygon: outline - valid color name } -setup { ::graph .graph1 .graph1 marker create polygon -name Marker1 } -body { .graph1 marker configure Marker1 -outline black .graph1 marker cget Marker1 -outline } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {black {}} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -outline command works correctly for polygon # markers when given an invalid color name. # ------------------------------------------------------------------------------ test graph.marker.configure.polygon-4.2 { ::graph marker configure polygon: outline - invalid color name } -setup { ::graph .graph1 .graph1 marker create polygon -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -outline invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure configuring stipple changes the coresponding option value pair # ------------------------------------------------------------------------------ test graph.marker.configure.polygon-5.1 { Configure Stipple } -setup { ::graph .graph1 .graph1 marker create polygon -name Marker1 } -body { .graph1 marker configure Marker1 \ -stipple @[file join [file dirname [info script]] greenback.xbm] .graph1 marker cget Marker1 -stipple } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -match glob -result {@*greenback.xbm} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -cap command works correctly when given 'butt'. # ------------------------------------------------------------------------------ test graph.marker.configure.polygon-6.1 { ::graph marker configure: cap - butt } -setup { ::graph .graph1 .graph1 marker create polygon -name Marker1 } -body { .graph1 marker configure Marker1 -cap butt .graph1 marker cget Marker1 -cap } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {butt} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -cap command works correctly when given # 'projecting'. # ------------------------------------------------------------------------------ test graph.marker.configure.polygon-6.2 { ::graph marker configure: cap - projecting } -setup { ::graph .graph1 .graph1 marker create polygon -name Marker1 } -body { .graph1 marker configure Marker1 -cap projecting .graph1 marker cget Marker1 -cap } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {projecting} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -cap command works correctly when given # 'round'. # ------------------------------------------------------------------------------ test graph.marker.configure.polygon-6.3 { ::graph marker configure: cap - round } -setup { ::graph .graph1 .graph1 marker create polygon -name Marker1 } -body { .graph1 marker configure Marker1 -cap round .graph1 marker cget Marker1 -cap } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {round} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -join command works correctly when given # 'bevel'. # ------------------------------------------------------------------------------ test graph.marker.configure.polygon-7.1 { ::graph marker configure: join - bevel } -setup { ::graph .graph1 .graph1 marker create polygon -name Marker1 } -body { .graph1 marker configure Marker1 -join bevel .graph1 marker cget Marker1 -join } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {bevel} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -join command works correctly when given # 'miter'. # ------------------------------------------------------------------------------ test graph.marker.configure.polygon-7.2 { ::graph marker configure: join - miter } -setup { ::graph .graph1 .graph1 marker create polygon -name Marker1 } -body { .graph1 marker configure Marker1 -join miter .graph1 marker cget Marker1 -join } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {miter} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -join command works correctly when given # 'round'. # ------------------------------------------------------------------------------ test graph.marker.configure.polygon-7.3 { ::graph marker configure: join - round } -setup { ::graph .graph1 .graph1 marker create polygon -name Marker1 } -body { .graph1 marker configure Marker1 -join round .graph1 marker cget Marker1 -join } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {round} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -xor command works correctly when given 1. # ------------------------------------------------------------------------------ test graph.marker.configure.polygon-8.1 { ::graph marker configure: xor - 1 } -setup { ::graph .graph1 .graph1 marker create polygon -name Marker1 } -body { .graph1 marker configure Marker1 -xor 1 .graph1 marker cget Marker1 -xor } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -xor command works correctly when given 0. # ------------------------------------------------------------------------------ test graph.marker.configure.polygon-8.2 { ::graph marker configure: xor - 0 } -setup { ::graph .graph1 .graph1 marker create polygon -name Marker1 } -body { .graph1 marker configure Marker1 -xor 0 .graph1 marker cget Marker1 -xor } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -xor command works correctly when given true. # ------------------------------------------------------------------------------ test graph.marker.configure.polygon-8.3 { ::graph marker configure: xor - true } -setup { ::graph .graph1 .graph1 marker create polygon -name Marker1 } -body { .graph1 marker configure Marker1 -xor true .graph1 marker cget Marker1 -xor } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -xor command works correctly when given false. # ------------------------------------------------------------------------------ test graph.marker.configure.polygon-8.4 { ::graph marker configure: xor - false } -setup { ::graph .graph1 .graph1 marker create polygon -name Marker1 } -body { .graph1 marker configure Marker1 -xor false .graph1 marker cget Marker1 -xor } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -xor command works correctly when given yes. # ------------------------------------------------------------------------------ test graph.marker.configure.polygon-8.5 { ::graph marker configure: xor - yes } -setup { ::graph .graph1 .graph1 marker create polygon -name Marker1 } -body { .graph1 marker configure Marker1 -xor yes .graph1 marker cget Marker1 -xor } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -xor command works correctly when given no. # ------------------------------------------------------------------------------ test graph.marker.configure.polygon-8.6 { ::graph marker configure: xor - no } -setup { ::graph .graph1 .graph1 marker create polygon -name Marker1 } -body { .graph1 marker configure Marker1 -xor no .graph1 marker cget Marker1 -xor } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -xor command works correctly when given an # invalid input value. # ------------------------------------------------------------------------------ test graph.marker.configure.polygon-8.7 { ::graph marker configure: xor - invalid input } -setup { ::graph .graph1 .graph1 marker create polygon -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -xor invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} #=============================================================================== # This part contains the automatic tests that test the text marker configure # function of the graph BLT component. # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -anchor command works correctly for text # markers when given 'n' as input. # ------------------------------------------------------------------------------ test graph.marker.configure.text-1.1 { ::graph marker configure text: anchor - n } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { .graph1 marker configure Marker1 -anchor n .graph1 marker cget Marker1 -anchor } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {n} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -anchor command works correctly for text # markers when given 'ne' as input. # ------------------------------------------------------------------------------ test graph.marker.configure.text-1.2 { ::graph marker configure text: anchor - ne } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { .graph1 marker configure Marker1 -anchor ne .graph1 marker cget Marker1 -anchor } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {ne} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -anchor command works correctly for text # markers when given 'e' as input. # ------------------------------------------------------------------------------ test graph.marker.configure.text-1.3 { ::graph marker configure text: anchor - e } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { .graph1 marker configure Marker1 -anchor e .graph1 marker cget Marker1 -anchor } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {e} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -anchor command works correctly for text # markers when given 'se' as input. # ------------------------------------------------------------------------------ test graph.marker.configure.text-1.4 { ::graph marker configure text: anchor - se } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { .graph1 marker configure Marker1 -anchor se .graph1 marker cget Marker1 -anchor } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {se} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -anchor command works correctly for text # markers when given 's' as input. # ------------------------------------------------------------------------------ test graph.marker.configure.text-1.5 { ::graph marker configure text: anchor - s } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { .graph1 marker configure Marker1 -anchor s .graph1 marker cget Marker1 -anchor } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {s} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -anchor command works correctly for text # markers when given 'sw' as input. # ------------------------------------------------------------------------------ test graph.marker.configure.text-1.6 { ::graph marker configure text: anchor - sw } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { .graph1 marker configure Marker1 -anchor sw .graph1 marker cget Marker1 -anchor } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {sw} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -anchor command works correctly for text # markers when given 'w' as input. # ------------------------------------------------------------------------------ test graph.marker.configure.text-1.7 { ::graph marker configure text: anchor - w } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { .graph1 marker configure Marker1 -anchor w .graph1 marker cget Marker1 -anchor } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {w} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -anchor command works correctly for text # markers when given 'nw' as input. # ------------------------------------------------------------------------------ test graph.marker.configure.text-1.8 { ::graph marker configure text: anchor - nw } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { .graph1 marker configure Marker1 -anchor nw .graph1 marker cget Marker1 -anchor } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {nw} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -anchor command works correctly for text # markers when given 'center' as input. # ------------------------------------------------------------------------------ test graph.marker.configure.text-1.9 { ::graph marker configure text: anchor - center } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { .graph1 marker configure Marker1 -anchor center .graph1 marker cget Marker1 -anchor } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {center} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -anchor command works correctly for text # markers when given invalid numerical input. # ------------------------------------------------------------------------------ test graph.marker.configure.text-1.10 { ::graph marker configure text: anchor - invalid numerical input } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -anchor 3.5}]} { return 0 } else { return 1 } } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -anchor command works correctly for text # markers when given invalid character input. # ------------------------------------------------------------------------------ test graph.marker.configure.text-1.11 { ::graph marker configure text: anchor - invalid character input } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -anchor invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -background command works correctly for text # markers when given a valid color name. # ------------------------------------------------------------------------------ test graph.marker.configure.text-2.1 { ::graph marker configure text: background - valid color name } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { .graph1 marker configure Marker1 -background black .graph1 marker cget Marker1 -background } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {black} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -background command works correctly for text # markers when given an invalid color name. # ------------------------------------------------------------------------------ test graph.marker.configure.text-2.2 { ::graph marker configure text: background - invalid color name } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -background invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the legend configure -font command works correctly when given a # string as input. # ------------------------------------------------------------------------------ test graph.marker.configure.text-3.1 { ::graph marker configure Marker1: font - string } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { .graph1 marker configure Marker1 -font Times .graph1 marker cget Marker1 -font } -cleanup { destroy .graph1 } -result {Times} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure Marker1 -font command works correctly when given a list # with a string as input. # ------------------------------------------------------------------------------ test graph.marker.configure.text-3.2 { ::graph marker configure Marker1: font - list with string } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { .graph1 marker configure Marker1 -font {Times} .graph1 marker cget Marker1 -font } -cleanup { destroy .graph1 } -result {Times} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure Marker1 -font command works correctly when given a list # with a string and positive integer as input. # ------------------------------------------------------------------------------ test graph.marker.configure.text-3.3 { ::graph marker configure Marker1: font - list with string and positive integer } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { .graph1 marker configure Marker1 -font {Times 10} .graph1 marker cget Marker1 -font } -cleanup { destroy .graph1 } -result {Times 10} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure Marker1 -font command works correctly when given a list # with a string and negative integer as input. # ------------------------------------------------------------------------------ test graph.marker.configure.text-3.4 { ::graph marker configure Marker1: font - list with string and negative integer } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { .graph1 marker configure Marker1 -font {Times -10} .graph1 marker cget Marker1 -font } -cleanup { destroy .graph1 } -result {Times -10} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure Marker1 -font command works correctly when given a list # with a string and decimal as input. # ------------------------------------------------------------------------------ test graph.marker.configure.text-3.5 { ::graph marker configure Marker1: font - list with string and decimal } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -font {Times 10.5}}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure Marker1 -font command works correctly when given a list # with 2 strings as input. # ------------------------------------------------------------------------------ test graph.marker.configure.text-3.6 { ::graph marker configure Marker1: font - list with 2 strings } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -font {Times Ten}}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure configuring font changes the coresponding option value pair # ------------------------------------------------------------------------------ test graph.marker.configure.text-3.7 { Configure Font } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { .graph1 marker configure Marker1 -font "*-Helvetica-*-R-Normal-*-125-*" .graph1 marker cget Marker1 -font } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {*-Helvetica-*-R-Normal-*-125-*} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -fill command works correctly for text markers # when given a valid color name. # ------------------------------------------------------------------------------ test graph.marker.configure.text-4.1 { ::graph marker configure text: fill - valid color name } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { .graph1 marker configure Marker1 -fill black .graph1 marker cget Marker1 -fill } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {black} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -fill command works correctly for text markers # when given an invalid color name. # ------------------------------------------------------------------------------ test graph.marker.configure.text-4.2 { ::graph marker configure text: fill - invalid color name } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -fill invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -foreground command works correctly for text # markers when given a valid color name. # ------------------------------------------------------------------------------ test graph.marker.configure.text-5.1 { ::graph marker configure text: foreground - valid color name } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { .graph1 marker configure Marker1 -foreground black .graph1 marker cget Marker1 -foreground } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {black} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -foreground command works correctly for text # markers when given an invalid color name. # ------------------------------------------------------------------------------ test graph.marker.configure.text-5.2 { ::graph marker configure text: foreground - invalid color name } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -foreground invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -justify command works correctly for text # markers when given 'left' as input. # ------------------------------------------------------------------------------ test graph.marker.configure.text-6.1 { ::graph marker configure text: justify - left } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { .graph1 marker configure Marker1 -justify left .graph1 marker cget Marker1 -justify } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {left} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -justify command works correctly for text # markers when given 'center' as input. # ------------------------------------------------------------------------------ test graph.marker.configure.text-6.2 { ::graph marker configure text: justify - center } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { .graph1 marker configure Marker1 -justify center .graph1 marker cget Marker1 -justify } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {center} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -justify command works correctly for text # markers when given 'right' as input. # ------------------------------------------------------------------------------ test graph.marker.configure.text-6.3 { ::graph marker configure text: justify - right } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { .graph1 marker configure Marker1 -justify right .graph1 marker cget Marker1 -justify } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {right} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -justify command works correctly for text # markers when given invalid input. # ------------------------------------------------------------------------------ test graph.marker.configure.text-6.4 { ::graph marker configure text: justify - invalid input } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -justify invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -outline command works correctly for text # markers when given a valid color name. # ------------------------------------------------------------------------------ test graph.marker.configure.text-7.1 { ::graph marker configure text: outline - valid color name } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { .graph1 marker configure Marker1 -outline black .graph1 marker cget Marker1 -outline } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {black} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -outline command works correctly for text # markers when given an invalid color name. # ------------------------------------------------------------------------------ test graph.marker.configure.text-7.2 { ::graph marker configure text: outline - invalid color name } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -outline invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -padx command works correctly for text # markers when given a single valid integer input. # ------------------------------------------------------------------------------ test graph.marker.configure.text-8.1 { ::graph marker configure text: padx - single valid integer } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { .graph1 marker configure Marker1 -padx 6 .graph1 marker cget Marker1 -padx } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {6 6} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -padx command works correctly for text # markers when given a single invalid integer input. # ------------------------------------------------------------------------------ test graph.marker.configure.text-8.2 { ::graph marker configure text: padx - single invalid integer } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -padx -6}]} { return 0 } else { return 1 } } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -padx command works correctly for text # markers when given a valid list of valid integers. # ------------------------------------------------------------------------------ test graph.marker.configure.text-8.3 { ::graph marker configure text: padx - list of valid integers } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { .graph1 marker configure Marker1 -padx {6 2} .graph1 marker cget Marker1 -padx } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {6 2} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -padx command works correctly for text # markers when given an invalid list of integers. # ------------------------------------------------------------------------------ test graph.marker.configure.text-8.4 { ::graph marker configure text: padx - list of invalid integers } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -padx {6 -2}}]} { return 0 } else { return 1 } } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -padx command works correctly for text # markers when given a list that is too long. # ------------------------------------------------------------------------------ test graph.marker.configure.text-8.5 { ::graph marker configure text: padx - long list } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -padx {6 3 1}}]} { return 0 } else { return 1 } } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -padx command works correctly for text # markers when given character input. # ------------------------------------------------------------------------------ test graph.marker.configure.text-8.6 { ::graph marker configure text: padx - character input } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -padx invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -padx command works correctly for text # markers when given 0 as input. # ------------------------------------------------------------------------------ test graph.marker.configure.text-8.7 { ::graph marker configure text: padx - zero } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { .graph1 marker configure Marker1 -padx 0 .graph1 marker cget Marker1 -padx } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0 0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -pady command works correctly for text # markers when given a single valid integer input. # ------------------------------------------------------------------------------ test graph.marker.configure.text-9.1 { ::graph marker configure text: pady - single valid integer } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { .graph1 marker configure Marker1 -pady 6 .graph1 marker cget Marker1 -pady } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {6 6} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -pady command works correctly for text # markers when given a single invalid integer input. # ------------------------------------------------------------------------------ test graph.marker.configure.text-9.2 { ::graph marker configure text: pady - single invalid integer } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -pady -6}]} { return 0 } else { return 1 } } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -pady command works correctly for text # markers when given a valid list of valid integers. # ------------------------------------------------------------------------------ test graph.marker.configure.text-9.3 { ::graph marker configure text: pady - list of valid integers } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { .graph1 marker configure Marker1 -pady {6 2} .graph1 marker cget Marker1 -pady } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {6 2} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -pady command works correctly for text # markers when given an invalid list of integers. # ------------------------------------------------------------------------------ test graph.marker.configure.text-9.4 { ::graph marker configure text: pady - list of invalid integers } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -pady {6 -2}}]} { return 0 } else { return 1 } } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -pady command works correctly for text # markers when given a list that is too long. # ------------------------------------------------------------------------------ test graph.marker.configure.text-9.5 { ::graph marker configure text: pady - long list } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -pady {6 3 1}}]} { return 0 } else { return 1 } } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -pady command works correctly for text # markers when given character input. # ------------------------------------------------------------------------------ test graph.marker.configure.text-9.6 { ::graph marker configure text: pady - character input } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -pady invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -pady command works correctly for text # markers when given 0 as input. # ------------------------------------------------------------------------------ test graph.marker.configure.text-9.7 { ::graph marker configure text: pady - zero } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { .graph1 marker configure Marker1 -pady 0 .graph1 marker cget Marker1 -pady } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0 0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -rotate command works correctly when given # an integer angle. # ------------------------------------------------------------------------------ test graph.marker.configure.text-10.1 { ::graph marker configure: rotate - integer input } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { .graph1 marker configure Marker1 -rotate 90 .graph1 marker cget Marker1 -rotate } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {90.0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -rotate command works correctly when given # a decimal angle. # ------------------------------------------------------------------------------ test graph.marker.configure.text-10.2 { ::graph marker configure: rotate - decimal input } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { .graph1 marker configure Marker1 -rotate 45.5 .graph1 marker cget Marker1 -rotate } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {45.5} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -rotate command works correctly when given # a negative integer angle. # ------------------------------------------------------------------------------ test graph.marker.configure.text-10.3 { ::graph marker configure: rotate - negative integer input } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { .graph1 marker configure Marker1 -rotate -90 .graph1 marker cget Marker1 -rotate } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {270.0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -rotate command works correctly when given # a negative decimal angle. # ------------------------------------------------------------------------------ test graph.marker.configure.text-10.4 { ::graph marker configure: rotate - negative decimal input } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { .graph1 marker configure Marker1 -rotate -45.5 .graph1 marker cget Marker1 -rotate } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {314.5} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -rotate command works correctly when given # a character as input. # ------------------------------------------------------------------------------ test graph.marker.configure.text-10.5 { ::graph marker configure: rotate - character input } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -rotate invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -text command works correctly. # ------------------------------------------------------------------------------ test graph.marker.configure.text-11.1 { ::graph marker configure: text } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { .graph1 marker configure Marker1 -text "foobar" .graph1 marker cget Marker1 -text } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {foobar} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -shadow command works correctly when given a # valid color name. # ------------------------------------------------------------------------------ test graph.marker.configure.text-12.1 { ::graph marker configure: shadow - valid color name } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { .graph1 marker configure Marker1 -shadow black .graph1 marker cget Marker1 -shadow } -cleanup { destroy .graph1 } -result {black 1} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -shadow command works correctly when given an # invalid color name. # ------------------------------------------------------------------------------ test graph.marker.configure.text-12.2 { ::graph marker configure: shadow - invalid color name } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -shadow invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -shadow command works correctly when given a # valid color name and valid integer value. # ------------------------------------------------------------------------------ test graph.marker.configure.text-12.3 { ::graph marker configure: shadow - valid color name, valid integer } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { .graph1 marker configure Marker1 -shadow {black 2} .graph1 marker cget Marker1 -shadow } -cleanup { destroy .graph1 } -result {black 2} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -shadow command works correctly when given an # invalid color name and valid integer value. # ------------------------------------------------------------------------------ test graph.marker.configure.text-12.4 { ::graph marker configure: shadow - invalid color name, valid integer } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -shadow {invalid 1}}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -shadow command works correctly when given a # valid color name and invalid integer value. # ------------------------------------------------------------------------------ test graph.marker.configure.text-12.5 { ::graph marker configure: shadow - valid color name, invalid integer } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -shadow {black -1}}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} #=============================================================================== # This part contains the automatic tests that test the window marker configure # function of the graph BLT component. # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -anchor command works correctly for window # markers when given 'n' as input. # ------------------------------------------------------------------------------ test graph.marker.configure.window-1.1 { ::graph marker configure window: anchor - n } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { .graph1 marker configure Marker1 -anchor n .graph1 marker cget Marker1 -anchor } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {n} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -anchor command works correctly for window # markers when given 'ne' as input. # ------------------------------------------------------------------------------ test graph.marker.configure.window-1.2 { ::graph marker configure window: anchor - ne } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { .graph1 marker configure Marker1 -anchor ne .graph1 marker cget Marker1 -anchor } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {ne} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -anchor command works correctly for window # markers when given 'e' as input. # ------------------------------------------------------------------------------ test graph.marker.configure.window-1.3 { ::graph marker configure window: anchor - e } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { .graph1 marker configure Marker1 -anchor e .graph1 marker cget Marker1 -anchor } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {e} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -anchor command works correctly for window # markers when given 'se' as input. # ------------------------------------------------------------------------------ test graph.marker.configure.window-1.4 { ::graph marker configure window: anchor - se } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { .graph1 marker configure Marker1 -anchor se .graph1 marker cget Marker1 -anchor } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {se} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -anchor command works correctly for window # markers when given 's' as input. # ------------------------------------------------------------------------------ test graph.marker.configure.window-1.5 { ::graph marker configure window: anchor - s } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { .graph1 marker configure Marker1 -anchor s .graph1 marker cget Marker1 -anchor } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {s} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -anchor command works correctly for window # markers when given 'sw' as input. # ------------------------------------------------------------------------------ test graph.marker.configure.window-1.6 { ::graph marker configure window: anchor - sw } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { .graph1 marker configure Marker1 -anchor sw .graph1 marker cget Marker1 -anchor } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {sw} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -anchor command works correctly for window # markers when given 'w' as input. # ------------------------------------------------------------------------------ test graph.marker.configure.window-1.7 { ::graph marker configure window: anchor - w } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { .graph1 marker configure Marker1 -anchor w .graph1 marker cget Marker1 -anchor } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {w} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -anchor command works correctly for window # markers when given 'nw' as input. # ------------------------------------------------------------------------------ test graph.marker.configure.window-1.8 { ::graph marker configure window: anchor - nw } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { .graph1 marker configure Marker1 -anchor nw .graph1 marker cget Marker1 -anchor } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {nw} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -anchor command works correctly for window # markers when given 'center' as input. # ------------------------------------------------------------------------------ test graph.marker.configure.window-1.9 { ::graph marker configure window: anchor - center } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { .graph1 marker configure Marker1 -anchor center .graph1 marker cget Marker1 -anchor } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {center} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -anchor command works correctly for window # markers when given invalid numerical input. # ------------------------------------------------------------------------------ test graph.marker.configure.window-1.10 { ::graph marker configure window: anchor - invalid numerical input } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -anchor 3.5}]} { return 0 } else { return 1 } } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -anchor command works correctly for window # markers when given invalid character input. # ------------------------------------------------------------------------------ test graph.marker.configure.window-1.11 { ::graph marker configure window: anchor - invalid character input } -setup { ::graph .graph1 .graph1 marker create text -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -anchor invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -height command works correctly when given # an integer pixel value. # ------------------------------------------------------------------------------ test graph.marker.configure.window-2.1 { ::graph marker configure: height - integer input } -setup { ::graph .graph1 .graph1 marker create window -name Marker1 } -body { .graph1 marker configure Marker1 -height 2 .graph1 marker cget Marker1 -height } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {2} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -height command works correctly when given # an invalid integer pixel value. # ------------------------------------------------------------------------------ test graph.marker.configure.window-2.2 { ::graph marker configure: height - invalid integer input } -setup { ::graph .graph1 .graph1 marker create window -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -height -1}]} { return 0 } else { return 1 } } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -height command works correctly when given # a decimal pixel value. # ------------------------------------------------------------------------------ test graph.marker.configure.window-2.3 { ::graph marker configure: height - decimal input } -setup { ::graph .graph1 .graph1 marker create window -name Marker1 } -body { .graph1 marker configure Marker1 -height 3.5 .graph1 marker cget Marker1 -height } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {4} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -height command works correctly when given # an invalid decimal pixel value. # ------------------------------------------------------------------------------ test graph.marker.configure.window-2.4 { ::graph marker configure: height - invalid decimal input } -setup { ::graph .graph1 .graph1 marker create window -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -height -1.5}]} { return 0 } else { return 1 } } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -height command works correctly when given # a character as input. # ------------------------------------------------------------------------------ test graph.marker.configure.window-2.5 { ::graph marker configure: height - character input } -setup { ::graph .graph1 .graph1 marker create window -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -height a}]} { return 0 } else { return 1 } } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -height command works correctly when given 0 # as input. # ------------------------------------------------------------------------------ test graph.marker.configure.window-2.6 { ::graph marker configure: height - zero } -setup { ::graph .graph1 .graph1 marker create window -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -height 0}]} { return 0 } else { return 1 } } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -width command works correctly when given # an integer pixel value. # ------------------------------------------------------------------------------ test graph.marker.configure.window-3.1 { ::graph marker configure: width - integer input } -setup { ::graph .graph1 .graph1 marker create window -name Marker1 } -body { .graph1 marker configure Marker1 -width 2 .graph1 marker cget Marker1 -width } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {2} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -width command works correctly when given # an invalid integer pixel value. # ------------------------------------------------------------------------------ test graph.marker.configure.window-3.2 { ::graph marker configure: width - invalid integer input } -setup { ::graph .graph1 .graph1 marker create window -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -width -1}]} { return 0 } else { return 1 } } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -width command works correctly when given # a decimal pixel value. # ------------------------------------------------------------------------------ test graph.marker.configure.window-3.3 { ::graph marker configure: width - decimal input } -setup { ::graph .graph1 .graph1 marker create window -name Marker1 } -body { .graph1 marker configure Marker1 -width 3.5 .graph1 marker cget Marker1 -width } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {4} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -width command works correctly when given # an invalid decimal pixel value. # ------------------------------------------------------------------------------ test graph.marker.configure.window-3.4 { ::graph marker configure: width - invalid decimal input } -setup { ::graph .graph1 .graph1 marker create window -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -width -1.5}]} { return 0 } else { return 1 } } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -width command works correctly when given # a character as input. # ------------------------------------------------------------------------------ test graph.marker.configure.window-3.5 { ::graph marker configure: width - character input } -setup { ::graph .graph1 .graph1 marker create window -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -width a}]} { return 0 } else { return 1 } } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -width command works correctly when given 0 # as input. # ------------------------------------------------------------------------------ test graph.marker.configure.window-3.6 { ::graph marker configure: width - zero } -setup { ::graph .graph1 .graph1 marker create window -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -width 0}]} { return 0 } else { return 1 } } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -window command works correctly when given a # valid button name. # ------------------------------------------------------------------------------ test graph.marker.configure.window-4.1 { ::graph marker configure: window - valid button name } -setup { ::graph .graph1 button .graph1.button1 -text "foo" .graph1 marker create window -name Marker1 } -body { .graph1 marker configure Marker1 -window .graph1.button1 .graph1 marker cget Marker1 -window } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {.graph1.button1} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker configure -window command works correctly when given a # non-existent button name. # ------------------------------------------------------------------------------ test graph.marker.configure.window-4.2 { ::graph marker configure: window - non-existent button name } -setup { ::graph .graph1 .graph1 marker create window -name Marker1 } -body { if {[catch {.graph1 marker configure Marker1 -window .graph1.button1}]} { return 0 } else { return 1 } } -cleanup { .graph1 marker delete Marker1 destroy .graph1 } -result {0} #=============================================================================== # This part contains the automatic tests that test the marker create # function of the graph BLT component. # ------------------------------------------------------------------------------ # Purpose: Ensure creating a marker actually creates the marker on the graph # ------------------------------------------------------------------------------ test graph.marker.create-1.1 { Create Marker } -setup { ::graph .graph1 } -body { .graph1 marker create text -name marker1 .graph1 marker exists marker1 } -cleanup { .graph1 marker delete marker1 destroy .graph1 } -result {1} #=============================================================================== # This part contains the automatic tests that test the marker delete # function of the graph BLT component. # ------------------------------------------------------------------------------ # Purpose: Ensure the marker delete command works correctly when given a single # existing marker name # ------------------------------------------------------------------------------ test graph.marker.delete-1.1 { Deletes a single marker } -setup { ::graph .graph1 .graph1 marker create text -name marker1 } -body { .graph1 marker delete marker1 .graph1 marker exists marker1 } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker delete command works correctly when given multiple # existing marker name # ------------------------------------------------------------------------------ test graph.marker.delete-1.2 { Deletes multiple markers } -setup { ::graph .graph1 .graph1 marker create text -name marker1 .graph1 marker create bitmap -name marker2 } -body { .graph1 marker delete marker1 marker2 expr {[.graph1 marker exists marker1] && [.graph1 marker exists marker1]} } -cleanup { destroy .graph1 } -result {0} #=============================================================================== # This part contains the automatic tests that test the marker exists # function of the graph BLT component. # ------------------------------------------------------------------------------ # Purpose: Ensure that a marker that doesn't exist is recognized by exists # ------------------------------------------------------------------------------ test graph.marker.exists-1.1 { Test exists on non-existant marker } -setup { ::graph .graph1 } -body { .graph1 marker exists marker1 } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure that a marker that an existing marker is recognized by exists # ------------------------------------------------------------------------------ test graph.marker.exists-1.2 { Test exists on existing marker } -setup { ::graph .graph1 .graph1 marker create text -name marker1 } -body { .graph1 marker exists marker1 } -cleanup { .graph1 marker delete marker1 destroy .graph1 } -result {1} #=============================================================================== # This part contains the automatic tests that test the marker names # function of the graph BLT component. # ------------------------------------------------------------------------------ # Purpose: Ensure the marker names command works correctly when no pattern is given. # ------------------------------------------------------------------------------ test graph.marker.names-1.1 { Marker Names: No Pattern } -setup { ::graph .graph1 .graph1 marker create text -name marker1 .graph1 marker create polygon -name marker2 } -body { .graph1 marker names } -cleanup { .graph1 marker delete marker1 marker2 destroy .graph1 } -result {marker1 marker2} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker names command works correctly when an exact pattern is # given. # ------------------------------------------------------------------------------ test graph.marker.names-1.2 { Marker Names: Exact Pattern } -setup { ::graph .graph1 .graph1 marker create text -name marker1 .graph1 marker create polygon -name marker2 } -body { .graph1 marker names marker1 } -cleanup { .graph1 marker delete marker1 marker2 destroy .graph1 } -result {marker1} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker names command works correctly when a wildcard pattern is # given. # ------------------------------------------------------------------------------ test graph.marker.names-1.3 { Marker Names: Wildcard Pattern } -setup { ::graph .graph1 .graph1 marker create text -name marker1 .graph1 marker create polygon -name marker2 } -body { .graph1 marker names marker* } -cleanup { .graph1 marker delete marker1 marker2 destroy .graph1 } -result {marker1 marker2} # ------------------------------------------------------------------------------ # Purpose: Ensure the marker names command works correctly when an incorrect pattern # is given # ------------------------------------------------------------------------------ test graph.marker.names-1.4 { Marker Names: Incorrect Pattern } -setup { ::graph .graph1 .graph1 marker create text -name marker1 .graph1 marker create polygon -name marker2 } -body { .graph1 marker names marker } -cleanup { .graph1 marker delete marker1 marker2 destroy .graph1 } -result {} #=============================================================================== # This part contains the automatic tests that test the marker type # function of the graph BLT component. # ------------------------------------------------------------------------------ # Purpose: Ensure a text marker is of the correct type (TextMarker). # ------------------------------------------------------------------------------ test graph.marker.type-1.1 { Type of a Text Marker } -setup { ::graph .graph1 .graph1 marker create text -name marker1 } -body { .graph1 marker type marker1 } -cleanup { .graph1 marker delete destroy .graph1 } -result {TextMarker} # ------------------------------------------------------------------------------ # Purpose: Ensure a line marker is of the correct type (LineMarker). # ------------------------------------------------------------------------------ test graph.marker.type-1.2 { Type of a line marker } -setup { ::graph .graph1 .graph1 marker create line -name marker1 } -body { .graph1 marker type marker1 } -cleanup { .graph1 marker delete destroy .graph1 } -result {LineMarker} # ------------------------------------------------------------------------------ # Purpose: Ensure a bitmap marker is of the correct type (BitmapMarker). # ------------------------------------------------------------------------------ test graph.marker.type-1.3 { Type of a bitmap marker } -setup { ::graph .graph1 .graph1 marker create bitmap -name marker1 } -body { .graph1 marker type marker1 } -cleanup { .graph1 marker delete destroy .graph1 } -result {BitmapMarker} # ------------------------------------------------------------------------------ # Purpose: Ensure a image marker is of the correct type (ImageMarker). # ------------------------------------------------------------------------------ test graph.marker.type-1.4 { Type of a image marker } -setup { ::graph .graph1 .graph1 marker create image -name marker1 } -body { .graph1 marker type marker1 } -cleanup { .graph1 marker delete destroy .graph1 } -result {ImageMarker} # ------------------------------------------------------------------------------ # Purpose: Ensure a polygon marker is of the correct type (PolygonMarker). # ------------------------------------------------------------------------------ test graph.marker.type-1.5 { Type of a polygon marker } -setup { ::graph .graph1 .graph1 marker create polygon -name marker1 } -body { .graph1 marker type marker1 } -cleanup { .graph1 marker delete destroy .graph1 } -result {PolygonMarker} # ------------------------------------------------------------------------------ # Purpose: Ensure a window marker is of the correct type (WindowMarker). # ------------------------------------------------------------------------------ test graph.marker.type-1.6 { Type of a window marker } -setup { ::graph .graph1 .graph1 marker create window -name marker1 } -body { .graph1 marker type marker1 } -cleanup { .graph1 marker delete destroy .graph1 } -result {WindowMarker} #=============================================================================== # This part contains the automatic tests that test the pen cget # function of the graph BLT component. # ------------------------------------------------------------------------------ # Purpose: Ensure that cget works with an explicitly set option # ------------------------------------------------------------------------------ test graph.pen.cget-1.1 { Test pen cget configure } -setup { ::graph .graph1 pack .graph1 .graph1 pen create Pen1 -color blue } -body { .graph1 pen cget Pen1 -color } -cleanup { destroy .graph1 } -result {blue} # ------------------------------------------------------------------------------ # Purpose: Ensure that cget works with a default value # ------------------------------------------------------------------------------ test graph.pen.cget-1.2 { Test pen cget default } -setup { ::graph .graph1 pack .graph1 .graph1 pen create Pen1 } -body { .graph1 pen cget Pen1 -type } -cleanup { destroy .graph1 } -result {line} # ------------------------------------------------------------------------------ # Purpose: Ensure that cget works with an invalid value # ------------------------------------------------------------------------------ test graph.pen.cget-1.3 { Test pen cget invalid value } -setup { ::graph .graph1 pack .graph1 .graph1 pen create Pen1 } -body { if {[catch {.graph1 pen cget Pen1 -invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} #=============================================================================== # This part tests the configuration of pen component of a BLT graph component. # ------------------------------------------------------------------------------ # Purpose: Ensure the pen configure -color command works correctly when given a valid # color name. # ------------------------------------------------------------------------------ test graph.pen.configure-1.1 { ::graph pen: configure - color - valid color name } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 pen configure "activeLine" -color black .graph1 pen cget "activeLine" -color } -cleanup { destroy .graph1 } -result {black} # ------------------------------------------------------------------------------ # Purpose: Ensure the pen configure -color command works correctly when given an # invalid color name. # ------------------------------------------------------------------------------ test graph.pen.configure-1.2 { ::graph pen: configure - color - invalid color name } -setup { ::graph .graph1 } -body { if {[catch {.graph1 pen configure "activeLine" -color invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the pen configure -dashes command works correctly when given a # valid dash list. # ------------------------------------------------------------------------------ test graph.pen.configure-2.1 { ::graph pen: configure - dashes - valid dash list } -setup { ::graph .graph1 } -body { .graph1 pen configure "activeLine" -dashes {2 3 2 4} .graph1 pen cget "activeLine" -dashes } -cleanup { destroy .graph1 } -result {2 3 2 4} # ------------------------------------------------------------------------------ # Purpose: Ensure the pen configure -dashes command works correctly when given an # empty dash list. # ------------------------------------------------------------------------------ test graph.pen.configure-2.2 { ::graph pen: configure - dashes - empty dash list } -setup { ::graph .graph1 } -body { .graph1 pen configure "activeLine" -dashes "" .graph1 pen cget "activeLine" -dashes } -cleanup { destroy .graph1 } -result {} # ------------------------------------------------------------------------------ # Purpose: Ensure the pen configure -dashes command works correctly when given a dash # list that is too long. # ------------------------------------------------------------------------------ test graph.pen.configure-2.3 { ::graph pen: configure - dashes - long dash list } -setup { ::graph .graph1 } -body { if {[catch {.graph1 pen configure "activeLine" -dashes {2 3 2 4 2 3 2 4 2 3 2 4}}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the pen configure -dashes command works correctly when given an # invalid numerical dash list. # ------------------------------------------------------------------------------ test graph.pen.configure-2.4 { ::graph pen: configure - dashes - invalid numerical dash list } -setup { ::graph .graph1 } -body { if {[catch {.graph1 pen configure "activeLine" -dashes {2 3 2 -1 2}}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the pen configure -dashes command works correctly when given a dash # list with characters. # ------------------------------------------------------------------------------ test graph.pen.configure-2.5 { ::graph pen: configure - dashes - dash list with characters } -setup { ::graph .graph1 } -body { if {[catch {.graph1 pen configure "activeLine" -dashes {2 3 2 a 2}}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure that the fill configuration works for valid fill colors # ------------------------------------------------------------------------------ test graph.pen.configure-3.1 { Test pen configure fill } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 pen configure "activeLine" -fill black .graph1 pen cget "activeLine" -fill } -cleanup { destroy .graph1 } -result {black} # ------------------------------------------------------------------------------ # Purpose: Ensure that the fill configuration works for no fill # ------------------------------------------------------------------------------ test graph.pen.configure-3.2 { Test pen configure no fill } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 pen configure "activeLine" -fill "" .graph1 pen cget "activeLine" -fill } -cleanup { destroy .graph1 } -result {} # ------------------------------------------------------------------------------ # Purpose: Ensure that the fill configuration works for no fill # ------------------------------------------------------------------------------ test graph.pen.configure-3.3 { Test pen configure invalid color } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 pen configure "activeLine" -fill invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the pen configure -linewidth command works correctly when given a # valid integer pixel value. # ------------------------------------------------------------------------------ test graph.pen.configure-4.1 { ::graph pen: configure - linewidth - valid integer input } -setup { ::graph .graph1 } -body { .graph1 pen configure "activeLine" -linewidth 2 .graph1 pen cget "activeLine" -linewidth } -cleanup { destroy .graph1 } -result {2} # ------------------------------------------------------------------------------ # Purpose: Ensure the pen configure -linewidth command works correctly when given an # invalid integer pixel value. # ------------------------------------------------------------------------------ test graph.pen.configure-4.2 { ::graph pen: configure - linewidth - invalid integer input } -setup { ::graph .graph1 } -body { if {[catch {.graph1 pen configure "activeLine" -linewidth -2}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the pen configure -linewidth command works correctly when given a # decimal pixel value. # ------------------------------------------------------------------------------ test graph.pen.configure-4.3 { ::graph pen: configure - linewidth - decimal input } -setup { ::graph .graph1 } -body { .graph1 pen configure "activeLine" -linewidth 3.5 .graph1 pen cget "activeLine" -linewidth } -cleanup { destroy .graph1 } -result {4} # ------------------------------------------------------------------------------ # Purpose: Ensure the pen configure -linewidth command works correctly when given an # invalid decimal pixel value. # ------------------------------------------------------------------------------ test graph.pen.configure-4.4 { ::graph pen: configure - linewidth - invalid decimal input } -setup { ::graph .graph1 } -body { if {[catch {.graph1 pen configure "activeLine" -linewidth -2.5}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the pen configure -linewidth command works correctly when given a # character value. # ------------------------------------------------------------------------------ test graph.pen.configure-4.5 { ::graph pen: configure - linewidth - character input } -setup { ::graph .graph1 } -body { if {[catch {.graph1 pen configure "activeLine" -linewidth invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the pen configure -linewidth command works correctly when given 0 as # input. # ------------------------------------------------------------------------------ test graph.pen.configure-4.6 { ::graph pen: configure - linewidth - zero } -setup { ::graph .graph1 } -body { .graph1 pen configure "activeLine" -linewidth 0 .graph1 pen cget "activeLine" -linewidth } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure that the offdash configuration works for valid offdash colors # ------------------------------------------------------------------------------ test graph.pen.configure-5.1 { Test pen configure offdash - valid color } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 pen configure "activeLine" -offdash black .graph1 pen cget "activeLine" -offdash } -cleanup { destroy .graph1 } -result {black} # ------------------------------------------------------------------------------ # Purpose: Ensure that the offdash configuration works for invalid color names # ------------------------------------------------------------------------------ test graph.pen.configure-5.2 { Test pen configure offdash - invalid color } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 pen configure "activeLine" -offdash invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure that the outline configuration works for valid outline colors # ------------------------------------------------------------------------------ test graph.pen.configure-6.1 { Test pen configure outline - valid color } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 pen configure "activeLine" -outline black .graph1 pen cget "activeLine" -outline } -cleanup { destroy .graph1 } -result {black} # ------------------------------------------------------------------------------ # Purpose: Ensure that the outline configuration works for invalid color names # ------------------------------------------------------------------------------ test graph.pen.configure-6.2 { Test pen configure outline - invalid color } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 pen configure "activeLine" -outline invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure that the outline configuration works for defcolor (the same color # as the color configuration option) # ------------------------------------------------------------------------------ test graph.pen.configure-6.3 { Test pen configure default outline } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 pen configure "activeLine" -outline defcolor .graph1 pen cget "activeLine" -outline } -cleanup { destroy .graph1 } -result {defcolor} # ------------------------------------------------------------------------------ # Purpose: Ensure the pen configure -outlinewidth command works correctly when given # an integer pixel value. # ------------------------------------------------------------------------------ test graph.pen.configure-7.1 { ::graph pen: configure - outlinewidth - valid integer input } -setup { ::graph .graph1 } -body { .graph1 pen configure "activeLine" -outlinewidth 2 .graph1 pen cget "activeLine" -outlinewidth } -cleanup { destroy .graph1 } -result {2} # ------------------------------------------------------------------------------ # Purpose: Ensure the pen configure -outlinewidth command works correctly when given # an invalid integer pixel value. # ------------------------------------------------------------------------------ test graph.pen.configure-7.2 { ::graph pen: configure - outlinewidth - invalid integer input } -setup { ::graph .graph1 } -body { if {[catch {.graph1 pen configure "activeLine" -outlinewidth -1}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the pen configure -outlinewidth command works correctly when given a # decimal pixel value. # ------------------------------------------------------------------------------ test graph.pen.configure-7.3 { ::graph pen: configure - outlinewidth - valid decimal input } -setup { ::graph .graph1 } -body { .graph1 pen configure "activeLine" -outlinewidth 3.5 .graph1 pen cget "activeLine" -outlinewidth } -cleanup { destroy .graph1 } -result {4} # ------------------------------------------------------------------------------ # Purpose: Ensure the pen configure -outlinewidth command works correctly when given # an invalid decimal pixel value. # ------------------------------------------------------------------------------ test graph.pen.configure-7.4 { ::graph pen: configure - outlinewidth - invalid decimal input } -setup { ::graph .graph1 } -body { if {[catch {.graph1 pen configure "activeLine" -outlinewidth -1.5}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the pen configure -outlinewidth command works correctly when given a # character as input. # ------------------------------------------------------------------------------ test graph.pen.configure-7.5 { ::graph pen: configure - outlinewidth - character input } -setup { ::graph .graph1 } -body { if {[catch {.graph1 pen configure "activeLine" -outlinewidth a}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the pen configure -pixels command works correctly when given an # integer pixel value. # ------------------------------------------------------------------------------ test graph.pen.configure-8.1 { ::graph pen: configure - pixels - valid integer input } -setup { ::graph .graph1 } -body { .graph1 pen configure "activeLine" -pixels 2 .graph1 pen cget "activeLine" -pixels } -cleanup { destroy .graph1 } -result {2} # ------------------------------------------------------------------------------ # Purpose: Ensure the pen configure -pixels command works correctly when given an # invalid integer pixel value. # ------------------------------------------------------------------------------ test graph.pen.configure-8.2 { ::graph pen: configure - pixels - invalid integer input } -setup { ::graph .graph1 } -body { if {[catch {.graph1 pen configure "activeLine" -pixels -1}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the pen configure -pixels command works correctly when given a # decimal pixel value. # ------------------------------------------------------------------------------ test graph.pen.configure-8.3 { ::graph pen: configure - pixels - valid decimal input } -setup { ::graph .graph1 } -body { .graph1 pen configure "activeLine" -pixels 3.5 .graph1 pen cget "activeLine" -pixels } -cleanup { destroy .graph1 } -result {4} # ------------------------------------------------------------------------------ # Purpose: Ensure the pen configure -pixels command works correctly when given an # invalid decimal pixel value. # ------------------------------------------------------------------------------ test graph.pen.configure-8.4 { ::graph pen: configure - pixels - invalid decimal input } -setup { ::graph .graph1 } -body { if {[catch {.graph1 pen configure "activeLine" -pixels -1.5}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the pen configure -pixels command works correctly when given a # character as input. # ------------------------------------------------------------------------------ test graph.pen.configure-8.5 { ::graph pen: configure - pixels - character input } -setup { ::graph .graph1 } -body { if {[catch {.graph1 pen configure "activeLine" -pixels a}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure that the pixels configuration works for symbol size zero # ------------------------------------------------------------------------------ test graph.pen.configure-8.6 { ::graph pen: configure - no pixels } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 pen configure "activeLine" -pixels 0 .graph1 pen cget "activeLine" -pixels } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure that the symbol configuration works for square # ------------------------------------------------------------------------------ test graph.pen.configure-9.1 { Test pen configure symbol square } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 pen configure "activeLine" -symbol square .graph1 pen cget "activeLine" -symbol } -cleanup { destroy .graph1 } -result {square} # ------------------------------------------------------------------------------ # Purpose: Ensure that the symbol configuration works for circle # ------------------------------------------------------------------------------ test graph.pen.configure-9.2 { Test pen configure symbol circle } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 pen configure "activeLine" -symbol circle .graph1 pen cget "activeLine" -symbol } -cleanup { destroy .graph1 } -result {circle} # ------------------------------------------------------------------------------ # Purpose: Ensure that the symbol configuration works for diamond # ------------------------------------------------------------------------------ test graph.pen.configure-9.3 { Test pen configure symbol diamond } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 pen configure "activeLine" -symbol diamond .graph1 pen cget "activeLine" -symbol } -cleanup { destroy .graph1 } -result {diamond} # ------------------------------------------------------------------------------ # Purpose: Ensure that the symbol configuration works for plus # ------------------------------------------------------------------------------ test graph.pen.configure-9.4 { Test pen configure symbol plus } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 pen configure "activeLine" -symbol plus .graph1 pen cget "activeLine" -symbol } -cleanup { destroy .graph1 } -result {plus} # ------------------------------------------------------------------------------ # Purpose: Ensure that the symbol configuration works for cross # ------------------------------------------------------------------------------ test graph.pen.configure-9.5 { Test pen configure symbol cross } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 pen configure "activeLine" -symbol cross .graph1 pen cget "activeLine" -symbol } -cleanup { destroy .graph1 } -result {cross} # ------------------------------------------------------------------------------ # Purpose: Ensure that the symbol configuration works for splus # ------------------------------------------------------------------------------ test graph.pen.configure-9.6 { Test pen configure symbol splus } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 pen configure "activeLine" -symbol splus .graph1 pen cget "activeLine" -symbol } -cleanup { destroy .graph1 } -result {splus} # ------------------------------------------------------------------------------ # Purpose: Ensure that the symbol configuration works for scross # ------------------------------------------------------------------------------ test graph.pen.configure-9.7 { Test pen configure symbol scross } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 pen configure "activeLine" -symbol scross .graph1 pen cget "activeLine" -symbol } -cleanup { destroy .graph1 } -result {scross} # ------------------------------------------------------------------------------ # Purpose: Ensure that the symbol configuration works for triangle # ------------------------------------------------------------------------------ test graph.pen.configure-9.8 { Test pen configure symbol triangle } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 pen configure "activeLine" -symbol triangle .graph1 pen cget "activeLine" -symbol } -cleanup { destroy .graph1 } -result {triangle} # ------------------------------------------------------------------------------ # Purpose: Ensure that the symbol configuration works for no symbol # ------------------------------------------------------------------------------ test graph.pen.configure-9.9 { Test pen configure symbol none } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 pen configure "activeLine" -symbol none .graph1 pen cget "activeLine" -symbol } -cleanup { destroy .graph1 } -result {none} # ------------------------------------------------------------------------------ # Purpose: Ensure that the symbol configuration works for bitmap symbols # ------------------------------------------------------------------------------ test graph.pen.configure-9.10 { Test pen configure symbol bitmap } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 pen configure "activeLine" -symbol warning .graph1 pen cget "activeLine" -symbol } -cleanup { destroy .graph1 } -result {warning {}} # ------------------------------------------------------------------------------ # Purpose: Ensure that the symbol configuration works for invalid input # ------------------------------------------------------------------------------ test graph.pen.configure-9.11 { ::graph pen: configure - invalid input } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 pen configure "activeLine" -symbol invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure that the default type of a pen is set # ------------------------------------------------------------------------------ test graph.pen.configure-10.1 { Test pen configure default type } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 pen create Pen1 .graph1 pen cget Pen1 -type } -cleanup { destroy .graph1 } -result {line} # ------------------------------------------------------------------------------ # Purpose: Ensure that the type configuration works with valid input # ------------------------------------------------------------------------------ test graph.pen.configure-10.2 { Test pen configure type } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 pen create Pen1 -type foobar .graph1 pen cget Pen1 -type } -cleanup { destroy .graph1 } -result {foobar} # ------------------------------------------------------------------------------ # Purpose: Ensure that the errorbarcolor configuration works for valid errorbarcolor colors # ------------------------------------------------------------------------------ test graph.pen.configure-11.1 { Test pen configure errorbarcolor } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 pen configure "activeLine" -errorbarcolor black .graph1 pen cget "activeLine" -errorbarcolor } -cleanup { destroy .graph1 } -result {black} # ------------------------------------------------------------------------------ # Purpose: Ensure that the errorbarcolor configuration works for no errorbarcolor # ------------------------------------------------------------------------------ test graph.pen.configure-11.2 { Test pen configure invalid color } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 pen configure "activeLine" -errorbarcolor invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the pen configure -errorbarwidth command works correctly when given # an integer pixel value. # ------------------------------------------------------------------------------ test graph.pen.configure-12.1 { ::graph pen: configure - errorbarwidth - valid integer input } -setup { ::graph .graph1 } -body { .graph1 pen configure "activeLine" -errorbarwidth 2 .graph1 pen cget "activeLine" -errorbarwidth } -cleanup { destroy .graph1 } -result {2} # ------------------------------------------------------------------------------ # Purpose: Ensure the pen configure -errorbarwidth command works correctly when given # an invalid integer pixel value. # ------------------------------------------------------------------------------ test graph.pen.configure-12.2 { ::graph pen: configure - errorbarwidth - invalid integer input } -setup { ::graph .graph1 } -body { if {[catch {.graph1 pen configure "activeLine" -errorbarwidth -1}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the pen configure -errorbarwidth command works correctly when given # a decimal pixel value. # ------------------------------------------------------------------------------ test graph.pen.configure-12.3 { ::graph pen: configure - errorbarwidth - valid decimal input } -setup { ::graph .graph1 } -body { .graph1 pen configure "activeLine" -errorbarwidth 3.5 .graph1 pen cget "activeLine" -errorbarwidth } -cleanup { destroy .graph1 } -result {4} # ------------------------------------------------------------------------------ # Purpose: Ensure the pen configure -errorbarwidth command works correctly when given # an invalid decimal pixel value. # ------------------------------------------------------------------------------ test graph.pen.configure-12.4 { ::graph pen: configure - errorbarwidth - invalid decimal input } -setup { ::graph .graph1 } -body { if {[catch {.graph1 pen configure "activeLine" -errorbarwidth -1.5}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the pen configure -errorbarwidth command works correctly when given # a character as input. # ------------------------------------------------------------------------------ test graph.pen.configure-12.5 { ::graph pen: configure - errorbarwidth - character input } -setup { ::graph .graph1 } -body { if {[catch {.graph1 pen configure "activeLine" -errorbarwidth a}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure that the errorbarwidth configuration works for symbol size zero # ------------------------------------------------------------------------------ test graph.pen.configure-12.6 { ::graph pen: configure - no errorbarwidth } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 pen configure "activeLine" -errorbarwidth 0 .graph1 pen cget "activeLine" -errorbarwidth } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the pen configure -showvalues command works correctly when given # x. # ------------------------------------------------------------------------------ test graph.pen.configure-13.1 { ::graph pen configure: showvalues - x } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 pen configure "activeLine" -showvalues x .graph1 pen cget "activeLine" -showvalues } -cleanup { destroy .graph1 } -result {x} # ------------------------------------------------------------------------------ # Purpose: Ensure the pen configure -showvalues command works correctly when given # y. # ------------------------------------------------------------------------------ test graph.pen.configure-13.2 { ::graph pen configure: showvalues - y } -setup { ::graph .graph1 } -body { .graph1 pen configure "activeLine" -showvalues y .graph1 pen cget "activeLine" -showvalues } -cleanup { destroy .graph1 } -result {y} # ------------------------------------------------------------------------------ # Purpose: Ensure the pen configure -showvalues command works correctly when given # both. # ------------------------------------------------------------------------------ test graph.pen.configure-13.3 { ::graph pen configure: showvalues - both } -setup { ::graph .graph1 } -body { .graph1 pen configure "activeLine" -showvalues both .graph1 pen cget "activeLine" -showvalues } -cleanup { destroy .graph1 } -result {both} # ------------------------------------------------------------------------------ # Purpose: Ensure the pen configure -showvalues command works correctly when given # none. # ------------------------------------------------------------------------------ test graph.pen.configure-13.4 { ::graph pen configure: showvalues - none } -setup { ::graph .graph1 } -body { .graph1 pen configure "activeLine" -showvalues none .graph1 pen cget "activeLine" -showvalues } -cleanup { destroy .graph1 } -result {none} # ------------------------------------------------------------------------------ # Purpose: Ensure the pen configure -showvalues command works correctly when given # no. # ------------------------------------------------------------------------------ test graph.pen.configure-13.5 { ::graph pen configure: showvalues - no } -setup { ::graph .graph1 } -body { .graph1 pen configure "activeLine" -showvalues no .graph1 pen cget "activeLine" -showvalues } -cleanup { destroy .graph1 } -result {none} # ------------------------------------------------------------------------------ # Purpose: Ensure the pen configure -valueanchor command works correctly when # given 'n' as input. # ------------------------------------------------------------------------------ test graph.pen.configure-14.1 { ::graph pen configure: valueanchor - n } -setup { ::graph .graph1 .graph1 pen create pen1 } -body { .graph1 pen configure pen1 -valueanchor n .graph1 pen cget pen1 -valueanchor } -cleanup { .graph1 pen delete pen1 destroy .graph1 } -result {n} # ------------------------------------------------------------------------------ # Purpose: Ensure the pen configure -valueanchor command works correctly when # given 'ne' as input. # ------------------------------------------------------------------------------ test graph.pen.configure-14.2 { ::graph pen configure: valueanchor - ne } -setup { ::graph .graph1 .graph1 pen create pen1 } -body { .graph1 pen configure pen1 -valueanchor ne .graph1 pen cget pen1 -valueanchor } -cleanup { .graph1 pen delete pen1 destroy .graph1 } -result {ne} # ------------------------------------------------------------------------------ # Purpose: Ensure the pen configure -valueanchor command works correctly when # given 'e' as input. # ------------------------------------------------------------------------------ test graph.pen.configure-14.3 { ::graph pen configure: valueanchor - e } -setup { ::graph .graph1 .graph1 pen create pen1 } -body { .graph1 pen configure pen1 -valueanchor e .graph1 pen cget pen1 -valueanchor } -cleanup { .graph1 pen delete pen1 destroy .graph1 } -result {e} # ------------------------------------------------------------------------------ # Purpose: Ensure the pen configure -valueanchor command works correctly when # given 'se' as input. # ------------------------------------------------------------------------------ test graph.pen.configure-14.4 { ::graph pen configure: valueanchor - se } -setup { ::graph .graph1 .graph1 pen create pen1 } -body { .graph1 pen configure pen1 -valueanchor se .graph1 pen cget pen1 -valueanchor } -cleanup { .graph1 pen delete pen1 destroy .graph1 } -result {se} # ------------------------------------------------------------------------------ # Purpose: Ensure the pen configure -valueanchor command works correctly when # given 'ne' as input. # ------------------------------------------------------------------------------ test graph.pen.configure-14.5 { ::graph pen configure: valueanchor - s } -setup { ::graph .graph1 .graph1 pen create pen1 } -body { .graph1 pen configure pen1 -valueanchor s .graph1 pen cget pen1 -valueanchor } -cleanup { .graph1 pen delete pen1 destroy .graph1 } -result {s} # ------------------------------------------------------------------------------ # Purpose: Ensure the pen configure -valueanchor command works correctly when # given 'sw' as input. # ------------------------------------------------------------------------------ test graph.pen.configure-14.6 { ::graph pen configure: valueanchor - sw } -setup { ::graph .graph1 .graph1 pen create pen1 } -body { .graph1 pen configure pen1 -valueanchor sw .graph1 pen cget pen1 -valueanchor } -cleanup { .graph1 pen delete pen1 destroy .graph1 } -result {sw} # ------------------------------------------------------------------------------ # Purpose: Ensure the pen configure -valueanchor command works correctly when # given 'w' as input. # ------------------------------------------------------------------------------ test graph.pen.configure-14.7 { ::graph pen configure: valueanchor - w } -setup { ::graph .graph1 .graph1 pen create pen1 } -body { .graph1 pen configure pen1 -valueanchor w .graph1 pen cget pen1 -valueanchor } -cleanup { .graph1 pen delete pen1 destroy .graph1 } -result {w} # ------------------------------------------------------------------------------ # Purpose: Ensure the pen configure -valueanchor command works correctly when # given 'nw' as input. # ------------------------------------------------------------------------------ test graph.pen.configure-14.8 { ::graph pen configure: valueanchor - nw } -setup { ::graph .graph1 .graph1 pen create pen1 } -body { .graph1 pen configure pen1 -valueanchor nw .graph1 pen cget pen1 -valueanchor } -cleanup { .graph1 pen delete pen1 destroy .graph1 } -result {nw} # ------------------------------------------------------------------------------ # Purpose: Ensure the pen configure -valueanchor command works correctly when # given 'center' as input. # ------------------------------------------------------------------------------ test graph.pen.configure-14.9 { ::graph pen configure: valueanchor - center } -setup { ::graph .graph1 .graph1 pen create pen1 } -body { .graph1 pen configure pen1 -valueanchor center .graph1 pen cget pen1 -valueanchor } -cleanup { .graph1 pen delete pen1 destroy .graph1 } -result {center} # ------------------------------------------------------------------------------ # Purpose: Ensure the pen configure -valueanchor command works correctly when # given invalid numerical input. # ------------------------------------------------------------------------------ test graph.pen.configure-14.10 { ::graph pen configure: valueanchor - invalid numerical input } -setup { ::graph .graph1 .graph1 pen create pen1 } -body { if {[catch {.graph1 pen configure pen1 -valueanchor 3.5}]} { return 0 } else { return 1 } } -cleanup { .graph1 pen delete pen1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the pen configure -valueanchor command works correctly when # given invalid character input. # ------------------------------------------------------------------------------ test graph.pen.configure-14.11 { ::graph pen configure: valueanchor - invalid character input } -setup { ::graph .graph1 .graph1 pen create pen1 } -body { if {[catch {.graph1 pen configure pen1 -valueanchor invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 pen delete pen1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the pen configure -valuecolor command works correctly when given # a valid color name. # ------------------------------------------------------------------------------ test graph.pen.configure-15.1 { ::graph pen configure: valuecolor - valid color name } -setup { ::graph .graph1 .graph1 pen create pen1 } -body { .graph1 pen configure pen1 -valuecolor black .graph1 pen cget pen1 -valuecolor } -cleanup { .graph1 pen delete pen1 destroy .graph1 } -result {black} # ------------------------------------------------------------------------------ # Purpose: Ensure the pen configure -valuecolor command works correctly when given # an invalid color name. # ------------------------------------------------------------------------------ test graph.pen.configure-15.2 { ::graph pen configure: valuecolor - invalid color name } -setup { ::graph .graph1 .graph1 pen create pen1 } -body { if {[catch {.graph1 pen configure pen1 -valuecolor invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 pen delete pen1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the pen configure -valuerotate command works correctly when # given an integer angle. # ------------------------------------------------------------------------------ test graph.pen.configure-16.1 { ::graph pen configure: valuerotate - integer input } -setup { ::graph .graph1 .graph1 pen create pen1 } -body { .graph1 pen configure pen1 -valuerotate 90 .graph1 pen cget pen1 -valuerotate } -cleanup { .graph1 pen delete pen1 destroy .graph1 } -result {90.0} # ------------------------------------------------------------------------------ # Purpose: Ensure the pen configure -valuerotate command works correctly when # given a decimal angle. # ------------------------------------------------------------------------------ test graph.pen.configure-16.2 { ::graph pen configure: valuerotate - decimal input } -setup { ::graph .graph1 .graph1 pen create pen1 } -body { .graph1 pen configure pen1 -valuerotate 45.5 .graph1 pen cget pen1 -valuerotate } -cleanup { .graph1 pen delete pen1 destroy .graph1 } -result {45.5} # ------------------------------------------------------------------------------ # Purpose: Ensure the pen configure -valuerotate command works correctly when # given a negative integer angle. # ------------------------------------------------------------------------------ test graph.pen.configure-16.3 { ::graph pen configure: valuerotate - negative integer input } -setup { ::graph .graph1 .graph1 pen create pen1 } -body { .graph1 pen configure pen1 -valuerotate -90 .graph1 pen cget pen1 -valuerotate } -cleanup { .graph1 pen delete pen1 destroy .graph1 } -result {-90.0} # ------------------------------------------------------------------------------ # Purpose: Ensure the pen configure -valuerotate command works correctly when # given a negative decimal angle. # ------------------------------------------------------------------------------ test graph.pen.configure-16.4 { ::graph pen configure: valuerotate - negative decimal input } -setup { ::graph .graph1 .graph1 pen create pen1 } -body { .graph1 pen configure pen1 -valuerotate -45.5 .graph1 pen cget pen1 -valuerotate } -cleanup { .graph1 pen delete pen1 destroy .graph1 } -result {-45.5} # ------------------------------------------------------------------------------ # Purpose: Ensure the pen configure -valuerotate command works correctly when # given a character as input. # ------------------------------------------------------------------------------ test graph.pen.configure-16.5 { ::graph pen configure: valuerotate - character input } -setup { ::graph .graph1 .graph1 pen create pen1 } -body { if {[catch {.graph1 pen configure pen1 -valuerotate invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 pen delete pen1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the pen configure -valueshadow command works correctly when # given a valid color name. # ------------------------------------------------------------------------------ test graph.pen.configure-17.1 { ::graph pen configure: valueshadow - valid color name } -setup { ::graph .graph1 .graph1 pen create pen1 } -body { .graph1 pen configure pen1 -valueshadow black .graph1 pen cget pen1 -valueshadow } -cleanup { .graph1 pen delete pen1 destroy .graph1 } -result {black 1} # ------------------------------------------------------------------------------ # Purpose: Ensure the pen configure -valueshadow command works correctly when # given an invalid color name. # ------------------------------------------------------------------------------ test graph.pen.configure-17.2 { ::graph pen configure: valueshadow - invalid color name } -setup { ::graph .graph1 .graph1 pen create pen1 } -body { if {[catch {.graph1 pen configure pen1 -valueshadow invalid}]} { return 0 } else { return 1 } } -cleanup { .graph1 pen delete pen1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the pen configure -valueshadow command works correctly when # given a valid color name and valid integer value. # ------------------------------------------------------------------------------ test graph.pen.configure-17.3 { ::graph pen configure: valueshadow - valid color name, valid integer } -setup { ::graph .graph1 .graph1 pen create pen1 } -body { .graph1 pen configure pen1 -valueshadow {black 2} .graph1 pen cget pen1 -valueshadow } -cleanup { .graph1 pen delete pen1 destroy .graph1 } -result {black 2} # ------------------------------------------------------------------------------ # Purpose: Ensure the pen configure -valueshadow command works correctly when # given an invalid color name and valid integer value. # ------------------------------------------------------------------------------ test graph.pen.configure-17.4 { ::graph pen configure: valueshadow - invalid color name, valid integer } -setup { ::graph .graph1 .graph1 pen create pen1 } -body { if {[catch {.graph1 pen configure pen1 -valueshadow {invalid 1}}]} { return 0 } else { return 1 } } -cleanup { .graph1 pen delete pen1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the pen configure -valueshadow command works correctly when # given a valid color name and invalid integer value. # ------------------------------------------------------------------------------ test graph.pen.configure-17.5 { ::graph pen configure: valueshadow - valid color name, invalid integer } -setup { ::graph .graph1 .graph1 pen create pen1 } -body { if {[catch {.graph1 pen configure pen1 -valueshadow {black -1}}]} { return 0 } else { return 1 } } -cleanup { .graph1 pen delete pen1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the pen configure -valueformat command works correctly when an # input value is given. # ------------------------------------------------------------------------------ test graph.pen.configure-18.1 { ::graph pen configure: valueformat - input } -setup { ::graph .graph1 .graph1 pen create pen1 } -body { .graph1 pen configure pen1 -valueformat formatstring .graph1 pen cget pen1 -valueformat } -cleanup { .graph1 pen delete pen1 destroy .graph1 } -result {formatstring} # ------------------------------------------------------------------------------ # Purpose: Ensure the pen configure -valuefont command works correctly when given # a string as input. # ------------------------------------------------------------------------------ test graph.pen.configure-19.1 { ::graph pen configure: valuefont - string } -setup { ::graph .graph1 .graph1 pen create pen1 } -body { .graph1 pen configure pen1 -valuefont Times .graph1 pen cget pen1 -valuefont } -cleanup { .graph1 pen delete pen1 destroy .graph1 } -result {Times} # ------------------------------------------------------------------------------ # Purpose: Ensure the pen configure -valuefont command works correctly when given # a list with a string as input. # ------------------------------------------------------------------------------ test graph.pen.configure-19.2 { ::graph pen configure: valuefont - list with string } -setup { ::graph .graph1 .graph1 pen create pen1 } -body { .graph1 pen configure pen1 -valuefont {Times} .graph1 pen cget pen1 -valuefont } -cleanup { .graph1 pen delete pen1 destroy .graph1 } -result {Times} # ------------------------------------------------------------------------------ # Purpose: Ensure the pen configure -valuefont command works correctly when given # a list with a string and positive integer as input. # ------------------------------------------------------------------------------ test graph.pen.configure-19.3 { ::graph pen configure: valuefont - list with string and positive integer } -setup { ::graph .graph1 .graph1 pen create pen1 } -body { .graph1 pen configure pen1 -valuefont {Times 10} .graph1 pen cget pen1 -valuefont } -cleanup { .graph1 pen delete pen1 destroy .graph1 } -result {Times 10} # ------------------------------------------------------------------------------ # Purpose: Ensure the pen configure -valuefont command works correctly when given # a list with a string and negative integer as input. # ------------------------------------------------------------------------------ test graph.pen.configure-19.4 { ::graph pen configure: valuefont - list with string and negative integer } -setup { ::graph .graph1 .graph1 pen create pen1 } -body { .graph1 pen configure pen1 -valuefont {Times -10} .graph1 pen cget pen1 -valuefont } -cleanup { .graph1 pen delete pen1 destroy .graph1 } -result {Times -10} # ------------------------------------------------------------------------------ # Purpose: Ensure the pen configure -valuefont command works correctly when given # a list with a string and decimal as input. # ------------------------------------------------------------------------------ test graph.pen.configure-19.5 { ::graph pen configure: valuefont - list with string and decimal } -setup { ::graph .graph1 .graph1 pen create pen1 } -body { if {[catch {.graph1 pen configure pen1 -valuefont {Times 10.5}}]} { return 0 } else { return 1 } } -cleanup { .graph1 pen delete pen1 destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the pen configure -valuefont command works correctly when given # a list with 2 strings as input. # ------------------------------------------------------------------------------ test graph.pen.configure-19.6 { ::graph pen configure: valuefont - list with 2 strings } -setup { ::graph .graph1 .graph1 pen create pen1 } -body { if {[catch {.graph1 pen configure pen1 -valuefont {Times Ten}}]} { return 0 } else { return 1 } } -cleanup { .graph1 pen delete pen1 destroy .graph1 } -result {0} #=============================================================================== # This part contains the automatic tests that test the pen create # function of the graph BLT component. # ------------------------------------------------------------------------------ # Purpose: Ensure that pen creation works when passed only a pen name # ------------------------------------------------------------------------------ test graph.pen.create-1.1 { Test pen creation with name only } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 pen create Pen1 .graph1 pen names Pen1 } -cleanup { destroy .graph1 } -result {Pen1} # ------------------------------------------------------------------------------ # Purpose: Ensure that pen creation will not overwrite an existing pen name # ------------------------------------------------------------------------------ test graph.pen.create-1.2 { Test pen creation non-overwriting } -setup { ::graph .graph1 pack .graph1 .graph1 pen create Pen1 } -body { if {[catch {.graph1 pen create Pen1}]} { return 0 } return 1 } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure that two default pens are created automatically when a graph is # created # ------------------------------------------------------------------------------ test graph.pen.create-1.3 { Test default pen creation } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 pen names } -cleanup { destroy .graph1 } -result {activeLine activeBar} # ------------------------------------------------------------------------------ # Purpose: Ensure that pen creation works when passed a single option-value pair # ------------------------------------------------------------------------------ test graph.pen.create-1.4 { Test pen creation with single option-value pair } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 pen create Pen1 -color blue .graph1 pen cget Pen1 -color } -cleanup { destroy .graph1 } -result {blue} # ------------------------------------------------------------------------------ # Purpose: Ensure that pen creation works when passed option-value pairs # ------------------------------------------------------------------------------ test graph.pen.create-1.5 { Test pen creation with option-value pairs } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 pen create Pen1 -color blue -type foo list [.graph1 pen cget Pen1 -color] [.graph1 pen cget Pen1 -type] } -cleanup { destroy .graph1 } -result {blue foo} #=============================================================================== # This part contains the automatic tests that test the pen delete # function of the graph BLT component. # ------------------------------------------------------------------------------ # Purpose: Ensure that pen deletion works when deleting a single pen # ------------------------------------------------------------------------------ test graph.pen.delete-1.1 { Test single pen deletion } -setup { ::graph .graph1 pack .graph1 .graph1 pen create Pen1 } -body { .graph1 pen delete Pen1 .graph1 pen names Pen1 } -cleanup { destroy .graph1 } -result {} # ------------------------------------------------------------------------------ # Purpose: Ensure that pen deletion works when deleting multiple pens # ------------------------------------------------------------------------------ test graph.pen.delete-1.2 { Test multiple pen deletion } -setup { ::graph .graph1 pack .graph1 .graph1 pen create Pen1 .graph1 pen create Pen2 } -body { .graph1 pen delete Pen1 Pen2 .graph1 pen names P* } -cleanup { destroy .graph1 } -result {} # ------------------------------------------------------------------------------ # Purpose: Ensure that pen deletion works when given a non-existent pen name # ------------------------------------------------------------------------------ test graph.pen.delete-1.3 { Test multiple pen deletion } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 pen delete Pen1}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} #=============================================================================== # This part contains the automatic tests that test the pen names # function of the graph BLT component. # ------------------------------------------------------------------------------ # Purpose: Ensure that names works with no given pattern # ------------------------------------------------------------------------------ test graph.pen.names-1.1 { Test pen names } -setup { ::graph .graph1 pack .graph1 .graph1 pen create Pen1 } -body { .graph1 pen names } -cleanup { destroy .graph1 # TODO: The results of this test are valid, regardless of the order, but exact matching # will cause this to fail if the results appear in any other order } -result {Pen1 activeLine activeBar} # ------------------------------------------------------------------------------ # Purpose: Ensure that names works with a pattern parameter # ------------------------------------------------------------------------------ test graph.pen.names-1.2 { Test pen names } -setup { ::graph .graph1 pack .graph1 .graph1 pen create Pen1 } -body { .graph1 pen names P* } -cleanup { destroy .graph1 } -result {Pen1} #=============================================================================== # This part contains the automatic tests that test the postscript cget # function of the graph BLT component. # ------------------------------------------------------------------------------ # Purpose: Ensure that cget works for default values # ------------------------------------------------------------------------------ test graph.postscript.cget-1.1 { Test postscript cget default } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 postscript cget -center } -cleanup { destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure that cget works with an explicitly set option # ------------------------------------------------------------------------------ test graph.postscript.cget-1.2 { Test postscript cget configured } -setup { ::graph .graph1 pack .graph1 .graph1 postscript configure -center 0 } -body { .graph1 postscript cget -center } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure that cget works with invalid input. # ------------------------------------------------------------------------------ test graph.postscript.cget-1.3 { Test postscript cget configured } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 postscript cget -invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} #=============================================================================== # This part contains the automatic tests that test the postscript configure # function of the graph BLT component. # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -center command works correctly when given # 1 as input. # ------------------------------------------------------------------------------ test graph.postscript.configure-1.1 { ::graph postscript configure: center - 1 } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 postscript configure -center 1 .graph1 postscript cget -center } -cleanup { destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -center command works correctly when given # 0 as input. # ------------------------------------------------------------------------------ test graph.postscript.configure-1.2 { ::graph postscript configure: center - 0 } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 postscript configure -center 0 .graph1 postscript cget -center } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -center command works correctly when given # 'true' as input. # ------------------------------------------------------------------------------ test graph.postscript.configure-1.3 { ::graph postscript configure: center - true } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 postscript configure -center true .graph1 postscript cget -center } -cleanup { destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -center command works correctly when given # 'false' as input. # ------------------------------------------------------------------------------ test graph.postscript.configure-1.4 { ::graph postscript configure: center - false } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 postscript configure -center false .graph1 postscript cget -center } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -center command works correctly when given # 'yes' as input. # ------------------------------------------------------------------------------ test graph.postscript.configure-1.5 { ::graph postscript configure: center - yes } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 postscript configure -center yes .graph1 postscript cget -center } -cleanup { destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -center command works correctly when given # 'no' as input. # ------------------------------------------------------------------------------ test graph.postscript.configure-1.6 { ::graph postscript configure: center - no } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 postscript configure -center no .graph1 postscript cget -center } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -center command works correctly when given # an invalid input value. # ------------------------------------------------------------------------------ test graph.postscript.configure-1.7 { ::graph postscript configure: center - invalid input } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 postscript configure -center invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure that the colormap configuration works for valid colormaps # FIXME: I have no idea how to do this. # ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------ # Purpose: Ensure that the colormode configuration works for color mode # ------------------------------------------------------------------------------ test graph.postscript.configure-3.1 { ::graph postscript configure: colormode - color } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 postscript configure -colormode color .graph1 postscript cget -colormode } -cleanup { destroy .graph1 } -result {color} # ------------------------------------------------------------------------------ # Purpose: Ensure that the colormode configuration works for gray mode # ------------------------------------------------------------------------------ test graph.postscript.configure-3.2 { ::graph postscript configure: colormode - gray } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 postscript configure -colormode gray .graph1 postscript cget -colormode } -cleanup { destroy .graph1 } -result {greyscale} # ------------------------------------------------------------------------------ # Purpose: Ensure that the colormode configuration works for greyscale mode # ------------------------------------------------------------------------------ test graph.postscript.configure-3.3 { ::graph postscript configure: colormode - greyscale } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 postscript configure -colormode greyscale .graph1 postscript cget -colormode } -cleanup { destroy .graph1 } -result {greyscale} # ------------------------------------------------------------------------------ # Purpose: Ensure that the colormode configuration works for mono mode # ------------------------------------------------------------------------------ test graph.postscript.configure-3.4 { ::graph postscript configure: colormode - mono } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 postscript configure -colormode mono .graph1 postscript cget -colormode } -cleanup { destroy .graph1 } -result {monochrome} # ------------------------------------------------------------------------------ # Purpose: Ensure that the colormode configuration works for monochrome mode # ------------------------------------------------------------------------------ test graph.postscript.configure-3.5 { ::graph postscript configure: colormode - monochrome } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 postscript configure -colormode monochrome .graph1 postscript cget -colormode } -cleanup { destroy .graph1 } -result {monochrome} # ------------------------------------------------------------------------------ # Purpose: Ensure that the fontmap configuration works for valid fontmaps # FIXME: I have no idea how to do this. # ---------------------------------------------s--------------------------------- # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -decorations command works correctly when # given 1 as input. # ------------------------------------------------------------------------------ test graph.postscript.configure-5.1 { ::graph postscript configure: decorations - 1 } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 postscript configure -decorations 1 .graph1 postscript cget -decorations } -cleanup { destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -decorations command works correctly when # given 0 as input. # ------------------------------------------------------------------------------ test graph.postscript.configure-5.2 { ::graph postscript configure: decorations - 0 } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 postscript configure -decorations 0 .graph1 postscript cget -decorations } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -decorations command works correctly when # given 'true' as input. # ------------------------------------------------------------------------------ test graph.postscript.configure-5.3 { ::graph postscript configure: decorations - true } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 postscript configure -decorations true .graph1 postscript cget -decorations } -cleanup { destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -decorations command works correctly when # given 'false' as input. # ------------------------------------------------------------------------------ test graph.postscript.configure-5.4 { ::graph postscript configure: decorations - false } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 postscript configure -decorations false .graph1 postscript cget -decorations } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -decorations command works correctly when # given 'yes' as input. # ------------------------------------------------------------------------------ test graph.postscript.configure-5.5 { ::graph postscript configure: decorations - yes } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 postscript configure -decorations yes .graph1 postscript cget -decorations } -cleanup { destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -decorations command works correctly when # given 'no' as input. # ------------------------------------------------------------------------------ test graph.postscript.configure-5.6 { ::graph postscript configure: decorations - no } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 postscript configure -decorations no .graph1 postscript cget -decorations } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -decorations command works correctly when # given an invalid input value. # ------------------------------------------------------------------------------ test graph.postscript.configure-5.7 { ::graph postscript configure: decorations - invalid input } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 postscript configure -decorations invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure that the height configuration works for zero # ------------------------------------------------------------------------------ test graph.postscript.configure-6.1 { postscript configure: height - zero } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 postscript configure -height 0 .graph1 postscript cget -height } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure that the height configuration works for valid values # ------------------------------------------------------------------------------ test graph.postscript.configure-6.2 { postscript configure: height - valid input } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 postscript configure -height 20 .graph1 postscript cget -height } -cleanup { destroy .graph1 } -result {20} # ------------------------------------------------------------------------------ # Purpose: Ensure that the height configuration works for invalid numerical input # ------------------------------------------------------------------------------ test graph.postscript.configure-6.3 { postscript configure: height - invalid numerical input } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 postscript configure -height -20}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure that the height configuration works for invalid character input # ------------------------------------------------------------------------------ test graph.postscript.configure-6.4 { postscript configure: height - invalid character input } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 postscript configure -height invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -landscape command works correctly when # given 1 as input. # ------------------------------------------------------------------------------ test graph.postscript.configure-7.1 { ::graph postscript configure: landscape - 1 } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 postscript configure -landscape 1 .graph1 postscript cget -landscape } -cleanup { destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -landscape command works correctly when # given 0 as input. # ------------------------------------------------------------------------------ test graph.postscript.configure-7.2 { ::graph postscript configure: landscape - 0 } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 postscript configure -landscape 0 .graph1 postscript cget -landscape } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -landscape command works correctly when # given 'true' as input. # ------------------------------------------------------------------------------ test graph.postscript.configure-7.3 { ::graph postscript configure: landscape - true } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 postscript configure -landscape true .graph1 postscript cget -landscape } -cleanup { destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -landscape command works correctly when # given 'false' as input. # ------------------------------------------------------------------------------ test graph.postscript.configure-7.4 { ::graph postscript configure: landscape - false } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 postscript configure -landscape false .graph1 postscript cget -landscape } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -landscape command works correctly when # given 'yes' as input. # ------------------------------------------------------------------------------ test graph.postscript.configure-7.5 { ::graph postscript configure: landscape - yes } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 postscript configure -landscape yes .graph1 postscript cget -landscape } -cleanup { destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -landscape command works correctly when # given 'no' as input. # ------------------------------------------------------------------------------ test graph.postscript.configure-7.6 { ::graph postscript configure: landscape - no } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 postscript configure -landscape no .graph1 postscript cget -landscape } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -landscape command works correctly when # given an invalid input value. # ------------------------------------------------------------------------------ test graph.postscript.configure-7.7 { ::graph postscript configure: landscape - invalid input } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 postscript configure -landscape invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -maxpect command works correctly when given # 1 as input. # ------------------------------------------------------------------------------ test graph.postscript.configure-8.1 { ::graph postscript configure: maxpect - 1 } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 postscript configure -maxpect 1 .graph1 postscript cget -maxpect } -cleanup { destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -maxpect command works correctly when given # 0 as input. # ------------------------------------------------------------------------------ test graph.postscript.configure-8.2 { ::graph postscript configure: maxpect - 0 } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 postscript configure -maxpect 0 .graph1 postscript cget -maxpect } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -maxpect command works correctly when given # 'true' as input. # ------------------------------------------------------------------------------ test graph.postscript.configure-8.3 { ::graph postscript configure: maxpect - true } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 postscript configure -maxpect true .graph1 postscript cget -maxpect } -cleanup { destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -maxpect command works correctly when given # 'false' as input. # ------------------------------------------------------------------------------ test graph.postscript.configure-8.4 { ::graph postscript configure: maxpect - false } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 postscript configure -maxpect false .graph1 postscript cget -maxpect } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -maxpect command works correctly when given # 'yes' as input. # ------------------------------------------------------------------------------ test graph.postscript.configure-8.5 { ::graph postscript configure: maxpect - yes } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 postscript configure -maxpect yes .graph1 postscript cget -maxpect } -cleanup { destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -maxpect command works correctly when given # 'no' as input. # ------------------------------------------------------------------------------ test graph.postscript.configure-8.6 { ::graph postscript configure: maxpect - no } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 postscript configure -maxpect no .graph1 postscript cget -maxpect } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -maxpect command works correctly when given # an invalid input value. # ------------------------------------------------------------------------------ test graph.postscript.configure-8.7 { ::graph postscript configure: maxpect - invalid input } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 postscript configure -maxpect invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -padx command works correctly when given an # integer pixel value. # ------------------------------------------------------------------------------ test graph.postscript.configure-9.1 { ::graph postscript configure: padx - integer input } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 postscript configure -padx 2 .graph1 postscript cget -padx } -cleanup { destroy .graph1 } -result {2 2} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -padx command works correctly when given an # invalid integer pixel value. # ------------------------------------------------------------------------------ test graph.postscript.configure-9.2 { ::graph postscript configure: padx - invalid integer input } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 postscript configure -padx -1}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -padx command works correctly when given a # decimal pixel value. # ------------------------------------------------------------------------------ test graph.postscript.configure-9.3 { ::graph postscript configure: padx - decimal input } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 postscript configure -padx 3.5 .graph1 postscript cget -padx } -cleanup { destroy .graph1 } -result {4 4} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -padx command works correctly when given an # invalid decimal pixel value. # ------------------------------------------------------------------------------ test graph.postscript.configure-9.4 { ::graph postscript configure: padx - invalid decimal input } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 postscript configure -padx -1.5}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -padx command works correctly when given a # valid list of numerical pixel values. # ------------------------------------------------------------------------------ test graph.postscript.configure-9.5 { ::graph postscript: configure: padx - valid list of values } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 postscript configure -padx {1 2} .graph1 postscript cget -padx } -cleanup { destroy .graph1 } -result {1 2} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -padx command works correctly when given a # character as input. # ------------------------------------------------------------------------------ test graph.postscript.configure-9.6 { ::graph postscript configure: padx - character input } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 postscript configure -padx a}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -padx command works correctly when given an # invalid list of numerical pixel values. # ------------------------------------------------------------------------------ test graph.postscript.configure-9.7 { ::graph postscript: configure: padx - invalid list of values } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 postscript configure -padx {1 a}}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -padx command works correctly when given a # list of input that is too long. # ------------------------------------------------------------------------------ test graph.postscript.configure-9.8 { ::graph postscript configure: padx - invalid list length } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 postscript configure -padx {1 2 3}}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -padx command works correctly when given 0 # as input. # ------------------------------------------------------------------------------ test graph.postscript.configure-9.9 { ::graph postscript configure: padx - zero } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 postscript configure -padx 0 .graph1 postscript cget -padx } -cleanup { destroy .graph1 } -result {0 0} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -pady command works correctly when given an # integer pixel value. # ------------------------------------------------------------------------------ test graph.postscript.configure-10.1 { ::graph postscript configure: pady - integer input } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 postscript configure -pady 2 .graph1 postscript cget -pady } -cleanup { destroy .graph1 } -result {2 2} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -pady command works correctly when given an # invalid integer pixel value. # ------------------------------------------------------------------------------ test graph.postscript.configure-10.2 { ::graph postscript configure: pady - invalid integer input } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 postscript configure -pady -1}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -pady command works correctly when given a # decimal pixel value. # ------------------------------------------------------------------------------ test graph.postscript.configure-10.3 { ::graph postscript configure: pady - decimal input } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 postscript configure -pady 3.5 .graph1 postscript cget -pady } -cleanup { destroy .graph1 } -result {4 4} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -pady command works correctly when given an # invalid decimal pixel value. # ------------------------------------------------------------------------------ test graph.postscript.configure-10.4 { ::graph postscript configure: pady - invalid decimal input } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 postscript configure -pady -1.5}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -pady command works correctly when given a # valid list of numerical pixel values. # ------------------------------------------------------------------------------ test graph.postscript.configure-10.5 { ::graph postscript: configure: pady - valid list of values } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 postscript configure -pady {1 2} .graph1 postscript cget -pady } -cleanup { destroy .graph1 } -result {1 2} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -pady command works correctly when given a # character as input. # ------------------------------------------------------------------------------ test graph.postscript.configure-10.6 { ::graph postscript configure: pady - character input } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 postscript configure -pady a}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -pady command works correctly when given an # invalid list of numerical pixel values. # ------------------------------------------------------------------------------ test graph.postscript.configure-10.7 { ::graph postscript: configure: pady - invalid list of values } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 postscript configure -pady {1 a}}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -pady command works correctly when given a # list of input that is too long. # ------------------------------------------------------------------------------ test graph.postscript.configure-10.8 { ::graph postscript configure: pady - invalid list length } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 postscript configure -pady {1 2 3}}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -pady command works correctly when given 0 # as input. # ------------------------------------------------------------------------------ test graph.postscript.configure-10.9 { ::graph postscript configure: pady - zero } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 postscript configure -pady 0 .graph1 postscript cget -pady } -cleanup { destroy .graph1 } -result {0 0} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -paperheight command works correctly when # given an integer pixel value. # ------------------------------------------------------------------------------ test graph.postscript.configure-11.1 { ::graph postscript configure: paperheight - integer input } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 postscript configure -paperheight 2 .graph1 postscript cget -paperheight } -cleanup { destroy .graph1 } -result {2} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -paperheight command works correctly when # given an invalid integer pixel value. # ------------------------------------------------------------------------------ test graph.postscript.configure-11.2 { ::graph postscript configure: paperheight - invalid integer input } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 postscript configure -paperheight -1}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -paperheight command works correctly when # given a decimal pixel value. # ------------------------------------------------------------------------------ test graph.postscript.configure-11.3 { ::graph postscript configure: paperheight - decimal input } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 postscript configure -paperheight 3.5 .graph1 postscript cget -paperheight } -cleanup { destroy .graph1 } -result {4} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -paperheight command works correctly when # given an invalid decimal pixel value. # ------------------------------------------------------------------------------ test graph.postscript.configure-11.4 { ::graph postscript configure: paperheight - invalid decimal input } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 postscript configure -paperheight -1.5}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -paperheight command works correctly when # given a character as input. # ------------------------------------------------------------------------------ test graph.postscript.configure-11.5 { ::graph postscript configure: paperheight - character input } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 postscript configure -paperheight a}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -paperheight command works correctly when # given 0 as input. # ------------------------------------------------------------------------------ test graph.postscript.configure-11.6 { ::graph postscript configure: paperheight - zero } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 postscript configure -paperheight 0}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -paperwidth command works correctly when # given an integer pixel value. # ------------------------------------------------------------------------------ test graph.postscript.configure-12.1 { ::graph postscript configure: paperwidth - integer input } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 postscript configure -paperwidth 2 .graph1 postscript cget -paperwidth } -cleanup { destroy .graph1 } -result {2} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -paperwidth command works correctly when # given an invalid integer pixel value. # ------------------------------------------------------------------------------ test graph.postscript.configure-12.2 { ::graph postscript configure: paperwidth - invalid integer input } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 postscript configure -paperwidth -1}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -paperwidth command works correctly when # given a decimal pixel value. # ------------------------------------------------------------------------------ test graph.postscript.configure-12.3 { ::graph postscript configure: paperwidth - decimal input } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 postscript configure -paperwidth 3.5 .graph1 postscript cget -paperwidth } -cleanup { destroy .graph1 } -result {4} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -paperwidth command works correctly when # given an invalid decimal pixel value. # ------------------------------------------------------------------------------ test graph.postscript.configure-12.4 { ::graph postscript configure: paperwidth - invalid decimal input } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 postscript configure -paperwidth -1.5}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -paperwidth command works correctly when # given a character as input. # ------------------------------------------------------------------------------ test graph.postscript.configure-12.5 { ::graph postscript configure: paperwidth - character input } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 postscript configure -paperwidth a}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -paperwidth command works correctly when # given 0 as input. # ------------------------------------------------------------------------------ test graph.postscript.configure-12.6 { ::graph postscript configure: paperwidth - zero } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 postscript configure -paperwidth 0}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -width command works correctly when # given an integer pixel value. # ------------------------------------------------------------------------------ test graph.postscript.configure-13.1 { ::graph postscript configure: width - integer input } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 postscript configure -width 2 .graph1 postscript cget -width } -cleanup { destroy .graph1 } -result {2} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -width command works correctly when # given an invalid integer pixel value. # ------------------------------------------------------------------------------ test graph.postscript.configure-13.2 { ::graph postscript configure: width - invalid integer input } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 postscript configure -width -1}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -width command works correctly when # given a decimal pixel value. # ------------------------------------------------------------------------------ test graph.postscript.configure-13.3 { ::graph postscript configure: width - decimal input } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 postscript configure -width 3.5 .graph1 postscript cget -width } -cleanup { destroy .graph1 } -result {4} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -width command works correctly when # given an invalid decimal pixel value. # ------------------------------------------------------------------------------ test graph.postscript.configure-13.4 { ::graph postscript configure: width - invalid decimal input } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 postscript configure -width -1.5}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -width command works correctly when # given a character as input. # ------------------------------------------------------------------------------ test graph.postscript.configure-13.5 { ::graph postscript configure: width - character input } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 postscript configure -width a}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -width command works correctly when # given 0 as input. # ------------------------------------------------------------------------------ test graph.postscript.configure-13.6 { ::graph postscript configure: width - zero } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 postscript configure -width 0 .graph1 postscript cget -width } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -footer command works correctly when given # 1 as input. # ------------------------------------------------------------------------------ test graph.postscript.configure-14.1 { ::graph postscript configure: footer - 1 } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 postscript configure -footer 1 .graph1 postscript cget -footer } -cleanup { destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -footer command works correctly when given # 0 as input. # ------------------------------------------------------------------------------ test graph.postscript.configure-14.2 { ::graph postscript configure: footer - 0 } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 postscript configure -footer 0 .graph1 postscript cget -footer } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -footer command works correctly when given # 'true' as input. # ------------------------------------------------------------------------------ test graph.postscript.configure-14.3 { ::graph postscript configure: footer - true } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 postscript configure -footer true .graph1 postscript cget -footer } -cleanup { destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -footer command works correctly when given # 'false' as input. # ------------------------------------------------------------------------------ test graph.postscript.configure-14.4 { ::graph postscript configure: footer - false } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 postscript configure -footer false .graph1 postscript cget -footer } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -footer command works correctly when given # 'yes' as input. # ------------------------------------------------------------------------------ test graph.postscript.configure-14.5 { ::graph postscript configure: footer - yes } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 postscript configure -footer yes .graph1 postscript cget -footer } -cleanup { destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -footer command works correctly when given # 'no' as input. # ------------------------------------------------------------------------------ test graph.postscript.configure-14.6 { ::graph postscript configure: footer - no } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 postscript configure -footer no .graph1 postscript cget -footer } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -footer command works correctly when given # an invalid input value. # ------------------------------------------------------------------------------ test graph.postscript.configure-14.7 { ::graph postscript configure: footer - invalid input } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 postscript configure -footer invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -preview command works correctly when given # 1 as input. # ------------------------------------------------------------------------------ test graph.postscript.configure-15.1 { ::graph postscript configure: preview - 1 } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 postscript configure -preview 1 .graph1 postscript cget -preview } -cleanup { destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -preview command works correctly when given # 0 as input. # ------------------------------------------------------------------------------ test graph.postscript.configure-15.2 { ::graph postscript configure: preview - 0 } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 postscript configure -preview 0 .graph1 postscript cget -preview } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -preview command works correctly when given # 'true' as input. # ------------------------------------------------------------------------------ test graph.postscript.configure-15.3 { ::graph postscript configure: preview - true } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 postscript configure -preview true .graph1 postscript cget -preview } -cleanup { destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -preview command works correctly when given # 'false' as input. # ------------------------------------------------------------------------------ test graph.postscript.configure-15.4 { ::graph postscript configure: preview - false } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 postscript configure -preview false .graph1 postscript cget -preview } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -preview command works correctly when given # 'yes' as input. # ------------------------------------------------------------------------------ test graph.postscript.configure-15.5 { ::graph postscript configure: preview - yes } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 postscript configure -preview yes .graph1 postscript cget -preview } -cleanup { destroy .graph1 } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -preview command works correctly when given # 'no' as input. # ------------------------------------------------------------------------------ test graph.postscript.configure-15.6 { ::graph postscript configure: preview - no } -setup { ::graph .graph1 pack .graph1 } -body { .graph1 postscript configure -preview no .graph1 postscript cget -preview } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure the postscript configure -preview command works correctly when given # an invalid input value. # ------------------------------------------------------------------------------ test graph.postscript.configure-15.7 { ::graph postscript configure: preview - invalid input } -setup { ::graph .graph1 pack .graph1 } -body { if {[catch {.graph1 postscript configure -preview invalid}]} { return 0 } else { return 1 } } -cleanup { destroy .graph1 } -result {0} # ------------------------------------------------------------------------------ # Purpose: Ensure that the preview format configuration works for valid formats # FIXME: I have no idea how to do this. # ------------------------------------------------------------------------------ #=============================================================================== # This part contains the automatic tests that test the postscript output # function of the graph BLT component. # ------------------------------------------------------------------------------ # Purpose: Ensure that output will print postscript to the console # ------------------------------------------------------------------------------ test graph.postscript.output-1.1 { Test postscript output to console } -setup { ::graph .graph1 pack .graph1 } -body { set TestPs [.graph1 postscript output] if {$TestPs != ""} { return 1 } return 0 } -cleanup { destroy .graph1 unset TestPs } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure that output will print postscript to a file # ------------------------------------------------------------------------------ test graph.postscript.output-1.2 { Test postscript output to file } -setup { ::graph .graph1 pack .graph1 set FileName graph.legend.3.1.ps } -body { .graph1 postscript output $FileName file exists $FileName } -cleanup { destroy .graph1 file delete -force $FileName unset FileName } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure that output will print postscript to the console with option-value # pairs # ------------------------------------------------------------------------------ test graph.postscript.output-1.3 { Test postscript output to console with options } -setup { ::graph .graph1 pack .graph1 } -body { set TestPs [.graph1 postscript output -center 0] if {$TestPs != ""} { return 1 } return 0 } -cleanup { destroy .graph1 unset TestPs } -result {1} # ------------------------------------------------------------------------------ # Purpose: Ensure that output will print postscript to a file with option-value pairs # ------------------------------------------------------------------------------ test graph.postscript.output-1.4 { Test postscript output to file with options } -setup { ::graph .graph1 pack .graph1 set FileName graph.legend.3.4.ps } -body { .graph1 postscript output $FileName -center 0 file exists $FileName } -cleanup { destroy .graph1 file delete -force $FileName unset FileName } -result {1} cleanupTests } catch {namespace delete ::TEST} # vim: set ts=4 sw=4 sts=4 ff=unix et :