File: test-suite-rng.tcl

package info (click to toggle)
ns2 2.35%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 78,120 kB
  • sloc: cpp: 172,923; tcl: 107,127; perl: 6,391; sh: 6,143; ansic: 5,846; makefile: 812; awk: 525; csh: 355
file content (47 lines) | stat: -rw-r--r-- 826 bytes parent folder | download | duplicates (8)
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