# HG changeset patch # User Rik # Date 1377142865 25200 # Node ID 7f27a3cbdb413c71930e60a0bfab56d38f3b4336 # Parent 1e1d42f0f33299eee8462100dccbc723b292e69d Use Octave coding convention of 1 space after '%!' test prefix. * scripts/signal/fftconv.m, scripts/signal/fftshift.m, scripts/testfun/assert.m, test/args.tst: Use Octave coding convention of 1 space after '%!' test prefix. diff -r 1e1d42f0f332 -r 7f27a3cbdb41 scripts/signal/fftconv.m --- a/scripts/signal/fftconv.m Wed Aug 21 20:23:03 2013 -0700 +++ b/scripts/signal/fftconv.m Wed Aug 21 20:41:05 2013 -0700 @@ -67,36 +67,36 @@ %% FIXME: Borrow tests from conv.m. May need a tolerance on the assert comparison %!test -%! x = ones (3,1); -%! y = ones (1,3); -%! b = 2; -%! c = 3; -%! assert (fftconv (x, x), [1; 2; 3; 2; 1], 5*eps); -%! assert (fftconv (y, y), [1, 2, 3, 2, 1], 5*eps); -%! assert (fftconv (x, y), [1, 2, 3, 2, 1], 5*eps); -%! assert (fftconv (y, x), [1; 2; 3; 2; 1], 5*eps); -%! assert (fftconv (c, x), [3; 3; 3], 5*eps); -%! assert (fftconv (c, y), [3, 3, 3], 5*eps); -%! assert (fftconv (x, c), [3; 3; 3], 5*eps); -%! assert (fftconv (y, c), [3, 3, 3], 5*eps); -%! assert (fftconv (b, c), 6, 5*eps); +%! x = ones (3,1); +%! y = ones (1,3); +%! b = 2; +%! c = 3; +%! assert (fftconv (x, x), [1; 2; 3; 2; 1], 5*eps); +%! assert (fftconv (y, y), [1, 2, 3, 2, 1], 5*eps); +%! assert (fftconv (x, y), [1, 2, 3, 2, 1], 5*eps); +%! assert (fftconv (y, x), [1; 2; 3; 2; 1], 5*eps); +%! assert (fftconv (c, x), [3; 3; 3], 5*eps); +%! assert (fftconv (c, y), [3, 3, 3], 5*eps); +%! assert (fftconv (x, c), [3; 3; 3], 5*eps); +%! assert (fftconv (y, c), [3, 3, 3], 5*eps); +%! assert (fftconv (b, c), 6, 5*eps); %!test -%! a = 1:10; -%! b = 1:3; -%! assert (size (conv (a,b)), [1, numel(a)+numel(b)-1]) -%! assert (size (conv (b,a)), [1, numel(a)+numel(b)-1]) +%! a = 1:10; +%! b = 1:3; +%! assert (size (conv (a,b)), [1, numel(a)+numel(b)-1]); +%! assert (size (conv (b,a)), [1, numel(a)+numel(b)-1]); -%! a = (1:10).'; -%! b = 1:3; -%! assert (size (conv (a,b)), [numel(a)+numel(b)-1, 1]) -%! assert (size (conv (b,a)), [numel(a)+numel(b)-1, 1]) +%! a = (1:10).'; +%! b = 1:3; +%! assert (size (conv (a,b)), [numel(a)+numel(b)-1, 1]); +%! assert (size (conv (b,a)), [numel(a)+numel(b)-1, 1]); %!test -%! a = 1:10; -%! b = (1:3).'; -%! assert (size (conv (a,b)), [1, numel(a)+numel(b)-1]) -%! assert (size (conv (b,a)), [1, numel(a)+numel(b)-1]) +%! a = 1:10; +%! b = (1:3).'; +%! assert (size (conv (a,b)), [1, numel(a)+numel(b)-1]); +%! assert (size (conv (b,a)), [1, numel(a)+numel(b)-1]); %% Test input validation %!error fftconv (1) diff -r 1e1d42f0f332 -r 7f27a3cbdb41 scripts/signal/fftshift.m --- a/scripts/signal/fftshift.m Wed Aug 21 20:23:03 2013 -0700 +++ b/scripts/signal/fftshift.m Wed Aug 21 20:41:05 2013 -0700 @@ -85,47 +85,47 @@ %!test -%! x = [0:7]; -%! y = fftshift (x); -%! assert (y, [4 5 6 7 0 1 2 3]); -%! assert (fftshift (y), x); +%! x = [0:7]; +%! y = fftshift (x); +%! assert (y, [4 5 6 7 0 1 2 3]); +%! assert (fftshift (y), x); %!test -%! x = [0:6]; -%! y = fftshift (x); -%! assert (y, [4 5 6 0 1 2 3]); -%! assert (fftshift (y), [1 2 3 4 5 6 0]); +%! x = [0:6]; +%! y = fftshift (x); +%! assert (y, [4 5 6 0 1 2 3]); +%! assert (fftshift (y), [1 2 3 4 5 6 0]); %!test -%! x = [0:7]'; -%! y = fftshift (x); -%! assert (y, [4;5;6;7;0;1;2;3]); -%! assert (fftshift (y), x); +%! x = [0:7]'; +%! y = fftshift (x); +%! assert (y, [4;5;6;7;0;1;2;3]); +%! assert (fftshift (y), x); %!test -%! x = [0:6]'; -%! y = fftshift (x); -%! assert (y, [4;5;6;0;1;2;3]); -%! assert (fftshift (y), [1;2;3;4;5;6;0]); +%! x = [0:6]'; +%! y = fftshift (x); +%! assert (y, [4;5;6;0;1;2;3]); +%! assert (fftshift (y), [1;2;3;4;5;6;0]); %!test -%! x = [0:3]; -%! x = [x;2*x;3*x+1;4*x+1]; -%! y = fftshift (x); -%! assert (y, [[7 10 1 4];[9 13 1 5];[2 3 0 1];[4 6 0 2]]); -%! assert (fftshift (y), x); +%! x = [0:3]; +%! x = [x;2*x;3*x+1;4*x+1]; +%! y = fftshift (x); +%! assert (y, [[7 10 1 4];[9 13 1 5];[2 3 0 1];[4 6 0 2]]); +%! assert (fftshift (y), x); %!test -%! x = [0:3]; -%! x = [x;2*x;3*x+1;4*x+1]; -%! y = fftshift (x,1); -%! assert (y, [[1 4 7 10];[1 5 9 13];[0 1 2 3];[0 2 4 6]]); -%! assert (fftshift (y,1), x); +%! x = [0:3]; +%! x = [x;2*x;3*x+1;4*x+1]; +%! y = fftshift (x,1); +%! assert (y, [[1 4 7 10];[1 5 9 13];[0 1 2 3];[0 2 4 6]]); +%! assert (fftshift (y,1), x); %!test -%! x = [0:3]; -%! x = [x;2*x;3*x+1;4*x+1]; -%! y = fftshift (x,2); -%! assert (y, [[2 3 0 1];[4 6 0 2];[7 10 1 4];[9 13 1 5]]); -%! assert (fftshift (y,2), x); +%! x = [0:3]; +%! x = [x;2*x;3*x+1;4*x+1]; +%! y = fftshift (x,2); +%! assert (y, [[2 3 0 1];[4 6 0 2];[7 10 1 4];[9 13 1 5]]); +%! assert (fftshift (y,2), x); diff -r 1e1d42f0f332 -r 7f27a3cbdb41 scripts/testfun/assert.m --- a/scripts/testfun/assert.m Wed Aug 21 20:23:03 2013 -0700 +++ b/scripts/testfun/assert.m Wed Aug 21 20:41:05 2013 -0700 @@ -549,21 +549,22 @@ ## structures %!error assert (1, struct ("a", 1)) %!error -%! x(1,2,3).a = 1; -%! y(1,2).a = 1; -%! assert (x,y); +%! x(1,2,3).a = 1; +%! y(1,2).a = 1; +%! assert (x,y); %!error -%! x(1,2,3).a = 1; -%! y(3,2,2).a = 1; -%! assert (x,y); +%! x(1,2,3).a = 1; +%! y(3,2,2).a = 1; +%! assert (x,y); %!error -%! x.a = 1; x.b = 1; -%! y.a = 1; -%! assert (x,y); +%! x.a = 1; +%! x.b = 1; +%! y.a = 1; +%! assert (x,y); %!error <'b' is not an expected field> -%! x.b = 1; -%! y.a = 1; -%! assert (x,y); +%! x.b = 1; +%! y.a = 1; +%! assert (x,y); %!test %! x.a = 1; x.b=[2, 2]; diff -r 1e1d42f0f332 -r 7f27a3cbdb41 test/args.tst --- a/test/args.tst Wed Aug 21 20:23:03 2013 -0700 +++ b/test/args.tst Wed Aug 21 20:41:05 2013 -0700 @@ -123,98 +123,98 @@ %! assert (x, 0); %!endfunction %!test -%! f() +%! f() ## numeric vector (spaces) %!function f (x = [0 1 2]) %! assert (x, [0 1 2]); %!endfunction %!test -%! f() +%! f() ## numeric vector (range) %!function f (x = 1:3) %! assert (x, 1:3); %!endfunction %!test -%! f() +%! f() ## numeric vector (commas) %!function f (x = [0,1,2]) %! assert (x, [0 1 2]); %!endfunction %!test -%! f() +%! f() ## numeric vector (commas and spaces) %!function f (x = [0, 1, 2]) %! assert (x, [0 1 2]); %!endfunction %!test -%! f() +%! f() ## numeric matrix %!function f (x = [0, 1, 2;3, 4, 5]) %! assert (x, [0 1 2;3 4 5]); %!endfunction %!test -%! f() +%! f() ## empty cell %!function f (x = {}) %! assert (x, {}); %!endfunction %!test -%! f() +%! f() ## full cell %!function f (x = {1}) %! assert (x, {1}); %!endfunction %!test -%! f() +%! f() ## many cells %!function f (x = {1 'a' "b" 2.0 struct("a", 3)}) %! assert (x, {1 'a' "b" 2.0 struct("a", 3)}); %!endfunction %!test -%! f() +%! f() ## struct %!function f (x = struct("a", 3)) %! assert (x, struct ("a", 3)); %!endfunction %!test -%! f() +%! f() ## char (double quotes) %!function f (x = "a") %! assert (x, "a"); %!endfunction %!test -%! f() +%! f() ## char (single quotes) %!function f (x = 'a') %! assert (x, "a"); %!endfunction %!test -%! f() +%! f() ## char (string, double quotes) %!function f (x = "abc123") %! assert (x, "abc123"); %!endfunction %!test -%! f() +%! f() ## char (string, double quotes, punctuation) %!function f (x = "abc123`1234567890-=~!@#$%^&*()_+[]{}|;':\",./<>?\\") %! assert (x, "abc123`1234567890-=~!@#$%^&*()_+[]{}|;':\",./<>?\\"); %!endfunction %!test -%! f() +%! f() ## Function handle (builtin) %!function f (x = @sin) @@ -223,7 +223,7 @@ %! assert (isa (x, "function_handle") && strcmp (fname, "sin")); %!endfunction %!test -%! f() +%! f() ## Function handle (anonymous) %!function f (x = @(x) x.^2) @@ -232,5 +232,5 @@ %! assert (isa (x, "function_handle") && strcmp (ftype, "anonymous")); %!endfunction %!test -%! f() +%! f()