Skip to content

Commit

Permalink
Require ccNcompt return type to be >= long.
Browse files Browse the repository at this point in the history
Add 2 tests to check for this for byte image inputs.
  • Loading branch information
d-lamb committed Mar 16, 2016
1 parent c560ccd commit 8e01c4c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Lib/Image2D/image2d.pd
Expand Up @@ -1156,7 +1156,7 @@ where the second parameter specifies the connectivity (4 or 8) of the labeling.

',
HandleBad => 0, # a marker
Pars => 'a(m,n); [o]b(m,n);',
Pars => 'a(m,n); int+ [o]b(m,n);',
OtherPars => 'int con',
Code => '

Expand Down
6 changes: 5 additions & 1 deletion t/image2d.t
Expand Up @@ -3,7 +3,7 @@

use Test;
BEGIN {
plan tests => 26;
plan tests => 28;
}

use PDL;
Expand Down Expand Up @@ -146,6 +146,10 @@ eval 'ccNcompt($a,5)';
ok($@ ne '');
eval 'ccNcompt($a,8)';
ok($@ eq '');
my $im = (xvals(25,25)+yvals(25,25));
my $seg_b = cc4compt(byte $im%2);
ok($seg_b->type >= long);
ok(cc4compt($im%2)->max == $seg_b->max);

# pnpoly
my $px = pdl(0,3,1);
Expand Down

0 comments on commit 8e01c4c

Please sign in to comment.