home *** CD-ROM | disk | FTP | other *** search
- #==============================================================================
- # misc.test
- #------------------------------------------------------------------------------
- # Test of the Tcl SIPP misc commands.
- #------------------------------------------------------------------------------
- # Copyright 1992 Mark Diekhans
- # Permission to use, copy, modify, and distribute this software and its
- # documentation for any purpose and without fee is hereby granted, provided
- # that the above copyright notice appear in all copies. Mark Diekhans makes
- # no representations about the suitability of this software for any purpose.
- # It is provided "as is" without express or implied warranty.
- #------------------------------------------------------------------------------
- # $Id: misc.test,v 2.0 1992/11/02 03:55:55 markd Rel $
- #==============================================================================
-
-
- if {[info procs test] == ""} {source testprocs.tcl}
-
- #
- # Test SippMkVector command.
- #
-
- test {misc-1.1} {
- SippMkVector {0 0 0}
- } 1 {wrong # args: SippMkVector {pt0_x pt0_y pt0_z} {pt1_x pt1_y pt1_z}}
-
- test {misc-1.2} {
- SippMkVector {0 0 0} {1 1 1} {2 2 2}
- } 1 {wrong # args: SippMkVector {pt0_x pt0_y pt0_z} {pt1_x pt1_y pt1_z}}
-
- test {misc-1.3} {
- SippMkVector {0 0} {1 1 1}
- } 1 {vertex or vector must be a list of three elements}
-
- test {misc-1.4} {
- SippMkVector {0 0 0} {1 1 a}
- } 1 {expected floating-point number but got "a"}
-
- test {misc-1.5} {
- SippMkVector {0 0 0} {1 1 a}
- } 1 {expected floating-point number but got "a"}
-
- test {misc-1.6} {
- SippMkVector {0 0 0} {1 1 1}
- } 0 {1 1 1}
-
- test {misc-1.7} {
- SippMkVector {0.5 0.5 0.5} {2.25 1.75 1.75}
- } 0 {1.75 1.25 1.25}
-
- test {misc-1.8} {
- SippMkVector {1 1 1} {0 0 0}
- } 0 {-1 -1 -1}
-
- #
- # Test SippMatMult command.
- #
-
- test {misc-2.1} {
- SippMatMult
- } 1 {wrong # args: SippMatMult matrix1 matrix2}
-
- test {misc-2.2} {
- SippMatMult $testMat1 $identityMat $testMat1
- } 1 {wrong # args: SippMatMult matrix1 matrix2}
-
- test {misc-2.3} {
- SippMatMult {0 1 2 3} {4 5 6 7}
- } 1 {matrix must have 4 columns}
-
- test {misc-2.4} {
- SippMatMult $identityMat {4 5 6 7}
- } 1 {matrix must have 4 columns}
-
- test {misc-2.5} {
- SippMatMult $identityMat $testMat1
- } 0 $testMat1
-
- test {misc-2.6} {
- SippMatMult $testMat1 $identityMat
- } 0 $testMat1
-
- #
- # Test SippShowBackFaces command.
- #
-
- test {misc-3.1} {
- SippShowBackFaces 0 1
- } 1 {wrong # args: SippShowBackFaces [flag]}
-
- test {misc-3.2} {
- SippShowBackFaces true
- SippShowBackFaces
- } 0 {1}
-
- test {misc-3.3} {
- SippShowBackFaces false
- SippShowBackFaces
- } 0 {0}
-
- #
- # Test SippBackground command.
- #
-
- test {misc-4.1} {
- SippBackground 1 2 3
- } 1 {wrong # args: SippBackground [color]}
-
- test {misc-4.2} {
- SippBackground {0 .9 .4} {0 .9 .4}
- } 1 {wrong # args: SippBackground [color]}
-
- test {misc-4.3} {
- SippBackground {0 .9 .4}
- } 0 {}
-
- test {misc-4.4} {
- SippBackground {1 .9 .4}
- SippBackground
- } 0 {1 0.9 0.4}
-
- #
- # Test SippLineColor command.
- #
-
- test {misc-5.1} {
- SippLineColor 1 2 3
- } 1 {wrong # args: SippLineColor [color]}
-
- test {misc-5.2} {
- SippLineColor {0 .9 .4} {0 .9 .4}
- } 1 {wrong # args: SippLineColor [color]}
-
- test {misc-5.3} {
- SippLineColor {1 0 1}
- } 0 {}
-
- test {misc-5.4} {
- SippLineColor {1 0 0.1}
- SippLineColor
- } 0 {1 0 0.1}
-
- #
- # Test SippShadows command.
- #
-
- test {misc-6.1} {
- SippShadows
- } 1 {wrong # args: SippShadows flag [size]}
-
- test {misc-6.2} {
- SippShadows true 1000 1
- } 1 {wrong # args: SippShadows flag [size]}
-
- test {misc-6.3} {
- SippShadows foo
- } 1 {expected boolean value but got "foo"}
-
- test {misc-6.4} {
- SippShadows true
- } 1 {size argument must be specified when enabling shadows}
-
- test {misc-6.5} {
- SippShadows false 1000
- } 1 {size argument must be omitted when disabling shadows}
-
- test {misc-6.6} {
- SippShadows true 1000
- } 0 {}
-
- test {misc-6.7} {
- SippShadows false
- } 0 {}
-
-
- #
- # Test SippInfo command.
- #
-
- test {misc-7.1} {
- SippInfo
- } 1 {wrong # args: SippInfo attribute}
-
- test {misc-7.2} {
- SippInfo rle x
- } 1 {wrong # args: SippInfo attribute}
-
- test {misc-7.3} {
- SippInfo foo
- } 1 {expected an attribute of "version", "sippversion", "tsippversion", "tsipppatchlevel", or "rle", got "foo"}
-
- test {misc-7.4} {
- lempty [SippInfo version]
- } 0 0
-
- test {misc-7.5} {
- lempty [SippInfo sippversion]
- } 0 0
-
- test {misc-7.6} {
- lempty [SippInfo tsippversion]
- } 0 0
-
-
- test {misc-7.7} {
- lempty [SippInfo tsipppatchlevel]
- } 0 0
-
- test {misc-7.8} {
- expr {[lsearch {0 1} [SippInfo rle]] >= 0}
- } 0 1
-
-