#N canvas 577 122 585 499 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 318 184 905 641 get 0;
#X obj 105 488 outlet;
#X obj 105 26 inlet reset;
#X obj 105 71 t b b b;
#X obj 162 229 spigot;
#X msg 228 229 1;
#X msg 258 229 0;
#X obj 202 229 t f;
#X obj 163 120 s \$0-send;
#X text 248 120 <- start the test;
#X text 250 168 <- test result;
#X obj 162 165 r \$0-receive;
#X obj 105 342 spigot;
#X obj 228 212 t b b;
#X msg 129 45 bang;
#X obj 162 260 select -1;
#X obj 105 401 t f b;
#X msg 162 278 0;
#X msg 105 316 0;
#X text 136 321 <--------------- fail as default;
#X text 228 262 <- "-1" indicates "wait for result";
#X obj 105 430 t b f;
#X obj 105 446 del 0;
#X obj 105 462 f;
#X text 149 450 <--- buffering \, since we have to avoid that the object
triggers it's own destruction (stack corruption);
#X connect 1 0 2 0;
#X connect 2 0 17 0;
#X connect 2 1 7 0;
#X connect 2 2 12 0;
#X connect 3 0 14 0;
#X connect 4 0 6 0;
#X connect 5 0 6 0;
#X connect 6 0 3 1;
#X connect 6 0 11 1;
#X connect 10 0 3 0;
#X connect 11 0 15 0;
#X connect 12 0 4 0;
#X connect 13 0 2 0;
#X connect 14 0 16 0;
#X connect 14 1 15 0;
#X connect 15 0 20 0;
#X connect 15 1 5 0;
#X connect 16 0 11 1;
#X connect 17 0 11 0;
#X connect 20 0 21 0;
#X connect 20 1 22 1;
#X connect 21 0 22 0;
#X connect 22 0 0 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 obj 148 228 s pd-\$0-regressiontest;
#X obj 148 94 t s;
#X msg 148 165 obj 100 100 \$1 \$2;
#X connect 0 0 7 0;
#X connect 1 0 4 0;
#X connect 2 0 5 0;
#X connect 3 0 6 0;
#X connect 4 0 3 0;
#X connect 5 0 8 0;
#X connect 5 1 3 0;
#X connect 7 0 2 0;
#X connect 8 0 6 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 218 pd run-test;
#X obj 94 243 outlet;
#X obj 94 191 inlet;
#N canvas 487 407 450 300 \$0-regressiontest 0;
#X restore 92 266 pd \$0-regressiontest;
#X text 64 17 the test MUST IMMEDIATELY return a result!;
#X text 87 39 1: OK (test passed);
#X text 87 52 0: KO (test failed);
#X text 81 68 -1:;
#X text 103 68 WAIT (test takes some time);
#X text 64 92 if no result is returned immediately \, the test is considered
to be FAILED!;
#X text 63 131 note: we could have this be using "0" as the WAIT result
\, an no-result as KO \; for legacy reasons we don't;
#X connect 0 0 1 0;
#X connect 2 0 0 0;
