Skip to content

Commit

Permalink
near: add a test for correctness
Browse files Browse the repository at this point in the history
  • Loading branch information
jepler committed Oct 25, 2010
1 parent 1b5432c commit f4ae49c
Show file tree
Hide file tree
Showing 4 changed files with 268 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/near.0/README
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
regression test for components: near
122 changes: 122 additions & 0 deletions tests/near.0/expected
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
-12.000000 -12.000000 1 1
-12.000000 -11.000000 1 1
-12.000000 -10.000000 1 0
-12.000000 -2.000000 0 0
-12.000000 -1.000000 0 0
-12.000000 0.000000 0 0
-12.000000 1.000000 0 0
-12.000000 2.000000 0 0
-12.000000 10.000000 0 0
-12.000000 11.000000 0 0
-12.000000 12.000000 0 0
-11.000000 -12.000000 1 1
-11.000000 -11.000000 1 1
-11.000000 -10.000000 1 1
-11.000000 -2.000000 0 0
-11.000000 -1.000000 0 0
-11.000000 0.000000 0 0
-11.000000 1.000000 0 0
-11.000000 2.000000 0 0
-11.000000 10.000000 0 0
-11.000000 11.000000 0 0
-11.000000 12.000000 0 0
-10.000000 -12.000000 1 0
-10.000000 -11.000000 1 1
-10.000000 -10.000000 1 1
-10.000000 -2.000000 0 0
-10.000000 -1.000000 0 0
-10.000000 0.000000 0 0
-10.000000 1.000000 0 0
-10.000000 2.000000 0 0
-10.000000 10.000000 0 0
-10.000000 11.000000 0 0
-10.000000 12.000000 0 0
-2.000000 -12.000000 0 0
-2.000000 -11.000000 0 0
-2.000000 -10.000000 0 0
-2.000000 -2.000000 1 1
-2.000000 -1.000000 0 1
-2.000000 0.000000 0 0
-2.000000 1.000000 0 0
-2.000000 2.000000 0 0
-2.000000 10.000000 0 0
-2.000000 11.000000 0 0
-2.000000 12.000000 0 0
-1.000000 -12.000000 0 0
-1.000000 -11.000000 0 0
-1.000000 -10.000000 0 0
-1.000000 -2.000000 0 1
-1.000000 -1.000000 1 1
-1.000000 0.000000 0 1
-1.000000 1.000000 0 0
-1.000000 2.000000 0 0
-1.000000 10.000000 0 0
-1.000000 11.000000 0 0
-1.000000 12.000000 0 0
0.000000 -12.000000 0 0
0.000000 -11.000000 0 0
0.000000 -10.000000 0 0
0.000000 -2.000000 0 0
0.000000 -1.000000 0 1
0.000000 0.000000 1 1
0.000000 1.000000 0 1
0.000000 2.000000 0 0
0.000000 10.000000 0 0
0.000000 11.000000 0 0
0.000000 12.000000 0 0
1.000000 -12.000000 0 0
1.000000 -11.000000 0 0
1.000000 -10.000000 0 0
1.000000 -2.000000 0 0
1.000000 -1.000000 0 0
1.000000 0.000000 0 1
1.000000 1.000000 1 1
1.000000 2.000000 0 1
1.000000 10.000000 0 0
1.000000 11.000000 0 0
1.000000 12.000000 0 0
2.000000 -12.000000 0 0
2.000000 -11.000000 0 0
2.000000 -10.000000 0 0
2.000000 -2.000000 0 0
2.000000 -1.000000 0 0
2.000000 0.000000 0 0
2.000000 1.000000 0 1
2.000000 2.000000 1 1
2.000000 10.000000 0 0
2.000000 11.000000 0 0
2.000000 12.000000 0 0
10.000000 -12.000000 0 0
10.000000 -11.000000 0 0
10.000000 -10.000000 0 0
10.000000 -2.000000 0 0
10.000000 -1.000000 0 0
10.000000 0.000000 0 0
10.000000 1.000000 0 0
10.000000 2.000000 0 0
10.000000 10.000000 1 1
10.000000 11.000000 1 1
10.000000 12.000000 1 0
11.000000 -12.000000 0 0
11.000000 -11.000000 0 0
11.000000 -10.000000 0 0
11.000000 -2.000000 0 0
11.000000 -1.000000 0 0
11.000000 0.000000 0 0
11.000000 1.000000 0 0
11.000000 2.000000 0 0
11.000000 10.000000 1 1
11.000000 11.000000 1 1
11.000000 12.000000 1 1
12.000000 -12.000000 0 0
12.000000 -11.000000 0 0
12.000000 -10.000000 0 0
12.000000 -2.000000 0 0
12.000000 -1.000000 0 0
12.000000 0.000000 0 0
12.000000 1.000000 0 0
12.000000 2.000000 0 0
12.000000 10.000000 1 0
12.000000 11.000000 1 1
12.000000 12.000000 1 1
12.000000 12.000000 1 1
124 changes: 124 additions & 0 deletions tests/near.0/runstreamer
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
#!/bin/sh
halstreamer << EOF
-12 -12
-12 -11
-12 -10
-12 -2
-12 -1
-12 0
-12 1
-12 2
-12 10
-12 11
-12 12
-11 -12
-11 -11
-11 -10
-11 -2
-11 -1
-11 0
-11 1
-11 2
-11 10
-11 11
-11 12
-10 -12
-10 -11
-10 -10
-10 -2
-10 -1
-10 0
-10 1
-10 2
-10 10
-10 11
-10 12
-2 -12
-2 -11
-2 -10
-2 -2
-2 -1
-2 0
-2 1
-2 2
-2 10
-2 11
-2 12
-1 -12
-1 -11
-1 -10
-1 -2
-1 -1
-1 0
-1 1
-1 2
-1 10
-1 11
-1 12
0 -12
0 -11
0 -10
0 -2
0 -1
0 0
0 1
0 2
0 10
0 11
0 12
1 -12
1 -11
1 -10
1 -2
1 -1
1 0
1 1
1 2
1 10
1 11
1 12
2 -12
2 -11
2 -10
2 -2
2 -1
2 0
2 1
2 2
2 10
2 11
2 12
10 -12
10 -11
10 -10
10 -2
10 -1
10 0
10 1
10 2
10 10
10 11
10 12
11 -12
11 -11
11 -10
11 -2
11 -1
11 0
11 1
11 2
11 10
11 11
11 12
12 -12
12 -11
12 -10
12 -2
12 -1
12 0
12 1
12 2
12 10
12 11
12 12
EOF
21 changes: 21 additions & 0 deletions tests/near.0/test.hal
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
loadrt threads name1=fast period1=100000
loadrt near count=2
setp near.0.scale 1.5
setp near.1.difference 1.5

loadrt sampler depth=1000 cfg=ffbb
loadrt streamer depth=256 cfg=ff

net in1 streamer.0.pin.0 => near.0.in1 near.1.in1 sampler.0.pin.0
net in2 streamer.0.pin.1 => near.0.in2 near.1.in2 sampler.0.pin.1
net outa near.0.out => sampler.0.pin.2
net outb near.1.out => sampler.0.pin.3

addf streamer.0 fast
addf near.0 fast
addf near.1 fast
addf sampler.0 fast

loadusr -w sh runstreamer
start
loadusr -w halsampler -n 122

0 comments on commit f4ae49c

Please sign in to comment.