summaryrefslogtreecommitdiff
path: root/cesar
diff options
context:
space:
mode:
authorNicolas Schodet2010-11-22 16:54:37 +0100
committerNicolas Schodet2010-11-23 12:02:10 +0100
commitf3348e6b0ad008c29a1980ded44f79ceabf37194 (patch)
tree2b4318a5dfc085bd8aa8e9b6b6acfdf38432e743 /cesar
parent9a05555d874ee6af3efbf33bc8ab5fcd821df540 (diff)
cesar/mac/pbproc/test/int: fix test uninit
Old code could stop PBProc while get_seg was still pending.
Diffstat (limited to 'cesar')
-rw-r--r--cesar/mac/pbproc/test/int/py/test_coll.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/cesar/mac/pbproc/test/int/py/test_coll.py b/cesar/mac/pbproc/test/int/py/test_coll.py
index 7ae519d766..564b6f491e 100644
--- a/cesar/mac/pbproc/test/int/py/test_coll.py
+++ b/cesar/mac/pbproc/test/int/py/test_coll.py
@@ -2,6 +2,7 @@
from test_pbproc import *
bp_tck = 10 * 25000000 / 50
+feed_loops = 16
t1, t2 = begin (2)
@@ -30,18 +31,19 @@ t2.activate ()
stop = 0
def get_seg_cb (r, ttx, trx):
- assert (r.seg_nb == ttx.seg)
- ttx.seg = 0
global stop
+ assert r.seg_nb == ttx.seg or stop >= feed_loops
+ ttx.seg = 0
stop += 1
- feed (ttx, trx)
- trx.get_seg_async (lambda r: get_seg_cb (r, ttx, trx), seg_nb = ttx.seg)
+ if stop < feed_loops:
+ feed (ttx, trx)
+ trx.get_seg_async (lambda r: get_seg_cb (r, ttx, trx), seg_nb = ttx.seg)
t1.get_seg_async (lambda r: get_seg_cb (r, t2, t1), seg_nb = t2.seg)
t2.get_seg_async (lambda r: get_seg_cb (r, t1, t2), seg_nb = t1.seg)
bp = 0
-while stop < 4:
+while stop < feed_loops:
bp += 1
wait (bp_tck)
if bp == 1:
@@ -50,6 +52,8 @@ while stop < 4:
t1.set_tonemap (RX, tei = 2, tmi = 6, bits = 6)
t2.set_tonemap (TX, tei = 1, tmi = 6, bits = 6)
+t1.get_seg_stop ()
+t2.get_seg_stop ()
t1.activate (False)
t2.activate (False)