[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: missing tests
From: |
Carnë Draug |
Subject: |
Re: missing tests |
Date: |
Thu, 16 Jan 2014 11:46:47 +0000 |
On 16 January 2014 03:31, mike sander <address@hidden> wrote:
> i chose a function from http://wiki.octave.org/FilesMissingTests:
> miscellaneous/cast.m
>
> the following is what i have so far. Looking for some feedback before i
> continue. Do the tests look sensible? Is there a class of testing related
> to cast to int8 (& other types) that i am missing? I have tried to follow
> formatting/style from other tests.
>
> Thanks in advance for any comments/suggestions.
>
> [...]
The tests look good to me, and quite extensive. I would add some to
matrices as well, not only scalars. Example:
%!test
%! a = b = randi ([-1000 1000], 10, 15, 14, 78);
%! b(b>255) = 255;
%! b(b<0) = 0;
%! assert (cast (a, "uint8"), uint8 (b));
Similarly, you could test that scalars works fine with one example,
and then all the other possibilities (complex numbers, above and below
the range, etc) in a matrix with a single test.
Carnë