# HG changeset patch # User Rik # Date 1362679333 28800 # Node ID 6fe6ac8bbfdb0e3f1a926de723f5b07453dc911a # Parent b1283d4c06c25dfa8d479364f396515a4b36ea53 test: Remove trailing spaces from ends of lines in test/ directory. * test/bug-31371.tst, test/bug-36025/@testclass/testclass.m, test/build-sparse-tests.sh, test/classes/@CPrecedenceTester2/CPrecedenceTester2.m, test/classes/@CPrecedenceTester3/CPrecedenceTester3.m, test/classes/@Cork/click.m, test/classes/@Dork/Dork.m, test/classes/@Dork/display.m, test/classes/@Dork/gack.m, test/classes/@Gork/cork.m, test/classes/@Gork/gark.m, test/classes/@Gork/subsasgn.m, test/classes/@Pork/Pork.m, test/classes/@Pork/gurk.m, test/classes/@Snork/gick.m, test/classes/@Spork/geek.m, test/error.tst, test/func.tst, test/index.tst, test/io.tst, test/line-continue.tst, test/prefer.tst, test/switch.tst, test/system.tst, test/try.tst: Remove trailing spaces from ends of lines in test/ directory. diff --git a/test/bug-31371.tst b/test/bug-31371.tst --- a/test/bug-31371.tst +++ b/test/bug-31371.tst @@ -4,38 +4,38 @@ %! %! C = @(fcn,x) fcn(x); %! C2 = @(fcn,x,y) fcn(x,y); -%! +%! %! % Church Booleans %! T = @(t,f) t; %! F = @(t,f) f; -%! +%! %! % Church Numerals %! Zero = @(fcn,x) x; %! One = @(fcn,x) fcn(x); %! Two = @(fcn,x) fcn(fcn(x)); %! Three = @(fcn,x) fcn(fcn(fcn(x))); %! Four = @(fcn,x) fcn(fcn(fcn(fcn(x)))); -%! +%! %! % Arithmetic Operations %! Inc = @(a) @(f,x) f(a(f,x)); % Increment %! Add = @(a,b) @(f,x) a(f,b(f,x)); %! Mult = @(a,b) @(f,x) a(@(x) b(f,x),x); %! Dec = @(a) @(f,x) C(a(@(g) @(h) h(g(f)), @(u) x), @(u) u); % Decrement %! Sub = @(a,b) b(Dec, a); -%! +%! %! % Renderer - Convert church numeral to "real" number %! Render = @(n) n(@(n) n+1,0); -%! +%! %! % Predicates %! Iszero = @(n) n(@(x) F, T); -%! +%! %! % Y combinator implements recursion %! Ycomb = @(f) C(@(g) f(@(x) C(g(g), x)), ... %! @(g) f(@(x) C(g(g), x))); %! %! Factorial = Ycomb(@(f) @(n) C(C2(Iszero(n), ... %! @(d) One, @(d) Mult(n, f(Dec(n)))),0)); -%! +%! %! assert (Render (Factorial (Two)), 2) %! assert (Render (Factorial (Three)), 6) %! assert (Render (Factorial (Four)), 24) diff --git a/test/bug-36025/@testclass/testclass.m b/test/bug-36025/@testclass/testclass.m --- a/test/bug-36025/@testclass/testclass.m +++ b/test/bug-36025/@testclass/testclass.m @@ -1,4 +1,4 @@ function m = testclass (x,y) - m = struct ('x',x,'y',y); - m = class (m,"testclass"); + m = struct ('x',x,'y',y); + m = class (m,"testclass"); endfunction diff --git a/test/build-sparse-tests.sh b/test/build-sparse-tests.sh --- a/test/build-sparse-tests.sh +++ b/test/build-sparse-tests.sh @@ -19,7 +19,7 @@ # . # Some tests are commented out because they are known to be broken! -# Search for "# fails" +# Search for "# fails" # ./build_sparse_tests.sh preset # creates sparse.tst with preset tests. @@ -36,13 +36,13 @@ # uses randomly generated matrices. # # The tests are mostly identical for each case but the code is different, -# so it is important that the tests be run on all cases. Because our test +# so it is important that the tests be run on all cases. Because our test # harness doesn't have support for looping or macros (it is only needed # for new data types), but sh does, we use sh to generate inline versions of # the tests for each case. # # Our 'macros' use shared variables as parameters. This allows us to -# for example define A complex and include all the unary ops tests, +# for example define A complex and include all the unary ops tests, # then set A=real(A) and include all the unary ops tests. Thus the # same tests work for real and complex. For binary tests it is even # more complicated because we want full X sparse, sparse X full and @@ -59,7 +59,7 @@ # helper gen_eat_zeros # make sure sparse-scalar ops which generate 0 work # gen_specific_tests -# specific and eat zeros tests +# specific and eat zeros tests # helper gen_ordering_tests # ordered comparison operators for real valued tests # helper gen_sparsesparse_ordering_tests @@ -71,12 +71,12 @@ # element-wise matrix binary operators, for sparse-sparse ops. # horizontal/vertical concatenation are here as well. # helper gen_divop_tests -# left and right matrix division operators of rectangular matrices. +# left and right matrix division operators of rectangular matrices. # Needs QR solvers # helper gen_square_divop_tests -# left and right matrix division operators of square matrices. +# left and right matrix division operators of square matrices. # helper gen_matrixop_tests -# rectangular matrix binary operators: * +# rectangular matrix binary operators: * # helper gen_matrixdiag_tests # Tests extract of diag and creation of diagonal matrices using # diag and spdiags functions @@ -146,7 +146,7 @@ # Specific preset tests # ======================================================= -# If a sparse operation yields zeros, then those elements +# If a sparse operation yields zeros, then those elements # of the returned sparse matrix should be eaten. gen_eat_zeros() { cat >>$TESTS <>$TESTS < Snork + switch flag + case 1 % CPrecedencetester2 > Snork superiorto ('Snork'); - case 2, % CPrecedencetester2 < Snork + case 2 % CPrecedencetester2 < Snork inferiorto ('Snork'); - otherwise, + otherwise error ('Incorrect value for argument flag: %d', flag); end diff --git a/test/classes/@CPrecedenceTester3/CPrecedenceTester3.m b/test/classes/@CPrecedenceTester3/CPrecedenceTester3.m --- a/test/classes/@CPrecedenceTester3/CPrecedenceTester3.m +++ b/test/classes/@CPrecedenceTester3/CPrecedenceTester3.m @@ -3,12 +3,12 @@ x = struct ('useless_data', pi^3); x = class (x, 'CPrecedenceTester3'); - switch flag, - case 1, % CPrecedencetester3 > Snork + switch flag + case 1 % CPrecedencetester3 > Snork superiorto ('Snork'); - case 2, % CPrecedencetester3 < Snork + case 2 % CPrecedencetester3 < Snork inferiorto ('Snork'); - otherwise, + otherwise error ('Incorrect value for argument flag: %d', flag); end diff --git a/test/classes/@Cork/click.m b/test/classes/@Cork/click.m --- a/test/classes/@Cork/click.m +++ b/test/classes/@Cork/click.m @@ -1,6 +1,6 @@ function out = click (in, val) - if (nargin == 1) + if (nargin == 1) out = in.click; else in.click = val; diff --git a/test/classes/@Dork/Dork.m b/test/classes/@Dork/Dork.m --- a/test/classes/@Dork/Dork.m +++ b/test/classes/@Dork/Dork.m @@ -13,6 +13,6 @@ s.gack = gack; end s = class (s, 'Dork', s0); - end + end end diff --git a/test/classes/@Dork/display.m b/test/classes/@Dork/display.m --- a/test/classes/@Dork/display.m +++ b/test/classes/@Dork/display.m @@ -1,4 +1,4 @@ -function display (s) +function display (s) % Display the critical info for an amplifier gick = get (s, 'gick'); diff --git a/test/classes/@Dork/gack.m b/test/classes/@Dork/gack.m --- a/test/classes/@Dork/gack.m +++ b/test/classes/@Dork/gack.m @@ -1,6 +1,6 @@ function out = gack (in, val) - if (nargin == 1) + if (nargin == 1) out = in.gack; else in.gack = val; diff --git a/test/classes/@Gork/cork.m b/test/classes/@Gork/cork.m --- a/test/classes/@Gork/cork.m +++ b/test/classes/@Gork/cork.m @@ -1,6 +1,6 @@ function out = cork (in, val) - if (nargin == 1) + if (nargin == 1) out = in.Cork; else in.Cork = val; diff --git a/test/classes/@Gork/gark.m b/test/classes/@Gork/gark.m --- a/test/classes/@Gork/gark.m +++ b/test/classes/@Gork/gark.m @@ -1,6 +1,6 @@ function out = gark (in, val) - if (nargin == 1) + if (nargin == 1) out = in.gark; else in.gark = val; diff --git a/test/classes/@Gork/subsasgn.m b/test/classes/@Gork/subsasgn.m --- a/test/classes/@Gork/subsasgn.m +++ b/test/classes/@Gork/subsasgn.m @@ -4,7 +4,7 @@ case '.' switch s.subs case 'gyrk' - g.gyrk = x; + g.gyrk = x; end end diff --git a/test/classes/@Pork/Pork.m b/test/classes/@Pork/Pork.m --- a/test/classes/@Pork/Pork.m +++ b/test/classes/@Pork/Pork.m @@ -13,7 +13,7 @@ s.gurk = gurk; end s = class (s, 'Pork', s0); - end + end superiorto ('Dork'); end diff --git a/test/classes/@Pork/gurk.m b/test/classes/@Pork/gurk.m --- a/test/classes/@Pork/gurk.m +++ b/test/classes/@Pork/gurk.m @@ -1,6 +1,6 @@ function out = gurk (in, val) - if (nargin == 1) + if (nargin == 1) out = in.gurk; else in.gurk = val; diff --git a/test/classes/@Snork/gick.m b/test/classes/@Snork/gick.m --- a/test/classes/@Snork/gick.m +++ b/test/classes/@Snork/gick.m @@ -1,6 +1,6 @@ function out = gick (in, val) - if (nargin == 1) + if (nargin == 1) out = in.gick; else in.gick = val; diff --git a/test/classes/@Spork/geek.m b/test/classes/@Spork/geek.m --- a/test/classes/@Spork/geek.m +++ b/test/classes/@Spork/geek.m @@ -1,6 +1,6 @@ function out = geek (in, val) - if (nargin == 1) + if (nargin == 1) out = in.geek; else in.geek = val; diff --git a/test/error.tst b/test/error.tst --- a/test/error.tst +++ b/test/error.tst @@ -19,20 +19,20 @@ ## Test %!error usage %% test/octave.test/error/error-1.m -%!function g () +%!function g () %! error ("foo"); %!endfunction -%!function f () -%! g (); +%!function f () +%! g (); %!endfunction %!error f () %% test/octave.test/error/error-2.m -%!function g () +%!function g () %! error ("foo\n"); %!endfunction -%!function f () -%! g +%!function f () +%! g %!endfunction %!error f () @@ -68,20 +68,20 @@ ## Test usage() function %% test/octave.test/error/usage-1.m -%!function g () +%!function g () %! usage ("foo"); %!endfunction -%!function f () -%! g (); +%!function f () +%! g (); %!endfunction %!error f () %% test/octave.test/error/usage-2.m -%!function g () +%!function g () %! usage ("foo"); %!endfunction -%!function f () -%! g +%!function f () +%! g %!endfunction %!error f () diff --git a/test/func.tst b/test/func.tst --- a/test/func.tst +++ b/test/func.tst @@ -16,8 +16,8 @@ ## along with Octave; see the file COPYING. If not, see ## . -## This piece of test code ensures that all operations which work on -## dimensions alone (squeeze, triu, etc.) work for all objects and +## This piece of test code ensures that all operations which work on +## dimensions alone (squeeze, triu, etc.) work for all objects and ## preserve type. Even if the object is an empty matrix. This code is ## not to check that the function itself returns teh correct result, ## just that the results are consistent for all types. diff --git a/test/index.tst b/test/index.tst --- a/test/index.tst +++ b/test/index.tst @@ -160,7 +160,7 @@ %! assert (a, b); %!test -%! a(:,:,:) = 1:4; +%! a(:,:,:) = 1:4; %! assert (a, [1:4]); %!test diff --git a/test/io.tst b/test/io.tst --- a/test/io.tst +++ b/test/io.tst @@ -16,7 +16,7 @@ ## along with Octave; see the file COPYING. If not, see ## . -## FIXME -- we should skip (or mark as an expected failure) the test for +## 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. @@ -119,11 +119,11 @@ %! if (! isequal (a8, b8)) %! error ("failed: %s struct", file); %! endif -%! +%! %! if (! isequal (a9, b9)) %! error ("failed: %s cell", file); %! endif -%! +%! %! if (! isequal (a10, b10)) %! error ("failed: %s string", file); %! endif @@ -171,7 +171,7 @@ %! || isglobal ("a13") || isglobal ("a14") || isglobal ("a15") %! || isglobal ("a16") || isglobal ("a17") || isglobal ("a18") %! || isglobal ("a19") || isglobal ("a20")) -%! error ("failed: %s global test", file); +%! error ("failed: %s global test", file); %! endif %! endfor %! endif @@ -180,24 +180,24 @@ %!endfunction %!test -%! +%! %! [save_status, save_files] = testls (0); %! [load_status, load_files] = testls (1); -%! +%! %! for f = [save_files, load_files] %! unlink (f{1}); %! endfor -%! +%! %! assert (save_status && load_status); %!test -%! +%! %! STR.scalar_fld = 1; %! STR.matrix_fld = [1.1,2;3,4]; %! STR.string_fld = "Octave"; %! STR.struct_fld.x = 0; %! STR.struct_fld.y = 1; -%! +%! %! save struct.dat -struct STR; %! STR = load ("struct.dat"); %! @@ -282,7 +282,7 @@ %! [a, b, c] = sscanf ("1.2 3 foo", "%f%d%s", "C"); %! [v1, c1, m1] = sscanf ("1 2 3 4 5 6", "%d"); %! [v2, c2, m2] = sscanf ("1 2 bar 3 4 5 6", "%d"); -%! +%! %! assert ((a == 1.2 && b == 3 && c == "foo" %! && v1 == [1; 2; 3; 4; 5; 6] && c1 == 6 && ischar (m1) %! && v2 == [1; 2] && c2 == 2 && ischar (m2))); @@ -324,7 +324,7 @@ %% test/octave.test/io/sprintf-1.m %!test %! [s, msg, status] = sprintf ("%s: %d\n", "test", 1); -%! +%! %! assert (s == "test: 1\n" && ischar (msg) && status == 8); %% test/octave.test/io/sprintf-2.m @@ -336,9 +336,9 @@ %% test/octave.test/io/fopen-1.m %!test %! arch_list = ["native"; "ieee-le"; "ieee-be"; "vaxd"; "vaxg"; "cray"]; -%! +%! %! status = 1; -%! +%! %! for i = 1:6 %! arch = deblank (arch_list (i,:)); %! for j = 1:6 @@ -386,7 +386,7 @@ %! break; %! endif %! endfor -%! +%! %! assert (status == 1); %% test/octave.test/io/fopen-2.m @@ -433,7 +433,7 @@ %! "uint"; "unsigned int"; "long"; "ulong"; "unsigned long"; %! "float"; "float32"; "real*4"; "double"; "float64"; %! "real*8"; "int16"; "integer*2"; "int32"; "integer*4"]; -%! +%! %! n = rows (type_list); %! nm = tmpnam (); %! id = fopen (nm, "wb"); @@ -443,20 +443,20 @@ %! endfor %! %! fclose (id); -%! +%! %! id = fopen (nm, "rb"); %! if (id > 0) %! x = zeros (1, n); %! for i = 1:n %! x(i) = fread (id, [1, 1], deblank (type_list(i,:))); %! endfor -%! +%! %! if (x == 1:n) %! __printf_assert__ ("ok\n"); %! endif %! endif %! endif -%! +%! %! unlink (nm); %! assert (__prog_output_assert__ ("ok")); diff --git a/test/line-continue.tst b/test/line-continue.tst --- a/test/line-continue.tst +++ b/test/line-continue.tst @@ -30,7 +30,7 @@ %! x = [1;2]; %! y = [a... # comments here ok %! ;\ -%! +%! %! b]; %! assert (y, x); @@ -58,9 +58,9 @@ %!test %! x = [1, ... -%! +%! %! ... -%! +%! %! 2]; %! y = [1;2]; %! assert (y, x); diff --git a/test/prefer.tst b/test/prefer.tst --- a/test/prefer.tst +++ b/test/prefer.tst @@ -95,14 +95,14 @@ %!test %! wrre = warning ("query", "Octave:resize-on-range-error"); %! warning ("off", "Octave:resize-on-range-error"); -%! clear a; -%! a(2) = 1; a(3) = 2; +%! clear a; +%! a(2) = 1; a(3) = 2; %! assert (all (a == [0,1,2])); %! warning (wrre.state, "Octave:resize-on-range-error"); %% test/octave.test/prefer/prefer-18.m %!test -%! clear a; +%! clear a; %! a(1) = 1; a(2) = 2; %! assert (all (a == [1,2])); @@ -157,7 +157,7 @@ %! assert (x, 3.1416); %! save_precision (sp); -%% FIXME: How to capture standard output for comparison? +%% FIXME: How to capture standard output for comparison? %% test/octave.test/prefer/prefer-29.m %!function f () %! 1 @@ -169,7 +169,7 @@ %! assert (??); %! silent_functions (sf); -%% FIXME Same problem as above!!! +%% FIXME: Same problem as above!!! %% test/octave.test/prefer/prefer-30.m %!function f () %! 1 diff --git a/test/switch.tst b/test/switch.tst --- a/test/switch.tst +++ b/test/switch.tst @@ -21,12 +21,12 @@ %! a = 1; %! b = 2; %! c = 3; -%! +%! %! switch 0 case 1 x = a; case 2 x = b; otherwise x = c; endswitch %! switch 1 case 1 y = a; case 2 y = b; otherwise y = c; endswitch %! switch 2 case 1 z = a; case 2 z = b; otherwise z = c; endswitch %! switch 3 case 1 p = a; case 2 p = b; otherwise p = c; endswitch -%! +%! %! assert (x == c && y == a && z == b && p == c); %% test/octave.test/switch/switch-2.m @@ -34,11 +34,11 @@ %! a = 1; %! b = 2; %! c = 3; -%! +%! %! x = zeros (1, 4); -%! +%! %! k = 1; -%! +%! %! for i = 0:3 %! switch (i) %! case a @@ -50,7 +50,7 @@ %! endswitch %! k++; %! endfor -%! +%! %! assert (all (x == [3, 1, 2, 3])); %% test/octave.test/switch/switch-3.m @@ -58,11 +58,11 @@ %! a = 1; %! b = 2; %! c = 3; -%! +%! %! x = zeros (1, 4); -%! +%! %! k = 1; -%! +%! %! for i = 0:3 %! switch (i) %! case a @@ -70,7 +70,7 @@ %! endswitch %! k++; %! endfor -%! +%! %! assert (all (x == [0, 1, 0, 0])); %!test @@ -80,7 +80,7 @@ %! otherwise %! a = 2; %! endswitch -%! +%! %! assert (a == 2); diff --git a/test/system.tst b/test/system.tst --- a/test/system.tst +++ b/test/system.tst @@ -155,14 +155,14 @@ %! s1 = stat (nm); %! fclose (id); %! unlink (nm); -%! +%! %! umask (777); %! nm = tmpnam (); %! id = fopen (nm, "wb"); %! s2 = stat (nm); %! fclose (id); %! unlink (nm); -%! +%! %! assert (deblank (s1.modestr), "-rw-rw-rw-"); %! assert (deblank (s2.modestr), "----------"); %! # Restore original umask value @@ -372,7 +372,7 @@ %% test/octave.test/system/getpwent-1.m %!testif HAVE_GETPWENT %! s = getpwent (); -%! endpwent (); +%! endpwent (); %! assert ((isstruct (s) %! && isfield (s, "name") %! && isfield (s, "passwd") @@ -389,7 +389,7 @@ %!testif HAVE_GETPWUID %! x = getpwent (); %! y = getpwuid (x.uid); -%! endpwent (); +%! endpwent (); %! assert (strcmp (x.name, y.name) && x.uid == y.uid && x.gid == y.gid); %% test/octave.test/system/getpwuid-2.m @@ -402,7 +402,7 @@ %!testif HAVE_GETPWNAM %! x = getpwent (); %! y = getpwnam (x.name); -%! endpwent (); +%! endpwent (); %! assert (strcmp (x.name, y.name) && x.uid == y.uid && x.gid == y.gid); %% test/octave.test/system/getpwnam-2.m @@ -416,7 +416,7 @@ %! x = getpwent (); %! setpwent (); %! y = getpwent (); -%! endpwent (); +%! endpwent (); %! assert (strcmp (x.name, y.name) && x.uid == y.uid && x.gid == y.gid); %% test/octave.test/system/setpwent-2.m diff --git a/test/try.tst b/test/try.tst --- a/test/try.tst +++ b/test/try.tst @@ -68,7 +68,7 @@ %! assert (lasterr()(1:13), "'a' undefined"); %% test/octave.test/try/try-6.m -%!test +%!test %! try %! error ("user-defined error"); %! catch