Commit cdf8d443 authored by Jonathan Wilkes's avatar Jonathan Wilkes
Browse files

first draft of automated method testing

This can eventually be used with [pd~] so we can get a clean environment
for each library (including the core objects). There's already an "offset"
inlet to accommodate offsetting past the core objects in the method table.
parent cd9cd9cb
#N canvas 68 89 695 590 12;
#X obj 165 196 classinfo objectmaker;
#X obj 165 221 route bang;
#X obj 165 95 until;
#X obj 165 129 f;
#X obj 202 129 + 1;
#X obj 55 138 t a;
#X obj 165 165 +;
#X obj 337 40 inlet;
#X msg 211 95 0;
#X obj 165 57 t b b;
#N canvas 159 207 450 392 build_msg 0;
#X obj 14 14 inlet;
#X obj 14 93 list split 1;
#N canvas 461 242 450 300 list-drip 0;
#X obj 91 151 f;
#X obj 138 151 + 1;
#X obj 91 115 until;
#X obj 91 218 list;
#X msg 91 255 \$1;
#X msg 138 217 set \, adddollar \$1;
#X msg 137 115 0;
#X obj 91 65 list length;
#X obj 91 40 t a a a;
#X obj 138 176 t b a;
#X obj 91 5 inlet;
#X obj 91 281 list;
#X obj 91 307 outlet;
#X connect 0 0 1 0;
#X connect 1 0 0 1;
#X connect 1 0 9 0;
#X connect 2 0 0 0;
#X connect 3 0 4 0;
#X connect 4 0 11 0;
#X connect 5 0 4 0;
#X connect 6 0 0 1;
#X connect 7 0 2 0;
#X connect 8 0 7 0;
#X connect 8 1 3 1;
#X connect 8 2 6 0;
#X connect 9 0 3 0;
#X connect 9 1 5 0;
#X connect 10 0 8 0;
#X connect 11 0 12 0;
#X restore 65 118 pd list-drip;
#X obj 65 289 list;
#X obj 65 315 t a;
#X msg 65 193 42;
#X msg 203 193 \$0-dummy-array;
#X obj 14 40 trigger anything bang;
#X obj 14 390 list;
#X obj 14 415 outlet;
#X obj 65 147 select A_FLOAT A_DEFFLOAT A_SYMBOL A_DEFSYM A_GIMME;
#X obj 158 71 s \$0-reset;
#X obj 82 357 r \$0-reset;
#X obj 138 259 r \$0-reset;
#X connect 0 0 7 0;
#X connect 1 0 8 0;
#X connect 1 1 2 0;
#X connect 2 0 10 0;
#X connect 3 0 4 0;
#X connect 4 0 3 1;
#X connect 4 0 8 1;
#X connect 5 0 3 0;
#X connect 6 0 3 0;
#X connect 7 0 1 0;
#X connect 7 1 11 0;
#X connect 8 0 9 0;
#X connect 10 0 5 0;
#X connect 10 2 6 0;
#X connect 12 0 8 1;
#X connect 13 0 3 1;
#X restore 232 249 pd build_msg;
#N canvas 521 211 450 346 \$0-sandbox 0;
#X restore 507 346 pd \$0-sandbox;
#X text 387 39 \$1 offset;
#X text 387 62 $n classes to exclude from test;
#X obj 337 100 list split 1;
#N canvas 428 151 527 373 remove_troublemakers 0;
#X obj 43 30 inlet;
#X obj 271 342 outlet;
#X obj 43 56 trigger anything anything;
#X obj 271 286 b;
#X obj 271 311 list;
#X text 72 85 Filter some objects which can cause trouble:;
#X text 72 145 until - can cause an infinite loop;
#X text 72 115 template - binds a symbol that's the same as subpatch
symbol;
#X text 72 175 preset_node - can't connect to [s] since it has no outlet
;
#X obj 43 254 select template until preset_node;
#X text 72 205 canvas - unfortunately [objectinfo] can't tell inlet~
from inlet (we handle this in introspect-and-set-io subpatch);
#X connect 0 0 2 0;
#X connect 2 0 9 0;
#X connect 2 1 4 1;
#X connect 3 0 4 0;
#X connect 4 0 1 0;
#X connect 9 3 3 0;
#X restore 232 315 pd remove_troublemakers;
#N canvas 734 165 541 241 set-introspection 0;
#X obj 41 29 inlet;
#X obj 41 183 outlet;
#X msg 73 85 obj 200 0 r \$0-introspection \, msg 200 30 find \$1 \,
obj 200 60 canvasinfo \, obj 200 90 s \$0-introspection-result \, connect
1 0 2 0 \, connect 2 0 3 0 \, connect 3 0 4 0;
#X obj 41 54 t a a;
#X obj 73 142 s pd-\$0-sandbox;
#X connect 0 0 3 0;
#X connect 2 0 4 0;
#X connect 3 0 1 0;
#X connect 3 1 2 0;
#X restore 232 390 pd set-introspection;
#N canvas 0 0 450 300 clear_sandbox 0;
#X obj 54 26 inlet;
#X obj 54 51 t a b;
#X obj 54 176 outlet;
#X msg 86 80 clear;
#X obj 86 105 s pd-\$0-sandbox;
#X connect 0 0 1 0;
#X connect 1 0 2 0;
#X connect 1 1 3 0;
#X connect 3 0 4 0;
#X restore 232 340 pd clear_sandbox;
#N canvas 0 0 450 300 instantiate_object 0;
#X obj 12 12 inlet;
#X obj 12 37 t a a;
#X obj 44 92 list trim;
#X obj 44 121 send pd-\$0-sandbox;
#X obj 44 66 list prepend obj 20 60;
#X obj 12 152 outlet;
#X connect 0 0 1 0;
#X connect 1 0 5 0;
#X connect 1 1 4 0;
#X connect 2 0 3 0;
#X connect 4 0 2 0;
#X restore 232 365 pd instantiate_object;
#N canvas 573 194 450 323 introspect-and-set-io 0;
#X obj 62 24 inlet;
#X obj 62 49 t a b;
#X obj 94 79 s \$0-introspection;
#X obj 94 111 r \$0-introspection-result;
#N canvas 352 138 529 506 create-in-and-out 0;
#X obj 68 20 inlet;
#X obj 86 228 objectinfo;
#X obj 191 228 objectinfo;
#X msg 191 202 inlets;
#X msg 86 202 outlets;
#X obj 86 254 moses 1;
#X obj 191 254 moses 1;
#X obj 237 278 b;
#X obj 132 278 b;
#X obj 132 408 outlet;
#X msg 237 313 obj 20 30 r \$0-in \, connect 5 0 0 0;
#X obj 68 45 list split 1;
#X obj 68 142 t a b b a a;
#X obj 68 408 outlet;
#N canvas 544 60 450 579 filter_classes_with_dsp_method 0;
#X obj 66 19 inlet;
#X msg 89 109 class;
#X obj 89 134 objectinfo;
#X obj 66 74 t a b a;
#X obj 89 209 until;
#X obj 89 159 t b b a;
#X obj 137 210 f 0;
#X obj 89 244 f;
#X obj 156 370 select dsp;
#X obj 156 395 t b b;
#X obj 89 315 route bang;
#X obj 11 210 t a;
#X obj 66 449 spigot;
#X msg 156 421 0;
#X obj 89 340 t b b;
#X msg 89 365 1;
#X obj 66 474 outlet;
#X obj 156 341 list split 1;
#X obj 89 290 classinfo;
#X msg 89 184 100;
#X obj 129 244 + 1;
#X obj 202 236 t b b;
#X obj 202 261 print error: can't find class;
#N canvas 839 108 450 323 exclude_canvas 0;
#X obj 66 40 t a b a;
#X msg 89 67 class;
#X obj 89 92 objectinfo;
#X obj 66 13 inlet;
#X obj 66 212 spigot;
#X obj 89 117 select canvas;
#X msg 89 142 0;
#X obj 177 142 b;
#X msg 177 167 1;
#X obj 66 237 outlet;
#X connect 0 0 4 0;
#X connect 0 1 1 0;
#X connect 0 2 2 1;
#X connect 1 0 2 0;
#X connect 2 0 5 0;
#X connect 3 0 0 0;
#X connect 4 0 9 0;
#X connect 5 0 6 0;
#X connect 5 1 7 0;
#X connect 6 0 4 1;
#X connect 7 0 8 0;
#X connect 8 0 4 1;
#X restore 66 44 pd exclude_canvas;
#X connect 0 0 23 0;
#X connect 1 0 2 0;
#X connect 2 0 5 0;
#X connect 3 0 12 0;
#X connect 3 1 1 0;
#X connect 3 2 2 1;
#X connect 4 0 7 0;
#X connect 5 0 19 0;
#X connect 5 1 6 0;
#X connect 5 2 18 1;
#X connect 6 0 7 1;
#X connect 7 0 18 0;
#X connect 7 0 20 0;
#X connect 8 0 9 0;
#X connect 9 0 13 0;
#X connect 9 1 4 1;
#X connect 10 0 14 0;
#X connect 10 1 17 0;
#X connect 11 0 4 1;
#X connect 12 0 16 0;
#X connect 13 0 12 1;
#X connect 14 0 15 0;
#X connect 14 1 11 0;
#X connect 15 0 12 1;
#X connect 17 0 8 0;
#X connect 18 0 10 0;
#X connect 18 1 21 0;
#X connect 19 0 4 0;
#X connect 20 0 7 1;
#X connect 21 0 22 0;
#X connect 21 1 4 1;
#X connect 23 0 3 0;
#X restore 68 98 pd filter_classes_with_dsp_method;
#X obj 132 345 f;
#X obj 202 312 6;
#X obj 191 279 b;
#X obj 150 313 5;
#X msg 132 383 obj 20 90 s \$0-out \, connect 0 0 \$1 0;
#X connect 0 0 11 0;
#X connect 1 0 5 0;
#X connect 2 0 6 0;
#X connect 3 0 2 0;
#X connect 4 0 1 0;
#X connect 5 1 8 0;
#X connect 6 0 17 0;
#X connect 6 1 7 0;
#X connect 7 0 10 0;
#X connect 7 0 16 0;
#X connect 8 0 15 0;
#X connect 10 0 9 0;
#X connect 11 0 14 0;
#X connect 12 0 13 0;
#X connect 12 1 4 0;
#X connect 12 2 3 0;
#X connect 12 3 1 1;
#X connect 12 4 2 1;
#X connect 14 0 12 0;
#X connect 15 0 19 0;
#X connect 16 0 15 1;
#X connect 17 0 18 0;
#X connect 18 0 15 1;
#X connect 19 0 9 0;
#X restore 94 140 pd create-in-and-out;
#X obj 231 175 s pd-\$0-sandbox;
#X obj 62 223 list prepend;
#X obj 62 248 outlet;
#X connect 0 0 1 0;
#X connect 1 0 6 0;
#X connect 1 1 2 0;
#X connect 3 0 4 0;
#X connect 4 0 6 1;
#X connect 4 1 5 0;
#X connect 6 0 7 0;
#X restore 232 415 pd introspect-and-set-io;
#X text 243 282 <- creator args...;
#X text 249 444 <- now we've got (pointer-to-test-object) creator args...
;
#N canvas 842 135 450 587 test_the_object_methods 0;
#X obj 37 24 inlet;
#X obj 37 84 t b a;
#X msg 37 109 class;
#X obj 37 134 objectinfo;
#X msg 37 184 1000;
#X obj 37 209 until;
#X obj 37 159 t b b a;
#X obj 87 209 f 0;
#X obj 37 244 f;
#X obj 67 244 + 1;
#X obj 37 269 classinfo;
#N canvas 613 79 488 478 build_msg 0;
#X obj 42 22 inlet;
#X obj 42 101 list split 1;
#N canvas 461 242 450 300 list-drip 0;
#X obj 91 151 f;
#X obj 138 151 + 1;
#X obj 91 115 until;
#X obj 91 218 list;
#X msg 91 255 \$1;
#X msg 138 217 set \, adddollar \$1;
#X msg 137 115 0;
#X obj 91 65 list length;
#X obj 91 40 t a a a;
#X obj 138 176 t b a;
#X obj 91 5 inlet;
#X obj 91 281 list;
#X obj 91 307 outlet;
#X connect 0 0 1 0;
#X connect 1 0 0 1;
#X connect 1 0 9 0;
#X connect 2 0 0 0;
#X connect 3 0 4 0;
#X connect 4 0 11 0;
#X connect 5 0 4 0;
#X connect 6 0 0 1;
#X connect 7 0 2 0;
#X connect 8 0 7 0;
#X connect 8 1 3 1;
#X connect 8 2 6 0;
#X connect 9 0 3 0;
#X connect 9 1 5 0;
#X connect 10 0 8 0;
#X connect 11 0 12 0;
#X restore 93 126 pd list-drip;
#X obj 93 297 list;
#X obj 93 323 t a;
#X msg 93 201 42;
#X msg 231 201 \$0-dummy-array;
#X obj 42 48 trigger anything bang;
#X obj 42 398 list;
#X obj 42 423 outlet;
#X obj 93 155 select A_FLOAT A_DEFFLOAT A_SYMBOL A_DEFSYM A_GIMME;
#X obj 186 79 s \$0-reset;
#X obj 110 365 r \$0-reset;
#X obj 166 267 r \$0-reset;
#X connect 0 0 7 0;
#X connect 1 0 8 0;
#X connect 1 1 2 0;
#X connect 2 0 10 0;
#X connect 3 0 4 0;
#X connect 4 0 3 1;
#X connect 4 0 8 1;
#X connect 5 0 3 0;
#X connect 6 0 3 0;
#X connect 7 0 1 0;
#X connect 7 1 11 0;
#X connect 8 0 9 0;
#X connect 10 0 5 0;
#X connect 10 2 6 0;
#X connect 12 0 8 1;
#X connect 13 0 3 1;
#X restore 37 294 pd build_msg;
#X obj 37 57 list split 1;
#X obj 149 404 list;
#X obj 37 319 t a a;
#X obj 69 351 list split 1;
#X obj 149 454 print;
#X msg 149 429 \$2 \$1;
#X obj 37 456 s \$0-in;
#X obj 149 481 r \$0-out;
#X obj 149 506 print output;
#X obj 37 412 list trim;
#X connect 0 0 12 0;
#X connect 1 0 2 0;
#X connect 1 1 3 1;
#X connect 2 0 3 0;
#X connect 3 0 6 0;
#X connect 4 0 5 0;
#X connect 5 0 8 0;
#X connect 6 0 4 0;
#X connect 6 1 7 0;
#X connect 6 2 10 1;
#X connect 7 0 8 1;
#X connect 8 0 9 0;
#X connect 8 0 10 0;
#X connect 9 0 8 1;
#X connect 10 0 11 0;
#X connect 11 0 14 0;
#X connect 12 0 1 0;
#X connect 12 1 13 1;
#X connect 13 0 17 0;
#X connect 14 0 21 0;
#X connect 14 1 15 0;
#X connect 15 0 13 0;
#X connect 17 0 16 0;
#X connect 19 0 20 0;
#X connect 21 0 18 0;
#X restore 232 470 pd test_the_object_methods;
#X obj 183 12 bng 36 250 50 0 empty empty empty 17 7 0 10 -262144 -1
-1;
#X obj 67 10 r with_nogui;
#X msg 426 194 symbol clip;
#X connect 0 0 1 0;
#X connect 1 0 5 0;
#X connect 1 1 10 0;
#X connect 2 0 3 0;
#X connect 3 0 4 0;
#X connect 3 0 6 0;
#X connect 4 0 3 1;
#X connect 5 0 2 1;
#X connect 6 0 0 0;
#X connect 7 0 14 0;
#X connect 8 0 3 1;
#X connect 9 0 2 0;
#X connect 9 1 8 0;
#X connect 10 0 15 0;
#X connect 14 0 6 1;
#X connect 15 0 17 0;
#X connect 16 0 19 0;
#X connect 17 0 18 0;
#X connect 18 0 16 0;
#X connect 19 0 22 0;
#X connect 23 0 9 0;
#X connect 24 0 9 0;
#X connect 25 0 10 0;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment