changeset 452:3318f6ec2087

Better test of function. Now makes sure that the output is same class as input
author carandraug
date Thu, 14 Apr 2011 00:11:41 +0000
parents e0fc9967fcf0
children 8ec0b45eb554
files inst/imtophat.m
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/inst/imtophat.m
+++ b/inst/imtophat.m
@@ -70,7 +70,12 @@
 %!test
 %! I = [1 1 1; 1 1 1; 1 1 1;];
 %! se = [1 1; 0 1;];
-%! result = logical(imtophat(I, se));
+%! ## class of input should be the same as the output
+%! result = imtophat(logical(I), logical(se));
 %! expected = 0.5 < [0 0 1; 0 0 1; 1 1 1];
 %! assert(expected, result);
+%! result = imtophat((I), (se));
+%! expected = [0 0 1; 0 0 1; 1 1 1];
+%! assert(expected, result);
 
+