diff options
Diffstat (limited to 'contrib/bluegnu2.0.3/testsets/examples/lib')
-rw-r--r-- | contrib/bluegnu2.0.3/testsets/examples/lib/benchmark.itcl | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/contrib/bluegnu2.0.3/testsets/examples/lib/benchmark.itcl b/contrib/bluegnu2.0.3/testsets/examples/lib/benchmark.itcl new file mode 100644 index 0000000..b8f589c --- /dev/null +++ b/contrib/bluegnu2.0.3/testsets/examples/lib/benchmark.itcl @@ -0,0 +1,64 @@ +# +# + +namespace eval ::tc002 { + if {[::itcl::find classes Benchmark] != "Benchmark"} { + class Benchmark { + inherit ::BlueGnu::Benchmark + + public constructor {args} { + } + + public method benchmark {benchmarkFunction args} { + verbose {******* ${this}::benchmark\ + $benchmarkFunction $args} + verbose "Length Args is >[llength $args]<" 2 + set bResult 0 + switch -exact $benchmarkFunction { + English { + set bResult 1 + } + Dutch { + set bResult 1 + } + } + if $bResult { + pass "[info class]::benchmark\ + $benchmarkFunction $args" + } else { + fail "[info class]::benchmark\ + $benchmarkFunction $args" + } + return $bResult + } + } + + class English { + inherit ::tc002::Benchmark + + public constructor {args} { + eval ::BlueGnu::Benchmark::constructor $args + ::tc002::Benchmark::constructor + } { + verbose "******* Initialize Priority Benchmark Values" + foreach i [lsort [array names ARG]] { + verbose { ARG($i): >$ARG($i)<} 2 + } + } + } + + class Dutch { + inherit ::tc002::Benchmark + + public constructor {args} { + eval ::BlueGnu::Benchmark::constructor $args + ::tc002::Benchmark::constructor + } { + verbose "******* Initialize Priority Benchmark Values" + foreach i [lsort [array names ARG]] { + verbose { ARG($i): >$ARG($i)<} 2 + } + } + } + } +}
\ No newline at end of file |