Mercurial > hg > octave-lojdl
changeset 13276:d5c8c2fe2eed
speed.m: Further fixes for 2 speed tests (Bug #34234)
* speed.m: Check only that size of T_f2 is in range 10-15. It need
not match size of n or T_f1.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Wed, 05 Oct 2011 08:52:35 -0700 |
parents | 635db52feab4 |
children | 9f2e568123ea |
files | scripts/testfun/speed.m |
diffstat | 1 files changed, 6 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/testfun/speed.m +++ b/scripts/testfun/speed.m @@ -156,7 +156,7 @@ endif if (nargin < 2 || isempty (__init)) - __init = "x = randn(n, 1);"; + __init = "x = randn (n, 1);"; endif if (nargin < 3 || isempty (__max_n)) @@ -396,25 +396,22 @@ %! assert (fieldnames (order), {"p"; "a"}); %! assert (isnumeric (n)); %! assert (length (n) > 10); -%! n_sz = size (n); %! assert (isnumeric (T_f1)); -%! assert (size (T_f1), n_sz); +%! assert (size (T_f1), size (n)); %! assert (isnumeric (T_f2)); -%! assert (size (T_f2), n_sz); +%! assert (length (T_f2) > 10); %!test -%! [order, n, T_f1, T_f2] = speed ("sum (x)", "", [100, 1000], "v = 0; for i = 1:length (x), v += x(i); end"); +%! [order, n, T_f1, T_f2] = speed ("sum (x)", "", [100, 1000], "v = 0; for i = 1:length (x), v += x(i); endfor"); %! assert (isstruct (order)); %! assert (size (order), [1, 1]); %! assert (fieldnames (order), {"p"; "a"}); %! assert (isnumeric (n)); %! assert (length (n) > 10); -%! n_sz = size (n); -%! assert (size (n), [1, 15]); %! assert (isnumeric (T_f1)); -%! assert (size (T_f1), n_sz); +%! assert (size (T_f1), size (n)); %! assert (isnumeric (T_f2)); -%! assert (size (T_f2), n_sz); +%! assert (length (T_f2) > 10); %% Test input validation %!error speed ();