Mercurial > octave
changeset 28922:c68b077c8fd6
maint: Use parentheses around conditional expressions in test/.
* fA.m, myclass2.m, foo_subsref_subsasgn.m, get.m, set.m,
CPrecedenceTester2.m, CPrecedenceTester3.m, get.m, set.m, get.m, set.m, get.m,
set.m, subsasgn.m, subsref.m, get.m, set.m, get.m, set.m, get.m, set.m,
parent.m, recursive_nest.m, recursive_nest2.m, scope1.m, script_nest.m,
varg_nest2.m:
Use parentheses around conditional expressions in test/ directory.
line wrap: on
line diff
--- a/test/bug-35448/fA.m Tue Oct 13 23:26:17 2020 -0700 +++ b/test/bug-35448/fA.m Tue Oct 13 23:32:38 2020 -0700 @@ -1,7 +1,7 @@ # fA.m function y = fA (x, f) global gfun - if nargin < 2 + if (nargin < 2) y = fA (x, gfun); else w = feval (f, x);
--- a/test/bug-58593/myclass2.m Tue Oct 13 23:26:17 2020 -0700 +++ b/test/bug-58593/myclass2.m Tue Oct 13 23:32:38 2020 -0700 @@ -45,13 +45,13 @@ switch (S(1).subs) case 'data' % Transform: obj.data --> obj.data_ - if length (S)>1 + if (length (S)>1) B = subsasgn (obj.data_, S(2:end), B); end obj.data_ = B; case 'alldata' % Transform: obj.data --> obj.data_(1:end) - if length (S)>1 + if (length (S)>1) B = subsasgn (obj.data_(1:end), S(2:end), B); end % This statement should trigger *builtin* subsref to evaluate 'end',
--- a/test/classdef/foo_subsref_subsasgn.m Tue Oct 13 23:26:17 2020 -0700 +++ b/test/classdef/foo_subsref_subsasgn.m Tue Oct 13 23:32:38 2020 -0700 @@ -18,7 +18,7 @@ function ind = end (obj, k, n) sz = size (obj.x); - if k < n + if (k < n) ind = sz(k); else ind = prod (sz(k:end));
--- a/test/classes/@Blork/get.m Tue Oct 13 23:26:17 2020 -0700 +++ b/test/classes/@Blork/get.m Tue Oct 13 23:32:38 2020 -0700 @@ -1,6 +1,6 @@ function v = get (s, propName) - switch propName + switch (propName) case 'bleek' v = s.bleek; otherwise
--- a/test/classes/@Blork/set.m Tue Oct 13 23:26:17 2020 -0700 +++ b/test/classes/@Blork/set.m Tue Oct 13 23:32:38 2020 -0700 @@ -5,7 +5,7 @@ propName = propArgs{1}; propValue = propArgs{2}; propArgs = propArgs(3:end); - switch propName + switch (propName) case 'bleek' s.bleek = propValue; otherwise
--- a/test/classes/@CPrecedenceTester2/CPrecedenceTester2.m Tue Oct 13 23:26:17 2020 -0700 +++ b/test/classes/@CPrecedenceTester2/CPrecedenceTester2.m Tue Oct 13 23:32:38 2020 -0700 @@ -3,7 +3,7 @@ x = struct ('useless_data', pi^2); x = class (x, 'CPrecedenceTester2'); - switch flag + switch (flag) case 1 % CPrecedencetester2 > Snork superiorto ('Snork'); case 2 % CPrecedencetester2 < Snork
--- a/test/classes/@CPrecedenceTester3/CPrecedenceTester3.m Tue Oct 13 23:26:17 2020 -0700 +++ b/test/classes/@CPrecedenceTester3/CPrecedenceTester3.m Tue Oct 13 23:32:38 2020 -0700 @@ -3,7 +3,7 @@ x = struct ('useless_data', pi^3); x = class (x, 'CPrecedenceTester3'); - switch flag + switch (flag) case 1 % CPrecedencetester3 > Snork superiorto ('Snork'); case 2 % CPrecedencetester3 < Snork
--- a/test/classes/@Cork/get.m Tue Oct 13 23:26:17 2020 -0700 +++ b/test/classes/@Cork/get.m Tue Oct 13 23:32:38 2020 -0700 @@ -1,6 +1,6 @@ function v = get (s, propName) - switch propName + switch (propName) case 'click' v = s.click; otherwise
--- a/test/classes/@Cork/set.m Tue Oct 13 23:26:17 2020 -0700 +++ b/test/classes/@Cork/set.m Tue Oct 13 23:32:38 2020 -0700 @@ -5,7 +5,7 @@ propName = propArgs{1}; propValue = propArgs{2}; propArgs = propArgs(3:end); - switch propName + switch (propName) case 'click' s.click = propValue; otherwise
--- a/test/classes/@Dork/get.m Tue Oct 13 23:26:17 2020 -0700 +++ b/test/classes/@Dork/get.m Tue Oct 13 23:32:38 2020 -0700 @@ -1,6 +1,6 @@ function v = get (s, propName) - switch propName + switch (propName) case 'gack' v = s.gack; otherwise
--- a/test/classes/@Dork/set.m Tue Oct 13 23:26:17 2020 -0700 +++ b/test/classes/@Dork/set.m Tue Oct 13 23:32:38 2020 -0700 @@ -5,7 +5,7 @@ propName = propArgs{1}; propValue = propArgs{2}; propArgs = propArgs(3:end); - switch propName + switch (propName) case 'gack' s.gack = propValue; otherwise
--- a/test/classes/@Gork/get.m Tue Oct 13 23:26:17 2020 -0700 +++ b/test/classes/@Gork/get.m Tue Oct 13 23:32:38 2020 -0700 @@ -1,6 +1,6 @@ function v = get (s, propName) - switch propName + switch (propName) case 'cork' v = s.Cork; case 'gark'
--- a/test/classes/@Gork/set.m Tue Oct 13 23:26:17 2020 -0700 +++ b/test/classes/@Gork/set.m Tue Oct 13 23:32:38 2020 -0700 @@ -5,7 +5,7 @@ propName = propArgs{1}; propValue = propArgs{2}; propArgs = propArgs(3:end); - switch propName + switch (propName) case 'cork' if (isa (propValue, 'Cork')) s.Cork = propValue;
--- a/test/classes/@Gork/subsasgn.m Tue Oct 13 23:26:17 2020 -0700 +++ b/test/classes/@Gork/subsasgn.m Tue Oct 13 23:32:38 2020 -0700 @@ -1,8 +1,8 @@ function g = subsasgn (g, s, x) - switch s.type + switch (s.type) case '.' - switch s.subs + switch (s.subs) case 'gyrk' g.gyrk = x; end
--- a/test/classes/@Gork/subsref.m Tue Oct 13 23:26:17 2020 -0700 +++ b/test/classes/@Gork/subsref.m Tue Oct 13 23:32:38 2020 -0700 @@ -1,8 +1,8 @@ function x = subsref (g, s) - switch s.type + switch (s.type) case '.' - switch s.subs + switch (s.subs) case 'gyrk' x = g.gyrk; end
--- a/test/classes/@Pork/get.m Tue Oct 13 23:26:17 2020 -0700 +++ b/test/classes/@Pork/get.m Tue Oct 13 23:32:38 2020 -0700 @@ -1,6 +1,6 @@ function v = get (s, propName) - switch propName + switch (propName) case 'gurk' v = s.gurk; otherwise
--- a/test/classes/@Pork/set.m Tue Oct 13 23:26:17 2020 -0700 +++ b/test/classes/@Pork/set.m Tue Oct 13 23:32:38 2020 -0700 @@ -5,7 +5,7 @@ propName = propArgs{1}; propValue = propArgs{2}; propArgs = propArgs(3:end); - switch propName + switch (propName) case 'gurk' s.gurk = propValue; otherwise
--- a/test/classes/@Snork/get.m Tue Oct 13 23:26:17 2020 -0700 +++ b/test/classes/@Snork/get.m Tue Oct 13 23:32:38 2020 -0700 @@ -1,6 +1,6 @@ function v = get (s, propName) - switch propName + switch (propName) case 'gick' v = s.gick; otherwise
--- a/test/classes/@Snork/set.m Tue Oct 13 23:26:17 2020 -0700 +++ b/test/classes/@Snork/set.m Tue Oct 13 23:32:38 2020 -0700 @@ -5,7 +5,7 @@ propName = propArgs{1}; propValue = propArgs{2}; propArgs = propArgs(3:end); - switch propName + switch (propName) case 'gick' s.gick = propValue; otherwise
--- a/test/classes/@Spork/get.m Tue Oct 13 23:26:17 2020 -0700 +++ b/test/classes/@Spork/get.m Tue Oct 13 23:32:38 2020 -0700 @@ -1,6 +1,6 @@ function v = get (s, propName) - switch propName + switch (propName) case 'geek' v = s.geek; otherwise
--- a/test/classes/@Spork/set.m Tue Oct 13 23:26:17 2020 -0700 +++ b/test/classes/@Spork/set.m Tue Oct 13 23:32:38 2020 -0700 @@ -5,7 +5,7 @@ propName = propArgs{1}; propValue = propArgs{2}; propArgs = propArgs(3:end); - switch propName + switch (propName) case 'geek' s.geek = propValue; otherwise
--- a/test/ctor-vs-method/@parent/parent.m Tue Oct 13 23:26:17 2020 -0700 +++ b/test/ctor-vs-method/@parent/parent.m Tue Oct 13 23:32:38 2020 -0700 @@ -3,7 +3,7 @@ if (nargin == 0) rot = class (struct (), 'parent'); else - switch class (a) + switch (class (a)) case 'parent' %% copy constructor rot = a;
--- a/test/nest/recursive_nest.m Tue Oct 13 23:26:17 2020 -0700 +++ b/test/nest/recursive_nest.m Tue Oct 13 23:32:38 2020 -0700 @@ -5,7 +5,7 @@ f (20); function f (n) - if n > 0 + if (n > 0) x = x + recursive_nest_inc; f (n - 1); end
--- a/test/nest/recursive_nest2.m Tue Oct 13 23:26:17 2020 -0700 +++ b/test/nest/recursive_nest2.m Tue Oct 13 23:32:38 2020 -0700 @@ -7,7 +7,7 @@ C; v = Y; function BB (m) - if m > 0 + if (m > 0) Y = Y + 1; BB(m - 1); C;
--- a/test/nest/scope1.m Tue Oct 13 23:26:17 2020 -0700 +++ b/test/nest/scope1.m Tue Oct 13 23:32:38 2020 -0700 @@ -1,7 +1,7 @@ # scope1.m function scope1 (n) value = n; - if value + if (value) C; end function A