Mercurial > octave
changeset 22737:7abc25e6206a
maint: Clean up code base to follow Octave coding conventions.
Space between '!' and expression that follows.
Eliminate whitespace at end of line.
Use '#' rather than '%' for comment character.
* ButtonGroup.cc, ListBoxControl.cc, file-editor-tab.cc, file-editor.cc,
bsxfun.cc, cellfun.cc, conv2.cc, data.cc, dot.cc, fft2.cc, file-io.cc,
filter.cc, graphics.cc, kron.cc, oct-stream.cc, quadcc.cc, spparms.cc,
sylvester.cc, convhulln.cc, qr.cc, ov-class.cc, ov-cx-mat.cc, ov-usr-fcn.cc,
pt.h, Array.cc, gsvd.h, inputdlg.m, krylov.m, shrinkfaces.m, padecoef.m,
polyout.m, durbinlevinson.m:
maint: Clean up code base to follow Octave coding conventions.
line wrap: on
line diff
--- a/libgui/graphics/ButtonGroup.cc Mon Nov 07 15:48:46 2016 -0800 +++ b/libgui/graphics/ButtonGroup.cc Tue Nov 08 10:01:17 2016 -0800 @@ -443,7 +443,7 @@ ButtonGroup::buttonToggled (bool toggled) { Q_UNUSED (toggled); - if (!m_blockUpdates) + if (! m_blockUpdates) { gh_manager::auto_lock lock; uibuttongroup::properties& bp = properties<uibuttongroup> ();
--- a/libgui/graphics/ListBoxControl.cc Mon Nov 07 15:48:46 2016 -0800 +++ b/libgui/graphics/ListBoxControl.cc Tue Nov 08 10:01:17 2016 -0800 @@ -189,18 +189,18 @@ m_selectionChanged = true; } - void + void ListBoxControl::itemActivated (const QModelIndex &) { m_selectionChanged = true; } - void + void ListBoxControl::itemPressed (QListWidgetItem*) { m_selectionChanged = true; } - bool + bool ListBoxControl::eventFilter (QObject* watched, QEvent* e) { // listbox change @@ -213,11 +213,11 @@ sendSelectionChange (); m_selectionChanged = false; break; - + default: break; - } - + } + return Object::eventFilter (watched, e); } // listbox viewport @@ -228,7 +228,7 @@ switch (e->type ()) { - case QEvent::MouseButtonPress: + case QEvent::MouseButtonPress: { QMouseEvent* m = dynamic_cast<QMouseEvent*> (e); @@ -236,7 +236,8 @@ override_return = true; else { - if(!list->indexAt(m->pos()).isValid()) override_return = true; + if (! list->indexAt(m->pos()).isValid()) + override_return = true; m_selectionChanged = true; } break; @@ -244,25 +245,25 @@ case QEvent::MouseButtonRelease: { QMouseEvent* m = dynamic_cast<QMouseEvent*> (e); - + if (m->button () & Qt::RightButton) override_return = true; - else if(!list->indexAt(m->pos()).isValid()) + else if (! list->indexAt(m->pos()).isValid()) { - list->setCurrentRow(list->count()-1); + list->setCurrentRow(list->count()-1); override_return = true; } if (m_selectionChanged) sendSelectionChange (); m_selectionChanged = false; - + break; } default: break; - + } return BaseControl::eventFilter (watched, e) || override_return; }
--- a/libgui/src/m-editor/file-editor-tab.cc Mon Nov 07 15:48:46 2016 -0800 +++ b/libgui/src/m-editor/file-editor-tab.cc Tue Nov 08 10:01:17 2016 -0800 @@ -375,7 +375,7 @@ bool valid = false; std::string prompt = "dbstop if"; bool ok; - while (!valid) + while (! valid) { QString new_condition = QInputDialog::getText (this, tr ("Breakpoint condition"), @@ -1770,7 +1770,7 @@ } // Return early if this file is not loaded in the symbol table - if (!sym.is_defined () || !sym.is_user_code ()) + if (! sym.is_defined () || ! sym.is_user_code ()) return true; octave_user_code *fcn = sym.user_code_value (); @@ -1840,7 +1840,7 @@ { file_to_save = file_info.canonicalFilePath (); // Force reparse of this function next time it is used (bug #46632) - if (!exit_debug_and_clear (file_to_save, file_info.baseName ())) + if (! exit_debug_and_clear (file_to_save, file_info.baseName ())) return; } else
--- a/libgui/src/m-editor/file-editor.cc Mon Nov 07 15:48:46 2016 -0800 +++ b/libgui/src/m-editor/file-editor.cc Tue Nov 08 10:01:17 2016 -0800 @@ -474,7 +474,7 @@ } // If <unnamed> was absent or modified, create a new tab. - if (!fileEditorTab) + if (! fileEditorTab) fileEditorTab = new file_editor_tab (); if (fileEditorTab) @@ -485,7 +485,7 @@ { // Supply empty title then have the file_editor_tab update // with full or short name. - if (!reusing) + if (! reusing) add_file_editor_tab (fileEditorTab, ""); fileEditorTab->update_window_title (false); // file already loaded, add file to mru list here
--- a/libinterp/corefcn/bsxfun.cc Mon Nov 07 15:48:46 2016 -0800 +++ b/libinterp/corefcn/bsxfun.cc Tue Nov 08 10:01:17 2016 -0800 @@ -744,7 +744,7 @@ %!assert (bsxfun (f, a, d), a - repmat (d, [1, 1, 4])) %!assert (bsxfun ("minus", ones ([4, 0, 4]), ones ([4, 1, 4])), zeros ([4, 0, 4])) -%% The test below is a very hard case to treat +## The test below is a very hard case to treat %!assert (bsxfun (f, ones ([4, 1, 4, 1]), ones ([1, 4, 1, 4])), zeros ([4, 4, 4, 4])) %!shared a, b, aa, bb @@ -770,7 +770,7 @@ %!assert (bsxfun (@and, a > 0, b > 0), (aa > 0) & (bb > 0)) %!assert (bsxfun (@or, a > 0, b > 0), (aa > 0) | (bb > 0)) -%% Test automatic bsxfun +## Test automatic bsxfun % %!test %! funs = {@plus, @minus, @times, @rdivide, @ldivide, @power, @max, @min, ...
--- a/libinterp/corefcn/cellfun.cc Mon Nov 07 15:48:46 2016 -0800 +++ b/libinterp/corefcn/cellfun.cc Tue Nov 08 10:01:17 2016 -0800 @@ -722,13 +722,13 @@ %! assert (a, cell (2, 0)); %! assert (b, cell (2, 0)); -%% Test function to check the "Errorhandler" option +## Test function to check the "Errorhandler" option %!function z = __cellfunerror (S, varargin) %! z = S; %!endfunction -%% First input argument can be a string, an inline function, -%% a function_handle or an anonymous function +## First input argument can be a string, an inline function, +## a function_handle or an anonymous function %!test %! A = cellfun ("islogical", {true, 0.1, false, i*2}); %! assert (A, [true, false, true, false]); @@ -742,8 +742,8 @@ %! A = cellfun (@(x) islogical (x), {true, 0.1, false, i*2}); %! assert (A, [true, false, true, false]); -%% First input argument can be the special string "isreal", -%% "isempty", "islogical", "isnumeric", "length", "ndims" or "prodofsize" +## First input argument can be the special string "isreal", +## "isempty", "islogical", "isnumeric", "length", "ndims" or "prodofsize" %!test %! A = cellfun ("isreal", {true, 0.1, {}, i*2, [], "abc"}); %! assert (A, [true, true, false, false, true, true]); @@ -766,7 +766,7 @@ %! A = cellfun ("prodofsize", {[1, 2; 3, 4], (cell (1,2,3,4))}); %! assert (A, [4, 24]); -%% Number of input and output arguments may not be limited to one +## Number of input and output arguments may not be limited to one %!test %! A = cellfun (@(x,y,z) x + y + z, {1, 1, 1}, {2, 2, 2}, {3, 4, 5}); %! assert (A, [6, 7, 8]); @@ -774,20 +774,20 @@ %! A = cellfun (@(x,y,z) x + y + z, {1, 1, 1}, {2, 2, 2}, {3, 4, 5}, ... %! "UniformOutput", false); %! assert (A, {6, 7, 8}); -%!test %% Two input arguments of different types +%!test # Two input arguments of different types %! A = cellfun (@(x,y) islogical (x) && ischar (y), {false, true}, {"a", 3}); %! assert (A, [true, false]); -%!test %% Pass another variable to the anonymous function +%!test # Pass another variable to the anonymous function %! y = true; %! A = cellfun (@(x) islogical (x) && y, {false, 0.3}); %! assert (A, [true, false]); -%!test %% Three ouptut arguments of different type +%!test # Three ouptut arguments of different type %! [A, B, C] = cellfun (@find, {10, 11; 0, 12}, "UniformOutput", false); %! assert (isequal (A, {true, true; [], true})); %! assert (isequal (B, {true, true; [], true})); %! assert (isequal (C, {10, 11; [], 12})); -%% Input arguments can be of type cell array of logical +## Input arguments can be of type cell array of logical %!test %! A = cellfun (@(x,y) x == y, {false, true}, {true, true}); %! assert (A, [false, true]); @@ -798,7 +798,7 @@ %!test %! A = cellfun (@(x) x, {false, true; false, true}, "UniformOutput", false); %! assert (A, {false, true; false, true}); -%!test %% Three ouptut arguments of same type +%!test # Three ouptut arguments of same type %! [A, B, C] = cellfun (@find, {true, false; false, true}, ... %! "UniformOutput", false); %! assert (isequal (A, {true, []; [], true})); @@ -812,7 +812,7 @@ %! assert (isfield (A, "index"), true); %! assert (isempty (A.message), false); %! assert (A.index, 1); -%!test %% Overwriting setting of "UniformOutput" true +%!test # Overwriting setting of "UniformOutput" true %! A = cellfun (@(x,y) cell2str (x,y), {true}, {true}, ... %! "UniformOutput", true, "ErrorHandler", @__cellfunerror); %! assert (isfield (A, "identifier"), true); @@ -821,7 +821,7 @@ %! assert (isempty (A.message), false); %! assert (A.index, 1); -%% Input arguments can be of type cell array of numeric +## Input arguments can be of type cell array of numeric %!test %! A = cellfun (@(x,y) x>y, {1.1, 4.2}, {3.1, 2+3*i}); %! assert (A, [false, true]); @@ -833,7 +833,7 @@ %! A = cellfun (@(x,y) x:y, {1.1, 4}, {3.1, 6}, "UniformOutput", false); %! assert (isequal (A{1}, [1.1, 2.1, 3.1])); %! assert (isequal (A{2}, [4, 5, 6])); -%!test %% Three ouptut arguments of different type +%!test # Three ouptut arguments of different type %! [A, B, C] = cellfun (@find, {10, 11; 0, 12}, "UniformOutput", false); %! assert (isequal (A, {true, true; [], true})); %! assert (isequal (B, {true, true; [], true})); @@ -847,7 +847,7 @@ %! assert ([(isfield (A(1), "index")), (isfield (A(2), "index"))], [true, true]); %! assert ([(isempty (A(1).message)), (isempty (A(2).message))], [false, false]); %! assert ([A(1).index, A(2).index], [1, 2]); -%!test %% Overwriting setting of "UniformOutput" true +%!test # Overwriting setting of "UniformOutput" true %! A = cellfun (@(x,y) cell2str (x,y), {1.1, 4}, {3.1, 6}, ... %! "UniformOutput", true, "ErrorHandler", @__cellfunerror); %! B = isfield (A(1), "message") && isfield (A(1), "index"); @@ -857,8 +857,8 @@ %! assert ([(isempty (A(1).message)), (isempty (A(2).message))], [false, false]); %! assert ([A(1).index, A(2).index], [1, 2]); -%% Input arguments can be of type cell arrays of character or strings -%!error %% "UniformOutput" false should be used +## Input arguments can be of type cell arrays of character or strings +%!error # "UniformOutput" false should be used %! A = cellfun (@(x,y) x>y, {"ad", "c", "ghi"}, {"cc", "d", "fgh"}); %!test %! A = cellfun (@(x,y) x>y, {"a"; "f"}, {"c"; "d"}, "UniformOutput", true); @@ -874,7 +874,7 @@ %! assert ([(isfield (A(1), "index")), (isfield (A(2), "index"))], [true, true]); %! assert ([(isempty (A(1).message)), (isempty (A(2).message))], [false, false]); %! assert ([A(1).index, A(2).index], [1, 2]); -%!test %% Overwriting setting of "UniformOutput" true +%!test # Overwriting setting of "UniformOutput" true %! A = cellfun (@(x,y) cell2str (x,y), {"a", "d"}, {"c", "f"}, ... %! "UniformOutput", true, "ErrorHandler", @__cellfunerror); %! assert ([(isfield (A(1), "identifier")), (isfield (A(2), "identifier"))], [true, true]); @@ -883,12 +883,12 @@ %! assert ([(isempty (A(1).message)), (isempty (A(2).message))], [false, false]); %! assert ([A(1).index, A(2).index], [1, 2]); -%% Structures cannot be handled by cellfun +## Structures cannot be handled by cellfun %!error %! vst1.a = 1.1; vst1.b = 4.2; vst2.a = 3.1; vst2.b = 2; %! A = cellfun (@(x,y) (x.a < y.a) && (x.b > y.b), vst1, vst2); -%% Input arguments can be of type cell array of cell arrays +## Input arguments can be of type cell array of cell arrays %!test %! A = cellfun (@(x,y) x{1} < y{1}, {{1.1}, {4.2}}, {{3.1}, {2}}); %! assert (A, [1, 0], 1e-16); @@ -908,7 +908,7 @@ %! assert ([(isfield (A(1), "index")), (isfield (A(2), "index"))], [true, true]); %! assert ([(isempty (A(1).message)), (isempty (A(2).message))], [false, false]); %! assert ([A(1).index, A(2).index], [1, 2]); -%!test %% Overwriting setting of "UniformOutput" true +%!test # Overwriting setting of "UniformOutput" true %! A = cellfun (@(x,y) mat2str (x,y), {{1.1}, {4.2}}, {{3.1}, {2}}, ... %! "UniformOutput", true, "ErrorHandler", @__cellfunerror); %! assert ([(isfield (A(1), "identifier")), (isfield (A(2), "identifier"))], [true, true]); @@ -917,7 +917,7 @@ %! assert ([(isempty (A(1).message)), (isempty (A(2).message))], [false, false]); %! assert ([A(1).index, A(2).index], [1, 2]); -%% Input arguments can be of type cell array of structure arrays +## Input arguments can be of type cell array of structure arrays %!test %! a = struct ("a", 1, "b", 2); b = struct ("a", 1, "b", 3); %! A = cellfun (@(x,y) (x.a == y.a) && (x.b < y.b), {a}, {b}); @@ -941,7 +941,7 @@ %! assert (isfield (A, "index"), true); %! assert (isempty (A.message), false); %! assert (A.index, 1); -%!test %% Overwriting setting of "UniformOutput" true +%!test # Overwriting setting of "UniformOutput" true %! a = struct ("a", 1, "b", 2); b = struct ("a", 1, "b", 3); %! A = cellfun (@(x,y) cell2str (x.a, y.a), {a}, {b}, ... %! "UniformOutput", true, "ErrorHandler", @__cellfunerror); @@ -951,7 +951,7 @@ %! assert (isempty (A.message), false); %! assert (A.index, 1); -%% A lot of other tests +## A lot of other tests %!assert (cellfun (@sin, {0,1}), sin ([0,1])) %!assert (cellfun (inline ("sin (x)"), {0,1}), sin ([0,1])) %!assert (cellfun ("sin", {0,1}), sin ([0,1])) @@ -1414,12 +1414,12 @@ %!assert (arrayfun (@ones, 1, [2,3], "uniformoutput", false), {[1,1], [1,1,1]}) -%% Test function to check the "Errorhandler" option +## Test function to check the "Errorhandler" option %!function z = __arrayfunerror (S, varargin) %! z = S; %!endfunction -%% First input argument can be a string, an inline function, a -%% function_handle or an anonymous function +## First input argument can be a string, an inline function, a +## function_handle or an anonymous function %!test %! arrayfun (@isequal, [false, true], [true, true]); # No output argument %!error @@ -1437,27 +1437,27 @@ %! A = arrayfun (@(x,y) isequal (x,y), [false, true], [true, true]); %! assert (A, [false, true]); -%% Number of input and output arguments may be greater than one -%#!test +## Number of input and output arguments may be greater than one +%!test %! A = arrayfun (@(x) islogical (x), false); %! assert (A, true); %!test %! A = arrayfun (@(x,y,z) x + y + z, [1, 1, 1], [2, 2, 2], [3, 4, 5]); %! assert (A, [6, 7, 8], 1e-16); -%!test %% Two input arguments of different types +%!test # Two input arguments of different types %! A = arrayfun (@(x,y) islogical (x) && ischar (y), false, "a"); %! assert (A, true); -%!test %% Pass another variable to the anonymous function +%!test # Pass another variable to the anonymous function %! y = true; %! A = arrayfun (@(x) islogical (x && y), false); %! assert (A, true); -%!test %% Three ouptut arguments of different type +%!test # Three ouptut arguments of different type %! [A, B, C] = arrayfun (@find, [10, 11; 0, 12], "UniformOutput", false); %! assert (isequal (A, {true, true; [], true})); %! assert (isequal (B, {true, true; [], true})); %! assert (isequal (C, {10, 11; [], 12})); -%% Input arguments can be of type logical +## Input arguments can be of type logical %!test %! A = arrayfun (@(x,y) x == y, [false, true], [true, true]); %! assert (A, [false, true]); @@ -1467,7 +1467,7 @@ %!test %! A = arrayfun (@(x) x, [false, true, false, true], "UniformOutput", false); %! assert (A, {false, true, false, true}); -%!test %% Three ouptut arguments of same type +%!test # Three ouptut arguments of same type %! [A, B, C] = arrayfun (@find, [true, false; false, true], "UniformOutput", false); %! assert (isequal (A, {true, []; [], true})); %! assert (isequal (B, {true, []; [], true})); @@ -1480,7 +1480,7 @@ %! assert (isfield (A, "index"), true); %! assert (isempty (A.message), false); %! assert (A.index, 1); -%!test %% Overwriting setting of "UniformOutput" true +%!test # Overwriting setting of "UniformOutput" true %! A = arrayfun (@(x,y) array2str (x,y), true, true, "UniformOutput", true, ... %! "ErrorHandler", @__arrayfunerror); %! assert (isfield (A, "identifier"), true); @@ -1489,7 +1489,7 @@ %! assert (isempty (A.message), false); %! assert (A.index, 1); -%% Input arguments can be of type numeric +## Input arguments can be of type numeric %!test %! A = arrayfun (@(x,y) x>y, [1.1, 4.2], [3.1, 2+3*i]); %! assert (A, [false, true]); @@ -1500,7 +1500,7 @@ %! A = arrayfun (@(x,y) x:y, [1.1, 4], [3.1, 6], "UniformOutput", false); %! assert (isequal (A{1}, [1.1, 2.1, 3.1])); %! assert (isequal (A{2}, [4, 5, 6])); -%!test %% Three ouptut arguments of different type +%!test # Three ouptut arguments of different type %! [A, B, C] = arrayfun (@find, [10, 11; 0, 12], "UniformOutput", false); %! assert (isequal (A, {true, true; [], true})); %! assert (isequal (B, {true, true; [], true})); @@ -1514,7 +1514,7 @@ %! assert ([(isfield (A(1), "index")), (isfield (A(2), "index"))], [true, true]); %! assert ([(isempty (A(1).message)), (isempty (A(2).message))], [false, false]); %! assert ([A(1).index, A(2).index], [1, 2]); -%!test %% Overwriting setting of "UniformOutput" true +%!test # Overwriting setting of "UniformOutput" true %! A = arrayfun (@(x,y) array2str (x,y), {1.1, 4}, {3.1, 6}, ... %! "UniformOutput", true, "ErrorHandler", @__arrayfunerror); %! B = isfield (A(1), "message") && isfield (A(1), "index"); @@ -1524,7 +1524,7 @@ %! assert ([(isempty (A(1).message)), (isempty (A(2).message))], [false, false]); %! assert ([A(1).index, A(2).index], [1, 2]); -%% Input arguments can be of type character or strings +## Input arguments can be of type character or strings %!test %! A = arrayfun (@(x,y) x>y, ["ad", "c", "ghi"], ["cc", "d", "fgh"]); %! assert (A, [false, true, false, true, true, true]); @@ -1540,7 +1540,7 @@ %! B = isfield (A(1), "identifier") && isfield (A(1), "message") && isfield (A(1), "index"); %! assert (B, true); -%% Input arguments can be of type structure +## Input arguments can be of type structure %!test %! a = struct ("a", 1.1, "b", 4.2); b = struct ("a", 3.1, "b", 2); %! A = arrayfun (@(x,y) (x.a < y.a) && (x.b > y.b), a, b); @@ -1560,7 +1560,7 @@ %! assert (isfield (A, "index"), true); %! assert (isempty (A.message), false); %! assert (A.index, 1); -%!test %% Overwriting setting of "UniformOutput" true +%!test # Overwriting setting of "UniformOutput" true %! A = arrayfun (@(x) mat2str(x), "a", "UniformOutput", true, ... %! "ErrorHandler", @__arrayfunerror); %! assert (isfield (A, "identifier"), true); @@ -1569,7 +1569,7 @@ %! assert (isempty (A.message), false); %! assert (A.index, 1); -%% Input arguments can be of type cell array +## Input arguments can be of type cell array %!test %! A = arrayfun (@(x,y) x{1} < y{1}, {1.1, 4.2}, {3.1, 2}); %! assert (A, [true, false]);
--- a/libinterp/corefcn/conv2.cc Mon Nov 07 15:48:46 2016 -0800 +++ b/libinterp/corefcn/conv2.cc Tue Nov 08 10:01:17 2016 -0800 @@ -233,7 +233,7 @@ %!assert (conv2 (1:3, 1:2, [1,2;3,4;5,6], "full"), %! conv2 (1:3, 1:2, [1,2;3,4;5,6])); -%% Test shapes +## Test shapes %!shared A, B, C %! A = rand (3, 4); %! B = rand (4); @@ -251,10 +251,10 @@ %!assert (conv2 (A,B, "valid"), zeros (0, 0)) %!assert (size (conv2 (B,A, "valid")), [3 2]) -%% Clear shared variables so they are not reported for tests below +## Clear shared variables so they are not reported for tests below %!shared -%% Test cases from Bug #34893 +## Test cases from Bug #34893 %!assert <34893> (conv2 ([1:5;1:5], [1:2], "same"), %! [4 7 10 13 10; 4 7 10 13 10]) %!assert <34893> (conv2 ([1:5;1:5]', [1:2]', "same"), @@ -272,12 +272,12 @@ %! B = conv2 (x, y, "valid"); %! assert (B, A); # Yes, this test is for *exact* equivalence. -%% Test input validation +## Test input validation %!error conv2 () %!error conv2 (1) %!error <must be 1-D vectors or 2-D matrices> conv2 (ones (2), ones (2,2,2)) %!error <SHAPE type not valid> conv2 (1,2, "NOT_A_SHAPE") -%% Test alternate calling form which should be 2 vectors and a matrix +## Test alternate calling form which should be 2 vectors and a matrix %!error conv2 (ones (2), 1, 1) %!error conv2 (1, ones (2), 1) */
--- a/libinterp/corefcn/data.cc Mon Nov 07 15:48:46 2016 -0800 +++ b/libinterp/corefcn/data.cc Tue Nov 08 10:01:17 2016 -0800 @@ -1434,7 +1434,7 @@ %!assert (diag (cell (3,3), 4), cell (0, 1)) %!assert (diag (sparse (ones (3,3)), 4), sparse (zeros (0, 1))) -%% Test input validation +## Test input validation %!error <Invalid call to diag> diag () %!error <Invalid call to diag> diag (1,2,3,4) %!error diag (ones (2), 3, 3) @@ -1598,7 +1598,7 @@ %!assert (prod (single ([i, 2+i, -3+2i, 4])), single (-4 - 32i)) %!assert (prod (single ([1, 2, 3; i, 2i, 3i; 1+i, 2+2i, 3+3i])), single ([-1+i, -8+8i, -27+27i])) -%% Test sparse +## Test sparse %!assert (prod (sparse ([1, 2, 3])), sparse (6)) %!assert (prod (sparse ([-1; -2; -3])), sparse (-6)) ## Commented out until bug #42290 is fixed @@ -1635,13 +1635,13 @@ %!assert (prod (zeros (0, 2, "single"), 1), single ([1, 1])) %!assert (prod (zeros (0, 2, "single"), 2), zeros (0, 1, "single")) -%% Test "double" type argument +## Test "double" type argument %!assert (prod (single ([1, 2, 3]), "double"), 6) %!assert (prod (single ([-1; -2; -3]), "double"), -6) %!assert (prod (single ([i, 2+i, -3+2i, 4]), "double"), -4 - 32i) %!assert (prod (single ([1, 2, 3; i, 2i, 3i; 1+i, 2+2i, 3+3i]), "double"), [-1+i, -8+8i, -27+27i]) -%% Test "native" type argument +## Test "native" type argument %!assert (prod (uint8 ([1, 2, 3]), "native"), uint8 (6)) %!assert (prod (uint8 ([-1; -2; -3]), "native"), uint8 (0)) %!assert (prod (int8 ([1, 2, 3]), "native"), int8 (6)) @@ -1649,7 +1649,7 @@ %!assert (prod ([true false; true true], "native"), [true false]) %!assert (prod ([true false; true true], 2, "native"), [false; true]) -%% Test input validation +## Test input validation %!error prod () %!error prod (1,2,3) %!error <unrecognized type argument 'foobar'> prod (1, "foobar") @@ -3646,7 +3646,7 @@ } /* -%% Debian bug #706376 +## Debian bug #706376 %!assert (isempty (speye(2^16)), false) */ @@ -3709,7 +3709,7 @@ %! s.a = 1; %! assert (isscalar (s)); -%% Test input validation +## Test input validation %!error isscalar () %!error isscalar (1, 2) */ @@ -3747,7 +3747,7 @@ %! s.a = 1; %! assert (isvector (s), true); -%% Test input validation +## Test input validation %!error isvector () %!error isvector ([1, 2], 2) */ @@ -3791,7 +3791,7 @@ %! s.a = 1; %! assert (isrow (s), true); -%% Test input validation +## Test input validation %!error isrow () %!error isrow ([1, 2], 2) */ @@ -3835,7 +3835,7 @@ %! s.a = 1; %! assert (iscolumn (s)); -%% Test input validation +## Test input validation %!error iscolumn () %!error iscolumn ([1, 2], 2) */ @@ -3914,7 +3914,7 @@ %!assert (issquare ({1, 2; 3, 4})) %!assert (sparse (([1, 2; 3, 4]))) -%% Test input validation +## Test input validation %!error issquare () %!error issquare ([1, 2; 3, 4], 2) */
--- a/libinterp/corefcn/dot.cc Mon Nov 07 15:48:46 2016 -0800 +++ b/libinterp/corefcn/dot.cc Tue Nov 08 10:01:17 2016 -0800 @@ -210,7 +210,7 @@ %! assert (dot (x, y, 2), [17; 53]); %! assert (dot (x, y, 3), [5 12; 21 32]); -%% Test input validation +## Test input validation %!error dot () %!error dot (1) %!error dot (1,2,3,4) @@ -347,7 +347,7 @@ %! assert (blkmm (single (x), single (x)), single (z)); %! assert (blkmm (x, single (x)), single (z)); -%% Test input validation +## Test input validation %!error blkmm () %!error blkmm (1) %!error blkmm (1,2,3)
--- a/libinterp/corefcn/fft2.cc Mon Nov 07 15:48:46 2016 -0800 +++ b/libinterp/corefcn/fft2.cc Tue Nov 08 10:01:17 2016 -0800 @@ -179,9 +179,9 @@ } /* -%% Author: David Billinghurst (David.Billinghurst@riotinto.com.au) -%% Comalco Research and Technology -%% 02 May 2000 +## Author: David Billinghurst (David.Billinghurst@riotinto.com.au) +## Comalco Research and Technology +## 02 May 2000 %!test %! M = 16; %! N = 8; @@ -198,9 +198,9 @@ %! answer = kron (fft (sx)', fft (sy)); %! assert (S, answer, 4*M*N*eps); -%% Author: David Billinghurst (David.Billinghurst@riotinto.com.au) -%% Comalco Research and Technology -%% 02 May 2000 +## Author: David Billinghurst (David.Billinghurst@riotinto.com.au) +## Comalco Research and Technology +## 02 May 2000 %!test %! M = 12; %! N = 7; @@ -220,9 +220,9 @@ %! %! assert (s, answer, 30*eps); -%% Author: David Billinghurst (David.Billinghurst@riotinto.com.au) -%% Comalco Research and Technology -%% 02 May 2000 +## Author: David Billinghurst (David.Billinghurst@riotinto.com.au) +## Comalco Research and Technology +## 02 May 2000 %!test %! M = 16; %! N = 8; @@ -239,9 +239,9 @@ %! answer = kron (fft (sx)', fft (sy)); %! assert (S, answer, 4*M*N*eps ("single")); -%% Author: David Billinghurst (David.Billinghurst@riotinto.com.au) -%% Comalco Research and Technology -%% 02 May 2000 +## Author: David Billinghurst (David.Billinghurst@riotinto.com.au) +## Comalco Research and Technology +## 02 May 2000 %!test %! M = 12; %! N = 7;
--- a/libinterp/corefcn/file-io.cc Mon Nov 07 15:48:46 2016 -0800 +++ b/libinterp/corefcn/file-io.cc Tue Nov 08 10:01:17 2016 -0800 @@ -1557,12 +1557,12 @@ %! c = textscan ("L1\nL2", "%s", "endofline", ""); %! assert (int8 ([c{:}{:}]), int8 ([76, 49, 10, 76, 50])); -### Matlab fails this test. A literal after a conversion is not a delimiter -#%!test -#%! ## No delimiters at all besides EOL. Skip fields, even empty fields -#%! str = "Text1Text2Text\nTextText4Text\nText57Text"; -#%! c = textscan (str, "Text%*dText%dText"); -#%! assert (c{1}, int32 ([2; 4; 0])); +## Matlab fails this test. A literal after a conversion is not a delimiter +%!#test +%! ## No delimiters at all besides EOL. Skip fields, even empty fields +%! str = "Text1Text2Text\nTextText4Text\nText57Text"; +%! c = textscan (str, "Text%*dText%dText"); +%! assert (c{1}, int32 ([2; 4; 0])); ## CollectOutput test %!test @@ -1629,19 +1629,19 @@ %! assert (c{1}, int32 ([99; 88])); %! assert (c{2}, {"2 "; "4564"}); -## FIXME: Following two tests still fail (4/13/2016)? -### Delimiters as part of literals, and following literals -#%!test -#%! str = "12 R&D & 7"; -#%! c = textscan (str, "%f R&D %f", "delimiter", "&", "collectOutput", 1, -#%! "EmptyValue", -99); -#%! assert (c, {[12, -99; 7, -99]}); -# -### Delimiters as part of literals, and before literals -#%!test -#%! str = "12 & R&D 7"; -#%! c = textscan (str, "%f R&D %f", "delimiter", "&", "collectOutput", 1); -#%! assert (c, {[12 7]}); +## FIXME: Following two tests still fail (4/13/2016). +## Delimiters as part of literals, and following literals +%!#test +%! str = "12 R&D & 7"; +%! c = textscan (str, "%f R&D %f", "delimiter", "&", "collectOutput", 1, +%! "EmptyValue", -99); +%! assert (c, {[12, -99; 7, -99]}); + +## Delimiters as part of literals, and before literals +%!#test +%! str = "12 & R&D 7"; +%! c = textscan (str, "%f R&D %f", "delimiter", "&", "collectOutput", 1); +%! assert (c, {[12 7]}); ## Check number of lines read, not number of passes through format string %!test @@ -1740,11 +1740,11 @@ %! assert (c, {1, 2, 3}); ## FIXME: This test fails (4/14/16) -### Test incomplete first data line -#%!test -#%! R = textscan (['Empty1' char(10)], 'Empty%d %f'); -#%! assert (R{1}, int32 (1)); -#%! assert (isempty (R{2}), true); +## Test incomplete first data line +%!#test +%! R = textscan (['Empty1' char(10)], 'Empty%d %f'); +%! assert (R{1}, int32 (1)); +%! assert (isempty (R{2}), true); %!test <37023> %! data = textscan (" 1. 1 \n 2 3\n", '%f %f'); @@ -1880,7 +1880,7 @@ %! try %! C = textscan (fid, "", "headerlines"); %! end_try_catch; -%! assert (!feof (fid)); +%! assert (! feof (fid)); %! fclose (fid); %! unlink (f); %! assert (msg1, lasterr); @@ -1982,14 +1982,15 @@ %! "MultipleDelimsAsOne", 1); %! assert (c{1}, {"home"; "foo"}); -## FIXME: Test still fails (4/13/2016)? +## FIXME: Test still fails (4/13/2016). ## Allow cuddling %sliteral, but warn it is ambiguous -#%!test -#%! C = textscan ("abcxyz51\nxyz83\n##xyz101", "%s xyz %d"); -#%! assert (C{1}([1 3]), {"abc"; "##"}); -#%! assert (isempty (C{1}{2}), true); -#%! assert (C{2}, int32 ([51; 83; 101])); -### Literals are not delimiters. +%!#test +%! C = textscan ("abcxyz51\nxyz83\n##xyz101", "%s xyz %d"); +%! assert (C{1}([1 3]), {"abc"; "##"}); +%! assert (isempty (C{1}{2}), true); +%! assert (C{2}, int32 ([51; 83; 101])); + +## Literals are not delimiters. ## Test for false positives in check for non-supported format specifiers %!test @@ -2109,7 +2110,7 @@ %! C = textscan ("1 2\t3 4", '%f %[^\t] %f %f'); %! assert (C, {1, {"2"}, 3, 4}); -%% Check a non-empty line with no valid conversion registers empytValue +## Check a non-empty line with no valid conversion registers empytValue %!test %! C = textscan ("Empty\n", "Empty%f %f"); %! assert (C, { NaN, NaN }); @@ -2187,10 +2188,10 @@ %! assert (C{5}, [4; 7]); ## FIXME: Almost passes. Second return value is {"/"}. Tested 4/14/16. -### Test start of comment as string -#%!test -#%! c = textscan ("1 / 2 // 3", "%n %s %u8", "CommentStyle", {"//"}); -#%! assert (c(1), {1, "/", 2}); +## Test start of comment as string +%!#test +%! c = textscan ("1 / 2 // 3", "%n %s %u8", "CommentStyle", {"//"}); +%! assert (c(1), {1, "/", 2}); %!assert (textscan (["1 2 3 4"; "5 6 7 8"], "%f"), {[15; 26; 37; 48]})
--- a/libinterp/corefcn/filter.cc Mon Nov 07 15:48:46 2016 -0800 +++ b/libinterp/corefcn/filter.cc Tue Nov 08 10:01:17 2016 -0800 @@ -598,7 +598,7 @@ %!assert (filter (1, ones (10,1) / 10, zeros (0,10)), zeros (0,10)) %!assert (filter (1, ones (10,1) / 10, single (1:5)), repmat (single (10), 1, 5)) -%% Test using initial conditions +## Test using initial conditions %!assert (filter ([1, 1, 1], [1, 1], [1 2], [1, 1]), [2 2]) %!assert (filter ([1, 1, 1], [1, 1], [1 2], [1, 1]'), [2 2]) %!assert (filter ([1, 3], [1], [1 2; 3 4; 5 6], [4, 5]), [5 7; 6 10; 14 18])
--- a/libinterp/corefcn/graphics.cc Mon Nov 07 15:48:46 2016 -0800 +++ b/libinterp/corefcn/graphics.cc Tue Nov 08 10:01:17 2016 -0800 @@ -6279,9 +6279,9 @@ gh_manager::get_object (get_ylabel ()).set (prop, val); gh_manager::get_object (get_zlabel ()).set (prop, val); gh_manager::get_object (get_title ()).set (prop, tval); - - } - + + } + txt_renderer.set_font (get ("fontname").string_value (), get ("fontweight").string_value (), get ("fontangle").string_value (),
--- a/libinterp/corefcn/kron.cc Mon Nov 07 15:48:46 2016 -0800 +++ b/libinterp/corefcn/kron.cc Tue Nov 08 10:01:17 2016 -0800 @@ -311,9 +311,8 @@ %!assert (kron (diag ([1, 2]), diag ([3, 4])), diag ([3, 4, 6, 8])) -%% Test for two diag matrices. See the comments above in -%% dispatch_kron for this case. -%% +## Test for two diag matrices. +## See the comments above in dispatch_kron for this case. %!test %! expected = zeros (16, 16); %! expected (1, 11) = 3;
--- a/libinterp/corefcn/oct-stream.cc Mon Nov 07 15:48:46 2016 -0800 +++ b/libinterp/corefcn/oct-stream.cc Tue Nov 08 10:01:17 2016 -0800 @@ -3485,7 +3485,7 @@ { is.clear (is.rdstate () & ~std::ios::failbit); - if (!is.eof () && ~is_delim (is.peek ())) + if (! is.eof () && ~is_delim (is.peek ())) this_conversion_failed = true; } @@ -3522,7 +3522,7 @@ else this_conversion_failed = false; } - else if (! done && !conversion_failed) + else if (! done && ! conversion_failed) nothing_worked = false; }
--- a/libinterp/corefcn/quadcc.cc Mon Nov 07 15:48:46 2016 -0800 +++ b/libinterp/corefcn/quadcc.cc Tue Nov 08 10:01:17 2016 -0800 @@ -2211,7 +2211,7 @@ %! assert (q, 0, 1e-6); %! assert (err, 0, 15*eps); -%% Test input validation +## Test input validation %!error (quadcc ()) %!error (quadcc (@sin)) %!error (quadcc (@sin, 0))
--- a/libinterp/corefcn/spparms.cc Mon Nov 07 15:48:46 2016 -0800 +++ b/libinterp/corefcn/spparms.cc Tue Nov 08 10:01:17 2016 -0800 @@ -194,7 +194,7 @@ %! assert (spparms ("exact_d"), 5); %! spparms (old_vals); # restore state -%% Test input validation +## Test input validation %!error <too many input arguments> spparms (1, 2, 3) %!error <too many output arguments> [x, y, z] = spparms () %!error <KEY not recognized> spparms ("UNKNOWN_KEY")
--- a/libinterp/corefcn/sylvester.cc Mon Nov 07 15:48:46 2016 -0800 +++ b/libinterp/corefcn/sylvester.cc Tue Nov 08 10:01:17 2016 -0800 @@ -156,7 +156,7 @@ %!assert (sylvester ([1, 2; 3, 4], [5, 6; 7, 8], [9, 10; 11, 12]), [1/2, 2/3; 2/3, 1/2], sqrt (eps)) %!assert (sylvester (single ([1, 2; 3, 4]), single ([5, 6; 7, 8]), single ([9, 10; 11, 12])), single ([1/2, 2/3; 2/3, 1/2]), sqrt (eps ("single"))) -%% Test input validation +## Test input validation %!error sylvester () %!error sylvester (1) %!error sylvester (1,2)
--- a/libinterp/dldfcn/convhulln.cc Mon Nov 07 15:48:46 2016 -0800 +++ b/libinterp/dldfcn/convhulln.cc Tue Nov 08 10:01:17 2016 -0800 @@ -310,7 +310,7 @@ %! h = sortrows (sort (h, 2), [1:3]); %! assert (h, [1 2 4; 1 2 6; 1 4 8; 1 5 6; 1 5 8; 2 3 4; 2 3 7; 2 6 7; 3 4 7; 4 7 8; 5 6 7; 5 7 8]); %! assert (v, 1, 10*eps); -%! [h2, v2] = convhulln (cube); % Test defaut option = "Qt" +%! [h2, v2] = convhulln (cube); # Test default option = "Qt" %! assert (size (h2), size (h)); %! h2 = sortrows (sort (h2, 2), [1:3]); %! assert (h2, h); @@ -331,7 +331,7 @@ %! assert (v, 8/3, 10*eps); %!testif HAVE_QHULL -%! triangle=[0 0; 1 1; 1 0; 1 2]; +%! triangle = [0 0; 1 1; 1 0; 1 2]; %! h = convhulln (triangle); %! assert (size (h), [3 2]); */
--- a/libinterp/dldfcn/qr.cc Mon Nov 07 15:48:46 2016 -0800 +++ b/libinterp/dldfcn/qr.cc Tue Nov 08 10:01:17 2016 -0800 @@ -812,7 +812,7 @@ %! [c,r] = qr (a, b); %! assert (r\c, full (a)\b, 10e-10); -%% Test under-determined systems!! +## Test under-determined systems!! %!#testif HAVE_CXSPARSE %! n = 20; d = 0.2; %! a = sprandn (n,n+1,d) + speye (n,n+1); @@ -847,7 +847,7 @@ %! [c,r] = qr (a, b); %! assert (r\c, full (a)\b, 10e-10); -%% Test under-determined systems!! +## Test under-determined systems!! %!#testif HAVE_CXSPARSE %! n = 20; d = 0.2; %! a = 1i*sprandn (n,n+1,d) + speye (n,n+1);
--- a/libinterp/octave-value/ov-class.cc Mon Nov 07 15:48:46 2016 -0800 +++ b/libinterp/octave-value/ov-class.cc Tue Nov 08 10:01:17 2016 -0800 @@ -1785,7 +1785,7 @@ %! jobj = javaObject ("java.lang.StringBuffer"); %! assert (class (jobj), "java.lang.StringBuffer"); -%% Test Input Validation +## Test Input Validation %!error class () */
--- a/libinterp/octave-value/ov-cx-mat.cc Mon Nov 07 15:48:46 2016 -0800 +++ b/libinterp/octave-value/ov-cx-mat.cc Tue Nov 08 10:01:17 2016 -0800 @@ -375,7 +375,7 @@ is >> tmp; - if (!is) + if (! is) error ("load: failed to load matrix constant"); matrix = tmp;
--- a/libinterp/octave-value/ov-usr-fcn.cc Mon Nov 07 15:48:46 2016 -0800 +++ b/libinterp/octave-value/ov-usr-fcn.cc Tue Nov 08 10:01:17 2016 -0800 @@ -1123,18 +1123,18 @@ %! %!error [~, ~] = try_isargout () %! -%% Check to see that isargout isn't sticky: +## Check to see that isargout isn't sticky: %!test %! [x, y] = try_isargout (); %! assert ([x, y], [1, 2]); %! -%% It should work without (): +## It should work without (): %!test %! [~, y] = try_isargout; %! assert (y, -2); %! -%% It should work in function handles, anonymous functions, and cell -%% arrays of handles or anonymous functions. +## It should work in function handles, anonymous functions, and cell +## arrays of handles or anonymous functions. %!test %! fh = @try_isargout; %! af = @() try_isargout;
--- a/libinterp/parse-tree/pt.h Mon Nov 07 15:48:46 2016 -0800 +++ b/libinterp/parse-tree/pt.h Tue Nov 08 10:01:17 2016 -0800 @@ -73,7 +73,7 @@ bool meets_bp_condition (void) const; bool is_breakpoint (bool check_active = false) const - { return bp && (!check_active || meets_bp_condition ()); } + { return bp && (! check_active || meets_bp_condition ()); } // breakpoint condition, or "0" (i.e., "false") if no breakpoint. // To distinguish "0" from a disabled breakpoint, test "is_breakpoint" too.
--- a/liboctave/array/Array.cc Mon Nov 07 15:48:46 2016 -0800 +++ b/liboctave/array/Array.cc Tue Nov 08 10:01:17 2016 -0800 @@ -1721,8 +1721,8 @@ /* -%% Tranpose tests for matrices of the tile size and plus or minus a row -%% and with four tiles. +## Tranpose tests for matrices of the tile size and plus or minus a row +## and with four tiles. %!shared m7, mt7, m8, mt8, m9, mt9 %! m7 = reshape (1 : 7*8, 8, 7);
--- a/liboctave/numeric/gsvd.h Mon Nov 07 15:48:46 2016 -0800 +++ b/liboctave/numeric/gsvd.h Tue Nov 08 10:01:17 2016 -0800 @@ -15,7 +15,7 @@ // You should have received a copy of the GNU General Public License along with // this program; if not, see <http://www.gnu.org/licenses/>. -#if !defined (octave_gsvd_h) +#if ! defined (octave_gsvd_h) #define octave_gsvd_h 1 #include "octave-config.h"
--- a/scripts/gui/inputdlg.m Mon Nov 07 15:48:46 2016 -0800 +++ b/scripts/gui/inputdlg.m Tue Nov 08 10:01:17 2016 -0800 @@ -192,7 +192,7 @@ %! disp ('- test inputdlg with prescribed vector [1,2,3] for # of lines per text field and defaults.'); %! prompt = {'Width', 'Height', 'Depth'}; %! default = {'1.10', '2.10', '3.10'}; -%! rc = [1,2,3]; % NOTE: must be an array +%! rc = [1,2,3]; # NOTE: must be an array %! dims = inputdlg (prompt, 'Enter Box Dimensions', rc, default); %! if (isempty (dims)) %! helpdlg ('Canceled by user', 'Information'); @@ -209,7 +209,7 @@ %! disp ('- test inputdlg with prescribed row by column sizes and defaults.'); %! prompt = {'Width', 'Height', 'Depth'}; %! default = {'1.10', '2.20', '3.30'}; -%! rc = [1,10; 2,20; 3,30]; % NOTE: must be an array +%! rc = [1,10; 2,20; 3,30]; # NOTE: must be an array %! dims = inputdlg (prompt, 'Enter Box Dimensions', rc, default); %! if (isempty (dims)) %! helpdlg ('Canceled by user', 'Information');
--- a/scripts/linear-algebra/krylov.m Mon Nov 07 15:48:46 2016 -0800 +++ b/scripts/linear-algebra/krylov.m Tue Nov 08 10:01:17 2016 -0800 @@ -165,7 +165,7 @@ ## Reduce V per the reflection. V(idx,:) = V(idx,:) - av*hv*(hv' * V(idx,:)); - if(iter > 1) + if (iter > 1) ## FIXME: not done correctly for block case. H(nu,nu-1) = V(pivot_vec(nu),jj); endif
--- a/scripts/plot/draw/shrinkfaces.m Mon Nov 07 15:48:46 2016 -0800 +++ b/scripts/plot/draw/shrinkfaces.m Tue Nov 08 10:01:17 2016 -0800 @@ -198,7 +198,7 @@ %!demo %! clf; -%! N = 10; % N intervals per axis +%! N = 10; # N intervals per axis %! [x, y, z] = meshgrid (linspace (-4,4,N+1)); %! val = x.^3 + y.^3 + z.^3; %! fv = isosurface (x, y, z, val, 3, z, "noshare");
--- a/scripts/polynomial/padecoef.m Mon Nov 07 15:48:46 2016 -0800 +++ b/scripts/polynomial/padecoef.m Tue Nov 08 10:01:17 2016 -0800 @@ -165,7 +165,7 @@ ## For checking in Wolfram Alpha (look at Alternate forms -> more): ## PadeApproximant[Exp[-x * T], {x, 0, {n, n}}] -%% Test input validation +## Test input validation %!error padecoef () %!error padecoef (1,2,3) %!error <T must be a non-negative scalar> padecoef ([1,2])