Changeset 36993 in project


Ignore:
Timestamp:
12/13/18 18:52:24 (5 weeks ago)
Author:
kon
Message:

ren var in tests

Location:
release/5/synch/trunk/tests
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • release/5/synch/trunk/tests/synch-loose-test.scm

    r36990 r36993  
    1919;;;
    2020
    21 (test-begin "synch exception")
     21(test-begin "synch exit")
    2222
    2323(import (chicken condition))
     
    2525(define mx1 (make-mutex 'mx1))
    2626
    27 (define-thread mx1-exn-th
     27#;
     28(let ((exit-k (call/cc (lambda (k) k))) )
     29  (define-thread mx1-exn-th
     30    (synch mx1
     31      (when exit-k
     32        (test-assert "exit k" exit-k)
     33        (exit-k #f))))
     34  (thread-start! mx1-exn-th)
     35)
     36(thread-start!
     37  (lambda ()
     38    (call/cc (lambda (ret)
     39      (synch mx1
     40        (ret 'ca))))))
     41;(test-assert "not unlocked" (thread? (mutex-state mx1)))
     42(test "unlocked" 'not-abandoned (mutex-state mx1))
     43
     44(test-assert "reuse mutex" (synch mx1 #t))
     45
     46(test-end "synch exit")
     47
     48;;;
     49
     50(test-begin "synch exception")
     51
     52(import (chicken condition))
     53
     54(define mx2 (make-mutex 'mx2))
     55
     56(define-thread mx2-exn-th
    2857  (parameterize (
    2958    (current-synch-raise
    3059      (lambda (exn)
    3160        (test "exn" 'ca1 ((lambda () exn))))) )
    32     (synch mx1 (abort 'ca1))))
    33 (thread-start! mx1-exn-th)
    34 (test "unlocked" 'not-abandoned (mutex-state mx1))
     61    (synch mx2 (abort 'ca1))))
     62(thread-start! mx2-exn-th)
     63(test "unlocked" 'not-abandoned (mutex-state mx2))
    3564
    36 (test-assert "reuse mutex" (synch mx1 #t))
     65(test-assert "reuse mutex" (synch mx2 #t))
    3766
    3867(test-end "synch exception")
  • release/5/synch/trunk/tests/synch-test.scm

    r36990 r36993  
    2020;;;
    2121
    22 (test-begin "synch exception")
     22(test-begin "synch exit")
    2323
    2424(import (chicken condition))
     
    2626(define mx1 (make-mutex 'mx1))
    2727
    28 (define-thread mx1-exn-th
     28#;
     29(let ((exit-k (call/cc (lambda (k) k))) )
     30  (define-thread mx1-exn-th
     31    (synch mx1
     32      (when exit-k
     33        (test-assert "exit k" exit-k)
     34        (exit-k #f))))
     35  (thread-start! mx1-exn-th)
     36)
     37(thread-start!
     38  (lambda ()
     39    (call/cc (lambda (ret)
     40      (synch mx1
     41        (ret 'ca))))))
     42(test "unlocked" 'not-abandoned (mutex-state mx1))
     43
     44(test-assert "reuse mutex" (synch mx1 #t))
     45
     46(test-end "synch exit")
     47
     48;;;
     49
     50(test-begin "synch exception")
     51
     52(import (chicken condition))
     53
     54(define mx2 (make-mutex 'mx2))
     55
     56(define-thread mx2-exn-th
    2957  (handle-exceptions exn
    3058    (begin
    3159      (test "exn" 'ca1 ((lambda () exn)))
    3260      exn)
    33     (synch mx1 (abort 'ca1))))
    34 (thread-start! mx1-exn-th)
    35 (test "unlocked" 'not-abandoned (mutex-state mx1))
     61    (synch mx2 (abort 'ca1))))
     62(thread-start! mx2-exn-th)
     63(test "unlocked" 'not-abandoned (mutex-state mx2))
    3664
    37 (test-assert "reuse mutex" (synch mx1 #t))
     65(test-assert "reuse mutex" (synch mx2 #t))
    3866
    3967(test-end "synch exception")
  • release/5/synch/trunk/tests/synch-tight-test.scm

    r36990 r36993  
    1919;;;
    2020
    21 (test-begin "synch exception")
     21(test-begin "synch exit")
    2222
    2323(import (chicken condition))
     
    2525(define mx1 (make-mutex 'mx1))
    2626
    27 (define-thread mx1-exn-th
     27#;
     28(let ((exit-k (call/cc (lambda (k) k))) )
     29  (define-thread mx1-exn-th
     30    (synch mx1
     31      (when exit-k
     32        (test-assert "exit k" exit-k)
     33        (exit-k #f))))
     34  (thread-start! mx1-exn-th)
     35)
     36(thread-start!
     37  (lambda ()
     38    (call/cc (lambda (ret)
     39      (synch mx1
     40        (ret 'ca))))))
     41(test "unlocked" 'not-abandoned (mutex-state mx1))
     42
     43(test-assert "reuse mutex" (synch mx1 #t))
     44
     45(test-end "synch exit")
     46
     47;;;
     48
     49(test-begin "synch exception")
     50
     51(import (chicken condition))
     52
     53(define mx2 (make-mutex 'mx2))
     54
     55(define-thread mx2-exn-th
    2856  (parameterize (
    2957    (current-synch-raise
    3058      (lambda (exn)
    3159        (test "exn" 'ca1 ((lambda () exn))))) )
    32     (synch mx1 (abort 'ca1))))
    33 (thread-start! mx1-exn-th)
    34 (test "unlocked" 'not-abandoned (mutex-state mx1))
     60    (synch mx2 (abort 'ca1))))
     61(thread-start! mx2-exn-th)
     62(test "unlocked" 'not-abandoned (mutex-state mx2))
    3563
    36 (test-assert "reuse mutex" (synch mx1 #t))
     64(test-assert "reuse mutex" (synch mx2 #t))
    3765
    3866(test-end "synch exception")
Note: See TracChangeset for help on using the changeset viewer.