Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Jonathan Wilkes
purr-data
Commits
b2da9d2b
Commit
b2da9d2b
authored
Jul 05, 2020
by
Jonathan Wilkes
Browse files
add coverage tests, tweak error messages
parent
6ae5bdcf
Pipeline
#2175
passed with stage
in 394 minutes and 30 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
pd/src/m_class.c
View file @
b2da9d2b
...
@@ -71,7 +71,7 @@ char *type_hint(t_symbol *s, int argc, t_atom *argv, int dostof)
...
@@ -71,7 +71,7 @@ char *type_hint(t_symbol *s, int argc, t_atom *argv, int dostof)
one with [symbol( or [symbol] then send to [list trim]. */
one with [symbol( or [symbol] then send to [list trim]. */
if
(
s
==
&
s_
)
if
(
s
==
&
s_
)
{
{
sprintf
(
hint
,
" (Note: empty symbol selector)"
);
sprintf
(
hint
,
" (Note: empty symbol selector
detected
)"
);
return
hint
;
return
hint
;
}
}
...
@@ -81,7 +81,7 @@ char *type_hint(t_symbol *s, int argc, t_atom *argv, int dostof)
...
@@ -81,7 +81,7 @@ char *type_hint(t_symbol *s, int argc, t_atom *argv, int dostof)
if
(
s
&&
s
==
&
s_symbol
&&
argc
&&
argv
->
a_type
==
A_SYMBOL
if
(
s
&&
s
==
&
s_symbol
&&
argc
&&
argv
->
a_type
==
A_SYMBOL
&&
argv
->
a_w
.
w_symbol
==
&
s_
)
&&
argv
->
a_w
.
w_symbol
==
&
s_
)
{
{
sprintf
(
hint
,
" (Note:
empty
symbol message payload detected)"
);
sprintf
(
hint
,
" (Note: symbol message
with empty
payload detected)"
);
return
hint
;
return
hint
;
}
}
...
@@ -122,14 +122,14 @@ char *type_hint(t_symbol *s, int argc, t_atom *argv, int dostof)
...
@@ -122,14 +122,14 @@ char *type_hint(t_symbol *s, int argc, t_atom *argv, int dostof)
if
(
symbol_can_float
(
s
,
&
f
))
if
(
symbol_can_float
(
s
,
&
f
))
{
{
sprintf
(
hint
,
" (Note: %s looks like a float but is actually a "
sprintf
(
hint
,
" (Note: %s looks like a float but is actually a "
"symbol which cannot be saved properly)"
,
s
->
s_name
);
"symbol
atom
which cannot be saved properly)"
,
s
->
s_name
);
return
hint
;
return
hint
;
}
}
else
if
(
f
==
-
1
||
f
==
1
)
else
if
(
f
==
-
1
||
f
==
1
)
{
{
/* For values which would overflow, give a hint but don't
/* For values which would overflow, give a hint but don't
suggest float type */
suggest float type */
sprintf
(
hint
,
" (Note: this symbol
message
has an %s floatlike "
sprintf
(
hint
,
" (Note: this symbol
atom
has an %s floatlike "
"payload which cannot be saved properly."
,
"payload which cannot be saved properly."
,
f
==
1
?
"overflowing"
:
"underflowing"
);
f
==
1
?
"overflowing"
:
"underflowing"
);
return
hint
;
return
hint
;
...
...
scripts/regression_tests.pd
View file @
b2da9d2b
#N canvas
95 38
749 571 12;
#N canvas
14 40
749 571 12;
#X obj 465 281 r \$0-result;
#X obj 465 281 r \$0-result;
#X obj 212 239 bng 31 250 50 0 empty empty Run_all 39 13 0 12 -262144
#X obj 212 239 bng 31 250 50 0 empty empty Run_all 39 13 0 12 -262144
-1 -1;
-1 -1;
...
@@ -53,6 +53,7 @@ is handy for some binbuf tests.;
...
@@ -53,6 +53,7 @@ is handy for some binbuf tests.;
#X obj 198 1701 rtest wrap~_compatibility_bug;
#X obj 198 1701 rtest wrap~_compatibility_bug;
#X obj 198 1756 rtest select_bang;
#X obj 198 1756 rtest select_bang;
#X obj 198 1811 rtest float_symbol_method;
#X obj 198 1811 rtest float_symbol_method;
#X obj 198 1866 rtest type_hint_coverage;
#X connect 0 0 27 0;
#X connect 0 0 27 0;
#X connect 1 0 4 0;
#X connect 1 0 4 0;
#X connect 2 0 42 0;
#X connect 2 0 42 0;
...
@@ -91,3 +92,4 @@ is handy for some binbuf tests.;
...
@@ -91,3 +92,4 @@ is handy for some binbuf tests.;
#X connect 43 0 44 0;
#X connect 43 0 44 0;
#X connect 45 0 46 0;
#X connect 45 0 46 0;
#X connect 46 0 47 0;
#X connect 46 0 47 0;
#X connect 47 0 48 0;
scripts/regression_tests/type_hint_coverage.pd
0 → 100644
View file @
b2da9d2b
#N canvas 2 79 1230 587 12;
#X obj 128 68 inlet;
#X obj 244 127 unpost;
#X text 230 26 trigger as many branches as we can from the patch for
the type hints that come with certain errors. Just looking for crashers
here \, but we can later expand these if we wish.;
#X obj 128 486 list append triggered type hints and nothing crashed.
Hooray!;
#X obj 128 97 trigger bang bang;
#X obj 128 127 f 1;
#X obj 728 288 list trim;
#X msg 696 218 symbol;
#X obj 696 247 t a a;
#X text 755 219 empty symbol message;
#X text 805 289 empty symbol atom as selector;
#X msg 574 218 1;
#X obj 574 247 makefilename %d;
#X text 580 278 symbol message;
#X text 580 298 with "floatlike";
#X text 580 318 symbol atom;
#X text 580 338 payload;
#X obj 424 247 makefilename 1e+%d;
#X msg 424 218 2048;
#X msg 284 218 2048;
#X obj 284 247 makefilename 1e-%d;
#X obj 424 346 t a a;
#X obj 424 385 list trim;
#X obj 283 154 trigger bang bang bang bang;
#X text 283 286 symbol atoms with "floatlike" payload;
#X text 283 306 tht is out of range;
#X obj 128 531 outlet;
#X obj 696 430 trigger anything anything;
#X obj 696 499 int;
#X text 735 471 run through the inlet class \, too;
#X connect 0 0 4 0;
#X connect 1 1 23 0;
#X connect 3 0 26 0;
#X connect 4 0 5 0;
#X connect 4 1 1 0;
#X connect 5 0 3 0;
#X connect 6 0 27 0;
#X connect 7 0 8 0;
#X connect 8 0 27 0;
#X connect 8 1 6 0;
#X connect 11 0 12 0;
#X connect 12 0 27 0;
#X connect 17 0 21 0;
#X connect 18 0 17 0;
#X connect 19 0 20 0;
#X connect 20 0 21 0;
#X connect 21 0 22 0;
#X connect 21 1 27 0;
#X connect 22 0 27 0;
#X connect 23 0 19 0;
#X connect 23 1 18 0;
#X connect 23 2 11 0;
#X connect 23 3 7 0;
#X connect 27 0 28 0;
#X connect 27 1 28 1;
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment