Changeset 107833


Ignore:
Timestamp:
Jul 6, 2013, 5:45:00 PM (7 years ago)
Author:
marius@…
Message:

Fixed checksum-1 and site-tags to use initial_setup and one general proc for checksums.

Location:
branches/gsoc13-tests/tests/test
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/gsoc13-tests/tests/test/checksums-1/test.tcl

    r107651 r107833  
    88set path [file dirname [file normalize $argv0]]
    99
    10 # Initial setup
    11 load_variables $path
    12 set_dir
    13 port_index
    14 port_clean $path
    15 port_run $path
     10initial_setup
    1611
     12proc get_checksum {type} {
     13    global path
     14    global output_file
    1715
    18 # Useful procs
    19 proc get_md5 {filename} {
    20     global path
    21     set md5 "debug: calculated (md5)*"
    22 
    23     set line [get_line $path/$filename $md5]
    24     set result [lrange [split $line " "] 4 4]
    25 
    26     return $result
    27 }
    28 
    29 proc get_sha {filename} {
    30     global path
    31     set sha "debug: calculated (sha1)*"
    32 
    33     set line [get_line $path/$filename $sha]
    34     set result [lrange [split $line " "] 4 4]
    35 
    36     return $result
    37 }
    38 
    39 proc get_rmd {filename} {
    40     global path
    41     set sha "debug: calculated (rmd160)*"
    42 
    43     set line [get_line $path/$filename $sha]
     16    append string "debug: calculated (" $type ")*"
     17    set line [get_line $path/$output_file $string]
    4418    set result [lrange [split $line " "] 4 4]
    4519
     
    5226    Regression test for MD5 Checksum.
    5327} -body {
    54     get_md5 $output_file
     28    get_checksum md5
    5529} -result "d41d8cd98f00b204e9800998ecf8427e"
    5630
     
    5933    Regression test for SHA1 Checksum.
    6034} -body {
    61     get_sha $output_file
     35    get_checksum sha1
    6236} -result "da39a3ee5e6b4b0d3255bfef95601890afd80709"
    6337
     
    6640    Regression test for RMD160 Checksum.
    6741} -body {
    68     get_rmd $output_file
     42    get_checksum rmd160
    6943} -result "9c1185a5c5e9fc54612808977ee8f548b2258d31"
    7044
  • branches/gsoc13-tests/tests/test/site-tags/test.tcl

    r107704 r107833  
    1212    global path
    1313
    14     load_variables $path
    15     set_dir
    16     port_index
    17     port_clean $path
    18     port_run $path
     14    initial_setup
    1915
    2016    set err "error*"
Note: See TracChangeset for help on using the changeset viewer.