# "channel-test-d-03.prsimrc"
# @haco@ channel-test-d.haco-a
# testing channel sink

# register channels
source channel-test-d-01.prsimrc

watchall
# set up some channels with commands
# channel-log X channel-test-d-03-X.log
channel-watch X
channel-sink X
channel-reset X
getall X

echo manually resetting data
set X.d[0] 0
set X.d[1] 0
cycle
set X.n 1
cycle
assert X.e 0

echo releasing channel X
channel-release X
cycle
assert X.e 1
# because data is neutral, X.e should request new data

echo ------------------------------------
echo setting data rail
set X.d[0] 1
cycle
set X.n 0
cycle
assert X.e 0
channel-show X
backtrace X.e

echo ------------------------------------
echo resetting data rail
set X.d[0] 0
cycle
set X.n 1
cycle
assert X.e 1
channel-show X
backtrace X.e

echo ------------------------------------
echo setting data rail
set X.d[1] 1
cycle
set X.n 0
cycle
assert X.e 0
channel-show X
backtrace X.e

echo ------------------------------------
echo resetting data rail
set X.d[1] 0
cycle
set X.n 1
cycle
assert X.e 1
channel-show X
backtrace X.e

