Skip to content

Commit

Permalink
tests: add a test of ilowpass with low gain
Browse files Browse the repository at this point in the history
This test replicates an ilowpass off-by-one error reported by Stuart
Stevenson: https://sourceforge.net/p/emc/mailman/message/35761624/

Signed-off-by: Sebastian Kuzminsky <[email protected]>
  • Loading branch information
SebKuzminsky committed Apr 10, 2017
1 parent 3588a2b commit d7813e8
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/ilowpass/low-gain/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Test that ilowpass's output gets all the way to its target, even with
low gain.
3 changes: 3 additions & 0 deletions tests/ilowpass/low-gain/expected
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
4
0
-5
20 changes: 20 additions & 0 deletions tests/ilowpass/low-gain/test.hal
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
loadrt threads
loadrt ilowpass
addf ilowpass.0 thread1

setp ilowpass.0.scale 1
setp ilowpass.0.gain 0.1

start

setp ilowpass.0.in 4
loadusr -w sleep 1
getp ilowpass.0.out

setp ilowpass.0.in 0
loadusr -w sleep 1
getp ilowpass.0.out

setp ilowpass.0.in -5
loadusr -w sleep 1
getp ilowpass.0.out

0 comments on commit d7813e8

Please sign in to comment.