Mercurial > hg > octave-nkf
changeset 16213:b1283d4c06c2
test: Use Octave coding standards for scripts in test/ directory.
* test/bug-36025/@testclass/one.m, test/bug-36025/@testclass/testclass.m,
test/bug-36025/@testclass/two.m, test/build-bc-overload-tests.sh,
test/build-sparse-tests.sh, test/build_bc_overloads_expected.m,
test/classes/@Blork/Blork.m, test/classes/@Blork/bleek.m,
test/classes/@Blork/display.m, test/classes/@Blork/get.m,
test/classes/@Blork/set.m,
test/classes/@CPrecedenceTester1/CPrecedenceTester1.m,
test/classes/@CPrecedenceTester1/tattack.m,
test/classes/@CPrecedenceTester2/CPrecedenceTester2.m,
test/classes/@CPrecedenceTester2/tattack.m,
test/classes/@CPrecedenceTester3/CPrecedenceTester3.m,
test/classes/@CPrecedenceTester3/tattack.m, test/classes/@Cork/Cork.m,
test/classes/@Cork/click.m, test/classes/@Cork/display.m,
test/classes/@Cork/get.m, test/classes/@Cork/set.m, test/classes/@Dork/Dork.m,
test/classes/@Dork/bling.m, test/classes/@Dork/display.m,
test/classes/@Dork/gack.m, test/classes/@Dork/get.m,
test/classes/@Dork/getStash.m, test/classes/@Dork/private/myStash.m,
test/classes/@Dork/set.m, test/classes/@Gork/Gork.m, test/classes/@Gork/cork.m,
test/classes/@Gork/display.m, test/classes/@Gork/gark.m,
test/classes/@Gork/get.m, test/classes/@Gork/set.m,
test/classes/@Gork/subsasgn.m, test/classes/@Gork/subsref.m,
test/classes/@Pork/Pork.m, test/classes/@Pork/bling.m,
test/classes/@Pork/display.m, test/classes/@Pork/get.m,
test/classes/@Pork/gurk.m, test/classes/@Pork/private/myStash.m,
test/classes/@Pork/set.m, test/classes/@Sneetch/Sneetch.m,
test/classes/@Sneetch/display.m, test/classes/@Snork/Snork.m,
test/classes/@Snork/cack.m, test/classes/@Snork/display.m,
test/classes/@Snork/double.m, test/classes/@Snork/end.m,
test/classes/@Snork/eq.m, test/classes/@Snork/ge.m, test/classes/@Snork/get.m,
test/classes/@Snork/getStash.m, test/classes/@Snork/gick.m,
test/classes/@Snork/gt.m, test/classes/@Snork/horzcat.m,
test/classes/@Snork/ldivide.m, test/classes/@Snork/le.m,
test/classes/@Snork/loadobj.m, test/classes/@Snork/lt.m,
test/classes/@Snork/minus.m, test/classes/@Snork/mldivide.m,
test/classes/@Snork/mpower.m, test/classes/@Snork/mrdivide.m,
test/classes/@Snork/mtimes.m, test/classes/@Snork/ne.m,
test/classes/@Snork/plus.m, test/classes/@Snork/power.m,
test/classes/@Snork/private/myStash.m, test/classes/@Snork/rdivide.m,
test/classes/@Snork/saveobj.m, test/classes/@Snork/set.m,
test/classes/@Snork/subsasgn.m, test/classes/@Snork/subsindex.m,
test/classes/@Snork/subsref.m, test/classes/@Snork/tattack.m,
test/classes/@Snork/times.m, test/classes/@Snork/uminus.m,
test/classes/@Snork/uplus.m, test/classes/@Snork/vertcat.m,
test/classes/@Spork/Spork.m, test/classes/@Spork/cack.m,
test/classes/@Spork/display.m, test/classes/@Spork/geek.m,
test/classes/@Spork/get.m, test/classes/@Spork/getStash.m,
test/classes/@Spork/loadobj.m, test/classes/@Spork/private/myStash.m,
test/classes/@Spork/saveobj.m, test/classes/@Spork/set.m,
test/classes/classes.tst, test/ctor-vs-method/__trace__.m, test/error.tst,
test/eval-catch.tst,
test/fcn-handle-derived-resolution/@other/getsize_arrayfun.m, test/for.tst,
test/func.tst, test/global.tst, test/index.tst, test/io.tst, test/prefer.tst,
test/range.tst, test/recursion.tst, test/return.tst, test/slice.tst,
test/struct.tst, test/system.tst: Use Octave codings standards for scripts.
line wrap: on
line diff
--- a/test/bug-36025/@testclass/one.m +++ b/test/bug-36025/@testclass/one.m @@ -1,4 +1,5 @@ % function ONE return item "X" -function a=one(m) - a=m.x; +function a = one (m) + a = m.x; +endfunction
--- a/test/bug-36025/@testclass/testclass.m +++ b/test/bug-36025/@testclass/testclass.m @@ -1,3 +1,4 @@ -function m=testclass(x,y) -m=struct('x',x,'y',y); -m=class(m,"testclass"); +function m = testclass (x,y) + m = struct ('x',x,'y',y); + m = class (m,"testclass"); +endfunction
--- a/test/bug-36025/@testclass/two.m +++ b/test/bug-36025/@testclass/two.m @@ -1,4 +1,5 @@ % function TWO returns item "Y" -function a=one(m) - a=m.y; +function a = one (m) + a = m.y; +endfunction
--- a/test/build-bc-overload-tests.sh +++ b/test/build-bc-overload-tests.sh @@ -94,7 +94,7 @@ %!shared ex %! ex.double = 1; -%! ex.single = single(1); +%! ex.single = single (1); %! ex.logical = true; %! ex.char = 'char'; %! ex.int8 = int8 (1);
--- a/test/build-sparse-tests.sh +++ b/test/build-sparse-tests.sh @@ -175,14 +175,14 @@ %!test # segfault test from edd@debian.org %! n = 510; -%! sparse (kron ((1:n)', ones(n,1)), kron (ones(n,1), (1:n)'), ones (n)); +%! sparse (kron ((1:n)', ones (n,1)), kron (ones (n,1), (1:n)'), ones (n)); %% segfault tests from Fabian@isas-berlin.de %% Note that the last four do not fail, but rather give a warning %% of a singular matrix, which is consistent with the full matrix %% behaviour. They are therefore disabled. %!testif HAVE_UMFPACK -%! assert (inv (sparse ([1,1;1,1+i])), sparse([1-1i,1i;1i,-1i]), 10*eps); +%! assert (inv (sparse ([1,1;1,1+i])), sparse ([1-1i,1i;1i,-1i]), 10*eps); %#!error inv ( sparse ([1,1;1,1] ) ); %#!error inv ( sparse ([0,0;0,1] ) ); %#!error inv ( sparse ([0,0;0,1+i]) ); @@ -259,13 +259,13 @@ disp ("appending test output to sprandomtest.log"); fid = fopen ("sprandomtest.log", "at"); test ("sprandom.tst", "normal", fid); - ##[passes, total] = test("sprandomtest","normal",fid); + ##[passes, total] = test ("sprandomtest", "normal", fid); fclose (fid); endfunction EOF fi - + } @@ -405,7 +405,7 @@ %!assert (diag (as(:)',-1), sparse (diag (af(:)',-1))) %!assert (spdiags (as,[0,1]), [diag(af,0), diag(af,1)]) %!test -%! [tb,tc]=spdiags(as); +%! [tb,tc] = spdiags (as); %! assert (spdiags (tb,tc,sparse (zeros (size (as)))), as); %! assert (spdiags (tb,tc,size (as,1),size (as,2)), as); @@ -416,12 +416,12 @@ gen_matrixreshape_tests() { cat >>$TESTS <<EOF %% Matrix diagonal tests (uses af,as,bf,bs) -%!assert(reshape(as,1,prod(size(as))),sparse(reshape(af,1,prod(size(af))))) -%!assert(reshape(as,prod(size(as)),1),sparse(reshape(af,prod(size(af)),1))) -%!assert(reshape(as,fliplr(size(as))),sparse(reshape(af,fliplr(size(af))))) -%!assert(reshape(bs,1,prod(size(as))),sparse(reshape(bf,1,prod(size(af))))) -%!assert(reshape(bs,prod(size(as)),1),sparse(reshape(bf,prod(size(af)),1))) -%!assert(reshape(bs,fliplr(size(as))),sparse(reshape(bf,fliplr(size(af))))) +%!assert (reshape (as,1,prod(size(as))), sparse (reshape (af,1,prod(size(af))))) +%!assert (reshape (as,prod(size(as)),1), sparse (reshape (af,prod(size(af)),1))) +%!assert (reshape (as,fliplr(size(as))), sparse (reshape (af,fliplr(size(af))))) +%!assert (reshape (bs,1,prod(size(as))), sparse (reshape (bf,1,prod(size(af))))) +%!assert (reshape (bs,prod(size(as)),1), sparse (reshape (bf,prod(size(af)),1))) +%!assert (reshape (bs,fliplr(size(as))), sparse (reshape (bf,fliplr(size(af))))) EOF } @@ -552,7 +552,7 @@ %!assert (cumprod (as,2), sparse (cumprod (af,2))) %!assert (min (as), sparse (min (af))) -%!assert (full (min (as(:))),min (af(:))) +%!assert (full (min (as(:))), min (af(:))) %!assert (min (as,[],1), sparse (min (af,[],1))) %!assert (min (as,[],2), sparse (min (af,[],2))) %!assert (min (as,[],1), sparse (min (af,[],1))) @@ -582,8 +582,8 @@ %!assert (as', sparse (af')); %!assert (-as, sparse (-af)); %!assert (~as, sparse (~af)); -%!error [i,j]=size (af);as(i-1,j+1); -%!error [i,j]=size (af);as(i+1,j-1); +%!error [i,j] = size (af);as(i-1,j+1); +%!error [i,j] = size (af);as(i+1,j-1); %!test %! [Is,Js,Vs] = find (as); %! [If,Jf,Vf] = find (af); @@ -635,7 +635,7 @@ cat >>$TESTS <<EOF %!testif HAVE_UMFPACK -%! assert(det(bs+speye(size(bs))),det(bf+eye(size(bf))),100*eps*abs(det(bf+eye(size(bf))))) +%! assert(det(bs+speye(size(bs))), det(bf+eye(size(bf))), 100*eps*abs(det(bf+eye(size(bf))))) %!testif HAVE_UMFPACK %! [l,u] = lu (sparse ([1,1;1,1])); @@ -727,19 +727,19 @@ # test scalar operations: uses af and real scalar bf; modifies as,bf,bs gen_scalar_tests() { - echo '%!test as=sparse(af);' >> $TESTS - echo '%!test bs=bf;' >> $TESTS + echo '%!test as = sparse (af);' >> $TESTS + echo '%!test bs = bf;' >> $TESTS gen_elementop_tests gen_ordering_tests - echo '%!test bf=bf+1i;' >>$TESTS - echo '%!test bs=bf;' >> $TESTS + echo '%!test bf = bf+1i;' >>$TESTS + echo '%!test bs = bf;' >> $TESTS gen_elementop_tests } # test matrix operations: uses af and bf; modifies as,bs gen_rectangular_tests() { - echo '%!test as=sparse(af);' >> $TESTS - echo '%!test bs=sparse(bf);' >>$TESTS + echo '%!test as = sparse(af);' >> $TESTS + echo '%!test bs = sparse(bf);' >>$TESTS gen_mapper_tests gen_real_mapper_tests gen_unaryop_tests @@ -806,7 +806,7 @@ %! funiq = fsum = zeros (m,n); %! funiq(r(:) + m*(c(:)-1) ) = ones (size (r(:))); %! funiq = sparse (funiq); -%! for k=1:length(r) +%! for k=1:length (r) %! fsum(r(k),c(k)) += 1; %! endfor %! fsum = sparse (fsum); @@ -847,7 +847,7 @@ gen_select_tests() { cat >>$TESTS <<EOF -%!test as=sparse(af); +%!test as = sparse (af); %% Point tests %!test idx = ridx(:) + rows (as) * (cidx (:)-1); @@ -875,16 +875,16 @@ %% Assignment test %!test -%! ts=as; ts(:,:) = ts(fliplr (1:size (as,1)),:); -%! tf=af; tf(:,:) = tf(fliplr (1:size (af,1)),:); +%! ts = as; ts(:,:) = ts(fliplr (1:size (as,1)),:); +%! tf = af; tf(:,:) = tf(fliplr (1:size (af,1)),:); %! assert (ts, sparse (tf)); %!test -%! ts=as; ts(fliplr (1:size (as,1)),:) = ts; -%! tf=af; tf(fliplr (1:size (af,1)),:) = tf; +%! ts = as; ts(fliplr (1:size (as,1)),:) = ts; +%! tf = af; tf(fliplr (1:size (af,1)),:) = tf; %! assert (ts, sparse (tf)); %!test -%! ts=as; ts(:,fliplr (1:size (as,2))) = ts; -%! tf=af; tf(:,fliplr (1:size (af,2))) = tf; +%! ts = as; ts(:,fliplr (1:size (as,2))) = ts; +%! tf = af; tf(:,fliplr (1:size (af,2))) = tf; %! assert (ts, sparse (tf)); %!test %! ts(fliplr (1:size (as,1))) = as(:,1); @@ -893,10 +893,10 @@ %% Deletion tests %!test -%! ts=as; ts(1,:)=[]; tf=af; tf(1,:)=[]; +%! ts = as; ts(1,:) = []; tf = af; tf(1,:) = []; %! assert (ts, sparse (tf)); %!test -%! ts=as; ts(:,1)=[]; tf=af; tf(:,1)=[]; +%! ts = as; ts(:,1) = []; tf = af; tf(:,1) = []; %! assert (ts, sparse (tf)); %% Test "end" keyword @@ -921,7 +921,7 @@ %! clear as_save; %! load (savefile, "as_save"); %! unlink (savefile); -%! assert (as_save, sparse(af)); +%! assert (as_save, sparse (af)); %!test # save binary %! savefile = tmpnam (); %! as_save = as; @@ -929,7 +929,7 @@ %! clear as_save; %! load (savefile, "as_save"); %! unlink (savefile); -%! assert (as_save, sparse(af)); +%! assert (as_save, sparse (af)); %!testif HAVE_HDF5 # save hdf5 %! savefile = tmpnam (); %! as_save = as; @@ -937,7 +937,7 @@ %! clear as_save; %! load (savefile, "as_save"); %! unlink (savefile); -%! assert (as_save, sparse(af)); +%! assert (as_save, sparse (af)); ## FIXME: We should skip (or mark as an expected failure) the test for ## saving sparse matrices to MAT files when using 64-bit indexing since ## that is not implemented yet. @@ -948,7 +948,7 @@ %! clear as_save; %! load (savefile, "as_save"); %! unlink (savefile); -%! assert (as_save, sparse(af)); +%! assert (as_save, sparse (af)); EOF } @@ -975,11 +975,11 @@ cat >>$TESTS <<EOF %! df = diag (1:n).* alpha; ds = sparse (df); -%! pdf = df(randperm (n),randperm (n)); +%! pdf = df(randperm (n), randperm (n)); %! pds = sparse (pdf); -%! plf = lf(randperm (n),randperm (n)); +%! plf = lf(randperm (n), randperm (n)); %! pls = sparse (plf); -%! puf = uf(randperm (n),randperm (n)); +%! puf = uf(randperm (n), randperm (n)); %! pus = sparse (puf); %! bs = spdiags (repmat ([1:n]',1,4),-2:1,n,n).*alpha; %! bf = full (bs); @@ -1024,7 +1024,7 @@ cat >>$TESTS <<EOF %% QR solver tests -%!function f(a, sz, feps) +%!function f (a, sz, feps) %! b = randn (sz); %! x = a \ b; %! assert (a * x, b, feps); @@ -1040,12 +1040,12 @@ %!endfunction %!testif HAVE_UMFPACK %! a = alpha*sprandn (10,11,0.2) + speye (10,11); -%! f(a,[10,2],1e-10); +%! f (a,[10,2],1e-10); %! ## Test this by forcing matrix_type, as can't get a certain %! ## result for over-determined systems. -%! a = alpha*sprandn(10,10,0.2) + speye(10,10); +%! a = alpha*sprandn (10,10,0.2) + speye (10,10); %! matrix_type (a, "Singular"); -%! f(a,[10,2],1e-10); +%! f (a,[10,2],1e-10); %% Rectanguar solver tests that don't use QR @@ -1194,25 +1194,25 @@ gen_section gen_save_tests gen_section -echo '%!test bf=real(bf);' >> $TESTS +echo '%!test bf = real (bf);' >> $TESTS gen_rectangular_tests gen_section gen_sparsesparse_ordering_tests gen_section -echo '%!test af=real(af);' >> $TESTS +echo '%!test af = real (af);' >> $TESTS gen_rectangular_tests gen_section gen_save_tests gen_section -echo '%!test bf=bf+1i*(bf~=0);' >> $TESTS +echo '%!test bf = bf+1i*(bf~=0);' >> $TESTS gen_rectangular_tests gen_section # square operations if $preset; then - echo '%!test af=[1+1i,2-1i,0,0;0,0,0,3+2i;0,0,0,4];' >> $TESTS - echo '%! as=sparse(af);' >> $TESTS - echo '%!test bf=[0,1-1i,0,0;2+1i,0,0,0;3-1i,2+3i,0,0];' >> $TESTS + echo '%!test af = [1+1i,2-1i,0,0;0,0,0,3+2i;0,0,0,4];' >> $TESTS + echo '%! as = sparse (af);' >> $TESTS + echo '%!test bf = [0,1-1i,0,0;2+1i,0,0,0;3-1i,2+3i,0,0];' >> $TESTS else cat >>$TESTS <<EOF %!test @@ -1234,34 +1234,34 @@ gen_square_tests gen_section -echo '%!test bf=real(bf);' >> $TESTS -echo '%! bs=sparse(bf);' >> $TESTS +echo '%!test bf = real (bf);' >> $TESTS +echo '%! bs = sparse (bf);' >> $TESTS gen_square_tests gen_section -echo '%!test af=real(af);' >> $TESTS -echo '%! as=sparse(af);' >> $TESTS +echo '%!test af = real (af);' >> $TESTS +echo '%! as = sparse (af);' >> $TESTS gen_square_tests gen_section -echo '%!test bf=bf+1i*(bf~=0);' >> $TESTS -echo '%! bs=sparse(bf);' >> $TESTS +echo '%!test bf = bf+1i*(bf~=0);' >> $TESTS +echo '%! bs = sparse (bf);' >> $TESTS gen_square_tests gen_section # cholesky tests if $preset; then - echo '%!test bf=[5,0,1+1i,0;0,5,0,1-2i;1-1i,0,5,0;0,1+2i,0,5];' >> $TESTS - echo '%! bs=sparse(bf);' >> $TESTS + echo '%!test bf = [5,0,1+1i,0;0,5,0,1-2i;1-1i,0,5,0;0,1+2i,0,5];' >> $TESTS + echo '%! bs = sparse (bf);' >> $TESTS else echo '# This has a small chance of failing to create a positive definite matrix' >> $TESTS - echo '%!test n=floor (lognrnd (8,2)+1)' >> $TESTS + echo '%!test n = floor (lognrnd (8,2)+1)' >> $TESTS echo '%! bs = n*speye (n,n) + sprandn (n,n,0.3);' >> $TESTS echo '%! bf = full (bs);' >> $TESTS fi gen_cholesky_tests gen_section -echo '%!test bf=real(bf);' >> $TESTS -echo '%! bs=sparse(bf);' >> $TESTS +echo '%!test bf = real (bf);' >> $TESTS +echo '%! bs = sparse (bf);' >> $TESTS gen_cholesky_tests gen_section @@ -1311,16 +1311,16 @@ fi gen_scalar_select_tests gen_select_tests -echo '%!test af=real(af);' >> $TESTS +echo '%!test af = real (af);' >> $TESTS gen_select_tests gen_section echo '%!shared alpha,beta,df,pdf,lf,plf,uf,puf,bf,cf,bcf,tf,tcf,xf,ds,pds,ls,pls,us,pus,bs,cs,bcs,ts,tcs,xs' >>$TESTS -echo '%!test alpha=1;beta=1;' >> $TESTS +echo '%!test alpha=1; beta=1;' >> $TESTS gen_solver_tests -echo '%!test alpha=1;beta=1i;' >> $TESTS +echo '%!test alpha=1; beta=1i;' >> $TESTS gen_solver_tests -echo '%!test alpha=1i;beta=1;' >> $TESTS +echo '%!test alpha=1i; beta=1;' >> $TESTS gen_solver_tests -echo '%!test alpha=1i;beta=1i;' >> $TESTS +echo '%!test alpha=1i; beta=1i;' >> $TESTS gen_solver_tests gen_section
--- a/test/build_bc_overloads_expected.m +++ b/test/build_bc_overloads_expected.m @@ -6,7 +6,7 @@ % to generate the overloaded functions. % ex.double = 1; -ex.single = single(1); +ex.single = single (1); ex.logical = true; ex.char = 'char'; ex.int8 = int8 (1);
--- a/test/classes/@Blork/Blork.m +++ b/test/classes/@Blork/Blork.m @@ -1,16 +1,15 @@ -function [ s ] = Blork( bleek ) +function s = Blork (bleek) % Test class. - if (nargin==1) && isa(bleek, 'Blork') - s = bleek; + if (nargin == 1 && isa (bleek, 'Blork')) + s = bleek; + else + if (nargin == 0) + s.bleek = 1; else - if nargin==0 - s.bleek = 1; - else - s.bleek = bleek; - end - s = class(s, 'Blork'); + s.bleek = bleek; + end + s = class (s, 'Blork'); + end - end - end
--- a/test/classes/@Blork/bleek.m +++ b/test/classes/@Blork/bleek.m @@ -1,10 +1,10 @@ -function [ out ] = bleek( in, val ) +function out = bleek (in, val) - if (nargin==1) + if (nargin == 1) out = in.bleek; else in.bleek = val; out = in; end - + end
--- a/test/classes/@Blork/display.m +++ b/test/classes/@Blork/display.m @@ -1,7 +1,7 @@ -function display( s ) +function display (s) - disp([inputname(1),'.bleek = ']) - disp(' '); - disp(s.bleek); + disp ([inputname(1),'.bleek = ']); + disp (' '); + disp (s.bleek); -end \ No newline at end of file +end
--- a/test/classes/@Blork/get.m +++ b/test/classes/@Blork/get.m @@ -1,10 +1,10 @@ -function [ v ] = get( s, propName ) +function v = get (s, propName) - switch propName - case 'bleek' - v = s.bleek; - otherwise - error([propName, ' is not a valid Blork property']); - end + switch propName + case 'bleek' + v = s.bleek; + otherwise + error ([propName, ' is not a valid Blork property']); + end end
--- a/test/classes/@Blork/set.m +++ b/test/classes/@Blork/set.m @@ -1,7 +1,7 @@ -function [ s ] = set( s, varargin ) +function s = set (s, varargin) propArgs = varargin; - while (length(propArgs) >= 2) + while (length (propArgs) >= 2) propName = propArgs{1}; propValue = propArgs{2}; propArgs = propArgs(3:end); @@ -9,7 +9,7 @@ case 'bleek' s.bleek = propValue; otherwise - error([propName, ' is not a valid Blork property']); + error ([propName, ' is not a valid Blork property']); end end
--- a/test/classes/@CPrecedenceTester1/CPrecedenceTester1.m +++ b/test/classes/@CPrecedenceTester1/CPrecedenceTester1.m @@ -1,7 +1,7 @@ -function x = CPrecedenceTester1() +function x = CPrecedenceTester1 () - x = struct('useless_data', pi); - x = class(x, 'CPrecedenceTester1'); + x = struct ('useless_data', pi); + x = class (x, 'CPrecedenceTester1'); % don't change anything as far as precedence is concerned
--- a/test/classes/@CPrecedenceTester1/tattack.m +++ b/test/classes/@CPrecedenceTester1/tattack.m @@ -1,5 +1,5 @@ -function s = tattack(x, y) - +function s = tattack (x, y) + s = 'CPrecedenceTester1'; - + end
--- a/test/classes/@CPrecedenceTester2/CPrecedenceTester2.m +++ b/test/classes/@CPrecedenceTester2/CPrecedenceTester2.m @@ -1,15 +1,15 @@ -function x = CPrecedenceTester2(flag) +function x = CPrecedenceTester2 (flag) - x = struct('useless_data', pi^2); - x = class(x, 'CPrecedenceTester2'); + x = struct ('useless_data', pi^2); + x = class (x, 'CPrecedenceTester2'); switch flag, case 1, % CPrecedencetester2 > Snork - superiorto('Snork'); + superiorto ('Snork'); case 2, % CPrecedencetester2 < Snork - inferiorto('Snork'); + inferiorto ('Snork'); otherwise, - error('Incorrect value for argument flag: %d', flag); + error ('Incorrect value for argument flag: %d', flag); end end
--- a/test/classes/@CPrecedenceTester2/tattack.m +++ b/test/classes/@CPrecedenceTester2/tattack.m @@ -1,5 +1,5 @@ -function s = tattack(x, y) - +function s = tattack (x, y) + s = 'CPrecedenceTester2'; - + end
--- a/test/classes/@CPrecedenceTester3/CPrecedenceTester3.m +++ b/test/classes/@CPrecedenceTester3/CPrecedenceTester3.m @@ -1,15 +1,15 @@ -function x = CPrecedenceTester3(flag) +function x = CPrecedenceTester3 (flag) - x = struct('useless_data', pi^3); - x = class(x, 'CPrecedenceTester3'); + x = struct ('useless_data', pi^3); + x = class (x, 'CPrecedenceTester3'); switch flag, case 1, % CPrecedencetester3 > Snork - superiorto('Snork'); + superiorto ('Snork'); case 2, % CPrecedencetester3 < Snork - inferiorto('Snork'); + inferiorto ('Snork'); otherwise, - error('Incorrect value for argument flag: %d', flag); + error ('Incorrect value for argument flag: %d', flag); end end
--- a/test/classes/@CPrecedenceTester3/tattack.m +++ b/test/classes/@CPrecedenceTester3/tattack.m @@ -1,5 +1,5 @@ -function s = tattack(x, y) - +function s = tattack (x, y) + s = 'CPrecedenceTester3'; - + end
--- a/test/classes/@Cork/Cork.m +++ b/test/classes/@Cork/Cork.m @@ -1,16 +1,16 @@ -function [ s ] = Cork( click ) +function s = Cork (click) % Test class. - if ( (nargin==1) && (isa(click, 'Cork')) ) + if (nargin == 1 && isa (click, 'Cork')) s = click; return; end - if( nargin<1 ) + if (nargin < 1) s.click = 1; else s.click = click; end - s = class(s, 'Cork'); + s = class (s, 'Cork'); end
--- a/test/classes/@Cork/click.m +++ b/test/classes/@Cork/click.m @@ -1,10 +1,10 @@ -function [ out ] = click( in, val ) +function out = click (in, val) - if (nargin==1) + if (nargin == 1) out = in.click; else in.click = val; out = in; end - + end
--- a/test/classes/@Cork/display.m +++ b/test/classes/@Cork/display.m @@ -1,7 +1,7 @@ -function display( s ) +function display (s) - disp([inputname(1),'.click = ']); - disp(' '); - disp(s.click); + disp ([inputname(1),'.click = ']); + disp (' '); + disp (s.click); -end \ No newline at end of file +end
--- a/test/classes/@Cork/get.m +++ b/test/classes/@Cork/get.m @@ -1,10 +1,10 @@ -function [ v ] = get( s, propName ) +function v = get (s, propName) - switch propName - case 'click' - v = s.click; - otherwise - error([propName, ' is not a valid Cork property']); - end + switch propName + case 'click' + v = s.click; + otherwise + error ([propName, ' is not a valid Cork property']); + end end
--- a/test/classes/@Cork/set.m +++ b/test/classes/@Cork/set.m @@ -1,7 +1,7 @@ -function [ s ] = set( s, varargin ) +function s = set (s, varargin) propArgs = varargin; - while (length(propArgs) >= 2) + while (length (propArgs) >= 2) propName = propArgs{1}; propValue = propArgs{2}; propArgs = propArgs(3:end); @@ -9,7 +9,7 @@ case 'click' s.click = propValue; otherwise - error([propName, ' is not a valid Cork property']); + error ([propName, ' is not a valid Cork property']); end end
--- a/test/classes/@Dork/Dork.m +++ b/test/classes/@Dork/Dork.m @@ -1,18 +1,18 @@ -function [ s ] = Dork( gick, gack ) +function s = Dork (gick, gack) - if (nargin==1) && isa(gick,'Dork') + if (nargin == 1 && isa (gick, 'Dork')) s = gick; else s.gack = 0; - if nargin == 0 + if (nargin == 0) s0 = Snork (); - elseif nargin==1 - s0 = Snork(gick); + elseif (nargin == 1) + s0 = Snork (gick); else - s0 = Snork(gick); + s0 = Snork (gick); s.gack = gack; end - s = class(s,'Dork',s0); + s = class (s, 'Dork', s0); end - + end
--- a/test/classes/@Dork/bling.m +++ b/test/classes/@Dork/bling.m @@ -1,5 +1,5 @@ -function [ out ] = bling( m1, m2 ) +function out = bling (m1, m2) out = 1; - + end
--- a/test/classes/@Dork/display.m +++ b/test/classes/@Dork/display.m @@ -1,13 +1,13 @@ -function display( s ) +function display (s) % Display the critical info for an amplifier - gick = get(s,'gick'); - disp([inputname(1),'.gick = ']) - disp(' '); - disp(gick); - disp(' '); - disp([inputname(1),'.gack = ']) - disp(' '); - disp(s.gack); + gick = get (s, 'gick'); + disp ([inputname(1),'.gick = ']); + disp (' '); + disp (gick); + disp (' '); + disp ([inputname(1),'.gack = ']); + disp (' '); + disp (s.gack); end
--- a/test/classes/@Dork/gack.m +++ b/test/classes/@Dork/gack.m @@ -1,10 +1,10 @@ -function [ out ] = gack( in, val ) +function out = gack (in, val) - if (nargin==1) + if (nargin == 1) out = in.gack; else in.gack = val; out = in; end - + end
--- a/test/classes/@Dork/get.m +++ b/test/classes/@Dork/get.m @@ -1,10 +1,10 @@ -function [ v ] = get( s, propName ) +function v = get (s, propName) switch propName case 'gack' v = s.gack; otherwise - v = get(s.Snork,propName); + v = get (s.Snork,propName); end end
--- a/test/classes/@Dork/getStash.m +++ b/test/classes/@Dork/getStash.m @@ -1,5 +1,5 @@ -function [ out ] = getStash(cls) +function out = getStash (cls) out = myStash (); - + end
--- a/test/classes/@Dork/private/myStash.m +++ b/test/classes/@Dork/private/myStash.m @@ -1,4 +1,4 @@ -function [ out ] = myStash () +function out = myStash () out = 2;
--- a/test/classes/@Dork/set.m +++ b/test/classes/@Dork/set.m @@ -1,7 +1,7 @@ -function [ s ] = set( s, varargin ) +function s = set (s, varargin) propArgs = varargin; - while (length(propArgs) >= 2) + while (length (propArgs) >= 2) propName = propArgs{1}; propValue = propArgs{2}; propArgs = propArgs(3:end); @@ -9,7 +9,7 @@ case 'gack' s.gack = propValue; otherwise - s.Snork = set(s.Snork, propName, propValue); + s.Snork = set (s.Snork, propName, propValue); end end
--- a/test/classes/@Gork/Gork.m +++ b/test/classes/@Gork/Gork.m @@ -1,5 +1,6 @@ -function [ s ] = Gork( g ) - if (nargin==1) && isa(g,'Gork') +function s = Gork (g) + + if (nargin == 1 && isa (g, 'Gork')) s = sprk; return; end @@ -7,9 +8,9 @@ drk = Dork (); prk = Pork (); blrk = Blork (); - s.Cork = Cork(17); % Aggregation. + s.Cork = Cork (17); % Aggregation. s.gark = -2; s.gyrk = -3; - s = class(s,'Gork',drk,prk,blrk); - + s = class (s,'Gork',drk,prk,blrk); + end
--- a/test/classes/@Gork/cork.m +++ b/test/classes/@Gork/cork.m @@ -1,10 +1,10 @@ -function [ out ] = cork( in, val ) +function out = cork (in, val) - if (nargin==1) + if (nargin == 1) out = in.Cork; else in.Cork = val; out = in; end - + end
--- a/test/classes/@Gork/display.m +++ b/test/classes/@Gork/display.m @@ -1,16 +1,15 @@ -function display( s ) +function display (s) % Display the critical info for a Gork. dork_base = s.Dork %pork_base = s.Pork %sprk = s.sprk; - gark = get(s,'gark'); - disp([inputname(1),'.gark = ']) - disp(' '); - disp(gark); - disp([inputname(1),'.Cork= ']) - disp(' '); - disp(click(s.Cork)); - + gark = get (s, 'gark'); + disp ([inputname(1),'.gark = ']); + disp (' '); + disp (gark); + disp ([inputname(1),'.Cork= ']); + disp (' '); + disp (click(s.Cork)); end
--- a/test/classes/@Gork/gark.m +++ b/test/classes/@Gork/gark.m @@ -1,10 +1,10 @@ -function [ out ] = gark( in, val ) +function out = gark (in, val) - if (nargin==1) + if (nargin == 1) out = in.gark; else in.gark = val; out = in; end - + end
--- a/test/classes/@Gork/get.m +++ b/test/classes/@Gork/get.m @@ -1,4 +1,4 @@ -function [ v ] = get( s, propName ) +function v = get (s, propName) switch propName case 'cork' @@ -8,7 +8,7 @@ otherwise % Note that get/set for multiple parents is hard. We only do one % branch of the parent tree just to test this stuff out. - v = get(s.Dork,propName); + v = get (s.Dork,propName); end end
--- a/test/classes/@Gork/set.m +++ b/test/classes/@Gork/set.m @@ -1,23 +1,23 @@ -function [ s ] = set( s, varargin ) +function s = set (s, varargin) propArgs = varargin; - while (length(propArgs) >= 2) + while (length (propArgs) >= 2) propName = propArgs{1}; propValue = propArgs{2}; propArgs = propArgs(3:end); switch propName case 'cork' - if(isa(propValue,'Cork')) + if (isa (propValue, 'Cork')) s.Cork = propValue; else - s.Cork = set(s.Cork, 'click',propValue); + s.Cork = set (s.Cork, 'click', propValue); end case 'gark' s.gark = propValue; otherwise % Note that get/set for multiple parents is hard. We only do one % branch of the parent tree just to test this stuff out. - s.Dork = set(s.Dork, propName, propValue); + s.Dork = set (s.Dork, propName, propValue); end end
--- a/test/classes/@Gork/subsasgn.m +++ b/test/classes/@Gork/subsasgn.m @@ -1,4 +1,4 @@ -function g = subsasgn(g, s, x) +function g = subsasgn (g, s, x) switch s.type case '.' @@ -6,4 +6,5 @@ case 'gyrk' g.gyrk = x; end + end
--- a/test/classes/@Gork/subsref.m +++ b/test/classes/@Gork/subsref.m @@ -1,4 +1,4 @@ -function x = subsref(g, s) +function x = subsref (g, s) switch s.type case '.' @@ -6,4 +6,5 @@ case 'gyrk' x = g.gyrk; end + end
--- a/test/classes/@Pork/Pork.m +++ b/test/classes/@Pork/Pork.m @@ -1,19 +1,19 @@ -function [ s ] = Pork( geek, gurk ) +function s = Pork (geek, gurk) - if (nargin==1) && isa(geek,'Pork') + if (nargin == 1 && isa (geek, 'Pork')) s = geek; else s.gurk = 0; - if nargin == 0 + if (nargin == 0) s0 = Spork (); - elseif nargin==1 - s0 = Spork(geek); + elseif (nargin == 1) + s0 = Spork (geek); else - s0 = Spork(geek); + s0 = Spork (geek); s.gurk = gurk; end - s = class(s,'Pork',s0); + s = class (s, 'Pork', s0); end - superiorto('Dork'); + superiorto ('Dork'); end
--- a/test/classes/@Pork/bling.m +++ b/test/classes/@Pork/bling.m @@ -1,5 +1,5 @@ -function [ out ] = bling( m1, m2 ) +function out = bling (m1, m2) out = 2; - + end
--- a/test/classes/@Pork/display.m +++ b/test/classes/@Pork/display.m @@ -1,13 +1,13 @@ -function display( s ) +function display (s) % Display the critical info for an amplifier - geek = get(s,'geek'); - disp([inputname(1),'.geek = ']) - disp(' '); - disp(geek); - disp(' '); - disp([inputname(1),'.gurk = ']) - disp(' '); - disp(s.gurk); + geek = get (s, 'geek'); + disp ([inputname(1),'.geek = ']); + disp (' '); + disp (geek); + disp (' '); + disp ([inputname(1),'.gurk = ']); + disp (' '); + disp (s.gurk); end
--- a/test/classes/@Pork/get.m +++ b/test/classes/@Pork/get.m @@ -1,10 +1,10 @@ -function [ v ] = get( s, propName ) +function v = get (s, propName) switch propName case 'gurk' v = s.gurk; otherwise - v = get(s.Spork,propName); + v = get (s.Spork, propName); end end
--- a/test/classes/@Pork/gurk.m +++ b/test/classes/@Pork/gurk.m @@ -1,10 +1,10 @@ -function [ out ] = gurk( in, val ) +function out = gurk (in, val) - if (nargin==1) + if (nargin == 1) out = in.gurk; else in.gurk = val; out = in; end - + end
--- a/test/classes/@Pork/private/myStash.m +++ b/test/classes/@Pork/private/myStash.m @@ -1,4 +1,4 @@ -function [ out ] = myStash () +function out = myStash () out = 4;
--- a/test/classes/@Pork/set.m +++ b/test/classes/@Pork/set.m @@ -1,7 +1,7 @@ -function [ s ] = set( s, varargin ) +function s = set (s, varargin) propArgs = varargin; - while (length(propArgs) >= 2) + while (length (propArgs) >= 2) propName = propArgs{1}; propValue = propArgs{2}; propArgs = propArgs(3:end); @@ -9,7 +9,7 @@ case 'gurk' s.gurk = propValue; otherwise - s.Spork = set(s.Spork, propName, propValue); + s.Spork = set (s.Spork, propName, propValue); end end
--- a/test/classes/@Sneetch/Sneetch.m +++ b/test/classes/@Sneetch/Sneetch.m @@ -1,16 +1,16 @@ -function [ s ] = Sneetch( mcbean ) +function s = Sneetch (mcbean) % Test class: should produce error. - if (nargin==1) && isa(mcbean, 'Sneetch') + if (nargin == 1 && isa (mcbean, 'Sneetch')) s = mcbean; else - if nargin==0 + if (nargin == 0) s.mcbean = 1; else s.mcbean = mcbean; end - s = class(s, 'Sneetch'); + s = class (s, 'Sneetch'); s.sylvester = 1; end - + end
--- a/test/classes/@Sneetch/display.m +++ b/test/classes/@Sneetch/display.m @@ -1,10 +1,10 @@ -function display( s ) +function display ( s ) - disp([inputname(1),'.mcbean = ']) - disp(' '); - disp(s.mcbean); - disp([inputname(1),'.sylvester = ']) - disp(' '); - disp(s.sylvester); + disp ([inputname(1),'.mcbean = ']); + disp (' '); + disp (s.mcbean); + disp ([inputname(1),'.sylvester = ']); + disp (' '); + disp (s.sylvester); -end \ No newline at end of file +end
--- a/test/classes/@Snork/Snork.m +++ b/test/classes/@Snork/Snork.m @@ -1,17 +1,16 @@ -function [ s ] = Snork( gick ) +function s = Snork (gick) % Test class. - if ( (nargin==1) && (isa(gick, 'Snork')) ) + if (nargin == 1 && isa (gick, 'Snork')) s = gick; else s.cack = [0 1 2 3]; - if nargin==0 + if (nargin == 0) s.gick = 1; else s.gick = gick; end - s = class(s, 'Snork'); - + s = class (s, 'Snork'); end - + end
--- a/test/classes/@Snork/cack.m +++ b/test/classes/@Snork/cack.m @@ -1,5 +1,5 @@ -function [ out ] = cack( in ) +function out = cack (in) out = in.cack; - + end
--- a/test/classes/@Snork/display.m +++ b/test/classes/@Snork/display.m @@ -1,7 +1,7 @@ -function display( s ) +function display (s) - disp([inputname(1),'.gick = ']); - disp(' '); - disp(s.gick); + disp ([inputname(1),'.gick = ']); + disp (' '); + disp (s.gick); -end \ No newline at end of file +end
--- a/test/classes/@Snork/double.m +++ b/test/classes/@Snork/double.m @@ -1,4 +1,4 @@ -function x = double(snk) +function x = double (snk) x = snk.gick;
--- a/test/classes/@Snork/end.m +++ b/test/classes/@Snork/end.m @@ -3,7 +3,7 @@ if (num_indices ~= 1) error ('Snork object may only have one index') end - + r = length (snk.cack); end
--- a/test/classes/@Snork/eq.m +++ b/test/classes/@Snork/eq.m @@ -1,8 +1,8 @@ -function b = eq(s1, s2) +function b = eq (s1, s2) - x1 = double(s1); - x2 = double(s2); + x1 = double (s1); + x2 = double (s2); - b = isequal(x1, x2); + b = isequal (x1, x2); -end \ No newline at end of file +end
--- a/test/classes/@Snork/ge.m +++ b/test/classes/@Snork/ge.m @@ -1,7 +1,7 @@ -function b = ge(s1, s2) +function b = ge (s1, s2) - x1 = double(s1); - x2 = double(s2); + x1 = double (s1); + x2 = double (s2); b = (x1(1) >= x2(1));
--- a/test/classes/@Snork/get.m +++ b/test/classes/@Snork/get.m @@ -1,10 +1,10 @@ -function [ v ] = get( s, propName ) +function v = get (s, propName) - switch propName - case 'gick' - v = s.gick; - otherwise - error([propName, ' is not a valid Snork property']); - end + switch propName + case 'gick' + v = s.gick; + otherwise + error ([propName, ' is not a valid Snork property']); + end end
--- a/test/classes/@Snork/getStash.m +++ b/test/classes/@Snork/getStash.m @@ -1,5 +1,5 @@ -function [ out ] = getStash(cls) +function out = getStash (l) out = myStash (); - + end
--- a/test/classes/@Snork/gick.m +++ b/test/classes/@Snork/gick.m @@ -1,10 +1,10 @@ -function [ out ] = gick( in, val ) +function out = gick (in, val) - if (nargin==1) + if (nargin == 1) out = in.gick; else in.gick = val; out = in; end - + end
--- a/test/classes/@Snork/gt.m +++ b/test/classes/@Snork/gt.m @@ -1,7 +1,7 @@ -function b = gt(s1, s2) +function b = gt (s1, s2) - x1 = double(s1); - x2 = double(s2); + x1 = double (s1); + x2 = double (s2); b = (x1(1) > x2(1));
--- a/test/classes/@Snork/horzcat.m +++ b/test/classes/@Snork/horzcat.m @@ -1,8 +1,8 @@ -function s = horzcat(s1, s2) +function s = horzcat (s1, s2) - x1 = double(s1); - x2 = double(s2); + x1 = double (s1); + x2 = double (s2); - s = Snork([x1 x2]); + s = Snork ([x1 x2]); end
--- a/test/classes/@Snork/ldivide.m +++ b/test/classes/@Snork/ldivide.m @@ -1,7 +1,7 @@ -function s = ldivide(s1, s2) +function s = ldivide (s1, s2) - x1 = double(s1); - x2 = double(s2); + x1 = double (s1); + x2 = double (s2); s = Snork(x1 .\ x2);
--- a/test/classes/@Snork/le.m +++ b/test/classes/@Snork/le.m @@ -1,7 +1,7 @@ -function b = le(s1, s2) +function b = le (s1, s2) - x1 = double(s1); - x2 = double(s2); + x1 = double (s1); + x2 = double (s2); b = (x1(1) <= x2(1));
--- a/test/classes/@Snork/loadobj.m +++ b/test/classes/@Snork/loadobj.m @@ -1,6 +1,6 @@ -function [ out ] = loadobj( in ) +function out = loadobj (in) out = in; out.cack = [-1 -2 -3 -4]; - + end
--- a/test/classes/@Snork/lt.m +++ b/test/classes/@Snork/lt.m @@ -1,7 +1,7 @@ -function b = lt(s1, s2) +function b = lt (s1, s2) - x1 = double(s1); - x2 = double(s2); + x1 = double (s1); + x2 = double (s2); b = (x1(1) < x2(1));
--- a/test/classes/@Snork/minus.m +++ b/test/classes/@Snork/minus.m @@ -1,8 +1,8 @@ -function s = minus(s1, s2) +function s = minus (s1, s2) - x1 = double(s1); - x2 = double(s2); + x1 = double (s1); + x2 = double (s2); - s = Snork(x1 - x2); + s = Snork (x1 - x2); end
--- a/test/classes/@Snork/mldivide.m +++ b/test/classes/@Snork/mldivide.m @@ -1,8 +1,8 @@ -function s = mldivide(s1, s2) +function s = mldivide (s1, s2) - x1 = double(s1); - x2 = double(s2); + x1 = double (s1); + x2 = double (s2); - s = Snork(x1 \ x2); + s = Snork (x1 \ x2); end
--- a/test/classes/@Snork/mpower.m +++ b/test/classes/@Snork/mpower.m @@ -1,7 +1,7 @@ -function s = mpower(s1, x) +function s = mpower (s1, x) - if ~isa(s1, 'Snork') || isa(x, 'Snork') - error('mpower Snork!!!'); + if (~isa (s1, 'Snork') || isa (x, 'Snork')) + error ('mpower Snork!!!'); end s = s1;
--- a/test/classes/@Snork/mrdivide.m +++ b/test/classes/@Snork/mrdivide.m @@ -1,8 +1,8 @@ -function s = mrdivide(s1, s2) +function s = mrdivide (s1, s2) - x1 = double(s1); - x2 = double(s2); + x1 = double (s1); + x2 = double (s2); - s = Snork(x1 / x2); + s = Snork (x1 / x2); end
--- a/test/classes/@Snork/mtimes.m +++ b/test/classes/@Snork/mtimes.m @@ -1,8 +1,8 @@ -function s = mtimes(s1, s2) +function s = mtimes (s1, s2) - x1 = double(s1); - x2 = double(s2); + x1 = double (s1); + x2 = double (s2); - s = Snork(x1 * x2); + s = Snork (x1 * x2); end
--- a/test/classes/@Snork/ne.m +++ b/test/classes/@Snork/ne.m @@ -1,4 +1,4 @@ -function b = ne(s1, s2) +function b = ne (s1, s2) b = ~(s1 == s2);
--- a/test/classes/@Snork/plus.m +++ b/test/classes/@Snork/plus.m @@ -1,8 +1,8 @@ -function s = plus(s1, s2) +function s = plus (s1, s2) - x1 = double(s1); - x2 = double(s2); + x1 = double (s1); + x2 = double (s2); - s = Snork(x1 + x2); + s = Snork (x1 + x2); -end \ No newline at end of file +end
--- a/test/classes/@Snork/power.m +++ b/test/classes/@Snork/power.m @@ -1,7 +1,7 @@ -function s = power(s1, x) +function s = power (s1, x) - if ~isa(s1, 'Snork') || isa(x, 'Snork') - error('power Snork!!!'); + if (~isa (s1, 'Snork') || isa (x, 'Snork')) + error ('power Snork!!!'); end s = s1;
--- a/test/classes/@Snork/private/myStash.m +++ b/test/classes/@Snork/private/myStash.m @@ -1,5 +1,5 @@ -function [ out ] = myStash () +function out = myStash () out = 1; - + end
--- a/test/classes/@Snork/rdivide.m +++ b/test/classes/@Snork/rdivide.m @@ -1,7 +1,7 @@ -function s = rdivide(s1, s2) +function s = rdivide (s1, s2) - x1 = double(s1); - x2 = double(s2); + x1 = double (s1); + x2 = double (s2); s = Snork(x1 ./ x2);
--- a/test/classes/@Snork/saveobj.m +++ b/test/classes/@Snork/saveobj.m @@ -1,6 +1,6 @@ -function [ out ] = saveobj( in ) +function out = saveobj (in) out = in; out.cack = []; - + end
--- a/test/classes/@Snork/set.m +++ b/test/classes/@Snork/set.m @@ -1,7 +1,7 @@ -function [ s ] = set( s, varargin ) +function s = set (s, varargin) propArgs = varargin; - while (length(propArgs) >= 2) + while (length (propArgs) >= 2) propName = propArgs{1}; propValue = propArgs{2}; propArgs = propArgs(3:end); @@ -9,7 +9,7 @@ case 'gick' s.gick = propValue; otherwise - error([propName, ' is not a valid Snork property']); + error ([propName, ' is not a valid Snork property']); end end
--- a/test/classes/@Snork/subsasgn.m +++ b/test/classes/@Snork/subsasgn.m @@ -1,4 +1,5 @@ function snk = subsasgn (snk, s, val) + if (length (s) < 1) error ('Snork: needs index'); end @@ -35,4 +36,5 @@ otherwise error ('invalid subscript type'); end + end
--- a/test/classes/@Snork/subsindex.m +++ b/test/classes/@Snork/subsindex.m @@ -1,5 +1,5 @@ -function [ out ] = subsindex( obj ) +function out = subsindex (obj) out = 0; - + end
--- a/test/classes/@Snork/subsref.m +++ b/test/classes/@Snork/subsref.m @@ -1,4 +1,5 @@ function b = subsref (snk, s) + if (isempty (s)) error ('Snork: missing index'); end @@ -27,4 +28,5 @@ otherwise error ('invalid subscript type'); end + end
--- a/test/classes/@Snork/tattack.m +++ b/test/classes/@Snork/tattack.m @@ -1,5 +1,5 @@ -function s = tattack(x, y) - +function s = tattack (x, y) + s = 'Snork'; - + end
--- a/test/classes/@Snork/times.m +++ b/test/classes/@Snork/times.m @@ -1,8 +1,8 @@ -function s = times(s1, s2, s3) +function s = times (s1, s2, s3) - x1 = double(s1); - x2 = double(s2); + x1 = double (s1); + x2 = double (s2); - s = Snork(x1 .* x2); + s = Snork (x1 .* x2); end
--- a/test/classes/@Snork/uminus.m +++ b/test/classes/@Snork/uminus.m @@ -1,6 +1,6 @@ -function s = uminus(s1) +function s = uminus (s1) s = s1; s.gick = - s.gick; -end \ No newline at end of file +end
--- a/test/classes/@Snork/uplus.m +++ b/test/classes/@Snork/uplus.m @@ -1,4 +1,4 @@ -function s = uplus(s1) +function s = uplus (s1) s = s1;
--- a/test/classes/@Snork/vertcat.m +++ b/test/classes/@Snork/vertcat.m @@ -1,8 +1,8 @@ -function s = vertcat(s1, s2) +function s = vertcat (s1, s2) - x1 = double(s1); - x2 = double(s2); + x1 = double (s1); + x2 = double (s2); - s = Snork([x1; x2]); + s = Snork ([x1; x2]); end
--- a/test/classes/@Spork/Spork.m +++ b/test/classes/@Spork/Spork.m @@ -1,17 +1,16 @@ -function [ s ] = Spork( geek ) +function s = Spork (geek) % Test class. - if (nargin==1) && isa(geek, 'Spork') - s = geek; + if (nargin == 1 && isa (geek, 'Spork')) + s = geek; else s.cack = [-1 -2 -3 -4]; - if nargin==0 + if (nargin == 0) s.geek = 1; else s.geek = geek; end - s = class(s, 'Spork'); - + s = class (s, 'Spork'); end - + end
--- a/test/classes/@Spork/cack.m +++ b/test/classes/@Spork/cack.m @@ -1,5 +1,5 @@ -function [ out ] = cack( in ) +function out = cack (in) out = in.cack; - + end
--- a/test/classes/@Spork/display.m +++ b/test/classes/@Spork/display.m @@ -1,7 +1,7 @@ -function display( s ) +function display (s) - disp([inputname(1),'.geek = ']) - disp(' '); - disp(s.geek); + disp ([inputname(1),'.geek = ']); + disp (' '); + disp (s.geek); -end \ No newline at end of file +end
--- a/test/classes/@Spork/geek.m +++ b/test/classes/@Spork/geek.m @@ -1,10 +1,10 @@ -function [ out ] = geek( in, val ) +function out = geek (in, val) - if (nargin==1) + if (nargin == 1) out = in.geek; else in.geek = val; out = in; end - + end
--- a/test/classes/@Spork/get.m +++ b/test/classes/@Spork/get.m @@ -1,10 +1,10 @@ -function [ v ] = get( s, propName ) +function v = get (s, propName) - switch propName - case 'geek' - v = s.geek; - otherwise - error([propName, ' is not a valid Spork property']); - end + switch propName + case 'geek' + v = s.geek; + otherwise + error ([propName, ' is not a valid Spork property']); + end end
--- a/test/classes/@Spork/getStash.m +++ b/test/classes/@Spork/getStash.m @@ -1,5 +1,5 @@ -function [ out ] = getStash(cls) +function out = getStash (cls) out = myStash (); - + end
--- a/test/classes/@Spork/loadobj.m +++ b/test/classes/@Spork/loadobj.m @@ -1,8 +1,8 @@ -function [ out ] = loadobj( in ) +function out = loadobj (in) out = in; - if (~isa(in,'Spork')) - out.cack=[]; + if (~isa (in, 'Spork')) + out.cack = []; end - + end
--- a/test/classes/@Spork/private/myStash.m +++ b/test/classes/@Spork/private/myStash.m @@ -1,5 +1,5 @@ -function [ out ] = myStash () +function out = myStash () out = 3; - + end
--- a/test/classes/@Spork/saveobj.m +++ b/test/classes/@Spork/saveobj.m @@ -1,6 +1,6 @@ -function [ out ] = saveobj( in ) +function out = saveobj (in) out = in; - %rmfield(out,'cack'); - + %rmfield (out,'cack'); + end
--- a/test/classes/@Spork/set.m +++ b/test/classes/@Spork/set.m @@ -1,7 +1,7 @@ -function [ s ] = set( s, varargin ) +function s = set (s, varargin) propArgs = varargin; - while (length(propArgs) >= 2) + while (length (propArgs) >= 2) propName = propArgs{1}; propValue = propArgs{2}; propArgs = propArgs(3:end); @@ -9,7 +9,7 @@ case 'geek' s.geek = propValue; otherwise - error([propName, ' is not a valid Spork property']); + error ([propName, ' is not a valid Spork property']); end end
--- a/test/classes/classes.tst +++ b/test/classes/classes.tst @@ -41,7 +41,7 @@ %% methods that the others don't so we can test indexing and other %% features. %!shared snk, snk1, snk2 -%!test snk = Snork(); +%!test snk = Snork (); %! assert (isequal (gick (snk), 1)); %! assert (isequal (snk.gick, 1)); %! assert (isequal (snk(2), 1)); @@ -64,10 +64,10 @@ %! assert (~ismethod (snk, 'bletch')); %! assert (exist ('snk') == 1); %! assert (exist ('blink') == 0); -%!test snk1 = Snork(snk); +%!test snk1 = Snork (snk); %! assert (isequal (class (snk1), 'Snork')); %! assert (isequal (gick (snk1), 4)); -%!test snk2 = Snork(-3); +%!test snk2 = Snork (-3); %! assert (isequal (class (snk2), 'Snork')); %! assert (isequal (gick (snk2), -3)); %!test x = [1 2 3 4]; @@ -83,7 +83,7 @@ %% sure that we haven't bollixed up the Spork class if we should make %% changes. We use Spork in the class hierarchy. %!shared sprk -%!test sprk = Spork(); +%!test sprk = Spork (); %! assert (isequal (geek (sprk), 1)); %!test sprk = geek (sprk, 3); %! assert (isequal (geek (sprk), 3)); @@ -97,7 +97,7 @@ %% sure that we haven't bollixed up the Blork class if we should make %% changes. We use Blork in the class hierarchy. %!shared blrk -%!test blrk = Blork(); +%!test blrk = Blork (); %! assert (isequal (bleek(blrk), 1)); %!test blrk = bleek (blrk, 3); %! assert (isequal (bleek (blrk), 3)); @@ -111,7 +111,7 @@ %% sure that we haven't bollixed up the Cork class if we should make %% changes. We use Cork in the class hierarchy. %!shared crk -%!test crk = Cork(23); +%!test crk = Cork (23); %! assert (isequal (click(crk), 23)); %!test crk = click(crk,3); %! assert (isequal (click(crk), 3)); @@ -122,7 +122,7 @@ %% The Dork class tests single inheritance. %!shared drk -%!test drk = Dork(); +%!test drk = Dork (); %! assert (isequal (gack (drk),0)); %!test drk = gack (drk,-2); %! assert (isequal (gack (drk),-2)); @@ -135,12 +135,12 @@ %! assert (isa (drk, 'Dork')); %! assert (isa (drk, 'Snork')); %! assert (isequal (getStash (drk), 2)); -%!test drk1 = Dork(drk); +%!test drk1 = Dork (drk); %! assert (isequal (class (drk1), 'Dork')); %! assert (isa (drk1, 'Snork')); %! assert (isequal (gick (drk1), 3)); %! assert (isequal (gack (drk1), -3)); -%!test drk2 = Dork(-4, 4); +%!test drk2 = Dork (-4, 4); %! assert (isequal (class (drk2), 'Dork')); %! assert (isa (drk2, 'Snork')); %! assert (isequal (gick (drk2), -4)); @@ -149,7 +149,7 @@ %% The Pork class is essentially a clone of Dork. It is used as part %% of the multiple inheritance test. %!shared prk, drk -%!test prk = Pork(); +%!test prk = Pork (); %! assert (isequal (geek (prk), 1)); %! assert (isequal (gurk (prk), 0)); %!test prk = gurk (prk,-3); @@ -159,13 +159,13 @@ %! assert (isequal (class (prk), 'Pork')); %! assert (isa (prk, 'Pork')); %! assert (isa (prk, 'Spork')); -%!test drk = Dork(); % Precedence. +%!test drk = Dork (); % Precedence. %! assert (isequal (bling (drk, prk), 2)); %! assert (isequal (bling (prk, drk), 2)); %% The Gork class tests aggregation and multiple inheritance. %!shared grk -%!test grk = Gork(); +%!test grk = Gork (); %! assert (isequal (gick (grk), 1)); %! assert (isequal (geek (grk), 1)); %! assert (isequal (gack (grk), 0)); @@ -189,7 +189,7 @@ %! assert (isequal (gark (grk), -6)); %! assert (isequal (click (cork (grk)), 23)); %!test -%! cork1 = Cork(13); +%! cork1 = Cork (13); %! grk = set (grk, 'gick', -5, 'gack', -6, 'gark', -7, 'cork', cork1); %! assert (isequal (get (grk, 'gick'), -5)); %! assert (isequal (get (grk, 'gack'), -6)); @@ -212,9 +212,9 @@ %% Common variables for testing overloaded operators %!shared x1, x2, x3, s1, s2, s3 -%! x1 = 1 + rand(3); s1 = Snork(x1); -%! x2 = 1 + rand(3); s2 = Snork(x2); -%! x3 = diag([1 2 3]); s3 = Snork(x3); +%! x1 = 1 + rand (3); s1 = Snork (x1); +%! x2 = 1 + rand (3); s2 = Snork (x2); +%! x3 = diag ([1 2 3]); s3 = Snork (x3); %% Test overloaded plus (+) and uplus (unitary +) for the Snork class %!test s = s1 + s2; assert (isa (s, 'Snork') && isequal (s.gick, x1 + x2)); @@ -226,7 +226,7 @@ %!test s = s1 - s2; assert (isa (s, 'Snork') && isequal (s.gick, x1 - x2)); %!test s = s1 - x2; assert (isa (s, 'Snork') && isequal (s.gick, x1 - x2)); %!test s = x1 - s2; assert (isa (s, 'Snork') && isequal (s.gick, x1 - x2)); -%!test s = -s1; assert (isequal (s, Snork(-x1))); +%!test s = -s1; assert (isequal (s, Snork (-x1))); %% Test overloaded mtimes (*) for the Snork class %!test s = s1 * s2; assert (isa (s, 'Snork') && isequal (s.gick, x1 * x2)); @@ -322,7 +322,7 @@ %% Test with the Blork class, where neither vertcat() nor horzcat() is overloaded %!shared x1, x2, x3 -%!test x1 = Blork(); +%!test x1 = Blork (); %!test x2 = [x1 x1]; %!assert (isa (x2, 'Blork') && isequal (size (x2), [1 2])); %!test x2 = [x1 51]; @@ -340,23 +340,24 @@ %% default: leftmost object wins %!shared A, B -%!test A = Snork(rand(2)); -%!test B = CPrecedenceTester1(); % no call to inferiorto/superiorto +%!test A = Snork (rand (2)); +%!test B = CPrecedenceTester1 (); % no call to inferiorto/superiorto %!assert (isequal (tattack (A, B), 'Snork')) %!assert (isequal (tattack (B, A), 'CPrecedenceTester1')) % idem %!shared A, B -%!test A = Snork(rand(2)); -%!test B = CPrecedenceTester2(1); % CPrecedenceTester2 > Snork +%!test A = Snork (rand (2)); +%!test B = CPrecedenceTester2 (1); % CPrecedenceTester2 > Snork %!assert (isequal (tattack (A, B), 'CPrecedenceTester2')) %!assert (isequal (tattack (B, A), 'CPrecedenceTester2')) %% Trying to change to CPrecendenceTester < Snork -%!error D = CPrecedenceTester2(2); +%!error D = CPrecedenceTester2 (2); %!shared A, B -%!test A = Snork(rand(2)); -%!test B = CPrecedenceTester3(2); % CPrecedenceTester3 < Snork +%!test A = Snork (rand (2)); +%!test B = CPrecedenceTester3 (2); % CPrecedenceTester3 < Snork %!assert (isequal (tattack (A, B), 'Snork')) %!assert (isequal (tattack (B, A), 'Snork')) %% Trying to change to CPrecendenceTester3 > Snork -%!error D = CPrecedenceTester3(1); +%!error D = CPrecedenceTester3 (1); +
--- a/test/ctor-vs-method/__trace__.m +++ b/test/ctor-vs-method/__trace__.m @@ -1,5 +1,6 @@ function r = __trace__ (t) persistent history + if (isempty (history)) history = {}; end @@ -14,5 +15,5 @@ else error ('incorrect call to __trace__'); end + end - \ No newline at end of file
--- a/test/error.tst +++ b/test/error.tst @@ -59,10 +59,10 @@ %! ws = warning ("query", "backtrace"); %! warning ("on", "backtrace"); %! st.state = "on"; -%! assert(warning ("query", "backtrace"), st); +%! assert (warning ("query", "backtrace"), st); %! warning ("off", "backtrace"); %! st.state = "off"; -%! assert(warning ("query", "backtrace"), st); +%! assert (warning ("query", "backtrace"), st); %! warning (ws.state, "backtrace"); ## Test usage() function
--- a/test/eval-catch.tst +++ b/test/eval-catch.tst @@ -48,7 +48,7 @@ %!endfunction %!test %! eval ("clear a; a; str='';", "str = mangle (lasterr);"); -%! assert (mangle(lasterr)(1:14), "<'a' undefined"); +%! assert (mangle (lasterr)(1:14), "<'a' undefined"); %! assert (str(1:14), "<'a' undefined"); %% test/octave.test/eval-catch/eval-catch-8.m
--- a/test/fcn-handle-derived-resolution/@other/getsize_arrayfun.m +++ b/test/fcn-handle-derived-resolution/@other/getsize_arrayfun.m @@ -1,3 +1,3 @@ function r = getsize_arrayfun (x) - r = arrayfun (@(i) numel (x(i).d), 1:numel(x), 'uniformoutput', true); + r = arrayfun (@(i) numel (x(i).d), 1:numel (x), 'uniformoutput', true); end
--- a/test/for.tst +++ b/test/for.tst @@ -106,6 +106,6 @@ %!test %! a = {1,3;2,4}; %! j = 0; -%! for i = cat (3, a, cellfun(@(x) 4 + x, a, "UniformOutput", 0)) +%! for i = cat (3, a, cellfun (@(x) 4 + x, a, "UniformOutput", 0)) %! assert (i, {1 + 2*j; 2 + 2*j++}) %! endfor
--- a/test/func.tst +++ b/test/func.tst @@ -93,13 +93,13 @@ %! m3 = []; %!test -%! __fntestfunc__("triu", m1, {"struct"}); +%! __fntestfunc__ ("triu", m1, {"struct"}); %!test %! __fntestfunc__ ("triu", m1, {"struct"}, -1); %!test %! __fntestfunc__ ("triu", m1, {"struct"}, 1); %!test -%! __fntestfunc__("triu", m3, {"struct"}); +%! __fntestfunc__ ("triu", m3, {"struct"}); %!test %! __fntestfunc__ ("tril", m1, {"struct"}); %!test @@ -107,7 +107,7 @@ %!test %! __fntestfunc__ ("tril", m1, {"struct"}, 1); %!test -%! __fntestfunc__("tril", m3, {"struct"}); +%! __fntestfunc__ ("tril", m3, {"struct"}); %!test %! __fntestfunc__ ("squeeze", m2); %!test
--- a/test/global.tst +++ b/test/global.tst @@ -36,7 +36,7 @@ %!endfunction %!test %! global G = 1; -%! f(); +%! f (); %% test/octave.test/global/global-4.m %!function f () @@ -54,7 +54,7 @@ %!function g () %! fail ("H"); %!test -%! g(); +%! g (); %% test/octave.test/global/global-6.m %!function f () @@ -65,8 +65,8 @@ %! assert (H,1); %!endfunction %!test -%! f(); -%! g(); +%! f (); +%! g (); %% test/octave.test/global/global-7.m %!test
--- a/test/index.tst +++ b/test/index.tst @@ -26,7 +26,7 @@ %!assert (a(:), 1) %!assert (a(:,:), 1) %!assert (a(1,:), 1) -%!assert (a(:,1),1) +%!assert (a(:,1), 1) %!assert (isempty (a(logical (0)))) %!error a(-1) %!error a(2) @@ -119,19 +119,19 @@ %!assert (b(:), [1; 3; 2; 4; 5; 7; 6; 8]) %!assert (b(:,:), [1, 2, 5, 6; 3, 4, 7, 8]) %!assert (b(:,1), [1;3]) -%!assert (b(:,:,:), reshape ([1,3,2,4,5,7,6,8],[2,2,2])) +%!assert (b(:,:,:), reshape ([1,3,2,4,5,7,6,8], [2,2,2])) %!assert (b(:,1,1), [1;3]) -%!assert (b(:,1,1,[1,1]),reshape ([1,3,1,3],[2,1,1,2])) +%!assert (b(:,1,1,[1,1]),reshape ([1,3,1,3], [2,1,1,2])) %!assert (b(1,3), 5) %!assert (b(1,[3,4]), [5,6]) %!assert (b(1,1:4), [1,2,5,6]) %!assert (b(1,[],:), zeros (1,0,2)) -%!assert (b(1,[]), zeros(1,0)) +%!assert (b(1,[]), zeros (1,0)) %!assert (b(:,3), [5;7]) %!assert (b([1,2],3), [5;7]) -%!assert (b(true(2,1),3), [5;7]) -%!assert (b(false(2,1),3), zeros(0,1)) -%!assert (b([],3), zeros(0,1)) +%!assert (b(true (2,1), 3), [5;7]) +%!assert (b(false (2,1), 3), zeros (0,1)) +%!assert (b([],3), zeros (0,1)) %!shared x %! # Dummy shared block to clear any previous definitions
--- a/test/io.tst +++ b/test/io.tst @@ -35,11 +35,11 @@ %! ## scalar %! a1 = 1; %! ## matrix -%! persistent a2 = hilb(3); +%! persistent a2 = hilb (3); %! ## complex scalar %! persistent a3 = 1 + 1i; %! ## complex matrix -%! persistent a4 = hilb(3) + 1i*hilb(3); +%! persistent a4 = hilb (3) + 1i*hilb (3); %! ## bool %! persistent a5 = (1 == 1); %! ## bool matrix @@ -211,7 +211,7 @@ %! save -binary struct.dat -struct STR matrix_fld str*_fld; %! STR = load ("struct.dat"); %! -%! assert (!isfield(STR,"scalar_fld") && ... +%! assert (!isfield (STR,"scalar_fld") && ... %! STR.matrix_fld == [1.1,2;3,4] && ... %! STR.string_fld == "Octave" && ... %! STR.struct_fld.x == 0 && ... @@ -305,13 +305,13 @@ %% test/octave.test/io/printf-1.m %!test %! nm = tmpnam (); -%! fid1 = fopen(nm,"w"); +%! fid1 = fopen (nm,"w"); %! x = fprintf (fid1, "%s: %d\n", "test", 1); -%! fclose(fid1); -%! fid2 = fopen(nm,"r"); -%! str = fscanf(fid2,"%s"); -%! fclose(fid2); -%! unlink(nm); +%! fclose (fid1); +%! fid2 = fopen (nm,"r"); +%! str = fscanf (fid2,"%s"); +%! fclose (fid2); +%! unlink (nm); %! assert (x, 8); %! assert (str, "test:1");
--- a/test/prefer.tst +++ b/test/prefer.tst @@ -137,7 +137,7 @@ %! save_precision (1); %! x = pi; %! nm = tmpnam (); -%! save("-text", nm, "x"); +%! save ("-text", nm, "x"); %! clear x; %! load (nm); %! unlink (nm); @@ -150,7 +150,7 @@ %! save_precision (5); %! x = pi; %! nm = tmpnam (); -%! save("-text", nm, "x"); +%! save ("-text", nm, "x"); %! clear x; %! load (nm); %! unlink (nm);
--- a/test/range.tst +++ b/test/range.tst @@ -40,14 +40,14 @@ %!assert ([ r ; sparse(z) ], sparse (expect)) %!assert ([ r ; sparse(logical(z)) ], sparse (expect)) -%!assert ([ r ; int8(z) ], int8(expect)) -%!assert ([ r ; int16(z) ], int16(expect)) -%!assert ([ r ; int32(z) ], int32(expect)) -%!assert ([ r ; int64(z) ], int64(expect)) -%!assert ([ r ; uint8(z) ], uint8(expect)) -%!assert ([ r ; uint16(z) ], uint16(expect)) -%!assert ([ r ; uint32(z) ], uint32(expect)) -%!assert ([ r ; uint64(z) ], uint64(expect)) +%!assert ([ r ; int8(z) ], int8 (expect)) +%!assert ([ r ; int16(z) ], int16 (expect)) +%!assert ([ r ; int32(z) ], int32 (expect)) +%!assert ([ r ; int64(z) ], int64 (expect)) +%!assert ([ r ; uint8(z) ], uint8 (expect)) +%!assert ([ r ; uint16(z) ], uint16 (expect)) +%!assert ([ r ; uint32(z) ], uint32 (expect)) +%!assert ([ r ; uint64(z) ], uint64 (expect)) ## Test mixing non-integer range with other types @@ -63,14 +63,14 @@ %!assert ([ r ; sparse(z) ], sparse (expect)) %!assert ([ r ; sparse(logical(z)) ], sparse (expect)) -%!assert ([ r ; int8(z) ], int8(expect)) -%!assert ([ r ; int16(z) ], int16(expect)) -%!assert ([ r ; int32(z) ], int32(expect)) -%!assert ([ r ; int64(z) ], int64(expect)) -%!assert ([ r ; uint8(z) ], uint8(expect)) -%!assert ([ r ; uint16(z) ], uint16(expect)) -%!assert ([ r ; uint32(z) ], uint32(expect)) -%!assert ([ r ; uint64(z) ], uint64(expect)) +%!assert ([ r ; int8(z) ], int8 (expect)) +%!assert ([ r ; int16(z) ], int16 (expect)) +%!assert ([ r ; int32(z) ], int32 (expect)) +%!assert ([ r ; int64(z) ], int64 (expect)) +%!assert ([ r ; uint8(z) ], uint8 (expect)) +%!assert ([ r ; uint16(z) ], uint16 (expect)) +%!assert ([ r ; uint32(z) ], uint32 (expect)) +%!assert ([ r ; uint64(z) ], uint64 (expect)) ## Test corner cases of ranges (base and limit)
--- a/test/recursion.tst +++ b/test/recursion.tst @@ -26,7 +26,7 @@ %! endif %!endfunction %! -%!assert(f (5), 120); +%!assert (f (5), 120) %% test/octave.test/recursion/recursion-2.m %!function y = f (x) @@ -38,6 +38,7 @@ %! endif %!endfunction %! -%!assert(f (5), 120); +%!assert (f (5), 120) %%FIXME: Need test for maximum recursion depth +
--- a/test/return.tst +++ b/test/return.tst @@ -23,7 +23,7 @@ %! y = 2; %!endfunction %! -%!assert(f(), 1) +%!assert (f (), 1) %% test/octave.test/return/return-2.m %!test
--- a/test/slice.tst +++ b/test/slice.tst @@ -32,7 +32,7 @@ %! case 33 %! x(:, :, slice) = 2; %! otherwise -%! error("invalid dim, '%d'", dim); +%! error ("invalid dim, '%d'", dim); %! endswitch %!endfunction
--- a/test/struct.tst +++ b/test/struct.tst @@ -152,8 +152,8 @@ %! c(4, 4, 4, 4).name = "a"; %! c(3, 3, 3, 3).value = 1; %! [c([1, 3], 2, :, [3, 4]).value] = deal (1); -%! assert (length(find([c.value] == 1)), 17); -%! assert (length(find([c.value])), 17); +%! assert (length (find ([c.value] == 1)), 17); +%! assert (length (find ([c.value])), 17); ## swap elements of struct array %!test @@ -166,7 +166,7 @@ %! c(4, 4, 4, 4).value = 3; %! c(1, 2, 3, 4).value = 2; %! c(3, 3, 3, 3).value = 1; -%! d = reshape ({c.value}, size(c)); +%! d = reshape ({c.value}, size (c)); %! assert ([d{4, 4, 4, 4}, d{1, 2, 3, 4}, d{3, 3, 3, 3}], %! [3, 2, 1]);