# RBC.eps.relief.A.test --
#
###Abstract
# This file contains the automatic tests that test the relief 
# function of the eps BLT component.
#
###Copyright
# See the file "license.terms" for information on usage and
# redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
###Revision String
# SVN: $Id$

###Package Definition
package provide eps.relief

package require rbc
namespace import rbc::*

package require tcltest
namespace import tcltest::*
namespace eval eps.relief {
	# ------------------------------------------------------------------------------------
	# Purpose: Ensure the relief command works properly when given 'raised' as input.
	# ------------------------------------------------------------------------------------ 
	test RBC.eps.relief.A.1.1 {
	    eps relief: raised
	} -setup {
	    canvas .canvas1
		.canvas1 create eps 0 0
	} -body {
		.canvas1 itemconfigure 1 -relief raised
		.canvas1 itemcget 1 -relief
	} -cleanup {
		.canvas1 delete 1
	    destroy .canvas1
	} -result {raised}
	
	# ------------------------------------------------------------------------------------
	# Purpose: Ensure the relief command works properly when given 'flat' as input.
	# ------------------------------------------------------------------------------------ 
	test RBC.eps.relief.A.1.2 {
	    eps relief: flat
	} -setup {
	    canvas .canvas1
		.canvas1 create eps 0 0
	} -body {
		.canvas1 itemconfigure 1 -relief flat
		.canvas1 itemcget 1 -relief
	} -cleanup {
		.canvas1 delete 1
	    destroy .canvas1
	} -result {flat}
	
	# ------------------------------------------------------------------------------------
	# Purpose: Ensure the relief command works properly when given 'groove' as input.
	# ------------------------------------------------------------------------------------ 
	test RBC.eps.relief.A.1.3 {
	    eps relief: groove
	} -setup {
	    canvas .canvas1
		.canvas1 create eps 0 0
	} -body {
		.canvas1 itemconfigure 1 -relief groove
		.canvas1 itemcget 1 -relief
	} -cleanup {
		.canvas1 delete 1
	    destroy .canvas1
	} -result {groove}
	
	# ------------------------------------------------------------------------------------
	# Purpose: Ensure the relief command works properly when given 'ridge' as input.
	# ------------------------------------------------------------------------------------ 
	test RBC.eps.relief.A.1.4 {
	    eps relief: ridge
	} -setup {
	    canvas .canvas1
		.canvas1 create eps 0 0
	} -body {
		.canvas1 itemconfigure 1 -relief ridge
		.canvas1 itemcget 1 -relief
	} -cleanup {
		.canvas1 delete 1
	    destroy .canvas1
	} -result {ridge}
	
	# ------------------------------------------------------------------------------------
	# Purpose: Ensure the relief command works properly when given 'solid' as input.
	# ------------------------------------------------------------------------------------ 
	test RBC.eps.relief.A.1.5 {
	    eps relief: solid
	} -setup {
	    canvas .canvas1
		.canvas1 create eps 0 0
	} -body {
		.canvas1 itemconfigure 1 -relief solid
		.canvas1 itemcget 1 -relief
	} -cleanup {
		.canvas1 delete 1
	    destroy .canvas1
	} -result {solid}
	
	# ------------------------------------------------------------------------------------
	# Purpose: Ensure the relief command works properly when given 'sunken' as input.
	# ------------------------------------------------------------------------------------ 
	test RBC.eps.relief.A.1.6 {
	    eps relief: sunken
	} -setup {
	    canvas .canvas1
		.canvas1 create eps 0 0
	} -body {
		.canvas1 itemconfigure 1 -relief sunken
		.canvas1 itemcget 1 -relief
	} -cleanup {
		.canvas1 delete 1
	    destroy .canvas1
	} -result {sunken}
	
	# ------------------------------------------------------------------------------------
	# Purpose: Ensure the relief command works properly when given an invalid color name.
	# ------------------------------------------------------------------------------------ 
	test RBC.eps.relief.A.1.7 {
	    eps relief: invalid color
	} -setup {
	    canvas .canvas1
		.canvas1 create eps 0 0
	} -body {
		if {[catch {.canvas1 itemconfigure 1 -relief invalid}]} {
			return 0
		} else {
			return 1
		}
	} -cleanup {
		.canvas1 delete 1
	    destroy .canvas1
	} -result {0}
	
	cleanupTests
}