OSDN Git Service

* duh bug fixes
authorfche <fche>
Fri, 24 Aug 2001 00:31:50 +0000 (00:31 +0000)
committerfche <fche>
Fri, 24 Aug 2001 00:31:50 +0000 (00:31 +0000)
2001-08-23  Frank Ch. Eigler  <fche@redhat.com>

* lib/monkey.exp (monkey_stop): New routine.
(monkey_test): Upon failure in test loop, break out, to always
call `monkey_stop'.
(monkey_test_pin): Don't mistakenly return "eof".

sid/component/testsuite/ChangeLog
sid/component/testsuite/lib/monkey.exp

index dbf9d1a..37f9f1d 100644 (file)
@@ -1,3 +1,10 @@
+2001-08-23  Frank Ch. Eigler  <fche@redhat.com>
+
+       * lib/monkey.exp (monkey_stop): New routine.
+       (monkey_test): Upon failure in test loop, break out, to always
+       call `monkey_stop'.
+       (monkey_test_pin): Don't mistakenly return "eof".
+
 2001-08-22  Ben Elliston  <bje@redhat.com>
 
        * config/default.exp (sid_assert): New proc.
index 97132c9..e0ffccd 100644 (file)
@@ -92,6 +92,7 @@ proc monkey_test {type sym lib {iterations 30s}} {
     # (e.g. m => minutes), then run the tests for the specified
     # duration, rather than as a fixed number of iterations.
 
+    set condition "pass"
     if {[regexp {[smhd]$} $iterations]} {
        regexp {([0-9]+)[smhd]$} $iterations ignore units
        set now [clock seconds]
@@ -106,15 +107,15 @@ proc monkey_test {type sym lib {iterations 30s}} {
            note "Testing $type until [clock format $finishtime]"
        }
        while {[clock seconds] < $finishtime} {
-           if {[do_one_test] == 0} then return
+           if {[do_one_test] == 0} then {set condition "fail"; break}
        }
     } else {
        for {set i 0} {$i < $iterations} {incr i} {
-           if {[do_one_test] == 0} then return
+           if {[do_one_test] == 0} then {set condition "fail"; break}
        }
     }
-    sid_stop
-    pass "$test ($iterations iterations)"
+    monkey_stop
+    $condition "$test ($iterations iterations)"
 
     catch {unset pins buses attributes}
 
@@ -175,6 +176,11 @@ proc monkey_start {type sym lib} {
     return 0
 }
 
+proc monkey_stop {} {
+    sid_stop
+}
+
+
 # Monkey test a pin (decided at runtime).
 proc monkey_test_pin {} {
     global pins victim
@@ -193,7 +199,9 @@ proc monkey_test_pin {} {
     # Value-carrying pin.
     set value [random [expr int(pow(2,16))]]
     set result [sid_cmd [list sid::pin::driven_h4 $handle $value]]
-    if [string match "" $result] then { return "eof" }
+   
+    # sid::pin::driven_h4 returns nothing!
+    # if [string match "" $result] then { return "eof" }
 }
 
 # Monkey test a bus (transaction type and width decided at runtime).