aboutsummaryrefslogtreecommitdiff
path: root/tests/testunit.pd
blob: a9f35bbbb236f13cc46e24dd5caaa4d8feb11770 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#N canvas 850 122 312 252 10;
#N canvas 455 165 474 559 run-test 0;
#X obj 71 136 symbol;
#X obj 71 104 inlet test-to-run;
#X obj 71 514 outlet result;
#X obj 71 440 pack 0 s;
#X msg 113 136 bang;
#N canvas 395 348 450 300 print 0;
#X obj 101 247 print regression-test;
#X obj 101 204 pack s s;
#X obj 101 117 select 1;
#X obj 152 137 b;
#X msg 152 160 failed;
#X msg 101 138 OK;
#X obj 101 185 symbol;
#X msg 101 223 \$2: \$1;
#X obj 101 52 inlet result;
#X obj 101 89 unpack 0 s;
#X connect 1 0 7 0;
#X connect 2 0 5 0;
#X connect 2 1 3 0;
#X connect 3 0 4 0;
#X connect 4 0 6 0;
#X connect 5 0 6 0;
#X connect 6 0 1 0;
#X connect 7 0 0 0;
#X connect 8 0 9 0;
#X connect 9 0 2 0;
#X connect 9 1 1 1;
#X restore 96 491 pd print result;
#X obj 71 252 t f b;
#X obj 71 164 t b s s;
#X text 99 217 start regression test;
#X text 105 251 regression test finished;
#N canvas 649 180 525 641 get 0;
#X obj 106 116 r \$0-receive;
#X msg 155 280 0;
#X obj 106 239 del 0;
#X obj 106 310 f;
#X text 193 114 get the result;
#X text 145 235 we need a delay \, since the object's output triggers
the destruction of the object \; this would lead to stack corruption
if we do it immediately;
#X obj 131 358 outlet;
#X obj 123 26 inlet reset;
#X obj 106 336 t b f;
#X obj 106 175 spigot;
#X msg 161 154 1;
#X obj 106 197 t b f b;
#X msg 189 154 0;
#X obj 137 154 t f;
#X text 182 178 we only accept the 1st result of the test;
#X obj 123 48 t b b b;
#X obj 123 66 s \$0-send;
#X connect 0 0 9 0;
#X connect 1 0 3 1;
#X connect 2 0 3 0;
#X connect 3 0 8 0;
#X connect 7 0 15 0;
#X connect 8 0 10 0;
#X connect 8 1 6 0;
#X connect 9 0 11 0;
#X connect 10 0 13 0;
#X connect 11 0 2 0;
#X connect 11 1 3 1;
#X connect 11 2 12 0;
#X connect 12 0 13 0;
#X connect 13 0 9 1;
#X connect 15 0 16 0;
#X connect 15 1 1 0;
#X connect 15 2 10 0;
#X restore 71 232 pd get result;
#X text 64 17 the test MUST return a result!;
#X text 77 64 cons: the regression test suite will block until the
test returns a result (potentially infinitely long)!;
#X text 77 33 pros: the test need not be finished in zero-time (good
for testing signal-objects or timed objects);
#X obj 71 470 t l l;
#X obj 71 214 t b;
#N canvas 0 0 625 330 create/destroy 0;
#X obj 148 53 inlet;
#X obj 449 48 inlet clear;
#X obj 148 129 pack s \$0;
#X msg 173 196 clear;
#X obj 449 76 t b;
#X obj 148 148 t l b;
#X msg 148 165 obj 100 100 r \$2-send \, obj 100 150 \$1 \, obj 100
200 s \$2-receive \, connect 0 0 1 0 \, connect 1 0 2 0;
#X obj 148 228 s pd-\$0-regressiontest;
#X obj 148 94 t s;
#X connect 0 0 8 0;
#X connect 1 0 4 0;
#X connect 2 0 5 0;
#X connect 3 0 7 0;
#X connect 4 0 3 0;
#X connect 5 0 6 0;
#X connect 5 1 3 0;
#X connect 6 0 7 0;
#X connect 8 0 2 0;
#X restore 89 326 pd create/destroy testpatch;
#X connect 0 0 7 0;
#X connect 1 0 0 0;
#X connect 3 0 14 0;
#X connect 4 0 0 0;
#X connect 6 0 3 0;
#X connect 6 1 16 1;
#X connect 7 0 15 0;
#X connect 7 1 16 0;
#X connect 7 2 3 1;
#X connect 10 0 6 0;
#X connect 14 0 2 0;
#X connect 14 1 5 0;
#X connect 15 0 10 0;
#X restore 94 138 pd run-test;
#X obj 94 163 outlet;
#X obj 94 111 inlet;
#N canvas 487 407 450 300 \$0-regressiontest 0;
#X restore 92 186 pd \$0-regressiontest;
#X connect 0 0 1 0;
#X connect 2 0 0 0;