changeset 10006:bfec87972219 octave-forge

im2double: added tests
author carandraug
date Wed, 11 Apr 2012 16:45:41 +0000
parents 0da880b38258
children 502c1b018b95
files main/image/inst/im2double.m
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/main/image/inst/im2double.m	Wed Apr 11 15:22:19 2012 +0000
+++ b/main/image/inst/im2double.m	Wed Apr 11 16:45:41 2012 +0000
@@ -67,3 +67,8 @@
       error ("unsupported image class");
   endswitch
 endfunction
+
+%!assert(im2double([1 2 3]), [1 2 3]);                  # double returns the same
+%!assert(im2double(uint8([0 255])), [0 1]);             # basic usage
+%!assert(im2double(uint8([1 25]), "indexed"), [2 26]);  # test indexed
+%!assert(im2double(int16([-32768 32768])), [0 1]);      # test signed integer