1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
|
# This test-suite uses the random number generator test (class rngtest)
# See rng.cc for details.
remove-all-packet-headers ; # removes all except common
add-packet-header Flags IP TCP ; # hdrs reqd for validation
# FOR UPDATING GLOBAL DEFAULTS:
Class TestSuite
Class Test/rngtest -superclass TestSuite
Test/rngtest instproc init {} {
set rng [new RNG]
$rng test
}
proc usage {} {
global argv
puts stderr "usage: ns $argv0 <tests> "
puts "Valid tests: rngtest"
exit 1
}
proc runtest {arg} {
global quiet
set quiet 0
set b [llength $arg]
if {$b == 1} {
set test $arg
} elseif {$b == 2} {
set test [lindex $arg 0]
if {[lindex $arg 1] == "QUIET"} {
set quiet 1
}
} else {
usage
}
set t [new Test/$test]
}
global argv arg0
runtest $argv
|