Mercurial > hg > octave-lyh
changeset 15064:489736962e80
image.m: Don't accept complex image data (bug #36866)
* image.m: Add input test for complex data. Add %!error validation
tests.
author | Rik <rik@octave.org> |
---|---|
date | Tue, 31 Jul 2012 11:11:05 -0700 |
parents | 36cbcc37fdb8 |
children | 6451a584305e |
files | scripts/image/image.m |
diffstat | 1 files changed, 7 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/image/image.m +++ b/scripts/image/image.m @@ -72,6 +72,10 @@ firstnonnumeric = 4; endif + if (iscomplex (img)) + error ("image: data can not be complex"); + endif + oldax = gca (); unwind_protect axes (ax); @@ -241,3 +245,6 @@ %! hold off; %! title ("line, image, line, image, line"); +## Test input validation +%!error <can not be complex> image (1+i) +%!error <matrix is empty> image ([])