# HG changeset patch # User John W. Eaton # Date 1360463755 18000 # Node ID 1af8d21608b736fe25ffc51dd4c070292e61d2d6 # Parent b8157404614f272dd978cae48bbdb969de082117 rename all test files in the test directory from test_X.m to X.tst * Use - instead of _ for .tst file names. Fix all file lists in module.mk and Makefile.am files. * __run_test_suite__.m: Adapt to new naming convention. diff -r b8157404614f -r 1af8d21608b7 scripts/testfun/__run_test_suite__.m --- a/scripts/testfun/__run_test_suite__.m Sat Feb 09 20:05:40 2013 -0500 +++ b/scripts/testfun/__run_test_suite__.m Sat Feb 09 21:35:55 2013 -0500 @@ -23,8 +23,8 @@ function __run_test_suite__ (fcndirs, fixedtestdirs) testsdir = octave_config_info ("octtestsdir"); - libinterptestdir = fullfile (testsdir, "libinterp") - liboctavetestdir = fullfile (testsdir, "liboctave") + libinterptestdir = fullfile (testsdir, "libinterp"); + liboctavetestdir = fullfile (testsdir, "liboctave"); fixedtestdir = fullfile (testsdir, "fixed"); fcnfiledir = octave_config_info ("fcnfiledir"); if (nargin == 0) @@ -194,13 +194,12 @@ chdir (d); for i = 1:length (lst) nm = lst(i).name; - if (length (nm) > 5 && strcmp (nm(1:5), "test_") - && strcmp (nm((end-1):end), ".m")) + if (length (nm) > 4 && strcmp (nm((end-3):end), ".tst")) p = n = xf = sk = 0; ffnm = fullfile (d, nm); if (has_tests (ffnm)) print_test_file_name (nm); - [p, n, xf, sk] = test (nm(1:(end-2)), "quiet", fid); + [p, n, xf, sk] = test (nm, "quiet", fid); print_pass_fail (n, p); files_with_tests(end+1) = ffnm; ##elseif (has_demos (ffnm)) @@ -244,8 +243,10 @@ continue endif f = fullfile (d, nm); - if ((length (nm) > 2 && strcmp (nm((end-1):end), ".m")) || - (length (nm) > 4 && strcmp (nm((end-3):end), "-tst"))) + if ((length (nm) > 2 && strcmp (nm((end-1):end), ".m")) + || (length (nm) > 4 + && (strcmp (nm((end-3):end), "-tst") + || strcmp (nm((end-3):end), ".tst")))) p = n = xf = 0; ## Only run if it contains %!test, %!assert %!error or %!warning if (has_tests (f)) diff -r b8157404614f -r 1af8d21608b7 test/Makefile.am --- a/test/Makefile.am Sat Feb 09 20:05:40 2013 -0500 +++ b/test/Makefile.am Sat Feb 09 21:35:55 2013 -0500 @@ -22,33 +22,33 @@ FCN_FILES = \ fntests.m \ - test_args.m \ - test_bug_31371.m \ - test_diag_perm.m \ - test_error.m \ - test_eval-catch.m \ - test_for.m \ - test_func.m \ - test_global.m \ - test_if.m \ - test_index.m \ - test_io.m \ - test_line_continue.m \ - test_logical_index.m \ - test_null_assign.m \ - test_parser.m \ - test_prefer.m \ - test_range.m \ - test_recursion.m \ - test_return.m \ - test_slice.m \ - test_struct.m \ - test_switch.m \ - test_system.m \ - test_transpose.m \ - test_try.m \ - test_unwind.m \ - test_while.m + args.tst \ + bug-31371.tst \ + diag-perm.tst \ + error.tst \ + eval-catch.tst \ + for.tst \ + func.tst \ + global.tst \ + if.tst \ + index.tst \ + io.tst \ + line-continue.tst \ + logical-index.tst \ + null-assign.tst \ + parser.tst \ + prefer.tst \ + range.tst \ + recursion.tst \ + return.tst \ + slice.tst \ + struct.tst \ + switch.tst \ + system.tst \ + transpose.tst \ + try.tst \ + unwind.tst \ + while.tst include bug-35448/module.mk include bug-36025/module.mk @@ -59,31 +59,34 @@ include fcn-handle-derived-resolution/module.mk include nest/module.mk -check: test_sparse.m test_bc_overloads.m +check: sparse.tst bc-overload-tests.stamp $(top_builddir)/run-octave --norc --silent --no-history $(srcdir)/fntests.m $(srcdir) -test_sparse.m: build_sparse_tests.sh - $(srcdir)/build_sparse_tests.sh +sparse.tst: build-sparse-tests.sh + $(srcdir)/build-sparse-tests.sh GENERATED_BC_OVERLOADS_DIRS := \ - $(shell $(srcdir)/build_bc_overload_tests.sh --list-dirs) + $(shell $(srcdir)/build-bc-overload-tests.sh --list-dirs) GENERATED_BC_OVERLOADS_FILES := \ - $(shell $(srcdir)/build_bc_overload_tests.sh --list-files) + $(shell $(srcdir)/build-bc-overload-tests.sh --list-files) -bc-overload-tests.stamp: build_bc_overload_tests.sh bc_overloads_expected - $(srcdir)/build_bc_overload_tests.sh $(srcdir)/bc_overloads_expected +bc-overload-tests.stamp: build-bc-overload-tests.sh bc-overloads-expected + $(srcdir)/build-bc-overload-tests.sh $(srcdir)/bc-overloads-expected touch $@ +BUILT_SOURCES = bc-overload-tests.stamp + EXTRA_DIST = \ - build_sparse_tests.sh \ - build_bc_overload_tests.sh \ - bc_overloads_expected \ + build-sparse-tests.sh \ + build-bc-overload-tests.sh \ + bc-overloads-expected \ build_bc_overloads_expected.m \ $(FCN_FILES) CLEANFILES = \ - test_sparse.m \ + sparse.tst \ + bc-overload-tests.stamp \ $(GENERATED_BC_OVERLOADS_FILES) DISTCLEANFILES = \ @@ -92,7 +95,7 @@ fixedtestsdir := $(octtestsdir)/fixed nobase_fixedtests_DATA = \ - test_sparse.m \ + sparse.tst \ $(GENERATED_BC_OVERLOADS_FILES) \ $(filter-out fntests.m, $(FCN_FILES)) diff -r b8157404614f -r 1af8d21608b7 test/args.tst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/args.tst Sat Feb 09 21:35:55 2013 -0500 @@ -0,0 +1,236 @@ +## Copyright (C) 2006-2012 John W. Eaton +## +## This file is part of Octave. +## +## Octave is free software; you can redistribute it and/or modify it +## under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 3 of the License, or (at +## your option) any later version. +## +## Octave is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with Octave; see the file COPYING. If not, see +## . + +######################################## +## No inputs or no outputs + +## no input or output arguments +%!function f () +%! assert (nargin, 0); +%! assert (nargout, 0); +%!endfunction +%!test +%! f; + +## one input with two possible inputs +%!function f (x, y) +%! assert (nargin, 1); +%! assert (nargout, 0); +%!endfunction +%!test +%! f (1); + +## no inputs, one of multiple outputs +%!function [x, y] = f () +%! assert (nargin, 0); +%! assert (nargout, 1); +%! x = 2; +%!endfunction +%!test +%! assert (f (), 2); + +## one of multiple inputs, one of multiple outputs +%!function [x, y] = f (a, b) +%! assert (nargin, 1); +%! assert (nargout, 1); +%! x = a; +%!endfunction +%!test +%! assert (f (1), 1); + +######################################## +## Varargin, varargout + +## varargin and varargout with no inputs or outputs +%!function [varargout] = f (varargin) +%! assert (nargin, 0); +%! assert (nargout, 0); +%!endfunction +%!test +%! f; + +## varargin and varargout with one input +%!function [varargout] = f (x, varargin) +%! assert (nargin, 1); +%! assert (nargout, 0); +%!endfunction +%!test +%! f (1); + +## varargin and varargout with one output +%!function [x, varargout] = f (varargin) +%! assert (nargin, 0); +%! assert (nargout, 1); +%! x = 2; +%!endfunction +%!test +%! assert (f (), 2); + +## varargin and varargout with one input and output +%!function [varargout] = f (varargin) +%! assert (nargin, 1); +%! assert (nargout, 1); +%! varargout{1} = varargin{1}; +%!endfunction +%!test +%! assert (f (1), 1); + +## multiple inputs, multiple outputs, but not all of either +## WARNING: The original test did not assign the outputs, it just +## requested them, and I think that is supposed to be an error. It also +## still has a non-assigned output argument. +%!function [x, y, z] = f (a, b, c, d, e) +%! assert (nargin, 4); +%! assert (nargout, 2); +%! x = a; +%! y = b; +%!endfunction +%!test +%! [s, t] = f (1, 2, 3, 4); +%! assert ([s t], [1 2]); + +## Fully used varargin and varargout +%!function [varargout] = f (varargin) +%! assert (nargin, 3); +%! assert (nargout, 4); +%! varargout{1} = varargin{1}; +%! varargout{2} = varargin{2}; +%! varargout{3} = varargin{3}; +%! varargout{4} = 4; +%!endfunction +%!test +%! [s, t, u, v] = f (1, 2, 3); +%! assert ([s t u v], [1 2 3 4]); + +## Test default arguments +## numeric +%!function f (x = 0) +%! assert (x, 0); +%!endfunction +%!test +%! f() + +## numeric vector (spaces) +%!function f (x = [0 1 2]) +%! assert (x, [0 1 2]); +%!endfunction +%!test +%! f() + +## numeric vector (range) +%!function f (x = 1:3) +%! assert (x, 1:3); +%!endfunction +%!test +%! f() + +## numeric vector (commas) +%!function f (x = [0,1,2]) +%! assert (x, [0 1 2]); +%!endfunction +%!test +%! f() + +## numeric vector (commas and spaces) +%!function f (x = [0, 1, 2]) +%! assert (x, [0 1 2]); +%!endfunction +%!test +%! f() + +## numeric matrix +%!function f (x = [0, 1, 2;3, 4, 5]) +%! assert (x, [0 1 2;3 4 5]); +%!endfunction +%!test +%! f() + +## empty cell +%!function f (x = {}) +%! assert (x, {}); +%!endfunction +%!test +%! f() + +## full cell +%!function f (x = {1}) +%! assert (x, {1}); +%!endfunction +%!test +%! 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() + +## struct +%!function f (x = struct("a", 3)) +%! assert (x, struct ("a", 3)); +%!endfunction +%!test +%! f() + +## char (double quotes) +%!function f (x = "a") +%! assert (x, "a"); +%!endfunction +%!test +%! f() + +## char (single quotes) +%!function f (x = 'a') +%! assert (x, "a"); +%!endfunction +%!test +%! f() + +## char (string, double quotes) +%!function f (x = "abc123") +%! assert (x, "abc123"); +%!endfunction +%!test +%! f() + +## char (string, double quotes, punctuation) +%!function f (x = "abc123`1234567890-=~!@#$%^&*()_+[]{}|;':\",./<>?\\") +%! assert (x, "abc123`1234567890-=~!@#$%^&*()_+[]{}|;':\",./<>?\\"); +%!endfunction +%!test +%! f() + +## Function handle (builtin) +%!function f (x = @sin) +%! finfo = functions (x); +%! fname = finfo.function; +%! assert (isa (x, "function_handle") && strcmp (fname, "sin")); +%!endfunction +%!test +%! f() + +## Function handle (anonymous) +%!function f (x = @(x) x.^2) +%! finfo = functions (x); +%! ftype = finfo.type; +%! assert (isa (x, "function_handle") && strcmp (ftype, "anonymous")); +%!endfunction +%!test +%! f() + diff -r b8157404614f -r 1af8d21608b7 test/bug-31371.tst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/bug-31371.tst Sat Feb 09 21:35:55 2013 -0500 @@ -0,0 +1,41 @@ +%!test +%! % Work around MATLAB bug where f(x)(y) is invalid syntax +%! % (This bug does not apply to Octave) +%! +%! 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 -r b8157404614f -r 1af8d21608b7 test/bug-35448/bug-35448.tst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/bug-35448/bug-35448.tst Sat Feb 09 21:35:55 2013 -0500 @@ -0,0 +1,11 @@ +%!test +%! global gfun +%! gfun = @fB; +%! y = fA (e); +%! assert (y, e); + +%!test +%! global gfun +%! gfun = @fC; +%! y = fA (e); +%! assert (y, e); diff -r b8157404614f -r 1af8d21608b7 test/bug-35448/module.mk --- a/test/bug-35448/module.mk Sat Feb 09 20:05:40 2013 -0500 +++ b/test/bug-35448/module.mk Sat Feb 09 21:35:55 2013 -0500 @@ -2,6 +2,6 @@ bug-35448/fA.m \ bug-35448/fB.m \ bug-35448/fC.m \ - bug-35448/test_bug_35448.m + bug-35448/bug-35448.tst FCN_FILES += $(bug_35448_FCN_FILES) diff -r b8157404614f -r 1af8d21608b7 test/bug-35448/test_bug_35448.m --- a/test/bug-35448/test_bug_35448.m Sat Feb 09 20:05:40 2013 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ -%!test -%! global gfun -%! gfun = @fB; -%! y = fA (e); -%! assert (y, e); - -%!test -%! global gfun -%! gfun = @fC; -%! y = fA (e); -%! assert (y, e); diff -r b8157404614f -r 1af8d21608b7 test/bug-36025/bug-36025.tst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/bug-36025/bug-36025.tst Sat Feb 09 21:35:55 2013 -0500 @@ -0,0 +1,9 @@ +%!test +%! warning off Octave:function-name-clash +%! f = testclass (1, 2); +%! assert (one (f), 1); +%! assert (two (f), 2); +%! rehash (); +%! assert (one (f), 1); +%! assert (two (f), 2); +%! assert (two (f), 2); diff -r b8157404614f -r 1af8d21608b7 test/bug-36025/module.mk --- a/test/bug-36025/module.mk Sat Feb 09 20:05:40 2013 -0500 +++ b/test/bug-36025/module.mk Sat Feb 09 21:35:55 2013 -0500 @@ -2,6 +2,6 @@ bug-36025/@testclass/one.m \ bug-36025/@testclass/testclass.m \ bug-36025/@testclass/two.m \ - bug-36025/test_bug_36025.m + bug-36025/bug-36025.tst FCN_FILES += $(bug_36025_FCN_FILES) diff -r b8157404614f -r 1af8d21608b7 test/bug-36025/test_bug_36025.m --- a/test/bug-36025/test_bug_36025.m Sat Feb 09 20:05:40 2013 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,9 +0,0 @@ -%!test -%! warning off Octave:function-name-clash -%! f = testclass (1, 2); -%! assert (one (f), 1); -%! assert (two (f), 2); -%! rehash (); -%! assert (one (f), 1); -%! assert (two (f), 2); -%! assert (two (f), 2); diff -r b8157404614f -r 1af8d21608b7 test/bug-38236/bug-38236.tst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/bug-38236/bug-38236.tst Sat Feb 09 21:35:55 2013 -0500 @@ -0,0 +1,3 @@ +%!test +%! u_vr + diff -r b8157404614f -r 1af8d21608b7 test/bug-38236/module.mk --- a/test/bug-38236/module.mk Sat Feb 09 20:05:40 2013 -0500 +++ b/test/bug-38236/module.mk Sat Feb 09 21:35:55 2013 -0500 @@ -1,6 +1,6 @@ bug_38236_FCN_FILES = \ bug-38236/df_vr.m \ bug-38236/u_vr.m \ - bug-38236/test_bug_38236.m + bug-38236/bug-38236.tst FCN_FILES += $(bug_38236_FCN_FILES) diff -r b8157404614f -r 1af8d21608b7 test/bug-38236/test_bug_38236.m --- a/test/bug-38236/test_bug_38236.m Sat Feb 09 20:05:40 2013 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -%!test -%! u_vr - diff -r b8157404614f -r 1af8d21608b7 test/build-bc-overload-tests.sh --- a/test/build-bc-overload-tests.sh Sat Feb 09 20:05:40 2013 -0500 +++ b/test/build-bc-overload-tests.sh Sat Feb 09 21:35:55 2013 -0500 @@ -40,7 +40,7 @@ case "$1" in --list-files) echo tbcover.m - echo test_bc_overloads.m + echo bc-overloads.tst for class in $CLASSES; do echo @$class/tbcover.m done @@ -87,7 +87,7 @@ exit fi -cat > test_bc_overloads.m << EOF +cat > bc-overloads.tst << EOF ## !!! DO NOT EDIT !!! ## THIS IS AN AUTOMATICALLY GENERATED FILE ## modify build_bc_overload_tests.sh to generate the tests you need. @@ -113,7 +113,7 @@ cat $expected_results_file | \ while read cl1 cl2 clr ; do - cat >> test_bc_overloads.m << EOF + cat >> bc-overloads.tst << EOF %% Name call %!assert (tbcover (ex.$cl1, ex.$cl2), "$clr") %% Handle call @@ -122,7 +122,7 @@ EOF done -cat >> test_bc_overloads.m << EOF +cat >> bc-overloads.tst << EOF %%test handles through cellfun %!test %! f = fieldnames (ex); diff -r b8157404614f -r 1af8d21608b7 test/build-sparse-tests.sh --- a/test/build-sparse-tests.sh Sat Feb 09 20:05:40 2013 -0500 +++ b/test/build-sparse-tests.sh Sat Feb 09 21:35:55 2013 -0500 @@ -22,12 +22,12 @@ # Search for "# fails" # ./build_sparse_tests.sh preset -# creates test_sparse.m with preset tests. -# Use "test test_sparse" from octave to run the tests. +# creates sparse.tst with preset tests. +# Use "test sparse.tst" from octave to run the tests. # # ./build_sparse_tests.sh random -# Creates test_sprandom.m with randomly generated matrices. -# Use "test test_sprandom" from octave to run the tests. +# Creates sprandom.tst with randomly generated matrices. +# Use "test sprandom.tst" from octave to run the tests. # build_sparse_tests.sh generates tests for real and complex sparse matrices. # Also, we want to run both fixed tests with known outputs (quick tests) @@ -114,9 +114,9 @@ esac if $preset; then - TESTS=test_sparse.m + TESTS=sparse.tst else - TESTS=test_sprandom.m + TESTS=sprandom.tst fi # create initial file @@ -238,7 +238,7 @@ ## run preset sparse tests. All should pass. function [passes, tests] = test_sparse disp ("writing test output to sptest.log"); - test ("test_sparse", "normal", "sptest.log"); + test ("sparse.tst", "normal", "sptest.log"); endfunction EOF @@ -258,7 +258,7 @@ warning ("untested --- fix the source in build_sparse_tests.sh"); disp ("appending test output to sprandomtest.log"); fid = fopen ("sprandomtest.log", "at"); - test ("test_sprandom", "normal", fid); + test ("sprandom.tst", "normal", fid); ##[passes, total] = test("sprandomtest","normal",fid); fclose (fid); endfunction diff -r b8157404614f -r 1af8d21608b7 test/class-concat/class-concat.tst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/class-concat/class-concat.tst Sat Feb 09 21:35:55 2013 -0500 @@ -0,0 +1,14 @@ +%!test +%! f = foo (); +%! x = [f,f]; +%! assert (size (x), [1, 2]) +%! assert (class (x), "foo") + +%!test +%! f = foo (); +%! x = [f,f]; +%! tmp = num2cell (x); +%! assert (iscell (tmp)) +%! assert (size (tmp), [1, 2]) +%! assert (class (tmp{1}), "foo") +%! assert (class (tmp{2}), "foo") diff -r b8157404614f -r 1af8d21608b7 test/class-concat/module.mk --- a/test/class-concat/module.mk Sat Feb 09 20:05:40 2013 -0500 +++ b/test/class-concat/module.mk Sat Feb 09 21:35:55 2013 -0500 @@ -1,5 +1,5 @@ class_concat_FCN_FILES = \ class-concat/@foo/foo.m \ - class-concat/test_class_concat.m + class-concat/class-concat.tst FCN_FILES += $(class_concat_FCN_FILES) diff -r b8157404614f -r 1af8d21608b7 test/class-concat/test_class_concat.m --- a/test/class-concat/test_class_concat.m Sat Feb 09 20:05:40 2013 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ -%!test -%! f = foo (); -%! x = [f,f]; -%! assert (size (x), [1, 2]) -%! assert (class (x), "foo") - -%!test -%! f = foo (); -%! x = [f,f]; -%! tmp = num2cell (x); -%! assert (iscell (tmp)) -%! assert (size (tmp), [1, 2]) -%! assert (class (tmp{1}), "foo") -%! assert (class (tmp{2}), "foo") diff -r b8157404614f -r 1af8d21608b7 test/classes/classes.tst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/classes/classes.tst Sat Feb 09 21:35:55 2013 -0500 @@ -0,0 +1,318 @@ +## Copyright (C) 2013 Julien Bect +## Copyright (C) 2009-2012 Robert T. Short +## +## This file is part of Octave. +## +## Octave is free software; you can redistribute it and/or modify it +## under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 3 of the License, or (at +## your option) any later version. +## +## Octave is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with Octave; see the file COPYING. If not, see +## . + +%% Test script for legacy OOP. +%% Requires the path to contain the test classes. +%% +%% Note: This script and all classes are also intended to run +%% in MATLAB to test compatibility. Don't break that! +%% +%% Note(JBect, 2013/01/27) : in order to ease to process of testing +%% Matlab compatibility, the syntax assert(observed, expected) should +%% be avoided. I use assert(isequal(observed, expected) instead. +%% +%% To Do: This script tests to ensure that things done correctly work +%% corrrectly. It should also check that things done incorrectly +%% error properly. +%% +%% The classes used for the tests reside in the test directory. +%% +%% The classes provide the ability to test most of the major features +%% of the legacy OOP facilities. There are a number of classes, mostly +%% kind of the same, that create a hierarchy. + +%% Test the Snork class. The Snork class has a number of the standard +%% methods that the others don't so we can test indexing and other +%% features. +%!shared snk, snk1, snk2 +%!test snk = Snork(); +%! assert (isequal (gick (snk), 1)); +%! assert (isequal (snk.gick, 1)); +%! assert (isequal (snk(2), 1)); +%! assert (isequal (snk{end}, 3)); +%!test snk = gick (snk, 2); +%! assert (isequal (gick (snk), 2)); +%!test snk = set (snk, 'gick', 7); +%! assert (isequal (get (snk, 'gick'), 7)); +%!test snk.gick = 4; +%! assert (isequal (gick (snk),4)); +%! snk(1) = 3; +%!test snk{end} = 9; +%! assert (isequal (cack (snk), [3 1 2 9])); +%! assert (isequal (getStash (snk), 1)); % Check private functions. +%! assert (isobject (snk)); +%! assert (isequal (class (snk), 'Snork')); +%! assert (isa (snk, 'Snork')); +%! assert (~isa (snk, 'Sneetch')); +%! assert (ismethod (snk, 'gick')); +%! assert (~ismethod (snk, 'bletch')); +%! assert (exist ('snk') == 1); +%! assert (exist ('blink') == 0); +%!test snk1 = Snork(snk); +%! assert (isequal (class (snk1), 'Snork')); +%! assert (isequal (gick (snk1), 4)); +%!test snk2 = Snork(-3); +%! assert (isequal (class (snk2), 'Snork')); +%! assert (isequal (gick (snk2), -3)); +%!test x = [1 2 3 4]; +%! assert (isequal (x(snk), 1)); + +%% x = methods ('Snork'); % Need to test the methods function. +%% save temp snk; +%% load temp % This load causes a segfault. +%% assert (isequal (cack(snk), [-1 -2 -3 -4])); % This is a major bug! + +%% The Spork class is a near clone of Snork but without as many standard +%% methods. We are testing no new octave features, but this is makes +%% 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(); +%! assert (isequal (geek (sprk), 1)); +%!test sprk = geek (sprk, 3); +%! assert (isequal (geek (sprk), 3)); +%!test sprk = set (sprk,'geek',7); +%! assert (isequal (get (sprk, 'geek'), 7)); +%! assert (isequal (class (sprk), 'Spork')); +%! assert (isa (sprk, 'Spork')); + +%% The Blork class is a near clone of Snork but without as many standard +%% methods. We are testing no new octave features, but this is makes +%% 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(); +%! assert (isequal (bleek(blrk), 1)); +%!test blrk = bleek (blrk, 3); +%! assert (isequal (bleek (blrk), 3)); +%!test blrk = set (blrk, 'bleek', 13); +%! assert (isequal (get (blrk, 'bleek'), 13)); +%! assert (isequal (class (blrk), 'Blork')); +%! assert (isa (blrk, 'Blork')); + +%% The Cork class is a near clone of Snork but without as many standard +%% methods. We are testing no new octave features, but this is makes +%% 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); +%! assert (isequal (click(crk), 23)); +%!test crk = click(crk,3); +%! assert (isequal (click(crk), 3)); +%!test crk = set (crk, 'click', 13); +%! assert (isequal (get (crk, 'click'), 13)); +%! assert (isequal (class (crk), 'Cork')); +%! assert (isa (crk, 'Cork')); + +%% The Dork class tests single inheritance. +%!shared drk +%!test drk = Dork(); +%! assert (isequal (gack (drk),0)); +%!test drk = gack (drk,-2); +%! assert (isequal (gack (drk),-2)); +%!test drk = gick (drk,2); +%! assert (isequal (gick (drk),2)); +%!test drk = set (drk, 'gick',3, 'gack',-3); +%! assert (isequal (get (drk, 'gick'), 3)); +%! assert (isequal (get (drk, 'gack'), -3)); +%! assert (isequal (class (drk), 'Dork')); +%! assert (isa (drk, 'Dork')); +%! assert (isa (drk, 'Snork')); +%! assert (isequal (getStash (drk), 2)); +%!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); +%! assert (isequal (class (drk2), 'Dork')); +%! assert (isa (drk2, 'Snork')); +%! assert (isequal (gick (drk2), -4)); +%! assert (isequal (gack (drk2), 4)); + +%% 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(); +%! assert (isequal (geek (prk), 1)); +%! assert (isequal (gurk (prk), 0)); +%!test prk = gurk (prk,-3); +%! assert (isequal (gurk (prk), -3)); +%!test prk = geek (prk,9); +%! assert (isequal (geek (prk), 9)); +%! assert (isequal (class (prk), 'Pork')); +%! assert (isa (prk, 'Pork')); +%! assert (isa (prk, 'Spork')); +%!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(); +%! assert (isequal (gick (grk), 1)); +%! assert (isequal (geek (grk), 1)); +%! assert (isequal (gack (grk), 0)); +%! assert (isequal (gurk (grk), 0)); +%! assert (isequal (bleek (grk), 1)); +%! assert (isequal (gark(grk), -2)); +%! assert (isequal (click (cork (grk)), 17)); +%! assert (isequal (class (cork (grk)), 'Cork')); +%!test grk = gick (grk, 3); +%!test grk = geek (grk, 4); +%!test grk = gack (grk, -9); +%!test grk = gurk (grk, -8); +%!test grk = bleek (grk, -7); +%!test grk = gark (grk, -6); +%!test grk = cork (grk, click (cork (grk), 23)); +%! assert (isequal (gick (grk), 3)); +%! assert (isequal (geek (grk), 4)); +%! assert (isequal (gack (grk), -9)); +%! assert (isequal (gurk (grk), -8)); +%! assert (isequal (bleek (grk), -7)); +%! assert (isequal (gark (grk), -6)); +%! assert (isequal (click (cork (grk)), 23)); +%!test +%! 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)); +%! assert (isequal (get (grk, 'gark'), -7)); +%! assert (isequal (click(get (grk, 'cork')), 13)); +%!test grk = set (grk, 'cork', 12); +%! assert (isequal (click(get (grk, 'cork')),12)); +%! assert (isequal (class (cork(grk)), 'Cork')); +%! assert (isequal (class (grk), 'Gork')); +%! assert (isa (grk, 'Gork')); +%! assert (isa (grk, 'Dork')); +%! assert (isa (grk, 'Pork')); +%! assert (isa (grk, 'Blork')); +%! assert (isa (grk, 'Snork')); +%! assert (isa (grk, 'Spork')); + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Testing (some) overloaded operators %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% 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); + +%% Test overloaded plus (+) and uplus (unitary +) for the Snork class +%!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, s1)); + +%% Test overloaded minus (-) for the Snork class +%!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 overloaded mtimes (*) for the Snork class +%!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 overloaded times (.*) for the Snork class +%!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 overloaded mpower (^) for the Snork class +%!test s = s1 ^ 3; assert (isa (s, 'Snork') && isequal (s.gick, x1 ^ 3)); +%!error s = s1 ^ s1; +%!error s = 20 ^ s1; + +%% Test overloaded power (.^) for the Snork class +%!test s = s1 .^ 2; assert (isa (s, 'Snork') && isequal (s.gick, x1 .^ 2)); +%!error s = s1 .^ s1; +%!error s = 20 .^ s1; + +%% Test overloaded rdivide (./) for the Snork class +%!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 overloaded ldivide (.\) for the Snork class +%!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 overloaded mrdivide (/) for the Snork class +%!test s = s1 / s3; assert (isa (s, 'Snork') && isequal (s.gick, x1 / x3)); +%!test s = s1 / x3; assert (isa (s, 'Snork') && isequal (s.gick, x1 / x3)); +%!test s = x1 / s3; assert (isa (s, 'Snork') && isequal (s.gick, x1 / x3)); + +%% Test overloaded mldivide (\) for the Snork class +%!test s = s3 \ s2; assert (isa (s, 'Snork') && isequal (s.gick, x3 \ x2)); +%!test s = s3 \ x2; assert (isa (s, 'Snork') && isequal (s.gick, x3 \ x2)); +%!test s = x3 \ s2; assert (isa (s, 'Snork') && isequal (s.gick, x3 \ x2)); + +%% Test overloaded eq (==) for the Snork class +%!assert (s1 == s1) +%!assert (s1 == x1) +%!assert (x1 == s1) +%!assert (~(s1 == (s1 + 1))) +%!assert (~(s1 == (x1 + 1))) +%!assert (~(x1 == (s1 + 1))) + +%% Test overloaded ne (~=) for the Snork class +%!assert (~(s1 ~= s1)) +%!assert (~(s1 ~= x1)) +%!assert (~(x1 ~= s1)) +%!assert (s1 ~= (s1 + 1)) +%!assert (x1 ~= (s1 + 1)) +%!assert (s1 ~= (x1 + 1)) + +%% Test overloaded lt (<) for the Snork class +%!assert (s1 < (s1 + 1)) +%!assert (s1 < (x1 + 1)) +%!assert (x1 < (s1 + 1)) + +%% Test overloaded gt (>) for the Snork class +%!assert (s1 > (s1 - 1)) +%!assert (s1 > (x1 - 1)) +%!assert (x1 > (s1 - 1)) + +%% Test overloaded lt (<=) for the Snork class +%!assert (s1 <= (s1 + 1)) +%!assert (s1 <= (x1 + 1)) +%!assert (x1 <= (s1 + 1)) + +%% Test overloaded gt (>=) for the Snork class +%!assert (s1 >= (s1 - 1)) +%!assert (s1 >= (x1 - 1)) +%!assert (x1 >= (s1 - 1)) + +%% Test overloaded vertcat() for the Snork class +%% See bug #38170 (http://savannah.gnu.org/bugs/?38170) +%!test s = [s1; s2]; assert (isa (s, 'Snork') && isequal (s.gick, [x1; x2])); +%!xtest s = [s1; x2]; assert (isa (s, 'Snork') && isequal (s.gick, [x1; x2])); +%!xtest s = [x1; s2]; assert (isa (s, 'Snork') && isequal (s.gick, [x1; x2])); + +%% Test overloaded horzcat() for the Snork class +%% See bug #38170 (http://savannah.gnu.org/bugs/?38170) +%!test s = [s1 s2]; assert (isa (s, 'Snork') && isequal (s.gick, [x1 x2])); +%!xtest s = [s1 x2]; assert (isa (s, 'Snork') && isequal (s.gick, [x1 x2])); +%!xtest s = [x1 s2]; assert (isa (s, 'Snork') && isequal (s.gick, [x1 x2])); + diff -r b8157404614f -r 1af8d21608b7 test/classes/module.mk --- a/test/classes/module.mk Sat Feb 09 20:05:40 2013 -0500 +++ b/test/classes/module.mk Sat Feb 09 21:35:55 2013 -0500 @@ -79,6 +79,6 @@ classes/@Spork/private/myStash.m \ classes/@Spork/saveobj.m \ classes/@Spork/set.m \ - classes/test_classes.m + classes/classes.tst FCN_FILES += $(classes_FCN_FILES) diff -r b8157404614f -r 1af8d21608b7 test/classes/test_classes.m --- a/test/classes/test_classes.m Sat Feb 09 20:05:40 2013 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,318 +0,0 @@ -## Copyright (C) 2013 Julien Bect -## Copyright (C) 2009-2012 Robert T. Short -## -## This file is part of Octave. -## -## Octave is free software; you can redistribute it and/or modify it -## under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 3 of the License, or (at -## your option) any later version. -## -## Octave is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with Octave; see the file COPYING. If not, see -## . - -%% Test script for legacy OOP. -%% Requires the path to contain the test classes. -%% -%% Note: This script and all classes are also intended to run -%% in MATLAB to test compatibility. Don't break that! -%% -%% Note(JBect, 2013/01/27) : in order to ease to process of testing -%% Matlab compatibility, the syntax assert(observed, expected) should -%% be avoided. I use assert(isequal(observed, expected) instead. -%% -%% To Do: This script tests to ensure that things done correctly work -%% corrrectly. It should also check that things done incorrectly -%% error properly. -%% -%% The classes used for the tests reside in the test directory. -%% -%% The classes provide the ability to test most of the major features -%% of the legacy OOP facilities. There are a number of classes, mostly -%% kind of the same, that create a hierarchy. - -%% Test the Snork class. The Snork class has a number of the standard -%% methods that the others don't so we can test indexing and other -%% features. -%!shared snk, snk1, snk2 -%!test snk = Snork(); -%! assert (isequal (gick (snk), 1)); -%! assert (isequal (snk.gick, 1)); -%! assert (isequal (snk(2), 1)); -%! assert (isequal (snk{end}, 3)); -%!test snk = gick (snk, 2); -%! assert (isequal (gick (snk), 2)); -%!test snk = set (snk, 'gick', 7); -%! assert (isequal (get (snk, 'gick'), 7)); -%!test snk.gick = 4; -%! assert (isequal (gick (snk),4)); -%! snk(1) = 3; -%!test snk{end} = 9; -%! assert (isequal (cack (snk), [3 1 2 9])); -%! assert (isequal (getStash (snk), 1)); % Check private functions. -%! assert (isobject (snk)); -%! assert (isequal (class (snk), 'Snork')); -%! assert (isa (snk, 'Snork')); -%! assert (~isa (snk, 'Sneetch')); -%! assert (ismethod (snk, 'gick')); -%! assert (~ismethod (snk, 'bletch')); -%! assert (exist ('snk') == 1); -%! assert (exist ('blink') == 0); -%!test snk1 = Snork(snk); -%! assert (isequal (class (snk1), 'Snork')); -%! assert (isequal (gick (snk1), 4)); -%!test snk2 = Snork(-3); -%! assert (isequal (class (snk2), 'Snork')); -%! assert (isequal (gick (snk2), -3)); -%!test x = [1 2 3 4]; -%! assert (isequal (x(snk), 1)); - -%% x = methods ('Snork'); % Need to test the methods function. -%% save temp snk; -%% load temp % This load causes a segfault. -%% assert (isequal (cack(snk), [-1 -2 -3 -4])); % This is a major bug! - -%% The Spork class is a near clone of Snork but without as many standard -%% methods. We are testing no new octave features, but this is makes -%% 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(); -%! assert (isequal (geek (sprk), 1)); -%!test sprk = geek (sprk, 3); -%! assert (isequal (geek (sprk), 3)); -%!test sprk = set (sprk,'geek',7); -%! assert (isequal (get (sprk, 'geek'), 7)); -%! assert (isequal (class (sprk), 'Spork')); -%! assert (isa (sprk, 'Spork')); - -%% The Blork class is a near clone of Snork but without as many standard -%% methods. We are testing no new octave features, but this is makes -%% 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(); -%! assert (isequal (bleek(blrk), 1)); -%!test blrk = bleek (blrk, 3); -%! assert (isequal (bleek (blrk), 3)); -%!test blrk = set (blrk, 'bleek', 13); -%! assert (isequal (get (blrk, 'bleek'), 13)); -%! assert (isequal (class (blrk), 'Blork')); -%! assert (isa (blrk, 'Blork')); - -%% The Cork class is a near clone of Snork but without as many standard -%% methods. We are testing no new octave features, but this is makes -%% 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); -%! assert (isequal (click(crk), 23)); -%!test crk = click(crk,3); -%! assert (isequal (click(crk), 3)); -%!test crk = set (crk, 'click', 13); -%! assert (isequal (get (crk, 'click'), 13)); -%! assert (isequal (class (crk), 'Cork')); -%! assert (isa (crk, 'Cork')); - -%% The Dork class tests single inheritance. -%!shared drk -%!test drk = Dork(); -%! assert (isequal (gack (drk),0)); -%!test drk = gack (drk,-2); -%! assert (isequal (gack (drk),-2)); -%!test drk = gick (drk,2); -%! assert (isequal (gick (drk),2)); -%!test drk = set (drk, 'gick',3, 'gack',-3); -%! assert (isequal (get (drk, 'gick'), 3)); -%! assert (isequal (get (drk, 'gack'), -3)); -%! assert (isequal (class (drk), 'Dork')); -%! assert (isa (drk, 'Dork')); -%! assert (isa (drk, 'Snork')); -%! assert (isequal (getStash (drk), 2)); -%!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); -%! assert (isequal (class (drk2), 'Dork')); -%! assert (isa (drk2, 'Snork')); -%! assert (isequal (gick (drk2), -4)); -%! assert (isequal (gack (drk2), 4)); - -%% 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(); -%! assert (isequal (geek (prk), 1)); -%! assert (isequal (gurk (prk), 0)); -%!test prk = gurk (prk,-3); -%! assert (isequal (gurk (prk), -3)); -%!test prk = geek (prk,9); -%! assert (isequal (geek (prk), 9)); -%! assert (isequal (class (prk), 'Pork')); -%! assert (isa (prk, 'Pork')); -%! assert (isa (prk, 'Spork')); -%!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(); -%! assert (isequal (gick (grk), 1)); -%! assert (isequal (geek (grk), 1)); -%! assert (isequal (gack (grk), 0)); -%! assert (isequal (gurk (grk), 0)); -%! assert (isequal (bleek (grk), 1)); -%! assert (isequal (gark(grk), -2)); -%! assert (isequal (click (cork (grk)), 17)); -%! assert (isequal (class (cork (grk)), 'Cork')); -%!test grk = gick (grk, 3); -%!test grk = geek (grk, 4); -%!test grk = gack (grk, -9); -%!test grk = gurk (grk, -8); -%!test grk = bleek (grk, -7); -%!test grk = gark (grk, -6); -%!test grk = cork (grk, click (cork (grk), 23)); -%! assert (isequal (gick (grk), 3)); -%! assert (isequal (geek (grk), 4)); -%! assert (isequal (gack (grk), -9)); -%! assert (isequal (gurk (grk), -8)); -%! assert (isequal (bleek (grk), -7)); -%! assert (isequal (gark (grk), -6)); -%! assert (isequal (click (cork (grk)), 23)); -%!test -%! 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)); -%! assert (isequal (get (grk, 'gark'), -7)); -%! assert (isequal (click(get (grk, 'cork')), 13)); -%!test grk = set (grk, 'cork', 12); -%! assert (isequal (click(get (grk, 'cork')),12)); -%! assert (isequal (class (cork(grk)), 'Cork')); -%! assert (isequal (class (grk), 'Gork')); -%! assert (isa (grk, 'Gork')); -%! assert (isa (grk, 'Dork')); -%! assert (isa (grk, 'Pork')); -%! assert (isa (grk, 'Blork')); -%! assert (isa (grk, 'Snork')); -%! assert (isa (grk, 'Spork')); - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% Testing (some) overloaded operators %% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% 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); - -%% Test overloaded plus (+) and uplus (unitary +) for the Snork class -%!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, s1)); - -%% Test overloaded minus (-) for the Snork class -%!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 overloaded mtimes (*) for the Snork class -%!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 overloaded times (.*) for the Snork class -%!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 overloaded mpower (^) for the Snork class -%!test s = s1 ^ 3; assert (isa (s, 'Snork') && isequal (s.gick, x1 ^ 3)); -%!error s = s1 ^ s1; -%!error s = 20 ^ s1; - -%% Test overloaded power (.^) for the Snork class -%!test s = s1 .^ 2; assert (isa (s, 'Snork') && isequal (s.gick, x1 .^ 2)); -%!error s = s1 .^ s1; -%!error s = 20 .^ s1; - -%% Test overloaded rdivide (./) for the Snork class -%!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 overloaded ldivide (.\) for the Snork class -%!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 overloaded mrdivide (/) for the Snork class -%!test s = s1 / s3; assert (isa (s, 'Snork') && isequal (s.gick, x1 / x3)); -%!test s = s1 / x3; assert (isa (s, 'Snork') && isequal (s.gick, x1 / x3)); -%!test s = x1 / s3; assert (isa (s, 'Snork') && isequal (s.gick, x1 / x3)); - -%% Test overloaded mldivide (\) for the Snork class -%!test s = s3 \ s2; assert (isa (s, 'Snork') && isequal (s.gick, x3 \ x2)); -%!test s = s3 \ x2; assert (isa (s, 'Snork') && isequal (s.gick, x3 \ x2)); -%!test s = x3 \ s2; assert (isa (s, 'Snork') && isequal (s.gick, x3 \ x2)); - -%% Test overloaded eq (==) for the Snork class -%!assert (s1 == s1) -%!assert (s1 == x1) -%!assert (x1 == s1) -%!assert (~(s1 == (s1 + 1))) -%!assert (~(s1 == (x1 + 1))) -%!assert (~(x1 == (s1 + 1))) - -%% Test overloaded ne (~=) for the Snork class -%!assert (~(s1 ~= s1)) -%!assert (~(s1 ~= x1)) -%!assert (~(x1 ~= s1)) -%!assert (s1 ~= (s1 + 1)) -%!assert (x1 ~= (s1 + 1)) -%!assert (s1 ~= (x1 + 1)) - -%% Test overloaded lt (<) for the Snork class -%!assert (s1 < (s1 + 1)) -%!assert (s1 < (x1 + 1)) -%!assert (x1 < (s1 + 1)) - -%% Test overloaded gt (>) for the Snork class -%!assert (s1 > (s1 - 1)) -%!assert (s1 > (x1 - 1)) -%!assert (x1 > (s1 - 1)) - -%% Test overloaded lt (<=) for the Snork class -%!assert (s1 <= (s1 + 1)) -%!assert (s1 <= (x1 + 1)) -%!assert (x1 <= (s1 + 1)) - -%% Test overloaded gt (>=) for the Snork class -%!assert (s1 >= (s1 - 1)) -%!assert (s1 >= (x1 - 1)) -%!assert (x1 >= (s1 - 1)) - -%% Test overloaded vertcat() for the Snork class -%% See bug #38170 (http://savannah.gnu.org/bugs/?38170) -%!test s = [s1; s2]; assert (isa (s, 'Snork') && isequal (s.gick, [x1; x2])); -%!xtest s = [s1; x2]; assert (isa (s, 'Snork') && isequal (s.gick, [x1; x2])); -%!xtest s = [x1; s2]; assert (isa (s, 'Snork') && isequal (s.gick, [x1; x2])); - -%% Test overloaded horzcat() for the Snork class -%% See bug #38170 (http://savannah.gnu.org/bugs/?38170) -%!test s = [s1 s2]; assert (isa (s, 'Snork') && isequal (s.gick, [x1 x2])); -%!xtest s = [s1 x2]; assert (isa (s, 'Snork') && isequal (s.gick, [x1 x2])); -%!xtest s = [x1 s2]; assert (isa (s, 'Snork') && isequal (s.gick, [x1 x2])); - diff -r b8157404614f -r 1af8d21608b7 test/ctor-vs-method/ctor-vs-method.tst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/ctor-vs-method/ctor-vs-method.tst Sat Feb 09 21:35:55 2013 -0500 @@ -0,0 +1,56 @@ +## Copyright (C) 2012 John W. Eaton +## +## This file is part of Octave. +## +## Octave is free software; you can redistribute it and/or modify it +## under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 3 of the License, or (at +## your option) any later version. +## +## Octave is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with Octave; see the file COPYING. If not, see +## . + +%% Test script for legacy OOP. +%% Requires the path to contain the directory ctor-vs-method. +%% +%% Note: This script and all classes are also intended to run +%% in Matlab to test compatibility. Don't break that! + +%!shared d, o +%! d = derived (); +%! o = other (); +%! +%!error method (o); + +%!test +%! ctrace = {'begin parent/method'; +%! 'begin derived/parent'; +%! 'begin parent/parent'; +%! 'end parent/parent'; +%! 'end derived/parent'; +%! 'end parent/method'}; +%! __trace__ (); %% clear call trace info +%! method (d); +%! assert (__trace__ (), ctrace); + +%!test +%! ctrace = {'begin other/parent'; +%! 'end other/parent'}; +%! __trace__ (); %% clear call trace info +%! parent (o); +%! assert (__trace__ (), ctrace); + +%!test +%! ctrace = {'begin derived/parent'; +%! 'begin parent/parent'; +%! 'end parent/parent'; +%! 'end derived/parent'}; +%! __trace__ (); %% clear call trace info +%! parent (d); +%! assert (__trace__ (), ctrace); diff -r b8157404614f -r 1af8d21608b7 test/ctor-vs-method/module.mk --- a/test/ctor-vs-method/module.mk Sat Feb 09 20:05:40 2013 -0500 +++ b/test/ctor-vs-method/module.mk Sat Feb 09 21:35:55 2013 -0500 @@ -6,6 +6,6 @@ ctor-vs-method/@parent/method.m \ ctor-vs-method/@parent/parent.m \ ctor-vs-method/__trace__.m \ - ctor-vs-method/test_ctor_vs_method.m + ctor-vs-method/ctor-vs-method.tst FCN_FILES += $(ctor_vs_method_FCN_FILES) diff -r b8157404614f -r 1af8d21608b7 test/ctor-vs-method/test_ctor_vs_method.m --- a/test/ctor-vs-method/test_ctor_vs_method.m Sat Feb 09 20:05:40 2013 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,56 +0,0 @@ -## Copyright (C) 2012 John W. Eaton -## -## This file is part of Octave. -## -## Octave is free software; you can redistribute it and/or modify it -## under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 3 of the License, or (at -## your option) any later version. -## -## Octave is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with Octave; see the file COPYING. If not, see -## . - -%% Test script for legacy OOP. -%% Requires the path to contain the directory ctor-vs-method. -%% -%% Note: This script and all classes are also intended to run -%% in Matlab to test compatibility. Don't break that! - -%!shared d, o -%! d = derived (); -%! o = other (); -%! -%!error method (o); - -%!test -%! ctrace = {'begin parent/method'; -%! 'begin derived/parent'; -%! 'begin parent/parent'; -%! 'end parent/parent'; -%! 'end derived/parent'; -%! 'end parent/method'}; -%! __trace__ (); %% clear call trace info -%! method (d); -%! assert (__trace__ (), ctrace); - -%!test -%! ctrace = {'begin other/parent'; -%! 'end other/parent'}; -%! __trace__ (); %% clear call trace info -%! parent (o); -%! assert (__trace__ (), ctrace); - -%!test -%! ctrace = {'begin derived/parent'; -%! 'begin parent/parent'; -%! 'end parent/parent'; -%! 'end derived/parent'}; -%! __trace__ (); %% clear call trace info -%! parent (d); -%! assert (__trace__ (), ctrace); diff -r b8157404614f -r 1af8d21608b7 test/diag-perm.tst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/diag-perm.tst Sat Feb 09 21:35:55 2013 -0500 @@ -0,0 +1,265 @@ +## Copyright (C) 2009-2012 E. Jason Riedy +## +## This file is part of Octave. +## +## Octave is free software; you can redistribute it and/or modify it +## under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 3 of the License, or (at +## your option) any later version. +## +## Octave is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with Octave; see the file COPYING. If not, see +## . + +######################################## +## Permutation matrices + +## row permutation +%!test +%! n = 5; +%! A = rand (n); +%! perm = randperm (n); +%! Prow = eye (n) (perm, :); +%! assert (A(perm, :), Prow * A); +%! invperm(perm) = 1:n; +%! assert (Prow \ A, A(invperm, :)); +%! assert (Prow' * A, A(invperm, :)); + +## column permutation +%!test +%! n = 7; +%! A = rand (n); +%! perm = randperm (n); +%! Pcol = eye (n) (:, perm); +%! assert (A(:, perm), A * Pcol); +%! invperm(perm) = 1:n; +%! assert (A / Pcol, A(:, invperm)); +%! assert (A * Pcol.', A(:, invperm)); + +## fall back to a matrix in addition +%!test +%! n = 4; +%! P1 = eye (n) (:, randperm (n)); +%! A = zeros (n) + P1; +%! assert (sum (A), full (ones (1, n))); +%! assert (sum (A, 2), full (ones (n, 1))); + +## preserve dense matrix structure +%!test +%! n = 7; +%! Pc = eye (n) (:, randperm (n)); +%! Pr = eye (n) (randperm (n), :); +%! assert (typeinfo (rand (n) * Pc), "matrix"); +%! assert (typeinfo (Pr * rand (n)), "matrix"); + +## preserve sparse matrix structure +%!test +%! n = 7; +%! Pc = eye (n) (:, randperm (n)); +%! Ac = sprand (n-3, n, .5) + I () * sprand (n-3, n, .5); +%! Pr = eye (n) (randperm (n), :); +%! Ar = sprand (n, n+2, .5); +%! assert (typeinfo (Ac * Pc), "sparse complex matrix"); +%! assert (full (Ac * Pc), full (Ac) * Pc); +%! assert (full (Ac / Pc), full (Ac) / Pc); +%! assert (typeinfo (Pr * Ar), "sparse matrix"); +%! assert (full (Pr * Ar), Pr * full (Ar)); +%! assert (full (Pr \ Ar), Pr \ full (Ar)); + +## structure rules for 1x1 dense / scalar and 1x1 perm +%!test +%! n = 7; +%! P1 = eye (1) (:, [1]); +%! A1 = 1; +%! P = eye (n) (:, randperm (n)); +%! A = rand (n-3, n, .5); +%! assert (typeinfo (A * P1), "matrix"); +%! assert (full (A * P1), full (A) * P1); +%! assert (typeinfo (P1 * A), "matrix"); +%! assert (full (P1 * A), P1 * full (A)); +%! assert (typeinfo (A1 * P), "matrix"); +%! assert (full (A1 * P), full (A1) * P); +%! assert (typeinfo (P * A1), "matrix"); +%! assert (full (P * A1), P * full (A1)); + +## structure rules for 1x1 sparse and 1x1 perm +%!test +%! n = 7; +%! P1 = eye (1) (:, [1]); +%! A1 = sparse (1, 1, 2); +%! P = eye (n) (:, randperm (n)); +%! A = sprand (n-3, n, .5); +%! assert (typeinfo (A * P1), "sparse matrix"); +%! assert (full (A * P1), full (A) * P1); +%! assert (typeinfo (P1 * A), "sparse matrix"); +%! assert (full (P1 * A), P1 * full (A)); +%! assert (typeinfo (A1 * P), "sparse matrix"); +%! assert (full (A1 * P), full (A1) * P); +%! assert (typeinfo (P * A1), "sparse matrix"); +%! assert (full (P * A1), P * full (A1)); + +## permuting a matrix with exceptional values does not introduce new ones. +%!test +%! n = 5; +%! pc = randperm (n); +%! Pc = eye (n) (:, pc); +%! pr = randperm (n); +%! Pr = eye (n) (pr, :); +%! A = rand (n); +%! A(n, n-2) = NaN; +%! A(3, 1) = Inf; +%! assert (Pr * A * Pc, A(pr, pc)); + +## conversion to sparse form +%!test +%! n = 7; +%! P = eye (n) (:, randperm (n)); +%! sP = sparse (P); +%! assert (full (sP), full (P)); +%! assert (size (find (sP), 1), n); +%! [I, J, V] = find (sP); +%! assert (all (V == 1)); + +######################################## +## Diagonal matrices + +## square row scaling +%!test +%! m = 7; +%! n = 11; +%! A = rand (m, n); +%! scalefact = rand (m, 1); +%! Dr = diag (scalefact); +%! assert (Dr * A, repmat (scalefact, 1, n) .* A); +%! assert (Dr \ A, A ./ repmat (scalefact, 1, n)); +%! scalefact(m-1) = Inf; +%! Dr(m-1, m-1) = 0; +%! assert (Dr \ A, A ./ repmat (scalefact, 1, n)); + +## square column scaling +%!test +%! m = 13; +%! n = 11; +%! A = rand (m, n); +%! scalefact = rand (1, n); +%! Dc = diag (scalefact); +%! assert (A * Dc, repmat (scalefact, m, 1) .* A); +%! assert (A / Dc, A ./ repmat (scalefact, m, 1)); +%! scalefact(n-1) = Inf; +%! Dc(n-1, n-1) = 0; +%! assert (A / Dc, A ./ repmat (scalefact, m, 1)); + +## arithmetic +%!test +%! m = 9; +%! n = 7; +%! mn = min (m, n); +%! d1 = rand (mn, 1) + I () * rand (mn, 1); +%! D1 = diag (d1, m, n); +%! d2 = rand (mn, 1); +%! D2 = diag (d2, m, n); +%! D1D2 = D1 + D2; +%! assert (typeinfo (D1D2), "complex diagonal matrix"); +%! assert (diag (D1D2), d1 + d2); +%! D1D2 = D2.' * D1; +%! assert (typeinfo (D1D2), "complex diagonal matrix"); +%! assert (diag (D1D2), d1 .* d2); + +## slicing +%!test +%! m = 13; +%! n = 6; +%! mn = min (m, n); +%! d = rand (mn, 1); +%! D = diag (d, m, n); +%! Dslice = D (1:(m-3), 1:(n-2)); +%! assert (typeinfo (Dslice), "diagonal matrix"); + +## preserve dense matrix structure when scaling +%!assert (typeinfo (rand (8) * (3 * eye (8))), "matrix"); +%!assert (typeinfo ((3 * eye (8)) * rand (8)), "matrix"); + +## preserve sparse matrix structure when scaling +%!assert (typeinfo (sprand (8, 8, .5) * (3 * eye (8))), "sparse matrix"); +%!assert (typeinfo (sprand (8, 8, .5) * (3 * eye (8))'), "sparse matrix"); +%!assert (typeinfo (((3 + 2 * I ()) * eye (8)) * sprand (8, 8, .5)), "sparse complex matrix"); +%!assert (typeinfo (((3 + 2 * I ()) * eye (8))' * sprand (8, 8, .5)), "sparse complex matrix"); +%!assert (typeinfo (sprand (8, 8, .5) * ((3 + 2 * I ()) * eye (8)).'), "sparse complex matrix"); + +## scaling a matrix with exceptional values does not introduce new ones. +%!test +%! n = 6; +%! dr = rand (n, 1); +%! Dr = diag (dr); +%! dc = rand (1, n); +%! Dc = diag (dc); +%! A = rand (n); +%! A(n, n-2) = NaN; +%! A(4, 1) = Inf; +%! assert (Dr * A * Dc, A .* kron (dr, dc), eps); + +## sparse inverse row scaling with a zero factor +%!test +%! n = 8; +%! A = sprand (n, n, .5); +%! scalefact = rand (n, 1); +%! Dr = diag (scalefact); +%! scalefact(n-1) = Inf; +%! Dr(n-1, n-1) = 0; +%! assert (full (Dr \ A), full (A) ./ repmat (scalefact, 1, n)); + +## narrow sparse inverse row scaling +%!test +%! n = 8; +%! A = sprand (n, n, .5); +%! scalefact = rand (n-2, 1); +%! Dr = diag (scalefact, n, n-2); +%! assert (full (Dr \ A), Dr \ full(A)); + +## sparse inverse column scaling with a zero factor +%!test +%! n = 11; +%! A = sprand (n, n, .5); +%! scalefact = rand (1, n); +%! Dc = diag (scalefact); +%! scalefact(n-1) = Inf; +%! Dc(n-1, n-1) = 0; +%! assert (full (A / Dc), full(A) / Dc); + +## short sparse inverse column scaling +%!test +%! n = 7; +%! A = sprand (n, n, .5); +%! scalefact = rand (1, n-2) + I () * rand(1, n-2); +%! Dc = diag (scalefact, n-2, n); +%! assert (full (A / Dc), full(A) / Dc); + +## adding sparse and diagonal stays sparse +%!test +%! n = 9; +%! A = sprand (n, n, .5); +%! D = 2 * eye (n); +%! assert (typeinfo (A + D), "sparse matrix"); +%! assert (typeinfo (A - D), "sparse matrix"); +%! D = D * I () + D; +%! assert (typeinfo (A - D), "sparse complex matrix"); +%! A = A * I () + A; +%! assert (typeinfo (D - A), "sparse complex matrix"); + +## adding sparse and diagonal stays sparse +%!test +%! n = 9; +%! A = sprand (n, n, .5); +%! D = 2 * eye (n); +%! assert (full (A + D), full (A) + D); +%! assert (full (A - D), full (A) - D); +%! D = D * I () + D; +%! assert (full (D + A), D + full (A)); +%! A = A * I () + A; +%! A(6, 4) = nan (); +%! assert (full (D - A), D - full (A)); diff -r b8157404614f -r 1af8d21608b7 test/error.tst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/error.tst Sat Feb 09 21:35:55 2013 -0500 @@ -0,0 +1,93 @@ +## Copyright (C) 2006-2012 John W. Eaton +## +## This file is part of Octave. +## +## Octave is free software; you can redistribute it and/or modify it +## under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 3 of the License, or (at +## your option) any later version. +## +## Octave is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with Octave; see the file COPYING. If not, see +## . + +## Test %!error usage + +%% test/octave.test/error/error-1.m +%!function g () +%! error ("foo"); +%!endfunction +%!function f () +%! g (); +%!endfunction +%!error f () + +%% test/octave.test/error/error-2.m +%!function g () +%! error ("foo\n"); +%!endfunction +%!function f () +%! g +%!endfunction +%!error f () + +%% test/octave.test/error/error-3.m +%!error error () + +%% test/octave.test/error/error-4.m +%!error error ("foo\n") + +## Test %!warning usage + +%% test/octave.test/error/warning-1.m +%!function g () +%! warning ("foo"); +%!endfunction +%!function f () +%! g; +%!endfunction +%!warning f () + +%% test/octave.test/error/warning-2.m +%!test +%! st.identifier = "backtrace"; +%! ws = warning ("query", "backtrace"); +%! warning ("on", "backtrace"); +%! st.state = "on"; +%! assert(warning ("query", "backtrace"), st); +%! warning ("off", "backtrace"); +%! st.state = "off"; +%! assert(warning ("query", "backtrace"), st); +%! warning (ws.state, "backtrace"); + +## Test usage() function + +%% test/octave.test/error/usage-1.m +%!function g () +%! usage ("foo"); +%!endfunction +%!function f () +%! g (); +%!endfunction +%!error f () + +%% test/octave.test/error/usage-2.m +%!function g () +%! usage ("foo"); +%!endfunction +%!function f () +%! g +%!endfunction +%!error f () + +%% test/octave.test/error/usage-3.m +%!error usage () + +%% test/octave.test/error/usage-4.m +%!error usage ("foo\n") + diff -r b8157404614f -r 1af8d21608b7 test/eval-catch.tst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/eval-catch.tst Sat Feb 09 21:35:55 2013 -0500 @@ -0,0 +1,73 @@ +## Copyright (C) 2006-2012 John W. Eaton +## +## This file is part of Octave. +## +## Octave is free software; you can redistribute it and/or modify it +## under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 3 of the License, or (at +## your option) any later version. +## +## Octave is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with Octave; see the file COPYING. If not, see +## . + +%% test/octave.test/eval-catch/eval-catch-1.m +%!test +%! eval ("clear a; a;", ""); + +%% test/octave.test/eval-catch/eval-catch-2.m +%!test +%! eval ("", "error ('Should not get here');"); + +%% test/octave.test/eval-catch/eval-catch-3.m +%!test +%! eval ("clear a; a; x = 0;", "x = 1;"); +%! assert (x, 1); + +%% test/octave.test/eval-catch/eval-catch-5.m +%!test +%! eval ("clear a; a; str = '';", "str=lasterr;"); +%! assert (lasterr()(1:13), "'a' undefined"); +%! assert (str(1:13), "'a' undefined"); + +%% test/octave.test/eval-catch/eval-catch-6.m +%!test +%! eval ("error ('user-defined error'); str = '';", "str = lasterr;"); +%! assert (lasterr()(1:18), "user-defined error"); +%! assert (str(1:18), "user-defined error"); + +%% test/octave.test/eval-catch/eval-catch-7.m +%!function ms = mangle (s) +%! ## Wrap angle brackets around S. +%! ms = cstrcat ("<", s, ">"); +%!endfunction +%!test +%! eval ("clear a; a; str='';", "str = mangle (lasterr);"); +%! assert (mangle(lasterr)(1:14), "<'a' undefined"); +%! assert (str(1:14), "<'a' undefined"); + +%% test/octave.test/eval-catch/eval-catch-8.m +%!test +%! eval ("eval (\"clear a; a;str1='';\", \"str1=lasterr;\"); clear b; b; str2='';", +%! "str2 = lasterr;"); +%! assert (str1(1:13), "'a' undefined"); +%! assert (str2(1:13), "'b' undefined"); + +%% test/octave.test/eval-catch/eval-catch-9.m +%!test +%! eval ("clear a; a; str1='';", +%! "eval (\"clear b; b; str2='';\", \"str2=lasterr;\"); str1=lasterr;"); +%! assert (str1(1:13), "'b' undefined"); +%! assert (str2(1:13), "'b' undefined"); + +%% test/octave.test/eval-catch/eval-catch-10.m +%!test +%! eval ("eval (\"clear a; a; str='';\",\"error (cstrcat (\\\"rethrow: \\\", lasterr));str='';\");", +%! "str=lasterr;"); +%! assert (str(1:22), "rethrow: 'a' undefined"); + diff -r b8157404614f -r 1af8d21608b7 test/fcn-handle-derived-resolution/fcn-handle-derived-resolution.tst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/fcn-handle-derived-resolution/fcn-handle-derived-resolution.tst Sat Feb 09 21:35:55 2013 -0500 @@ -0,0 +1,59 @@ +## Copyright (C) 2012 John W. Eaton +## +## This file is part of Octave. +## +## Octave is free software; you can redistribute it and/or modify it +## under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 3 of the License, or (at +## your option) any later version. +## +## Octave is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with Octave; see the file COPYING. If not, see +## . + +%% Test script for legacy OOP. +%% Requires the path to contain the directory ctor-vs-method. +%% +%% Note: This script and all classes are also intended to run +%% in Matlab to test compatibility. Don't break that! + +%!shared +%! clear -classes + +%!test +%! p = parent (7); +%! assert (numel (p), 7) + +%!test +%! d = derived (13); +%! assert (numel (d), 13) + +%!test +%! p = parent (11); +%! f = @numel; +%! assert (f (p), 11) + +%!test +%! d = parent (21); +%! f = @numel; +%! assert (f (d), 21) + +%!test +%! o(1) = other (13); +%! o(2) = other (42); +%! assert (getsize_loop (o), [13, 42]) + +%!test +%! o(1) = other (13); +%! o(2) = other (42); +%! assert (getsize_cellfun (o), [13, 42]) + +%!test +%! o(1) = other (13); +%! o(2) = other (42); +%! assert (getsize_arrayfun (o), [13, 42]) diff -r b8157404614f -r 1af8d21608b7 test/fcn-handle-derived-resolution/module.mk --- a/test/fcn-handle-derived-resolution/module.mk Sat Feb 09 20:05:40 2013 -0500 +++ b/test/fcn-handle-derived-resolution/module.mk Sat Feb 09 21:35:55 2013 -0500 @@ -6,6 +6,6 @@ fcn-handle-derived-resolution/@other/other.m \ fcn-handle-derived-resolution/@parent/numel.m \ fcn-handle-derived-resolution/@parent/parent.m \ - fcn-handle-derived-resolution/test_fcn_handle_derived_resolution.m + fcn-handle-derived-resolution/fcn-handle-derived-resolution.tst FCN_FILES += $(fcn_handle_derived_resolution_FCN_FILES) diff -r b8157404614f -r 1af8d21608b7 test/fcn-handle-derived-resolution/test_fcn_handle_derived_resolution.m --- a/test/fcn-handle-derived-resolution/test_fcn_handle_derived_resolution.m Sat Feb 09 20:05:40 2013 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,59 +0,0 @@ -## Copyright (C) 2012 John W. Eaton -## -## This file is part of Octave. -## -## Octave is free software; you can redistribute it and/or modify it -## under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 3 of the License, or (at -## your option) any later version. -## -## Octave is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with Octave; see the file COPYING. If not, see -## . - -%% Test script for legacy OOP. -%% Requires the path to contain the directory ctor-vs-method. -%% -%% Note: This script and all classes are also intended to run -%% in Matlab to test compatibility. Don't break that! - -%!shared -%! clear -classes - -%!test -%! p = parent (7); -%! assert (numel (p), 7) - -%!test -%! d = derived (13); -%! assert (numel (d), 13) - -%!test -%! p = parent (11); -%! f = @numel; -%! assert (f (p), 11) - -%!test -%! d = parent (21); -%! f = @numel; -%! assert (f (d), 21) - -%!test -%! o(1) = other (13); -%! o(2) = other (42); -%! assert (getsize_loop (o), [13, 42]) - -%!test -%! o(1) = other (13); -%! o(2) = other (42); -%! assert (getsize_cellfun (o), [13, 42]) - -%!test -%! o(1) = other (13); -%! o(2) = other (42); -%! assert (getsize_arrayfun (o), [13, 42]) diff -r b8157404614f -r 1af8d21608b7 test/for.tst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/for.tst Sat Feb 09 21:35:55 2013 -0500 @@ -0,0 +1,111 @@ +## Copyright (C) 2006-2012 John W. Eaton +## +## This file is part of Octave. +## +## Octave is free software; you can redistribute it and/or modify it +## under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 3 of the License, or (at +## your option) any later version. +## +## Octave is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with Octave; see the file COPYING. If not, see +## . + +%% test/octave.test/for/for-1.m +%!test +%! for i = 1 +%! __printf_assert__ ("%d", i); +%! end +%! __printf_assert__ ("\n"); +%! assert (__prog_output_assert__ ("1")); + +%% test/octave.test/for/for-2.m +%!test +%! for i = 1:4 +%! __printf_assert__ ("%d", i); +%! endfor +%! __printf_assert__ ("\n"); +%! assert (__prog_output_assert__ ("1234")); + +%% test/octave.test/for/for-3.m +%!test +%! for i = [1,2,3,4] +%! __printf_assert__ ("%d", i); +%! endfor +%! __printf_assert__ ("\n"); +%! assert (__prog_output_assert__ ("1234")); + +%% test/octave.test/for/for-4.m +%!test +%! for i = [1,2;3,4] +%! __printf_assert__ ("%d", i(1,1)); +%! __printf_assert__ ("%d", i(2,1)); +%! endfor +%! __printf_assert__ ("\n"); +%! assert (__prog_output_assert__ ("1324")); + +%% test/octave.test/for/for-5.m +%!test +%! for i = I +%! __printf_assert__ ("%d", imag (i)); +%! endfor +%! __printf_assert__ ("\n"); +%! assert (__prog_output_assert__ ("1")); + +%% test/octave.test/for/for-6.m +%!test +%! for i = [1,2,3,4]*I +%! __printf_assert__ ("%d", imag (i)); +%! endfor +%! __printf_assert__ ("\n"); +%! assert (__prog_output_assert__ ("1234")); + +%% test/octave.test/for/for-7.m +%!test +%! for i = [1,2;3,4]*I +%! __printf_assert__ ("%d", imag (i(1,1))); +%! __printf_assert__ ("%d", imag (i(2,1))); +%! endfor +%! __printf_assert__ ("\n"); +%! assert (__prog_output_assert__ ("1324")); + +%% test/octave.test/for/for-8.m +%!test +%! for i = [1,2,3,4] +%! if (i > 2) +%! break; +%! endif +%! __printf_assert__ ("%d", i); +%! endfor +%! __printf_assert__ ("\n"); +%! assert (__prog_output_assert__ ("12")); + +%% test/octave.test/for/for-9.m +%!test +%! for i = [1,2,3,4] +%! if (i < 3) +%! continue; +%! endif +%! __printf_assert__ ("%d", i); +%! endfor +%! __printf_assert__ ("\n"); +%! assert (__prog_output_assert__ ("34")); + +%!test +%! a = [1,3;2,4]; +%! j = 0; +%! for i = cat (3, a, 4 + a) +%! assert (i, [1;2] + 2*j++) +%! endfor + +%!test +%! a = {1,3;2,4}; +%! j = 0; +%! for i = cat (3, a, cellfun(@(x) 4 + x, a, "UniformOutput", 0)) +%! assert (i, {1 + 2*j; 2 + 2*j++}) +%! endfor diff -r b8157404614f -r 1af8d21608b7 test/func.tst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/func.tst Sat Feb 09 21:35:55 2013 -0500 @@ -0,0 +1,192 @@ +## Copyright (C) 2008-2012 David Bateman +## +## This file is part of Octave. +## +## Octave is free software; you can redistribute it and/or modify it +## under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 3 of the License, or (at +## your option) any later version. +## +## Octave is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## 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 +## 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. + +%!function __fntestfunc__ (fn, mn, varargin) +%! typ = {"double", "complex", "logical", "sparse", "complex sparse", ... +%! "logical sparse", "int8", "int16", "int32", "int64", "uint8", ... +%! "uint16", "uint32", "uint64", "char", "cell", "struct", ... +%! "single", "single complex"}; +%! +%! cmplx = [2, 5, 18]; +%! nlogical = [3, 6]; +%! ninteger = [7, 8, 9, 10, 11, 12, 13, 14]; +%! nsparse = [4, 5, 6]; +%! skip = {}; +%! +%! if (length (varargin) > 0 && iscell (varargin{1})) +%! skip = varargin{1}; +%! varargin(1) = []; +%! endif +%! +%! for i = 1 : length (typ) +%! if (any (strcmp (skip, typ {i}))) +%! continue; +%! endif +%! m = mn; +%! +%! if (any (nsparse == i)) +%! if (ndims (m) > 2) +%! sz = size (m); +%! m = reshape (m, [sz(1), prod(sz(2:end))]); +%! endif +%! if (any (cmplx == i)) +%! m = sparse ((1 + 1i) * m); +%! else +%! m = sparse (m); +%! endif +%! else +%! if (any (cmplx == i)) +%! m = (1 + 1i) * m; +%! endif +%! endif +%! if (any (nlogical == i)) +%! m = cast (m, "logical"); +%! endif +%! if (any (ninteger == i)) +%! m = cast (m, typ{i}); +%! endif +%! if (strcmp (typ{i}, "cell")) +%! m = num2cell (m); +%! elseif (strcmp (typ{i}, "struct")) +%! m = struct ("fld", num2cell (m)); +%! endif +%! +%! y = feval (fn, m, varargin{:}); +%! y2 = feval (fn, reshape (mn, size (m)), varargin{:}); +%! if (!strcmp (class (y), class (m)) || +%! issparse (y) != issparse (m) || !size_equal (y, y2)) +%! error ("failed for type %s\n", typ{i}); +%! endif +%! if (!(strcmp (typ{i}, "cell") || strcmp (typ{i}, "struct")) && +%! any (vec (cast (real (y), "double")) != +%! vec (feval (fn , cast (real (m), "double"), varargin{:})))) +%! error ("failed for type %s\n", typ{i}); +%! endif +%! endfor +%!endfunction + +%!shared m0, m1, m2, m3 +%! m0 = [1:5]; +%! m1 = reshape ([1 : 30], [5, 6]); +%! m2 = reshape ([1 : 30], [5, 1, 6]); +%! m3 = []; + +%!test +%! __fntestfunc__("triu", m1, {"struct"}); +%!test +%! __fntestfunc__ ("triu", m1, {"struct"}, -1); +%!test +%! __fntestfunc__ ("triu", m1, {"struct"}, 1); +%!test +%! __fntestfunc__("triu", m3, {"struct"}); +%!test +%! __fntestfunc__ ("tril", m1, {"struct"}); +%!test +%! __fntestfunc__ ("tril", m1, {"struct"}, -1); +%!test +%! __fntestfunc__ ("tril", m1, {"struct"}, 1); +%!test +%! __fntestfunc__("tril", m3, {"struct"}); +%!test +%! __fntestfunc__ ("squeeze", m2); +%!test +%! __fntestfunc__ ("squeeze", m3); +%!test +%! __fntestfunc__ ("permute", m1, [2, 1]); +%!test +%! __fntestfunc__ ("permute", m2, {"sparse", "logical sparse", "complex sparse"}, [3, 1, 2]); +%!test +%! __fntestfunc__ ("permute", m3, [2, 1]); +%!test +%! __fntestfunc__ ("ipermute", m1, [2, 1]); +%!test +%! __fntestfunc__ ("ipermute", m2, {"sparse", "logical sparse", "complex sparse"}, [3, 1, 2]); +%!test +%! __fntestfunc__ ("ipermute", m3, [2, 1]); +%!test +%! __fntestfunc__ ("shiftdim", m2, 1); +%!test +%! __fntestfunc__ ("shiftdim", m2, {"sparse", "logical sparse", "complex sparse"}, -1); +%!test +%! __fntestfunc__ ("shiftdim", m3, 1); +%!test +%! __fntestfunc__ ("circshift", m2, 1); +%!test +%! __fntestfunc__ ("circshift", m2, [1, -1]); +%!test +%! __fntestfunc__ ("circshift", m3, 1); +%!test +%! __fntestfunc__ ("reshape", m2, [6, 5]); +%!test +%! __fntestfunc__ ("reshape", m3, [1, 0]); +%!test +%! __fntestfunc__ ("diag", m0, {"struct"}); +%!test +%! __fntestfunc__ ("diag", m0, {"struct"}, 1); +%!test +%! __fntestfunc__ ("diag", m0, {"struct"}, -1); +%!test +%! __fntestfunc__ ("diag", m1, {"struct"}); +%!test +%! __fntestfunc__ ("diag", m1, {"struct"}, 1); +%!test +%! __fntestfunc__ ("diag", m1, {"struct"}, -1); +%!test +%! __fntestfunc__ ("diag", m3, {"struct"}); +%!test +%! __fntestfunc__ ("fliplr", m1); +%!test +%! __fntestfunc__ ("fliplr", m3); +%!test +%! __fntestfunc__ ("flipud", m1); +%!test +%! __fntestfunc__ ("flipud", m3); +%!test +%! __fntestfunc__ ("flipdim", m1, 2); +%!test +%! __fntestfunc__ ("flipdim", m3, 2); +%!test +%! __fntestfunc__ ("transpose", m1); +%!test +%! __fntestfunc__ ("transpose", m3); +%!test +%! __fntestfunc__ ("ctranspose", m1); +%!test +%! __fntestfunc__ ("ctranspose", m3); +%!test +%! __fntestfunc__ ("rot90", m1); +%!test +%! __fntestfunc__ ("rot90", m1, 2); +%!test +%! __fntestfunc__ ("rot90", m1, -1); +%!test +%! __fntestfunc__ ("rot90", m3); +%!test +%! __fntestfunc__ ("rotdim", m2, 1, [1, 2]); +%!test +%! __fntestfunc__ ("rotdim", m2, 2, [1, 2]); +%!test +%! __fntestfunc__ ("rotdim", m2, -1, [1, 2]); +%!test +%! __fntestfunc__ ("rotdim", m3, 1, [1, 2]); diff -r b8157404614f -r 1af8d21608b7 test/global.tst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/global.tst Sat Feb 09 21:35:55 2013 -0500 @@ -0,0 +1,91 @@ +## Copyright (C) 2006-2012 John W. Eaton +## +## This file is part of Octave. +## +## Octave is free software; you can redistribute it and/or modify it +## under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 3 of the License, or (at +## your option) any later version. +## +## Octave is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with Octave; see the file COPYING. If not, see +## . + +%% test/octave.test/global/global-1.m +%!test +%! global G = 1; +%! assert (G,1); + +%% test/octave.test/global/global-2.m +%!function f () +%! global G; +%! assert (G,1); +%!endfunction +%!test +%! global G = 1; +%! f; + +%% test/octave.test/global/global-3.m +%!function f () +%! fail ("G"); +%!endfunction +%!test +%! global G = 1; +%! f(); + +%% test/octave.test/global/global-4.m +%!function f () +%! global H = 1; +%!endfunction +%!test +%! f; +%! fail ("H"); + +%% test/octave.test/global/global-5.m +%!function f () +%! global H = 1; +%!endfunction +%!test +%!function g () +%! fail ("H"); +%!test +%! g(); + +%% test/octave.test/global/global-6.m +%!function f () +%! global H = 1; +%!endfunction +%!function g () +%! global H; +%! assert (H,1); +%!endfunction +%!test +%! f(); +%! g(); + +%% test/octave.test/global/global-7.m +%!test +%!function f () +%! global H = 1; +%!endfunction +%!test +%! fail ("H"); + +%% test/octave.test/global/global-8.m +%!function f () +%! global H = 1; +%!endfunction +%!function g () +%! global H; +%! assert (H,1); +%!endfunction +%!test +%! f; +%! clear H; +%! g; + diff -r b8157404614f -r 1af8d21608b7 test/if.tst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/if.tst Sat Feb 09 21:35:55 2013 -0500 @@ -0,0 +1,87 @@ +## Copyright (C) 2006-2012 John W. Eaton +## +## This file is part of Octave. +## +## Octave is free software; you can redistribute it and/or modify it +## under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 3 of the License, or (at +## your option) any later version. +## +## Octave is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with Octave; see the file COPYING. If not, see +## . + +%% test/octave.test/if/if-1.m +%!test +%! i = 0; +%! if (i == 0) +%! i++; +%! __printf_assert__ ("%d\n", i); +%! endif +%! assert (__prog_output_assert__ ("1")); + +%% test/octave.test/if/if-2.m +%!test +%! if (eye (2)) +%! __printf_assert__ ("fail\n"); +%! else +%! __printf_assert__ ("pass\n"); +%! end +%! assert (__prog_output_assert__ ("pass")); + +%% test/octave.test/if/if-3.m +%!test +%! x = 2; +%! if (eye (2)) +%! __printf_assert__ ("fail\n"); +%! elseif (x) +%! __printf_assert__ ("pass\n"); +%! endif +%! assert (__prog_output_assert__ ("pass")); + +%% test/octave.test/if/if-4.m +%!test +%! x = 0; +%! y = -2; +%! if (eye (2)) +%! __printf_assert__ ("fail\n"); +%! elseif (x) +%! __printf_assert__ ("fail\n"); +%! elseif (y) +%! __printf_assert__ ("pass\n"); +%! end +%! assert (__prog_output_assert__ ("pass")); + +%% test/octave.test/if/if-5.m +%!test +%! x = 0; +%! y = -2; +%! if (eye (2)) +%! __printf_assert__ ("fail\n"); +%! elseif (x) +%! __printf_assert__ ("fail\n"); +%! elseif (x) +%! __printf_assert__ ("fail\n"); +%! else +%! __printf_assert__ ("pass\n"); +%! endif +%! assert (__prog_output_assert__ ("pass")); + +%% test/octave.test/if/if-6.m +%!test +%! x = 0; +%! y = -2; +%! if (y) +%! __printf_assert__ ("pass\n"); +%! elseif (x) +%! __printf_assert__ ("fail\n"); +%! elseif (x) +%! __printf_assert__ ("fail\n"); +%! end +%! assert (__prog_output_assert__ ("pass")); + diff -r b8157404614f -r 1af8d21608b7 test/index.tst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/index.tst Sat Feb 09 21:35:55 2013 -0500 @@ -0,0 +1,212 @@ +## Copyright (C) 2006-2012 John W. Eaton +## +## This file is part of Octave. +## +## Octave is free software; you can redistribute it and/or modify it +## under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 3 of the License, or (at +## your option) any later version. +## +## Octave is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with Octave; see the file COPYING. If not, see +## . + +%!test +%! a = []; +%! assert (isempty (a)); + +%!shared a +%! a = 1; +%!assert (a(1), 1) +%!assert (a(:), 1) +%!assert (a(:,:), 1) +%!assert (a(1,:), 1) +%!assert (a(:,1),1) +%!assert (isempty (a(logical (0)))) +%!error a(-1) +%!error a(2) +%!error a(2,:) +%!error a(:,2) +%!error a(-1,:) +%!error a(:,-1) +%!error a([1,2,3]) +%!error a([1;2;3]) +%!error a([1,2;3,4]) +%!error a([0,1]) +%!error a([0;1]) +%!error a([-1,0]) +%!error a([-1;0]) + +%!shared a, a_prime, mid_a +%! a = [4,3,2,1]; +%! a_prime = [4;3;2;1]; +%! mid_a = [3,2]; + +%!assert (a(1),4) +%!assert (a(2),3) +%!assert (all (a(:) == a_prime)) +%!assert (all (a(1,:) == a)) +%!assert (a(:,3),2) +%!assert (all (a(:,:) == a)) +%!assert (all (a(logical ([0,1,1,0])) == mid_a)) +%!error a(0) +%!error a(5) +%!error a(0,1) +%!assert (isempty (a(logical (0),:))) +%!error a(:,0) +%!assert (isempty (a([]))) +%!assert (isempty (a([],:))) +%!assert (isempty (a(:,[]))) + +%!shared a, a_fvec, a_col_1, a_col_2, a_row_1, a_row_2 +%! a = [1,2;3,4]; +%! a_fvec = [1;3;2;4]; +%! a_col_1 = [1;3]; +%! a_col_2 = [2;4]; +%! a_row_1 = [1,2]; +%! a_row_2 = [3,4]; + +%!assert (all (all (a(:,:) == a))) +%!assert (all (a(:) == a_fvec)) +%!error a(0) +%!assert (a(2), 3) + +%% Additional tests + +%!shared a, b +%! a = [1,2;3,4]; +%! b = a; +%! b(:,:,2) = [5,6;7,8]; + +%!assert (a(:), [1;3;2;4]) +%!assert (a(1:2), [1,3]) +%!assert (a(:,:), [1,2;3,4]) +%!assert (a(:,1), [1;3]) +%!assert (a(1,1), 1) +%!assert (a(1:2,1), [1;3]) +%!assert (a(:,:,1), [1,2;3,4]) + +%!test +%! c(:,:,1) = [1,2;3,4]; +%! c(:,:,2) = [1,2;3,4]; +%! assert (a(:,:,[1,1]), c) + +%!test +%! c(:,:,1,1) = [1,2;3,4]; +%! c(:,:,1,2) = [1,2;3,4]; +%! assert (a(:,:,1,[1,1]), c) + +%!test +%! c(:,:,1,1) = [1,2;3,4]; +%! c(:,:,2,1) = [1,2;3,4]; +%! c(:,:,1,2) = [1,2;3,4]; +%! c(:,:,2,2) = [1,2;3,4]; +%! assert (a(:,:,[1,1],[1,1]), c) + +%!assert (a(1,[]), zeros (1,0)) +%!assert (a(1,[],[1,1]), zeros (1,0,2)) +%!assert (a(1,1,[]), zeros (1,1,0)) + +%!test +%! c (1:10,1) = 1:10; +%! assert (c, [1:10]'); + +%!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(:,1,1), [1;3]) +%!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(:,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)) + +%!shared x +%! # Dummy shared block to clear any previous definitions +%! x = 1; + +%!test +%! a(1,:) = [1,3]; +%! assert (a, [1,3]); + +%!test +%! a(1,:) = [1;3]; +%! assert (a, [1,3]); + +%!test +%! a(:,1) = [1;3]; +%! assert (a, [1;3]); + +%!test +%! a = [1,2;3,4]; +%! b (1,:,:) = a; +%! assert (b, reshape (a, [1,2,2])); + +%!test +%! a(1,1:4,2) = reshape (1:4, [1,1,4]); +%! b(:,:,2) = 1:4; +%! assert (a, b); + +%!test +%! a(:,:,:) = 1:4; +%! assert (a, [1:4]); + +%!test +%! a(:,:,1) = 1:4;; +%! assert (a, [1:4]); + +%!test +%! a(:,:,1) = [1:4]'; +%! assert (a, [1:4]'); + +%!test +%! a(:,:,1) = reshape (1:4,[1,1,4]); +%! assert (a, [1:4]'); + +%!test +%! a(:,1,:) = 1:4; +%! assert (a, reshape (1:4,[1,1,4])); + +%!test +%! a(:,1,:) = [1:4]'; +%! assert (a, [1:4]'); + +%!test +%! a(:,1,:) = reshape (1:4,[1,1,4]);; +%! assert (a, [1:4]'); + +%!test +%! a(1,:,:) = 1:4; +%! assert (a, reshape (1:4,[1,1,4])); + +%!test +%! a(1,:,:) = [1:4]'; +%! assert (a, [1:4]); + +%!test +%! a(1,:,:) = reshape (1:4,[1,1,4]); +%! assert (a, [1:4]); + +%!test +%! a(1,:,:,:) = reshape (1:4,[1,1,4]); +%! assert (a, reshape (1:4,[1,1,1,4])); + +%!error (a(1:2,1:2) = 1:4) + +%!shared x +%! x = 1:5; +%!error x(i) +%!error x(j) +%!error x(1+i) diff -r b8157404614f -r 1af8d21608b7 test/io.tst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/io.tst Sat Feb 09 21:35:55 2013 -0500 @@ -0,0 +1,616 @@ +## Copyright (C) 2006-2012 John W. Eaton +## +## This file is part of Octave. +## +## Octave is free software; you can redistribute it and/or modify it +## under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 3 of the License, or (at +## your option) any later version. +## +## Octave is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with Octave; see the file COPYING. If not, see +## . + +## 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. + +%% test/octave.test/io/load-save.m +%!function [ret, files] = testls (input) +%! ## flag a1 global so as to test the storage of global flags +%! global a1; +%! +%! ## Input or output, so as to be able to exchange between versions +%! if (nargin < 1) +%! input = 0; +%! endif +%! +%! ## Setup some variable to be saved or compared to loaded variables +%! +%! ## scalar +%! a1 = 1; +%! ## matrix +%! persistent a2 = hilb(3); +%! ## complex scalar +%! persistent a3 = 1 + 1i; +%! ## complex matrix +%! persistent a4 = hilb(3) + 1i*hilb(3); +%! ## bool +%! persistent a5 = (1 == 1); +%! ## bool matrix +%! persistent a6 = ([ones(1,5), zeros(1,5)] == ones (1,10)); +%! ## range +%! persistent a7 = 1:10; +%! ## structure +%! persistent a8 = struct ("a", a1, "b", a3); +%! ## cell array +%! persistent a9 = {a1, a3}; +%! ## string +%! persistent a10 = ["test"; "strings"]; +%! ## int8 array +%! persistent a11 = int8 (floor (256*rand (2,2))); +%! ## int16 array +%! persistent a12 = int16 (floor (65536*rand (2,2))); +%! ## int32 array +%! persistent a13 = int32 (floor (1e6*rand (2,2))); +%! ## int64 array +%! persistent a14 = int64 (floor (10*rand (2,2))); +%! ## uint8 array +%! persistent a15 = uint8 (floor (256*rand (2,2))); +%! ## uint16 array +%! persistent a16 = uint16 (floor (65536*rand (2,2))); +%! ## int32 array +%! persistent a17 = uint32 (floor (1e6*rand (2,2))); +%! ## uint64 array +%! persistent a18 = uint64 (floor (10*rand (2,2))); +%! ## sparse +%! persistent a19 = sprandn (100,100,0.01); +%! ## complex sparse +%! persistent a20 = sprandn (100,100,0.01) + 1i * sprandn (100,100,0.01); +%! +%! ret = 0; +%! +%! files = {"text.mat", "binary.mat", "mat5.mat", "mat7.mat"}; +%! opts = {"-z -text", "-z -binary", "-z -mat", "-v7"}; +%! tols = {2*eps, 0, 0, 0}; +%! +%! vars = "a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 a18 a19 a20"; +%! if (! input) +%! for i = 1:length (files) +%! eval (sprintf ("save %s %s %s", opts{i}, files{i}, vars)); +%! endfor +%! else +%! b1 = a1; b2 = a2; b3 = a3; b4 = a4; b5 = a5; +%! b6 = a6; b7 = a7; b8 = a8; b9 = a9; +%! b10 = a10; b11 = a11; b12 = a12; b13 = a13; b14 = a14; b15 = a15; +%! b16 = a16; b17 = a17; b18 = a18; b19 = a19; b20 = a20; +%! +%! for i = length (files) +%! +%! clear a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 a19 a20; +%! +%! file = files{i}; +%! tol = tols{i}; +%! +%! load (file); +%! +%! assert (a1, b1, tol); +%! assert (a2, b2, tol); +%! assert (a3, b3, tol); +%! assert (a4, b4, tol); +%! +%! if (! isequal (a5, b5)) +%! error ("failed: %s boolean", file); +%! endif +%! +%! if (! strcmp (file, "mat5") && ! strcmp (file, "mat7")) +%! if (! isequal (a6, b6)) +%! error ("failed: %s boolean matrix", file); +%! endif +%! endif +%! +%! assert ([a7], [b7], tol); +%! +%! 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 +%! +%! if (! isequal (a11, b11)) +%! error ("failed: %s int8", file); +%! endif +%! +%! if (! isequal (a12, b12)) +%! error ("failed: %s int16", file); +%! endif +%! +%! if (! isequal (a13, b13)) +%! error ("failed: %s int32", file); +%! endif +%! +%! if (! isequal (a14, b14)) +%! error ("failed: %s int64", file); +%! endif +%! +%! if (! isequal (a15, b15)) +%! error ("failed: %s uint8", file); +%! endif +%! +%! if (! isequal (a16, b16)) +%! error ("failed: %s uint16", file); +%! endif +%! +%! if (! isequal (a17, b17)) +%! error ("failed: %s uint32", file); +%! endif +%! +%! if (! isequal (a18, b18)) +%! error ("failed: %s uint64", file); +%! endif +%! +%! assert (a19, b19, tol); +%! assert (a20, b20, tol); +%! +%! ## Test for global flags +%! if (! isglobal ("a1") || isglobal ("a2") || isglobal ("a3") +%! || isglobal ("a4") || isglobal ("a5") || isglobal ("a6") +%! || isglobal ("a7") || isglobal ("a8") || isglobal ("a9") +%! || isglobal ("a10") || isglobal ("a11") || isglobal ("a12") +%! || isglobal ("a13") || isglobal ("a14") || isglobal ("a15") +%! || isglobal ("a16") || isglobal ("a17") || isglobal ("a18") +%! || isglobal ("a19") || isglobal ("a20")) +%! error ("failed: %s global test", file); +%! endif +%! endfor +%! endif +%! +%! ret = 1; +%!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"); +%! +%! assert (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 -binary struct.dat -struct STR matrix_fld str*_fld; +%! STR = load ("struct.dat"); +%! +%! assert (!isfield(STR,"scalar_fld") && ... +%! STR.matrix_fld == [1.1,2;3,4] && ... +%! STR.string_fld == "Octave" && ... +%! STR.struct_fld.x == 0 && ... +%! STR.struct_fld.y == 1); +%! +%! delete struct.dat; + +%!test +%! matrix1 = rand (100, 2); +%! save -ascii matrix.ascii matrix1 +%! matrix2 = load ("matrix.ascii"); +%! assert (matrix1, matrix2, 1e-9) +%! +%! delete matrix.ascii; + +%!error load ("") + +%% FIXME: This test is disabled as it writes to stdout and there is no easy +%% way to recover output. Need to spawn new octave process and pipe stdout +%% somewhere to treat this case. +%% test/octave.test/io/puts-1.m +%!#test +%! puts ("foo\n"); + +%% test/octave.test/io/puts-2.m +%!assert (puts (1),-1) + +%% test/octave.test/io/puts-3.m +%!error puts () + +%% test/octave.test/io/puts-4.m +%!error puts (1, 2) + +%!assert (sscanf ('123456', '%10c'), '123456') +%!assert (sscanf ('123456', '%10s'), '123456') + +%!assert (sscanf (['ab'; 'cd'], '%s'), 'acbd') + +%!assert (sscanf ('02:08:30', '%i:%i:%i'), [2; 0]); +%!assert (sscanf ('02:08:30', '%d:%d:%d'), [2; 8; 30]); + +%!assert (sscanf ('0177 08', '%i'), [127; 0; 8]); +%!assert (sscanf ('0177 08', '%d'), [177; 8]); + +%!test +%! [val, count, msg, pos] = sscanf ("3I2", "%f"); +%! assert (val, 3); +%! assert (count, 1); +%! assert (msg, ""); +%! assert (pos, 2); + +%!test +%! [val, count, msg, pos] = sscanf ("3In2", "%f"); +%! assert (val, 3); +%! assert (count, 1); +%! assert (msg, ""); +%! assert (pos, 2); + +%!test +%! [val, count, msg, pos] = sscanf ("3Inf2", "%f"); +%! assert (val, [3; Inf; 2]); +%! assert (count, 3); +%! assert (msg, ""); +%! assert (pos, 6); + +%% test/octave.test/io/sscanf-1.m +%!test +%! [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))); + +%% test/octave.test/io/sscanf-2.m +%!error sscanf () + +%% test/octave.test/io/sscanf-3.m +%!error sscanf (1, 2) + +%% test/octave.test/io/sscanf-4.m +%!error sscanf ("foo", "bar", "C", 1) + +%% test/octave.test/io/sscanf-5.m +%!test +%! [x, n] = sscanf (" 0.024000 0.200 0.200 2.000 1987 5 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 2 0 0 1 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 4 5 1 2 2 5 5 8 2 8 12 6 15 18 28 26 47 88 118 162 192 130 88 56 27 23 14 9 6 3 4 1 0 2 3 1 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0.026000 0.250 0.250 2.100 3115 3 0 0 0 0 0 0 0 0 0 0 0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5 11 5 5 3 3 7 3 6 4 4 2 4 4 4 1 5 5 9 6 6 9 3 10 8 6 8 3 10 8 16 16 13 18 23 29 25 19 19 20 27 19 22 27 24 21 15 18 11 20 21 17 12 5 18 6 12 7 9 11 7 12 11 4 8 8 4 8 7 7 2 6 4 4 9 6 9 3 4 7 7 7 4 10 4 11 5 8 8 8 5 4 4 8 6 4 9 8 12 12 8 5 8 3 10 8 7 5 3 5 6 8 5 6 10 7 2 11 2 5 5 6 8 10 2 7 5 5 14 2 7 3 9 3 5 2 8 2 3 4 4 7 9 5 4 7 6 7 5 6 3 5 4 7 6 7 7 9 3 0 2 1 1 1 0 0 0.142000 3.150 3.150 7.900 1429499 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 3 1 2 1 1 0 0 0 3 0 2 2 1 0 3 0 2 1 3 0 0 1 1 3 1 2 4 1 5 3 5 1 0 7 1 3 2 3 2 2 2 3 0 0 1 3 6 3 2 2 4 4 4 6 4 3 6 4 10 3 7 2 5 4 7 4 5 8 4 7 4 1 7 11 5 2 10 2 11 3 7 8 10 9 6 3 5 3 6 3 10 11 5 5 9 7 10 8 9 5 15 11 9 18 18 15 24 17 23 17 19 25 17 24 18 37 16 17 21 17 14 20 17 15 15 9 4 11 7 3 8 10 8 8 6 8 3 4 5 8 4 6 3 9 9 6 2 10 4 4 3 8 4 9 1 7 5 9 7 10 9 10 4 6 5 8 6 6 10 10 6 5 7 6 6 10 5 7 8 8 8 7 7 11 12 8 3 10 6 9 13 11 4 6 7 6 3 10 5 8 4 7 7 7 5 8 4 9 5 5 7 6 6 7 11 11 7 8 5 3 5 7 7 10 3 3 6 5 7 9 2 3 7 1 0 0 0 0 1 0.144000 3.200 3.200 8.000 1493946 3 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 2 3 0 0 1 2 1 1 1 4 1 0 1 0 1 2 1 3 1 1 1 1 2 1 1 3 2 6 0 4 0 1 4 2 4 5 2 1 3 0 2 2 4 2 3 2 4 3 5 4 4 4 1 5 1 3 4 5 6 4 7 2 8 8 8 5 3 6 0 7 3 2 2 5 7 5 7 5 8 9 6 4 3 6 8 6 10 2 5 6 3 3 6 6 6 6 17 5 10 6 6 11 11 13 12 21 26 18 24 21 24 23 30 18 22 20 24 19 13 17 25 22 17 15 8 13 7 10 8 9 6 7 9 8 7 8 9 7 7 6 12 5 9 9 12 9 12 6 9 7 10 7 7 4 9 7 4 2 7 4 5 8 8 9 7 6 7 5 9 4 8 13 6 5 4 7 9 6 7 7 9 4 4 5 8 10 9 10 6 6 7 9 12 11 8 8 9 11 5 8 7 5 5 8 5 9 10 5 5 11 11 6 8 8 4 8 5 5 5 4 7 4 5 6 5 6 6 7 7 4 2 6 3 2 1 0 0 0 0 0 0.146000 3.250 3.250 8.100 1562352 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 2 0 2 0 1 2 1 1 0 0 1 0 1 2 0 0 0 3 1 2 0 4 4 2 0 0 2 3 2 0 1 3 3 4 0 1 4 3 3 4 5 5 4 2 1 4 2 5 3 2 7 6 3 5 6 5 5 5 1 5 2 7 4 8 7 4 6 5 7 5 3 5 8 1 6 4 6 8 7 6 7 6 3 4 6 3 5 8 4 10 3 3 11 6 5 3 9 6 4 3 17 9 11 11 24 13 15 14 25 26 26 21 17 32 32 22 18 25 29 29 27 24 21 12 23 14 12 11 9 17 7 9 11 3 7 6 5 5 12 3 6 8 7 4 7 11 10 8 9 5 8 2 10 9 8 10 10 7 7 4 7 5 7 7 9 10 8 7 7 16 6 8 10 5 6 6 12 12 7 11 11 8 9 7 8 12 10 7 8 7 11 8 9 7 7 4 9 4 7 14 9 8 8 13 9 8 7 13 5 9 5 7 4 9 5 7 8 7 8 7 3 10 9 3 4 4 4 5 2 6 6 3 5 10 4 4 2 3 0 1 0 0 0.148000 3.300 3.300 8.200 1630559 3 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 4 2 1 1 1 2 1 2 0 2 1 5 0 1 1 4 0 2 1 4 5 3 0 1 1 1 2 1 3 3 3 1 1 1 1 1 3 4 6 6 8 8 4 3 2 7 2 2 1 7 4 4 5 1 10 6 4 4 4 3 3 3 6 11 6 4 5 4 8 5 5 9 4 5 5 7 6 4 13 12 3 6 7 5 2 7 9 7 8 8 4 7 6 4 10 6 8 9 9 9 13 15 17 23 25 13 16 24 22 26 21 27 24 24 21 21 21 15 17 22 25 21 22 17 14 11 8 12 5 9 7 8 5 11 10 6 6 5 9 13 10 9 8 8 8 6 4 9 10 9 9 7 8 7 5 7 8 14 13 5 14 5 12 11 8 9 6 5 4 9 13 7 10 13 11 11 8 5 9 10 8 7 6 7 13 3 13 8 7 13 17 5 8 5 10 7 12 7 6 6 9 7 8 8 11 8 11 9 11 11 8 5 6 10 4 9 3 10 8 7 10 8 7 8 10 10 7 4 11 5 7 8 2 4 3 0 0 1 0 1 0.150000 3.350 3.350 8.300 1707576 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 2 1 2 1 0 2 0 2 3 1 3 2 2 2 2 0 2 1 4 3 2 2 3 1 2 1 0 2 2 4 2 5 3 3 5 2 8 4 5 4 2 3 6 7 6 1 0 7 4 7 7 6 5 4 3 4 6 6 7 6 2 7 4 4 2 5 5 6 9 3 3 3 6 6 5 3 5 7 8 8 6 8 8 6 8 3 9 6 6 8 8 6 4 8 6 6 10 4 11 6 11 15 23 16 8 17 20 21 19 24 15 14 19 21 30 25 21 15 19 16 18 21 21 15 14 12 16 8 10 12 7 10 9 8 10 10 7 9 8 10 12 6 6 9 11 6 5 9 12 6 7 12 7 5 6 8 5 9 4 11 9 8 8 10 7 6 10 7 11 13 7 4 13 11 8 11 9 16 6 12 11 10 10 19 2 9 11 8 7 8 8 6 13 6 10 12 12 9 12 9 9 8 7 7 9 6 12 8 4 9 9 8 5 7 8 9 5 12 5 7 5 9 10 9 10 3 6 6 8 7 11 3 5 5 4 2 0 0 0 0 0.152000 3.400 3.400 8.400 1777231 3 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 1 1 0 0 1 1 3 1 0 3 4 2 3 3 3 3 3 2 1 1 1 1 3 3 0 1 8 0 0 5 3 7 4 4 4 4 4 3 5 2 2 5 3 6 1 7 6 1 2 2 5 2 1 6 6 8 7 7 5 10 4 1 6 9 3 4 5 3 5 8 4 9 8 11 8 3 2 7 7 9 10 9 10 8 6 8 6 8 7 10 8 7 3 8 4 10 7 6 8 9 6 5 16 9 19 24 23 17 23 24 22 30 21 15 23 27 20 20 20 18 20 23 18 17 15 19 17 18 13 9 4 4 7 12 7 10 4 8 6 10 5 6 13 2 3 8 7 8 7 3 11 8 7 9 7 19 7 8 9 6 14 8 8 11 10 11 13 14 10 16 8 9 13 8 9 9 12 7 12 11 6 9 15 5 9 9 9 11 11 13 6 10 6 4 12 9 9 12 11 8 6 9 16 10 10 10 8 10 10 6 7 4 1 15 6 8 4 9 13 11 8 10 11 9 8 3 3 6 6 7 9 4 6 8 7 4 2 1 2 2 1 0 0.154000 3.450 3.450 8.500 1849489 6 0 0 0 0 0 0 0 0 0 0 0 1 1 3 0 1 2 2 0 1 4 1 1 0 1 0 2 1 0 0 1 1 1 1 6 3 6 1 3 1 3 3 0 6 0 4 2 7 4 6 4 4 3 7 4 5 7 5 5 2 3 9 9 2 5 5 3 9 4 2 7 6 2 8 2 5 7 12 6 5 4 5 10 4 12 10 6 4 14 7 9 10 11 7 7 7 7 3 9 7 4 3 8 7 5 7 9 6 8 9 6 8 8 12 6 5 11 12 13 11 13 21 26 19 23 25 18 23 22 23 23 18 27 20 15 20 25 24 19 18 12 14 13 15 8 15 10 11 7 9 13 11 12 13 11 11 7 11 13 6 5 10 6 6 10 8 14 5 14 11 8 5 9 7 10 10 8 7 15 13 3 13 12 18 15 7 10 9 10 8 15 9 6 8 9 10 10 9 5 7 7 5 10 11 13 12 12 12 10 6 17 10 11 9 4 8 7 6 6 9 12 8 16 18 7 5 10 8 12 10 15 6 13 11 6 10 16 10 11 16 8 9 5 11 10 14 11 5 2 5 7 3 1 1 0 1 0 0.156000 3.500 3.500 8.600 1920727 4 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 1 0 2 1 2 0 3 0 1 1 0 1 0 3 0 4 4 1 3 1 2 3 3 4 3 1 2 3 9 5 2 3 7 3 3 6 5 2 6 1 4 3 2 3 6 5 1 8 3 8 5 3 7 6 13 11 9 5 8 7 7 5 8 7 4 8 6 4 10 4 6 5 6 9 9 12 6 7 10 9 9 8 8 3 8 9 8 8 2 12 11 13 8 13 7 8 6 6 9 6 8 16 13 14 16 16 22 20 21 21 17 20 18 19 22 20 11 20 22 21 14 19 15 23 17 15 12 14 19 16 10 11 14 11 9 11 9 12 8 16 14 9 6 18 10 11 7 10 11 17 10 13 8 10 12 9 12 7 7 10 10 11 11 9 8 8 14 10 10 9 14 9 14 13 9 19 16 17 4 11 8 12 11 10 21 6 10 8 9 12 9 7 7 12 7 16 14 10 13 6 13 8 9 10 6 10 8 7 10 4 6 11 19 12 6 7 5 8 11 10 12 13 9 6 10 5 11 11 4 14 10 7 2 6 5 1 2 5 1 1 0 0 0.158000 3.550 3.550 8.700 1999833 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 2 2 3 2 2 2 1 2 3 0 1 0 1 3 2 0 0 3 2 3 2 5 7 0 3 4 1 10 7 7 4 5 2 3 4 3 8 3 6 4 4 4 8 2 3 4 5 5 7 1 6 7 8 1 6 8 1 4 4 11 9 4 7 11 9 10 5 6 8 4 3 9 7 9 11 5 5 8 8 4 8 7 8 11 9 12 6 4 13 4 12 10 6 9 11 10 11 10 11 11 11 14 15 14 23 18 17 29 16 26 23 15 19 14 18 19 22 31 13 21 20 12 16 15 14 18 17 15 8 12 14 13 10 10 10 10 10 13 11 6 8 11 8 14 8 10 11 11 8 10 13 5 14 7 12 9 10 10 12 15 18 8 6 9 9 12 8 9 20 14 16 10 11 14 5 5 13 6 11 9 11 15 6 9 13 11 7 8 7 10 8 16 12 11 8 10 14 11 17 11 8 16 13 9 10 5 10 17 13 14 16 8 10 9 11 5 10 9 10 12 8 11 12 11 8 6 7 12 15 13 12 7 13 5 0 3 2 0 0 0 0 0.160000 3.600 3.600 8.800 2073149 3 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 2 1 2 1 2 2 1 0 2 2 1 0 3 6 4 5 5 2 2 2 5 5 3 6 4 6 4 5 2 4 4 3 2 4 6 3 3 6 5 7 4 5 7 5 3 5 6 13 5 3 10 5 9 7 4 5 6 5 10 6 5 5 6 6 4 14 7 6 11 6 9 10 9 8 5 3 8 10 10 6 6 8 9 5 6 14 7 11 10 9 9 11 13 8 4 5 10 12 6 16 8 8 7 19 20 23 10 16 27 25 23 19 26 21 16 20 21 24 18 25 8 11 13 16 18 13 22 18 9 16 4 16 10 12 13 9 7 9 8 17 11 10 13 10 14 4 9 12 16 8 9 16 17 13 11 14 8 8 13 9 11 15 10 11 14 8 6 4 9 11 18 9 9 8 9 15 11 11 11 9 6 13 13 10 7 8 10 15 14 9 7 4 10 12 17 10 14 13 10 10 12 20 9 7 6 11 15 11 10 8 9 6 10 13 17 6 8 9 6 13 13 16 10 15 5 11 14 11 12 6 5 12 9 4 9 2 4 1 1 0 0 0 0.162000 3.650 3.650 8.900 2156456 5 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 2 0 1 1 3 2 3 4 3 3 2 1 3 6 5 2 3 4 4 3 6 2 3 4 4 5 5 3 4 1 4 5 9 3 3 4 3 3 8 5 6 12 2 10 3 4 6 8 9 8 8 2 2 7 5 8 2 8 9 7 2 6 8 6 5 8 2 7 5 6 13 5 6 8 11 6 10 5 6 3 8 10 11 10 10 14 10 11 8 11 8 12 6 12 5 15 12 13 10 13 13 18 23 12 21 18 21 23 20 30 20 23 26 24 24 21 21 29 19 21 16 23 20 13 19 13 16 11 15 13 13 11 8 11 14 14 13 4 16 15 18 13 9 19 8 11 6 9 14 8 13 12 13 10 13 10 14 11 13 11 8 10 13 11 11 14 11 8 14 11 10 9 14 12 14 18 8 12 7 13 12 10 14 14 8 12 17 11 13 9 12 12 15 7 9 13 17 11 11 11 12 17 12 11 16 15 8 9 12 7 13 15 11 16 7 10 7 14 5 18 10 10 8 8 6 6 13 14 6 9 11 9 9 3 5 1 1 3 0 0 0.164000 3.700 3.700 9.000 2234753 3 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 4 1 4 2 1 3 1 1 3 2 3 3 1 3 6 2 4 4 3 3 3 6 5 2 6 4 1 3 3 7 1 4 4 6 12 4 5 2 6 4 9 3 1 8 11 5 2 7 6 3 8 4 7 3 8 3 9 6 7 8 9 2 7 6 9 6 15 6 9 5 9 4 9 17 15 10 2 10 6 8 12 12 11 12 10 9 7 11 8 7 5 11 10 14 16 7 7 7 13 15 10 16 17 21 19 14 18 24 19 27 27 24 20 22 24 21 20 14 24 17 17 18 32 15 12 13 15 12 8 14 11 11 19 11 14 15 18 10 5 12 11 11 9 15 9 7 9 16 12 9 12 10 15 9 18 7 11 12 14 7 20 8 10 13 14 11 6 6 9 11 8 10 16 8 17 13 17 9 16 11 10 9 13 20 17 14 12 10 13 11 9 9 17 20 10 16 8 14 13 14 18 15 15 8 10 12 11 22 12 13 9 12 9 11 14 19 12 12 8 8 12 11 19 11 11 12 15 11 15 13 9 9 10 9 4 9 4 2 1 0 0 0.166000 3.750 3.750 9.100 2327990 3 0 0 0 0 0 0 0 0 0 0 0 0 0 3 2 2 0 1 2 2 1 1 0 0 3 1 4 2 6 4 2 4 3 2 5 5 2 3 1 3 1 2 10 2 7 4 3 4 3 3 4 3 10 6 9 6 3 8 5 5 3 4 4 6 8 4 4 7 5 5 11 14 5 3 6 8 8 7 10 11 7 17 7 11 10 8 7 8 12 13 11 12 6 13 9 7 7 6 5 8 13 10 10 14 11 11 8 12 15 14 9 13 10 9 18 13 18 12 23 14 17 24 15 23 25 31 19 17 29 19 19 19 26 25 19 17 22 19 19 19 11 11 12 22 21 8 10 18 10 14 19 17 13 14 10 6 9 10 15 11 5 13 13 11 11 17 16 9 7 14 7 19 6 10 13 7 12 18 14 7 12 15 13 13 9 13 13 13 12 12 14 12 19 10 16 18 18 12 8 10 10 9 7 14 9 11 13 12 8 15 12 11 10 12 11 17 15 19 14 14 12 7 7 12 11 15 16 12 11 12 10 19 19 12 14 12 15 11 20 13 7 18 9 15 19 16 11 5 9 8 6 2 4 0 2 0 1 0.168000 3.800 3.800 9.200 2406866 3 0 0 0 0 0 0 0 0 0 0 1 0 2 0 1 0 2 3 2 3 1 2 1 2 2 5 2 1 2 3 2 2 2 5 3 5 3 3 1 3 6 8 6 1 3 9 6 3 6 10 5 5 7 4 5 7 12 9 5 7 5 6 6 8 3 5 4 7 8 5 6 5 8 13 4 10 2 10 9 7 7 16 9 10 9 13 8 12 9 13 15 9 15 9 10 11 6 6 6 7 7 6 8 15 9 8 9 6 12 12 11 14 12 11 13 8 17 18 18 11 14 19 14 25 21 15 10 15 19 27 23 22 24 17 19 18 12 16 22 21 25 9 25 15 19 15 21 15 8 11 13 12 10 12 7 13 11 17 11 13 10 16 19 14 23 11 8 12 13 10 9 17 4 14 10 7 10 17 14 11 11 20 18 13 8 12 6 8 13 12 23 15 14 15 16 9 14 9 13 14 17 11 17 11 10 15 17 11 6 12 12 14 15 17 12 16 16 8 17 15 15 10 15 11 10 15 12 13 9 12 9 12 15 12 6 18 7 15 14 12 21 18 11 10 18 11 19 11 7 11 3 2 5 4 0 1 1 0.170000 3.850 3.850 9.300 2508471 7 0 0 0 0 0 0 0 0 0 0 0 0 0 1 3 1 2 1 4 3 3 1 2 7 0 3 2 2 2 2 5 2 3 2 3 3 4 3 7 3 5 3 4 4 6 2 3 10 4 11 3 13 7 7 5 6 3 8 10 6 6 4 10 11 4 12 7 8 9 7 7 8 4 6 7 9 9 5 9 11 5 14 9 10 7 9 8 8 5 6 11 13 14 10 10 10 10 8 9 9 9 9 14 14 13 11 8 18 9 10 9 16 12 13 15 13 10 17 16 20 14 22 20 26 29 29 27 24 20 37 21 24 13 18 13 28 24 22 25 21 13 14 15 9 11 18 8 16 17 16 13 12 16 11 11 17 15 11 15 10 11 12 13 12 12 20 15 14 15 16 12 17 15 15 12 10 14 14 17 15 19 15 13 13 11 12 16 14 17 16 8 16 12 8 14 13 13 10 10 9 12 11 19 20 13 11 4 15 11 14 11 20 18 18 13 20 12 20 21 15 15 12 13 18 18 11 16 9 14 9 18 11 10 11 20 11 13 17 13 13 12 14 16 10 12 12 23 12 11 12 8 8 1 0 1 2 0 0.172000 3.900 3.900 9.400 2591210 3 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 4 4 3 2 1 3 3 2 3 0 3 6 1 3 1 5 5 4 3 9 9 0 4 7 5 3 5 5 8 7 3 3 5 5 8 5 11 10 8 10 3 6 6 6 7 7 8 8 12 9 6 10 8 7 10 8 8 10 4 6 12 20 4 6 11 7 9 10 7 5 10 6 12 11 7 13 13 16 12 6 8 14 13 9 7 5 14 17 17 10 12 11 6 13 11 17 3 23 13 21 12 21 28 11 23 30 28 23 24 26 26 17 21 15 27 23 33 16 22 25 11 20 22 23 21 20 7 21 13 16 12 16 16 13 18 18 9 13 16 15 9 20 13 19 15 8 9 11 14 13 10 9 10 16 15 14 17 15 19 16 12 14 12 14 14 16 19 19 4 24 8 12 15 16 11 15 14 20 14 13 13 14 16 19 14 13 19 14 18 23 15 15 4 14 17 14 8 10 15 20 11 15 19 12 9 13 12 11 16 12 16 13 14 16 13 16 16 19 19 12 11 10 19 15 15 14 12 5 11 18 17 10 13 12 9 6 2 0 0 1 0 0.174000 3.950 3.950 9.500 2675515 3 0 0 0 0 0 0 0 0 0 0 0 2 0 1 1 0 2 1 2 3 3 1 3 1 3 7 5 3 6 4 3 9 4 5 2 5 3 3 3 6 9 5 5 2 6 8 5 8 4 8 5 6 5 6 4 6 3 7 11 6 9 9 3 6 6 7 6 8 7 9 12 18 6 9 8 11 11 8 14 15 15 11 15 13 9 19 10 15 14 9 4 18 5 8 10 8 10 13 9 12 11 8 8 12 6 15 8 9 9 18 7 17 21 9 13 18 14 21 24 18 22 17 26 15 21 23 25 19 26 23 20 27 17 27 20 26 15 22 15 19 15 16 24 12 15 24 13 13 17 11 7 10 21 15 15 16 13 20 22 12 16 12 16 15 14 18 11 12 14 14 24 10 13 16 19 8 11 18 19 15 15 23 16 16 11 12 18 11 13 14 16 10 14 13 18 12 15 15 14 8 11 17 12 22 13 12 14 15 10 11 15 19 15 12 17 8 21 23 13 19 11 8 12 15 11 14 15 19 15 10 17 9 16 14 18 14 16 14 14 23 14 14 13 16 12 14 15 14 9 14 7 5 2 3 1 1 1 0.176000 4.000 4.000 9.600 2779386 5 0 0 0 0 0 0 0 0 0 0 0 0 2 2 3 0 1 3 0 6 2 6 3 1 5 0 4 1 6 5 1 6 3 6 5 6 2 5 4 5 3 9 8 5 7 5 8 4 12 8 12 6 8 5 7 5 7 10 5 5 6 7 9 7 10 7 10 10 8 12 10 6 13 10 11 12 11 10 10 16 9 6 12 9 11 17 10 11 10 14 11 16 7 11 13 12 10 17 14 11 13 12 10 13 16 16 17 17 15 14 11 8 15 13 27 22 14 19 17 22 22 27 18 28 19 27 32 24 33 21 17 23 12 27 25 20 20 17 22 14 15 22 21 14 9 16 12 19 16 17 16 16 20 14 18 15 14 18 10 12 9 16 12 12 10 13 19 12 12 15 14 15 22 12 11 15 18 19 18 10 6 11 14 10 23 17 14 16 19 10 10 16 19 17 23 16 18 19 18 16 12 14 14 14 13 11 10 24 21 22 26 18 18 18 14 17 5 13 17 11 13 16 14 18 16 9 15 15 18 16 14 21 13 22 17 9 8 16 17 16 16 19 7 20 19 18 16 10 6 10 6 3 5 1 0 0 2 0.178000 4.050 4.050 9.700 2869617 3 0 0 0 0 0 0 0 0 0 0 0 2 2 2 0 1 4 1 3 2 2 1 2 3 2 2 4 4 7 5 6 5 3 6 6 5 7 8 1 5 2 3 5 5 8 10 7 6 10 9 6 8 9 7 8 10 15 4 10 5 8 8 6 11 8 8 11 7 5 8 14 5 11 7 13 10 9 7 8 9 14 12 10 9 11 6 14 15 14 13 11 9 18 18 10 14 14 10 12 16 12 9 8 14 15 6 11 11 12 10 14 12 11 18 13 13 27 16 23 23 20 21 32 20 18 25 22 24 32 25 34 19 23 21 25 22 25 19 23 19 21 16 19 16 18 9 18 6 13 12 13 18 12 8 19 14 14 11 16 13 15 14 21 11 14 14 13 11 20 14 14 26 10 22 16 18 15 20 24 18 19 19 16 14 14 14 21 13 19 18 20 13 17 11 17 14 22 17 15 15 20 8 21 15 16 16 23 17 13 19 21 20 12 15 18 15 19 15 18 17 20 15 13 14 24 18 15 15 14 18 20 19 17 19 20 21 21 15 19 19 17 11 16 16 11 23 10 20 13 10 5 10 2 3 1 1 0 0.180000 4.100 4.100 9.800 2975040 3 0 0 0 0 0 0 0 0 0 1 0 0 1 2 2 4 4 2 4 4 1 2 5 0 3 3 5 2 5 5 4 9 2 7 8 4 8 3 11 6 10 4 7 8 6 6 5 8 8 7 11 4 4 11 12 7 11 7 10 11 7 11 11 10 9 7 13 12 18 8 14 12 14 12 8 8 16 10 10 14 16 10 6 8 15 15 15 22 13 19 18 12 6 11 10 7 12 12 24 15 17 9 17 21 10 17 18 14 14 14 9 22 11 23 17 15 23 32 20 11 12 20 15 23 30 20 25 19 26 29 19 27 23 15 19 11 30 16 21 24 18 18 14 8 6 25 13 21 13 13 19 13 21 25 23 18 14 14 13 20 12 14 8 10 25 14 15 20 15 10 15 16 21 8 15 20 21 20 13 16 15 20 11 18 17 17 9 12 24 19 13 18 17 20 14 15 20 10 23 19 25 8 7 13 14 11 15 18 13 10 12 10 17 11 24 16 17 11 12 13 16 20 14 26 12 17 13 14 16 16 6 20 16 23 22 11 17 16 14 25 19 17 21 22 19 13 19 16 18 10 11 7 4 6 0 0 2 0.182000 4.150 4.150 9.900 3083416 6 0 0 0 0 0 0 0 0 0 0 0 2 1 1 4 1 3 4 3 5 6 2 1 4 2 3 5 6 6 7 2 4 1 11 7 5 2 6 6 8 9 8 12 7 11 9 6 12 7 8 9 6 6 8 11 6 6 8 11 8 11 12 11 13 9 10 7 9 6 11 9 13 12 12 8 14 15 8 9 8 8 11 22 16 6 11 16 15 9 13 12 12 13 11 15 9 9 16 14 14 12 21 12 12 12 16 19 10 15 18 8 16 14 16 16 21 30 22 9 25 19 19 26 23 33 25 22 21 19 21 20 20 21 20 26 20 29 27 25 25 21 20 25 21 21 18 14 19 15 6 20 18 16 20 16 13 13 15 15 15 15 22 16 15 15 11 21 19 11 19 13 14 15 17 21 12 18 12 22 18 21 18 13 23 15 18 9 21 11 14 23 18 21 25 18 22 15 21 23 15 15 16 19 21 18 19 21 17 13 24 23 22 19 14 20 22 15 14 14 20 20 23 13 18 15 18 20 20 24 9 12 17 21 21 12 16 17 16 16 21 26 19 15 21 22 24 15 11 13 13 6 8 1 4 0 1 0 0.184000 4.200 4.200 10.00 3174897 3 0 0 0 0 0 0 0 0 0 0 0 1 1 2 3 0 5 4 3 3 0 7 3 2 4 2 8 6 4 5 9 3 8 6 4 2 7 6 8 7 9 3 5 8 5 9 7 7 6 11 14 7 12 9 9 5 15 12 14 15 12 9 11 5 8 13 11 12 10 9 17 12 11 8 17 11 19 11 15 9 11 7 15 14 16 16 16 7 12 10 14 13 13 16 16 11 15 13 14 12 16 11 12 13 17 10 13 19 11 17 11 13 14 13 10 19 19 23 24 22 24 24 31 19 23 22 28 21 25 29 17 23 17 21 30 22 19 25 27 27 22 23 23 17 25 17 20 17 12 23 21 9 17 20 16 19 16 17 20 9 16 11 22 16 15 12 15 17 23 24 16 16 18 26 11 16 20 18 10 14 17 26 19 17 15 17 19 12 21 20 24 17 27 13 16 18 19 23 14 19 14 10 11 18 19 6 15 21 23 25 17 17 18 21 27 20 17 18 20 25 22 20 18 22 18 17 15 24 16 15 22 18 22 14 20 20 22 18 22 25 19 26 12 19 19 13 12 16 19 14 9 7 5 4 2 0 2 0.186000 4.250 4.250 10.10 3283256 3 0 0 0 0 0 0 0 0 1 0 0 1 1 4 1 5 2 5 5 3 4 6 3 2 4 7 8 2 6 6 4 10 7 8 7 5 4 4 9 8 18 10 7 6 6 13 12 10 13 10 7 15 4 7 10 13 12 8 8 13 5 14 6 9 14 9 10 16 12 13 11 8 12 11 10 13 9 11 15 17 23 18 13 10 12 11 12 14 14 14 10 12 12 16 13 15 13 13 14 18 10 13 17 14 14 14 12 12 8 18 14 23 20 16 19 16 16 16 27 18 21 19 20 19 37 22 21 22 28 24 26 18 21 28 21 22 21 21 22 16 15 13 22 22 27 22 11 13 20 10 17 16 19 20 30 18 25 8 7 22 18 17 14 23 16 17 11 16 24 19 18 22 15 15 23 16 13 15 22 14 8 12 18 13 15 22 17 15 15 17 27 21 19 21 24 17 10 12 14 19 17 22 18 19 17 28 19 15 14 16 28 17 20 15 11 22 18 19 16 21 17 24 19 22 22 20 10 20 18 18 18 21 18 23 18 32 26 21 21 22 20 22 16 17 20 22 21 17 13 13 11 9 5 0 1 1 1 0.188000 4.300 4.300 10.20 3396610 5 0 0 0 0 0 0 0 0 0 0 0 1 2 3 0 2 5 5 4 3 3 5 1 2 3 6 9 3 3 3 8 7 2 9 5 7 5 11 8 9 7 6 9 6 4 5 8 6 10 9 14 10 15 6 7 13 15 10 13 7 15 10 10 11 14 14 6 7 17 13 19 3 13 9 6 13 13 14 10 11 12 16 17 13 10 15 15 19 19 11 11 15 11 13 9 13 20 8 18 14 18 23 23 23 15 19 20 14 11 7 18 16 15 22 28 20 24 22 25 17 20 39 24 26 25 25 33 25 25 25 33 15 29 18 29 18 12 18 23 17 24 28 22 16 20 33 23 18 23 26 23 15 24 16 16 16 16 17 15 15 16 14 11 9 23 17 13 13 18 12 19 20 30 20 20 15 21 19 16 18 20 23 19 15 10 11 15 19 13 22 22 18 19 16 19 23 16 10 25 23 20 21 20 31 19 19 18 15 22 18 14 13 21 18 19 22 19 16 17 21 14 20 26 18 26 22 19 26 19 20 22 15 13 24 23 15 21 21 21 27 18 22 19 24 17 22 16 18 23 10 12 3 5 3 3 0 0 0.190000 4.350 4.350 10.30 3502025 3 0 0 0 0 0 0 0 0 0 0 0 0 3 0 3 2 3 4 4 3 4 5 10 7 6 6 4 5 12 10 6 6 13 10 6 7 14 9 6 13 10 12 16 3 9 9 7 5 6 13 11 10 8 11 19 12 14 13 16 13 14 9 12 14 13 14 16 10 14 7 16 18 16 9 15 11 20 15 10 14 14 11 14 17 10 6 16 10 15 12 17 17 20 15 7 12 23 15 8 13 12 8 16 15 20 16 16 20 14 11 20 24 23 20 16 18 27 25 31 27 27 25 21 31 27 20 23 24 32 17 21 34 27 17 19 19 25 30 27 21 24 28 30 19 26 21 14 16 21 23 27 8 17 21 17 11 23 15 22 15 18 10 17 20 23 18 18 17 19 22 15 22 21 19 23 18 18 26 17 18 26 18 24 15 22 23 23 19 23 25 23 24 26 10 21 16 32 23 18 19 24 21 28 26 22 19 19 14 30 21 24 23 22 21 13 27 20 27 24 15 20 22 22 13 25 14 19 32 21 18 18 23 22 22 14 18 20 24 14 19 20 18 17 24 29 27 20 12 18 17 11 9 2 3 2 1 0 0.192000 4.400 4.400 10.40 3593938 3 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1 2 3 4 7 8 1 5 6 8 3 7 5 4 9 8 8 7 7 9 7 9 9 15 5 7 8 15 14 9 9 13 8 8 15 10 7 10 9 10 14 7 8 18 16 17 11 14 15 13 8 15 8 15 18 16 16 22 12 8 16 13 10 13 13 10 21 11 10 16 16 13 13 17 16 20 23 13 22 16 14 15 22 19 22 15 22 24 16 16 16 19 12 15 16 17 20 18 19 26 17 23 18 32 20 28 36 22 25 30 29 31 36 24 24 21 29 24 32 29 30 23 34 19 33 34 25 20 31 27 24 16 14 21 20 13 24 17 28 13 24 16 26 15 26 21 11 15 20 13 20 18 25 23 18 24 26 22 16 22 14 13 16 20 24 25 19 29 20 15 20 16 25 26 21 22 17 24 22 21 17 23 23 15 19 30 23 17 21 19 18 21 26 14 29 24 20 33 19 15 20 23 28 19 23 25 15 19 17 31 23 18 29 26 25 14 24 25 18 19 19 24 35 31 23 23 14 15 19 11 20 19 24 17 16 9 10 12 3 2 2 0 1 0.194000 4.450 4.450 10.50 3712573 7 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 5 3 5 4 3 11 3 10 4 6 7 8 5 5 5 8 9 12 7 7 11 8 6 7 9 10 13 10 6 13 9 9 9 11 14 14 12 13 10 6 13 13 15 12 13 19 8 14 13 16 11 13 14 15 9 15 16 13 16 17 17 17 23 18 16 19 10 13 18 16 10 9 21 11 22 14 20 14 18 13 15 12 13 14 16 14 15 20 29 17 14 18 8 15 21 15 19 15 22 20 17 15 23 26 16 26 24 23 23 23 23 30 24 29 28 26 35 33 31 22 23 22 20 37 22 27 33 26 27 26 17 16 18 27 22 21 24 18 18 18 17 15 18 14 19 24 22 15 20 21 15 19 25 15 16 26 19 22 29 20 16 13 15 16 32 24 23 13 33 17 22 18 18 23 24 22 21 20 26 21 16 22 18 18 16 15 26 26 17 22 21 13 25 24 13 23 18 18 25 32 20 24 21 17 19 24 24 23 33 19 19 21 32 18 22 23 19 23 32 18 31 22 25 23 23 31 29 21 16 20 20 15 22 14 12 5 10 9 2 1 0 1 0.196000 4.500 4.500 10.60 3829518 3 0 0 0 0 0 0 0 0 0 0 1 2 2 1 6 2 6 5 9 3 5 6 8 6 3 8 10 7 11 9 4 8 9 5 11 10 13 9 16 13 10 9 5 12 9 15 10 13 9 12 18 14 19 9 13 14 12 13 21 17 17 18 16 13 12 16 14 18 10 15 15 16 11 15 22 17 19 17 11 12 26 12 17 19 18 21 20 27 17 18 19 21 14 19 16 12 16 21 20 18 8 17 17 13 13 18 15 19 15 19 20 28 21 29 27 27 34 24 26 31 25 24 16 17 23 23 30 28 18 28 32 28 37 18 26 18 16 33 21 31 21 20 22 19 20 25 18 18 20 11 17 20 22 23 14 14 17 18 20 25 20 19 20 22 19 16 33 25 21 21 24 18 16 22 29 22 16 27 26 28 21 20 22 17 25 23 20 23 18 16 19 26 22 21 22 23 15 20 19 17 23 19 20 15 22 18 22 26 23 23 31 17 29 18 13 15 19 18 24 22 28 22 17 23 24 26 21 23 25 24 29 26 18 41 24 29 22 27 23 28 16 30 24 18 23 19 17 18 21 17 14 8 2 5 2 0 0 0.198000 4.550 4.550 10.70 3950740 3 0 0 0 0 0 0 0 0 0 1 1 1 2 1 3 7 5 6 7 7 7 4 5 6 4 1 8 9 10 9 8 10 8 12 6 10 8 10 8 11 9 10 15 7 11 8 13 11 13 15 15 17 12 10 8 17 12 9 14 12 14 11 14 21 14 15 20 18 16 8 15 22 24 14 10 18 14 15 16 12 10 16 21 16 25 17 20 17 17 20 15 24 15 17 22 25 17 13 22 18 20 19 11 21 22 21 16 21 24 16 22 17 21 17 24 22 24 35 27 24 28 24 32 37 34 25 24 29 37 37 25 28 21 23 24 22 21 20 25 22 32 19 21 22 24 20 21 20 22 18 27 17 14 20 22 22 22 14 19 20 20 21 23 22 14 20 21 23 20 18 23 20 25 31 24 18 22 14 23 22 21 23 27 27 20 21 18 22 23 24 23 21 18 22 17 22 21 35 15 24 24 12 27 30 27 28 22 31 24 24 19 27 24 28 23 25 26 35 27 22 29 21 24 18 19 26 33 29 31 23 25 19 24 26 21 10 23 24 26 28 20 27 26 17 29 22 18 14 22 8 10 11 4 4 1 2 0 0.200000 4.600 4.600 10.80 4068161 5 0 0 0 0 0 0 0 0 0 0 1 1 0 1 5 5 2 9 3 11 6 9 8 7 7 8 3 3 13 10 8 7 5 8 13 8 7 14 12 10 7 15 13 13 11 12 12 14 12 13 12 10 15 11 14 7 16 15 8 15 13 15 13 18 13 17 21 15 12 13 13 17 18 18 18 16 19 20 17 14 17 24 13 12 18 19 19 13 21 18 26 21 23 16 14 18 19 13 33 13 19 20 14 20 23 14 26 19 22 21 21 16 27 30 25 28 22 32 21 30 27 31 21 30 22 27 27 31 27 21 17 38 41 17 21 20 19 30 24 27 20 20 21 30 20 19 19 31 25 24 13 21 23 19 24 33 24 17 20 17 12 25 23 18 24 11 24 25 22 33 20 11 22 31 21 20 26 27 21 26 24 14 23 23 20 20 26 28 10 20 27 24 22 17 27 28 20 23 23 33 20 24 26 32 33 29 21 25 24 17 18 19 27 26 20 24 26 24 24 26 21 19 24 21 36 32 18 33 33 20 23 25 33 19 27 25 27 24 27 21 21 23 28 18 27 25 19 24 15 17 12 15 7 2 1 0 0 ", "%f ", Inf); +%! assert (rows (x) == n); + +%% Note use fprintf so output not sent to stdout +%% test/octave.test/io/printf-1.m +%!test +%! nm = tmpnam (); +%! 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); +%! assert (x, 8); +%! assert (str, "test:1"); + +%% test/octave.test/io/printf-2.m +%!error printf (1) + +%% test/octave.test/io/printf-3.m +%!error printf () + +%% 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 +%!error sprintf (1) + +%% test/octave.test/io/sprintf-3.m +%!error sprintf () + +%% 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 +%! if (j == 1) +%! mode_list = ["w"; "r"; "a"]; +%! elseif (j == 2) +%! mode_list = ["w+"; "r+"; "a+"]; +%! endif +%! nm = tmpnam (); +%! for k = 1:3 +%! mode = deblank (mode_list (k,:)); +%! [id, err] = fopen (nm, mode, arch); +%! if (id < 0) +%! __printf_assert__ ("open failed: %s (%s, %s): %s\n", nm, mode, arch, err); +%! status = 0; +%! break; +%! else +%! fclose (id); +%! endif +%! tmp_mode = cstrcat (mode, "b"); +%! [id, err] = fopen (nm, tmp_mode, arch); +%! if (id < 0) +%! __printf_assert__ ("open failed: %s (%s, %s): %s\n", nm, tmp_mode, arch, err); +%! status = 0; +%! break; +%! else +%! fclose (id); +%! endif +%! tmp_mode = cstrcat (mode, "t"); +%! [id, err] = fopen (nm, tmp_mode, arch); +%! if (id < 0) +%! __printf_assert__ ("open failed: %s (%s, %s): %s\n", nm, tmp_mode, arch, err); +%! status = 0; +%! break; +%! else +%! fclose (id); +%! endif +%! endfor +%! unlink (nm); +%! if (status == 0) +%! break; +%! endif +%! endfor +%! if (status == 0) +%! break; +%! endif +%! endfor +%! +%! assert (status == 1); + +%% test/octave.test/io/fopen-2.m +%!test +%! s.a = 1; +%! fail ("fopen (s)"); + +%% test/octave.test/io/fopen-3.m +%!error fopen ("foo", "x") + +%% test/octave.test/io/fopen-4.m +%! fopen ("foo", "wb", "noodle"); +%! assert (__prog_output_assert__ ("error:")); + +%% test/octave.test/io/fopen-5.m +%!error fopen () + +%% test/octave.test/io/fopen-6.m +%!error fopen ("foo", "wb", "native", 1) + +%% test/octave.test/io/fclose-1.m +%!error fclose (0) + +%% test/octave.test/io/fclose-2.m +%!error fclose (1, 2) + +%% test/octave.test/io/tmpnam-1.m +%!assert (ischar (tmpnam ())) + +%% test/octave.test/io/tmpnam-2.m +%!warning tmpnam (1); + +%% test/octave.test/io/tmpnam-3.m +%!warning tmpnam ("foo", 1); + +%% test/octave.test/io/tmpnam-4.m +%!error tmpnam (1, 2, 3) + +%% test/octave.test/io/binary-io-1.m +%!test +%! type_list = ["char"; "char*1"; "integer*1"; "int8"; +%! "schar"; "signed char"; "uchar"; "unsigned char"; +%! "short"; "ushort"; "unsigned short"; "int"; +%! "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"); +%! if (id > 0) +%! for i = 1:n +%! fwrite (id, i, deblank (type_list(i,:))); +%! 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")); + +%% test/octave.test/io/file-pos-1.m +%!test +%! nm = tmpnam (); +%! id = fopen (nm, "wb"); +%! if (id > 0) +%! fprintf (id, "%d\n", 1:100); +%! fclose (id); +%! id = fopen (nm, "rb"); +%! if (id > 0) +%! for i = 1:101 +%! fgets (id); +%! endfor +%! if (feof (id)) +%! fclose (id); +%! id = fopen (nm, "rb"); +%! pos_one = ftell (id); +%! s_one = fgets (id); +%! for i = 1:48 +%! s = fgets (id); +%! endfor +%! pos_fifty = ftell (id); +%! s_fifty = fgets (id); +%! fseek (id, pos_one, SEEK_SET); +%! s_one_x = fgets (id); +%! fseek (id, pos_fifty, SEEK_SET); +%! s_fifty_x = fgets (id); +%! if (s_one == s_one_x && s_fifty == s_fifty_x) +%! frewind (id); +%! s_one_x = fgets (id); +%! if (s_one != s_one_x) +%! error ("bombed!!"); +%! endif +%! endif +%! endif +%! endif +%! endif +%! unlink (nm); + +%% test/octave.test/io/fputs-1.m +%!error fputs () + +%% test/octave.test/io/fputs-2.m +%!error fputs (1, "foo", 1) + +%% test/octave.test/io/fputs-3.m +%!assert (fputs (1, 1),-1) + +%% test/octave.test/io/fgetl-1.m +%!error fgetl () + +%% test/octave.test/io/fgetl-2.m +%!error fgetl (1, 2, 3) + +%% test/octave.test/io/fgetl-3.m +%!error fgetl ("foo", 1) + +%% test/octave.test/io/fgets-1.m +%!error fgets () + +%% test/octave.test/io/fgets-2.m +%!error fgets (1, 2, 3) + +%% test/octave.test/io/fgets-3.m +%!error fgets ("foo", 1) + +%% test/octave.test/io/fprintf-1.m +%!error fprintf () + +%% test/octave.test/io/fprintf-2.m +%!error fprintf (1) + +%% test/octave.test/io/fprintf-3.m +%!test +%! s.a = 1; +%! fail ("fprintf (s)", "Invalid call to fprintf"); + +%% test/octave.test/io/fprintf-4.m +%!error fprintf (1, 1) + +%% test/octave.test/io/fprintf-5.m +%!error fprintf (-1, "foo") + +%% test/octave.test/io/fscanf-1.m +%!error fscanf () + +%% test/octave.test/io/fscanf-2.m +%!error fscanf (1) + +%% test/octave.test/io/fscanf-3.m +%!error fscanf ("foo", "bar") + +%% test/octave.test/io/fread-1.m +%!error fread () + +%% test/octave.test/io/fread-2.m +%!error fread (1, 2, "char", 1, "native", 2) + +%% test/octave.test/io/fread-3.m +%!error fread ("foo") + +%% test/octave.test/io/fwrite-1.m +%!error fwrite () + +%% test/octave.test/io/fwrite-2.m +%!error fwrite (1, rand (10), "char", 1, "native", 2) + +%% test/octave.test/io/fwrite-3.m +%!error fwrite ("foo", 1) + +%% test/octave.test/io/feof-1.m +%!error feof () + +%% test/octave.test/io/feof-2.m +%!error feof (1, 2) + +%% test/octave.test/io/feof-3.m +%!error feof ("foo") + +%% test/octave.test/io/ferror-1.m +%!error ferror () + +%% test/octave.test/io/ferror-2.m +%!error ferror (1, 'clear', 2) + +%% test/octave.test/io/ferror-3.m +%!error ferror ("foo") + +%% test/octave.test/io/ftell-1.m +%!error ftell () + +%% test/octave.test/io/ftell-2.m +%!error ftell (1, 2) + +%% test/octave.test/io/ftell-3.m +%!error ftell ("foo") + +%% test/octave.test/io/fseek-1.m +%!error fseek () + +%% test/octave.test/io/fseek-2.m +%!error fseek (1, 0, SEEK_SET, 1) + +%% test/octave.test/io/fseek-3.m +%!error fseek ("foo", 0, SEEK_SET) + +%% test/octave.test/io/frewind-1.m +%!error frewind () + +%% test/octave.test/io/frewind-2.m +%!error frewind (1, 2) + +%% test/octave.test/io/frewind-3.m +%!error frewind ("foo") + diff -r b8157404614f -r 1af8d21608b7 test/line-continue.tst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/line-continue.tst Sat Feb 09 21:35:55 2013 -0500 @@ -0,0 +1,80 @@ +## Copyright (C) 2006-2012 John W. Eaton +## +## This file is part of Octave. +## +## Octave is free software; you can redistribute it and/or modify it +## under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 3 of the License, or (at +## your option) any later version. +## +## Octave is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with Octave; see the file COPYING. If not, see +## . + +%!shared x, a, b +%! x = [1,2]; +%! a = 1; +%! b = 2; + +%!test +%! y = [a... # comments here ok +%! b]; +%! assert (y, x); + +%!test +%! x = [1;2]; +%! y = [a... # comments here ok +%! ;\ +%! +%! b]; +%! assert (y, x); + +%!assert (1 + ... +%! 2 - \# comments here ok +%! 3 / ... # comments here ok +%! -1,6); + +%!function y = f (a,... +%! b, ... +%! c, ... % comments ok +%! x, # continuation characters not required in parens +%! y, \# but they should work too. +%! z) +%! +%! y = 1; +%!endfunction +%! +%!assert (f (), 1) + +%!test +%!assert (1 == 1 +%! && 2 == 2 +%! || 3 == 5); + +%!test +%! x = [1, ... +%! +%! ... +%! +%! 2]; +%! y = [1;2]; +%! assert (y, x); + +%!test +%! x = [1 ,... +%! 2]; +%! y = [1,2]; +%! assert (y, x); + +%% test/oc tave.test/contin/contin-16.m +%!test +%! x = [ 1 , ... +%! 2]; +%! y = [1,2]; +%! assert (y, x); + diff -r b8157404614f -r 1af8d21608b7 test/logical-index.tst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/logical-index.tst Sat Feb 09 21:35:55 2013 -0500 @@ -0,0 +1,73 @@ +## Copyright (C) 2006-2012 John W. Eaton +## +## This file is part of Octave. +## +## Octave is free software; you can redistribute it and/or modify it +## under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 3 of the License, or (at +## your option) any later version. +## +## Octave is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with Octave; see the file COPYING. If not, see +## . + +%!test +%! a = []; +%! fail ("a(0);"); + +%!shared a +%! a = 2; +%!assert (a(1), 2); +%!error id=Octave:index-out-of-bounds a(logical ([1,1])) + +%!shared a +%! a = [9,8,7,6]; +%!assert (isempty (a(logical ([0,0,0,0])))) +%!assert (a(logical ([1,1,1,1])), [9,8,7,6]) +%!assert (a(logical ([0,1,1,0])), [8,7]) +%!assert (a(logical ([1,1])), [9,8]) + +%!shared a +%! a = [9,8;7,6]; +%!assert (isempty (a(logical ([0,0,0,0])))) +%!assert (a(logical ([1,1,1,1])), [9,7,8,6]) +%!assert (a(logical ([0,1,1,0])), [7,8]) +%!assert (a(logical (0:1),logical (0:1)), 6) +%!assert (a(logical (0:1),2:-1:1), [6,7]) +%!assert (a(logical (0:1),logical ([0,1])), 6) +%!assert (a(logical (0:1),[2,1]), [6,7]) +%!assert (a(logical (0:1),:), [7,6]) +%!assert (a(logical (0:1),1), 7) +%!assert (a(logical (0:1),logical ([1,1])), [7,6]) +%!assert (a(2:-1:1,logical (0:1)), [6;8]) +%!assert (a(2:-1:1,logical ([0,1])), [6;8]) +%!assert (a(2:-1:1,logical ([1,1])), [7,6;9,8]) +%!assert (a(logical ([0,1]),logical (0:1)), 6) +%!assert (a(logical ([0,1]),2:-1:1), [6,7]) +%!assert (a(logical ([0,1]),logical ([0,1])), 6) +%!assert (a(logical ([0,1]),[2,1]), [6,7]) +%!assert (a(logical ([0,1]),:), [7,6]) +%!assert (a(logical ([0,1]),1), 7) +%!assert (a(logical ([0,1]),logical ([1,1])), [7,6]) +%!assert (a([2,1],logical (0:1)), [6;8]) +%!assert (a([2,1],logical ([0,1])), [6;8]) +%!assert (a([2,1],logical ([1,1])), [7,6;9,8]) +%!assert (a(:,logical (0:1)), [8;6]) +%!assert (a(:,logical ([0,1])), [8;6]) +%!assert (a(:,logical ([1,1])), [9,8;7,6]) +%!assert (a(1,logical (0:1)), 8) +%!assert (a(1,logical ([0,1])), 8) +%!assert (a(1,logical ([1,1])), [9,8]) +%!assert (a(logical ([1,1]),logical (0:1)), [8;6]) +%!assert (a(logical ([1,1]),2:-1:1), [8,9;6,7]) +%!assert (a(logical ([1,1]),logical ([0,1])), [8;6]) +%!assert (a(logical ([1,1]),[2,1]), [8,9;6,7]) +%!assert (a(logical ([1,1]),:), [9,8;7,6]) +%!assert (a(logical ([1,1]),1), [9;7]) +%!assert (a(logical ([1,1]),logical ([1,1])), [9,8;7,6]) + diff -r b8157404614f -r 1af8d21608b7 test/nest/module.mk --- a/test/nest/module.mk Sat Feb 09 20:05:40 2013 -0500 +++ b/test/nest/module.mk Sat Feb 09 21:35:55 2013 -0500 @@ -1,4 +1,4 @@ -nest_FCN_FILES = \ +nest_fcn_files = \ nest/arg_nest.m \ nest/arg_ret.m \ nest/nest_eval.m \ @@ -13,7 +13,7 @@ nest/scope3.m \ nest/script_nest.m \ nest/script_nest_script.m \ - nest/test_nest.m \ + nest/nest.tst \ nest/varg_nest.m \ nest/varg_nest2.m diff -r b8157404614f -r 1af8d21608b7 test/nest/nest.tst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/nest/nest.tst Sat Feb 09 21:35:55 2013 -0500 @@ -0,0 +1,58 @@ +## Copyright (C) 2006-2012 John W. Eaton +## +## This file is part of Octave. +## +## Octave is free software; you can redistribute it and/or modify it +## under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 3 of the License, or (at +## your option) any later version. +## +## Octave is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with Octave; see the file COPYING. If not, see +## . + +################################################################################ +## This file actually executes the tests on nested functions. +## +## It relies on the function files defined in the nest/ directory. +################################################################################ + +%!assert (recursive_nest (), 25) + +%!assert (recursive_nest2 (), 20) + +%!assert (recursive_nest3 (), 5) + +%!assert (script_nest (), 5) + +%!assert (arg_ret (), 10) + +%!assert (arg_nest, 1) + +%!assert (varg_nest (-1), 6) + +%!assert (varg_nest2, 5) + +%!test +%! scope0; + +%!test +%! scope1 (1); + +%!test +%! scope3; + +%!assert (nest_eval ("x = 5;", "x = 6;"), 6); +%!assert (nest_eval ("x = 5;", "y = 6;"), 5); +%!assert (nest_eval ("x = -5; x = abs (x);", "y = 6;"), 5); + +%!error scope2 +%!error no_closure (0) +%!error no_closure (1) +%!error nest_eval ("y = 5;", "") +%!error nest_eval ("y;", "") diff -r b8157404614f -r 1af8d21608b7 test/nest/test_nest.m --- a/test/nest/test_nest.m Sat Feb 09 20:05:40 2013 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,58 +0,0 @@ -## Copyright (C) 2006-2012 John W. Eaton -## -## This file is part of Octave. -## -## Octave is free software; you can redistribute it and/or modify it -## under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 3 of the License, or (at -## your option) any later version. -## -## Octave is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with Octave; see the file COPYING. If not, see -## . - -################################################################################ -## This file actually executes the tests on nested functions. -## -## It relies on the function files defined in the nest/ directory. -################################################################################ - -%!assert (recursive_nest (), 25) - -%!assert (recursive_nest2 (), 20) - -%!assert (recursive_nest3 (), 5) - -%!assert (script_nest (), 5) - -%!assert (arg_ret (), 10) - -%!assert (arg_nest, 1) - -%!assert (varg_nest (-1), 6) - -%!assert (varg_nest2, 5) - -%!test -%! scope0; - -%!test -%! scope1 (1); - -%!test -%! scope3; - -%!assert (nest_eval ("x = 5;", "x = 6;"), 6); -%!assert (nest_eval ("x = 5;", "y = 6;"), 5); -%!assert (nest_eval ("x = -5; x = abs (x);", "y = 6;"), 5); - -%!error scope2 -%!error no_closure (0) -%!error no_closure (1) -%!error nest_eval ("y = 5;", "") -%!error nest_eval ("y;", "") diff -r b8157404614f -r 1af8d21608b7 test/null-assign.tst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/null-assign.tst Sat Feb 09 21:35:55 2013 -0500 @@ -0,0 +1,63 @@ +## Copyright (C) 2008-2012 Jaroslav Hajek +## +## This file is part of Octave. +## +## Octave is free software; you can redistribute it and/or modify it +## under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 3 of the License, or (at +## your option) any later version. +## +## Octave is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with Octave; see the file COPYING. If not, see +## . + +%!test +%! a = 1:3; a(:) = []; assert (size (a), [0, 0]) +%!test +%! a = 1:3; a(1:3) = []; assert (size (a), [1, 0]) +%!test +%! a = (1:3).'; a(1:3) = []; assert (size (a), [0, 1]) +%!test +%! a = ones (3); a(:,:) = []; assert (size (a), [0, 3]) +%!test +%! a = ones (3); a(1:3,:) = []; assert (size (a), [0, 3]) +%!test +%! a = ones (3); a(:,1:3) = []; assert (size (a), [3, 0]) +%!test +%! a = ones (3); fail ("a(1:2,1:2) = []", ".*"); +%!test +%! a = ones (3); fail ("a(1:3,1:3) = []", ".*"); + +## null strings should delete. [,] and [;] should delete. +%!test +%! a = ones (3); a(1:2,:) = [,]; assert (size (a), [1,3]) +%!test +%! a = ones (3); a(1:2,:) = [;]; assert (size (a), [1,3]) +%!test +%! a = ones (3); a(1:2,:) = ''; assert (size (a), [1,3]) +%!test +%! a = ones (3); a(1:2,:) = ""; assert (size (a), [1,3]) + +## null matrix stored anywhere should lose its special status +%!test +%! a = ones (3); b = []; fail ("a(:,1:3) = b", ".") +%!test +%! a = ones (3); b{1} = []; fail ("a(:,1:3) = b{1}", ".") +%!test +%! a = ones (3); b.x = []; fail ("a(:,1:3) = b.x", ".") + +## filtering a null matrix through a function should not delete +%!test +%! a = ones (3); fail ("a(:,1:3) = double ([])") + +## subsasgn should work the same way +%!test +%! a = ones (3); a = subsasgn (a, substruct ('()', {':',1:2}), []); assert (size (a), [3,1]) +%!test +%! a = ones (3); b = []; fail ("subsasgn (a, substruct ('()', {':',1:2}), b)", ".") + diff -r b8157404614f -r 1af8d21608b7 test/parser.tst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/parser.tst Sat Feb 09 21:35:55 2013 -0500 @@ -0,0 +1,259 @@ +## Copyright (C) 2010-2012 John W. Eaton +## +## This file is part of Octave. +## +## Octave is free software; you can redistribute it and/or modify it +## under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 3 of the License, or (at +## your option) any later version. +## +## Octave is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with Octave; see the file COPYING. If not, see +## . + +## Tests for parser problems belong in this file. +## We need many more tests here! + +%!assert ({1 2 {3 4}}, {1,2,{3,4}}) +%!assert ({1, 2 {3 4}}, {1,2,{3,4}}) +%!assert ({1 2, {3 4}}, {1,2,{3,4}}) +%!assert ({1 2 {3, 4}}, {1,2,{3,4}}) +%!assert ({1, 2, {3 4}}, {1,2,{3,4}}) +%!assert ({1 2,{3 4}}, {1,2,{3,4}}) +%!assert ({1 2,{3,4}}, {1,2,{3,4}}) +%!assert ({1,2,{3 4}}, {1,2,{3,4}}) + +## Tests for operator precedence as documented in section 8.8 of manual +## There are 13 levels of precedence from "parentheses and indexing" (highest) +## down to "statement operators" (lowest). +## +## Level 13 (parentheses and indexing) +## Overrides all other levels +%!test +%! a.b = 1; +%! assert (a. b++, 1) +%! assert (a.b, 2) +%! clear a; +%! a.b = [0 1]; +%! b = 2; +%! assert (a.b', [0;1]) +%! assert (!a .b, logical ([1 0])) +%! assert (3*a .b, [0 3]) +%! assert (a. b-1, [-1 0]) +%! assert (a. b:3, 0:3) +%! assert (a. b>0.5, logical ([0 1])) +%! assert (a. b&0, logical ([0 0])) +%! assert (a. b|0, logical ([0 1])) +%! a.b = [1 2]; +%! assert (a. b&&0, false) +%! assert (a. b||0, true) +%! a.b += a. b*2; +%! assert (a.b, [3 6]) +## Level 12 (postfix increment and decrement) +%!test +%! a = [3 5]; +%! assert (2.^a ++, [8 32]) +%! assert (a, [4 6]) +%! assert (a--', [4; 6]) +%! assert (a, [3 5]) +%! a = 0; +%! assert (!a --, true) +%! assert (-a ++, 1) +%! assert (3*a ++, 0) +%! assert (a++-2, -1) +%! assert (1:a ++, 1:2) +%! assert (4>a++, true) +%! a = [0 -1]; +%! assert ([1 1] & a++, logical ([0 1])) +%! assert ([0 0] | a++, logical ([1 0])) +%! a = 0; +%! assert (1 && a ++, false) +%! assert (0 || a --, true) +%! a = 5; b = 2; +%! b +=a ++; +%! assert (b, 7) + +## Level 11 (transpose and exponentiation) +%!test +%! assert (-2 ^2, -4) +%! assert (!0 ^0, false) +%! assert (2*3 ^2, 18) +%! assert (2+3 ^2, 11) +%! assert ([1:10](1:2 ^2), [1 2 3 4]) +%! assert (3>2 ^2, false) +%! assert (1&0 ^0, true) +%! assert (0|0 ^0, true) +%! assert (1&&0 ^0, true) +%! assert (0||0 ^0, true) +%! a = 3; +%! a *= 0 ^0; +%! assert (a, 3) +## Level 10 (unary plus/minus, prefix increment/decrement, not) +%!test +%! a = 2; +%! assert (++ a*3, 9) +%! assert (-- a-2, 0) +%! assert (a, 2) +%! assert (! a-2, -2) +%! assert ([1:10](++ a:5), 3:5) +%! a = [1 0]; +%! assert (! a>=[1 0], [false true]) +%! a = 0; +%! assert (++ a&1, true) +%! assert (-- a|0, false) +%! assert (-- a&&1, true) +%! assert (++ a||0, false) +%! a = 3; +%! a *= ++a; +%! assert (a, 16) +## Level 9 (multiply, divide) +%!test +%! assert (3+4 * 5, 23) +%! assert (5 * 1:6, [5 6]) +%! assert (3>1 * 5, false) +%! assert (1&1 * 0, false) +%! assert (1|1 * 0, true) +%! assert (1&&1 * 0, false) +%! assert (1||1 * 0, true) +%! a = 3; +%! a /= a * 2; +%! assert (a, 0.5) +## Level 8 (add, subtract) +%!test +%! assert ([2 + 1:6], 3:6) +%! assert (3>1 + 5, false) +%! assert (1&1 - 1, false) +%! assert (0|1 - 2, true) +%! assert (1&&1 - 1, false) +%! assert (0||1 - 2, true) +%! a = 3; +%! a *= 1 + 1; +%! assert (a, 6) +## Level 7 (colon) +%!test +%! assert (5:-1: 3>4, [true false false]) +%! assert (1: 3&1, [true true true]) +%! assert (1: 3|0, [true true true]) +%! assert (-1: 3&&1, false) +%! assert (-1: 3||0, false) +%! a = [1:3]; +%! a += 3 : 5; +%! assert (a, [4 6 8]) +## Level 6 (relational) +%!test +%! assert (0 == -1&0, false) +%! assert (1 == -1|0, false) +%! assert (0 == -1&&0, false) +%! assert (1 == -1||0, false) +%! a = 2; +%! a *= 3 > 1; +%! assert (a, 2) +## Level 5 (element-wise and) +%!test +%! assert (0 & 1|1, true) +%! assert ([0 1] & 1&&1, false) +%! assert (0 & 1||1, true) +%! a = 2; +%! a *= 3 & 1; +%! assert (a, 2) +## Level 4 (element-wise or) +%!test +%! assert ([0 1] | 1&&0, false) +%! assert ([0 1] | 1||0, true) +%! a = 2; +%! a *= 0 | 1; +%! assert (a, 2) +## Level 3 (logical and) +%!test +%! assert (0 && 1||1, true) +%! a = 2; +%! a *= 3 && 1; +%! assert (a, 2) +## Level 2 (logical or) +%!test +%! a = 2; +%! a *= 0 || 1; +%! assert (a, 2) + +## Tests for operator precedence within each level where ordering should +## be left to right except for postfix and assignment operators. + +## Level 13 (parentheses and indexing) +%!test +%! a.b1 = 2; +%! assert (a.(strcat('b','1'))++, 2) +%! assert (a.b1, 3) +%! b = {1 2 3 4 5}; +%! assert (b{(a. b1 + 1)}, 4) +%! b = 1:5; +%! assert (b(a. b1 + 1), 4) +%! assert ([2 3].^2', [4; 9]) +## Level 12 (postfix increment and decrement) +## No tests possible since a++-- is not valid +## Level 11 (transpose and exponentiation) +## Note: Exponentiation works left to right for compatibility with Matlab. +%! assert (2^3**2, 64) +%! assert ([2 3].^2.', [4;9]) +%! assert ([2 3].'.^2, [4;9]) +%! assert (3*4i'.', 0 - 12i) +%! assert (3*4i.'.', 0 + 12i) +## Level 10 (unary plus/minus, prefix increment/decrement, not) +%!test +%! assert (+-+1, -1) +%! a = -1; +%! assert (!++a, true) +%! assert (a, 0) +%! assert (-~a, -1) +%! assert (!~--a, true) +%! assert (a, -1) +## Level 9 (multiply, divide) +%!test +%! assert (3 * 4 / 5, 2.4) +%! assert (3 ./ 4 .* 5, 3.75) +%! assert (2 * 4 \ 6, 0.75) +%! assert (2 .\ 4 .* 6, 12) +## Level 8 (add, subtract) +%!test +%! assert (-3 - 4 + 1 + 3 * 2, 0) +## Level 7 (colon) +## No tests possible because colon operator can't be combined with second colon operator +## Level 6 (relational) +%!test +%! assert (0 < 1 <= 0.5 == 0 >= 0.5 > 0, true) +%! assert (1 < 1 == 0 != 0, true) +%! assert (1 < 1 == 0 ~= 0, true) +## Level 5 (element-wise and) +## No tests possible. Only one operator (&) at this precedence level and operation is associative. +## Level 4 (element-wise or) +## No tests possible. Only one operator (|) at this precedence level and operation is associative. +## Level 3 (logical and) +%!test +%! a = 1; +%! assert (1 && 0 && ++a, false) +%! assert (a, 1) +## Level 2 (logical or) +%!test +%! a = 1; +%! assert (0 || 1 || ++a, true) +%! assert (a, 1) +## Level 1 (assignment) +%!test +%! a = 2; b = 5; c = 7; +%! assert (a += b *= c += 1, 42) +%! assert (b == 40 && c == 8) + +## Test creation of anonymous functions + +%!test +%! af_in_cell = {@(x) [1 2]}; +%! assert (af_in_cell{1}(), [1, 2]); + +%!test +%! R = @(rot) [cos(rot) -sin(rot); sin(rot) cos(rot)]; +%! assert (R(pi/2), [cos(pi/2), -sin(pi/2); sin(pi/2),cos(pi/2)]); + diff -r b8157404614f -r 1af8d21608b7 test/prefer.tst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/prefer.tst Sat Feb 09 21:35:55 2013 -0500 @@ -0,0 +1,227 @@ +## Copyright (C) 2006-2012 John W. Eaton +## +## This file is part of Octave. +## +## Octave is free software; you can redistribute it and/or modify it +## under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 3 of the License, or (at +## your option) any later version. +## +## Octave is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with Octave; see the file COPYING. If not, see +## . + +%% test/octave.test/prefer/prefer-1.m +%!test +%! m = [3 2]; +%! assert (all (m == (3:-1:2))); + +%% test/octave.test/prefer/prefer-2.m +%!test +%! m = [3, +%! 2]; +%! assert (all (m == (3:-1:2)')); + +%% test/octave.test/prefer/prefer-3.m +%!test +%! a = 2; +%! assert ([a - 1], 1); + +%% test/octave.test/prefer/prefer-4.m +%!test +%! m = [3,2]; +%! fail ("[m ']"); + +%% test/octave.test/prefer/prefer-5.m +%!assert (all ([3 2] == (3:-1:2))); + +%% test/octave.test/prefer/prefer-6.m +%!assert (all ([3, 2] == (3:-1:2))); + +%% test/octave.test/prefer/prefer-7.m +%!test +%! m = [3,2]; +%! assert (all ([m (1)] == (3:-1:1))); + +%% test/octave.test/prefer/prefer-8.m +%!test +%! m = [3,2]; +%! assert ([m(1)],3); + +%% test/octave.test/prefer/prefer-10.m +%!test +%! a = 2; +%! assert ([a- 1], 1); + +%% test/octave.test/prefer/prefer-11.m +%!test +%! a = 1; +%! assert (all ([a -1] == (1:-2:-1))); + +%% test/octave.test/prefer/prefer-12.m +%!test +%! wsn = warning ("query", "Octave:str-to-num"); +%! warning ("off", "Octave:str-to-num"); +%! assert ("d" + 0, 100); +%! warning (wsn.state, "Octave:str-to-num"); + +%% test/octave.test/prefer/prefer-13.m +%!test +%! wsn = warning ("query", "Octave:str-to-num"); +%! warning ("on", "Octave:str-to-num"); +%! fail ("'d' + 0", "warning"); +%! warning (wsn.state, "Octave:str-to-num"); + +%% test/octave.test/prefer/prefer-14.m +%!test +%! wir = warning ("query", "Ocave:imag-to-real"); +%! warning ("off", "Ocave:imag-to-real"); +%! assert (eye (1+i), 1); +%! warning (wir.state, "Ocave:imag-to-real"); + +%% test/octave.test/prefer/prefer-15.m +%!test +%! wir = warning ("query", "Ocave:imag-to-real"); +%! warning ("on", "Ocave:imag-to-real"); +%! fail ("eye (1+i)", "warning"); +%! warning (wir.state, "Ocave:imag-to-real"); + +%% test/octave.test/prefer/prefer-17.m +%!test +%! wrre = warning ("query", "Octave:resize-on-range-error"); +%! warning ("off", "Octave:resize-on-range-error"); +%! 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; +%! a(1) = 1; a(2) = 2; +%! assert (all (a == [1,2])); + +%% test/octave.test/prefer/prefer-21.m +%!test +%! ped = print_empty_dimensions (); +%! print_empty_dimensions (0); +%! a = cell (1, 1); +%! b = type ("-q", "a"); +%! assert (!isempty (findstr (b{1}, "[]"))); +%! assert (isempty (findstr (b{1} ,"[](0x0)"))); +%! print_empty_dimensions (ped); + +%% test/octave.test/prefer/prefer-22.m +%!test +%! ped = print_empty_dimensions (); +%! print_empty_dimensions (1); +%! a = cell (1, 1); +%! b = type ("-q", "a"); +%! assert (!isempty (findstr (b{1}, "[](0x0)"))); +%! print_empty_dimensions (ped); + +%% test/octave.test/prefer/prefer-23.m +%!assert (all (size (inv ([])) == [0, 0])); + +%% test/octave.test/prefer/prefer-24.m +%!assert (all (svd ([]) == zeros (0, 1))); + +%% test/octave.test/prefer/prefer-27.m +%!test +%! sp = save_precision (); +%! save_precision (1); +%! x = pi; +%! nm = tmpnam (); +%! save("-text", nm, "x"); +%! clear x; +%! load (nm); +%! unlink (nm); +%! assert (x,3); +%! save_precision (sp); + +%% test/octave.test/prefer/prefer-28.m +%!test +%! sp = save_precision (); +%! save_precision (5); +%! x = pi; +%! nm = tmpnam (); +%! save("-text", nm, "x"); +%! clear x; +%! load (nm); +%! unlink (nm); +%! assert (x, 3.1416); +%! save_precision (sp); + +%% FIXME: How to capture standard output for comparison? +%% test/octave.test/prefer/prefer-29.m +%!function f () +%! 1 +%!endfunction +%!#test +%! sf = silent_functions (); +%! silent_functions (0); +%! f +%! assert (??); +%! silent_functions (sf); + +%% FIXME Same problem as above!!! +%% test/octave.test/prefer/prefer-30.m +%!function f () +%! 1 +%!endfunction +%!#test +%! sf = silent_functions (); +%! silent_functions (1); +%! f +%! assert (??); +%! silent_functions (sf); + +%% test/octave.test/prefer/prefer-32.m +%!test +%! wndz = warning ("query", "Octave:neg-dim-as-zero"); +%! warning ("on", "Octave:neg-dim-as-zero"); +%! fail ("eye (-1) == []", "warning"); +%! warning (wndz.state, "Octave:neg-dim-as-zero"); + +%% test/octave.test/prefer/prefer-33.m +%!test +%! wndz = warning ("query", "Octave:neg-dim-as-zero"); +%! warning ("off", "Octave:neg-dim-as-zero"); +%! assert (all (size (eye (-1)) == [0, 0])); +%! warning (wndz.state, "Octave:neg-dim-as-zero"); + +%% test/octave.test/prefer/prefer-34.m +%!test +%! watv = warning ("query", "Octave:assign-as-truth-value"); +%! warning ("off", "Octave:assign-as-truth-value"); +%! if (x = 1) 1; endif +%! warning (watv.state, "Octave:assign-as-truth-value"); + +%% test/octave.test/prefer/prefer-35.m +%!test +%! watv = warning ("query", "Octave:assign-as-truth-value"); +%! warning ("on", "Octave:assign-as-truth-value"); +%! fail ("if (x = 1) 1; endif", "warning"); +%! warning (watv.state, "Octave:assign-as-truth-value"); + +%% test/octave.test/prefer/prefer-38.m +%!test +%! wdbz = warning ("query", "Octave:divide-by-zero"); +%! warning ("off", "Octave:divide-by-zero"); +%! assert (isinf (1/0)); +%! warning (wdbz.state, "Octave:divide-by-zero"); + +%% test/octave.test/prefer/prefer-39.m +%!test +%! wdbz = warning ("query", "Octave:divide-by-zero"); +%! warning ("on", "Octave:divide-by-zero"); +%! a = 1; +%! b = 0; +%! fail ("isinf (a/b);", "warning") +%! warning (wdbz.state, "Octave:divide-by-zero"); + diff -r b8157404614f -r 1af8d21608b7 test/range.tst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/range.tst Sat Feb 09 21:35:55 2013 -0500 @@ -0,0 +1,74 @@ +## Copyright (C) 2007-2012 John W. Eaton +## +## This file is part of Octave. +## +## Octave is free software; you can redistribute it and/or modify it +## under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 3 of the License, or (at +## your option) any later version. +## +## Octave is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with Octave; see the file COPYING. If not, see +## . + +## Test values of range + +%!assert (full (1:9), [ 1 2 3 4 5 6 7 8 9 ]) +%!assert (full (1:0.4:3), [ 1.0 1.4 1.8 2.2 2.6 3.0 ]) +%!assert (full (9:1), zeros (1,0)) +%!assert (full (9:-1:1), [ 9 8 7 6 5 4 3 2 1 ]) +%!assert (full (1:-1:9), zeros (1,0)) +%!assert (full (1:1:1), 1) +%!assert (full (i:2i:10i), zeros (1,0)) + +## Test mixing integer range with other types + +%!shared expect, r, z +%! expect = [ 1 2 3 4 5 6 7 8 9 +%! 0 0 0 0 0 0 0 0 0 ]; +%! z = zeros (1,9); +%! r = 1:9; + +%!assert ([ r ; z ], expect) +%!assert ([ r ; single(z) ], single (expect)) +%!assert ([ r ; logical(z) ], expect) +%!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)) + +## Test mixing non-integer range with other types + +%!shared expect, r, z +%! expect = [ 1.0 1.4 1.8 2.2 2.6 3.0 +%! 0 0 0 0 0 0 ]; +%! z = zeros (1,6); +%! r = 1:0.4:3; + +%!assert ([ r ; z ], expect) +%!assert ([ r ; single(z) ], single (expect)) +%!assert ([ r ; logical(z) ], expect) +%!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)) + diff -r b8157404614f -r 1af8d21608b7 test/recursion.tst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/recursion.tst Sat Feb 09 21:35:55 2013 -0500 @@ -0,0 +1,43 @@ +## Copyright (C) 2006-2012 John W. Eaton +## +## This file is part of Octave. +## +## Octave is free software; you can redistribute it and/or modify it +## under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 3 of the License, or (at +## your option) any later version. +## +## Octave is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with Octave; see the file COPYING. If not, see +## . + +%% test/octave.test/recursion/recursion-1.m +%!function y = f (x) +%! if (x == 1) +%! y = x; +%! return; +%! else +%! y = x * f (x-1); +%! endif +%!endfunction +%! +%!assert(f (5), 120); + +%% test/octave.test/recursion/recursion-2.m +%!function y = f (x) +%! if (x == 1) +%! y = x; +%! return; +%! else +%! y = f (x-1) * x; +%! endif +%!endfunction +%! +%!assert(f (5), 120); + +%%FIXME: Need test for maximum recursion depth diff -r b8157404614f -r 1af8d21608b7 test/return.tst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/return.tst Sat Feb 09 21:35:55 2013 -0500 @@ -0,0 +1,31 @@ +## Copyright (C) 2006-2012 John W. Eaton +## +## This file is part of Octave. +## +## Octave is free software; you can redistribute it and/or modify it +## under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 3 of the License, or (at +## your option) any later version. +## +## Octave is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with Octave; see the file COPYING. If not, see +## . + +%% test/octave.test/return/return-1.m +%!function y = f () +%! y = 1; +%! return; +%! y = 2; +%!endfunction +%! +%!assert(f(), 1) + +%% test/octave.test/return/return-2.m +%!test +%! return; + diff -r b8157404614f -r 1af8d21608b7 test/slice.tst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/slice.tst Sat Feb 09 21:35:55 2013 -0500 @@ -0,0 +1,180 @@ +## Copyright (C) 2007-2012 John W. Eaton +## +## This file is part of Octave. +## +## Octave is free software; you can redistribute it and/or modify it +## under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 3 of the License, or (at +## your option) any later version. +## +## Octave is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with Octave; see the file COPYING. If not, see +## . + +%!function x = set_slice (size, dim, slice) +%! x = ones (size); +%! switch dim +%! case 11 +%! x(slice) = 2; +%! case 21 +%! x(slice, :) = 2; +%! case 22 +%! x(:, slice) = 2; +%! case 31 +%! x(slice, :, :) = 2; +%! case 32 +%! x(:, slice, :) = 2; +%! case 33 +%! x(:, :, slice) = 2; +%! otherwise +%! error("invalid dim, '%d'", dim); +%! endswitch +%!endfunction + +## size = [2 0] +%!assert (set_slice ([2 0], 11, []), zeros ([2 0])) +%!error id=Octave:invalid-resize set_slice ([2 0], 11, 1) +%!error id=Octave:invalid-resize set_slice ([2 0], 11, 2) +%!error id=Octave:invalid-resize set_slice ([2 0], 11, 3) +%!assert (set_slice ([2 0], 21, []), zeros ([2 0])) +%!assert (set_slice ([2 0], 21, 1), zeros ([2 0])) +%!assert (set_slice ([2 0], 21, 2), zeros ([2 0])) +%!assert (set_slice ([2 0], 21, 3), zeros ([3 0])) +%!assert (set_slice ([2 0], 22, []), zeros ([2 0])) +%!assert (set_slice ([2 0], 22, 1), [2 2]') +%!assert (set_slice ([2 0], 22, 2), [0 0;2 2]') +%!assert (set_slice ([2 0], 22, 3), [0 0;0 0;2 2]') +%!assert (set_slice ([2 0], 31, []), zeros ([2 0])) +%!assert (set_slice ([2 0], 31, 1), zeros ([2 0])) +%!assert (set_slice ([2 0], 31, 2), zeros ([2 0])) +%!assert (set_slice ([2 0], 31, 3), zeros ([3 0])) +%!assert (set_slice ([2 0], 32, []), zeros ([2 0])) +%!assert (set_slice ([2 0], 32, 1), [2 2]') +%!assert (set_slice ([2 0], 32, 2), [0 0;2 2]') +%!assert (set_slice ([2 0], 32, 3), [0 0;0 0;2 2]') +%!assert (set_slice ([2 0], 33, []), zeros ([2 0])) +%!assert (set_slice ([2 0], 33, 1), zeros ([2 0])) +%!assert (set_slice ([2 0], 33, 2), zeros ([2 0 2])) +%!assert (set_slice ([2 0], 33, 3), zeros ([2 0 3])) + +## size = [0 2] +%!assert (set_slice ([0 2], 11, []), zeros ([0 2])) +%!assert (set_slice ([0 2], 11, 1), 2) +%!assert (set_slice ([0 2], 11, 2), [0, 2]) +%!assert (set_slice ([0 2], 11, 3), [0, 0, 2]) +%!assert (set_slice ([0 2], 21, []), zeros ([0 2])) +%!assert (set_slice ([0 2], 21, 1), [2 2]) +%!assert (set_slice ([0 2], 21, 2), [0 0;2 2]) +%!assert (set_slice ([0 2], 21, 3), [0 0;0 0;2 2]) +%!assert (set_slice ([0 2], 22, []), zeros ([0 2])) +%!assert (set_slice ([0 2], 22, 1), zeros ([0 2])) +%!assert (set_slice ([0 2], 22, 2), zeros ([0 2])) +%!assert (set_slice ([0 2], 22, 3), zeros ([0 3])) +%!assert (set_slice ([0 2], 31, []), zeros ([0 2])) +%!assert (set_slice ([0 2], 31, 1), [2 2]) +%!assert (set_slice ([0 2], 31, 2), [0 0;2 2]) +%!assert (set_slice ([0 2], 31, 3), [0 0;0 0;2 2]) +%!assert (set_slice ([0 2], 32, []), zeros ([0 2])) +%!assert (set_slice ([0 2], 32, 1), zeros ([0 2])) +%!assert (set_slice ([0 2], 32, 2), zeros ([0 2])) +%!assert (set_slice ([0 2], 32, 3), zeros ([0 3])) +%!assert (set_slice ([0 2], 33, []), zeros ([0 2])) +%!assert (set_slice ([0 2], 33, 1), zeros ([0 2])) +%!assert (set_slice ([0 2], 33, 2), zeros ([0 2 2])) +%!assert (set_slice ([0 2], 33, 3), zeros ([0 2 3])) + +## size = [2 1] +%!assert (set_slice ([2 1], 11, []), ones ([2 1])) +%!assert (set_slice ([2 1], 11, 1), [2 1]') +%!assert (set_slice ([2 1], 11, 2), [1 2]') +%!assert (set_slice ([2 1], 11, 3), [1 1 2]') +%!assert (set_slice ([2 1], 11, 4), [1 1 0 2]') +%!assert (set_slice ([2 1], 21, []), ones ([2 1])) +%!assert (set_slice ([2 1], 21, 1), [2 1]') +%!assert (set_slice ([2 1], 21, 2), [1 2]') +%!assert (set_slice ([2 1], 21, 3), [1 1 2]') +%!assert (set_slice ([2 1], 21, 4), [1 1 0 2]') +%!assert (set_slice ([2 1], 22, []), ones ([2 1])) +%!assert (set_slice ([2 1], 22, 1), [2 2]') +%!assert (set_slice ([2 1], 22, 2), [1 1;2 2]') +%!assert (set_slice ([2 1], 22, 3), [1 1;0 0;2 2]') +%!assert (set_slice ([2 1], 31, []), ones ([2 1])) +%!assert (set_slice ([2 1], 31, 1), [2 1]') +%!assert (set_slice ([2 1], 31, 2), [1 2]') +%!assert (set_slice ([2 1], 31, 3), [1 1 2]') +%!assert (set_slice ([2 1], 31, 4), [1 1 0 2]') +%!assert (set_slice ([2 1], 32, []), ones ([2 1])) +%!assert (set_slice ([2 1], 32, 1), [2 2]') +%!assert (set_slice ([2 1], 32, 2), [1 1;2 2]') +%!assert (set_slice ([2 1], 32, 3), [1 1;0 0;2 2]') +%!assert (set_slice ([2 1], 33, []), ones ([2 1])) +%!assert (set_slice ([2 1], 33, 1), [2 2]') +%!assert (set_slice ([2 1], 33, 2), reshape ([1 1 2 2],[2 1 2])) +%!assert (set_slice ([2 1], 33, 3), reshape ([1 1 0 0 2 2],[2 1 3])) + +## size = [1 2] +%!assert (set_slice ([1 2], 11, []), full (ones ([1 2]))) +%!assert (set_slice ([1 2], 11, 1), [2 1]) +%!assert (set_slice ([1 2], 11, 2), [1 2]) +%!assert (set_slice ([1 2], 11, 3), [1 1 2]) +%!assert (set_slice ([1 2], 11, 4), [1 1 0 2]) +%!assert (set_slice ([1 2], 21, []), full (ones ([1 2]))) +%!assert (set_slice ([1 2], 21, 1), [2 2]) +%!assert (set_slice ([1 2], 21, 2), [1 1;2 2]) +%!assert (set_slice ([1 2], 21, 3), [1 1;0 0;2 2]) +%!assert (set_slice ([1 2], 22, []), full (ones ([1 2]))) +%!assert (set_slice ([1 2], 22, 1), [2 1]) +%!assert (set_slice ([1 2], 22, 2), [1 2]) +%!assert (set_slice ([1 2], 22, 3), [1 1 2]) +%!assert (set_slice ([1 2], 22, 4), [1 1 0 2]) +%!assert (set_slice ([1 2], 31, []), full (ones ([1 2]))) +%!assert (set_slice ([1 2], 31, 1), [2 2]) +%!assert (set_slice ([1 2], 31, 2), [1 1;2 2]) +%!assert (set_slice ([1 2], 31, 3), [1 1;0 0;2 2]) +%!assert (set_slice ([1 2], 32, []), full (ones ([1 2]))) +%!assert (set_slice ([1 2], 32, 1), [2 1]) +%!assert (set_slice ([1 2], 32, 2), [1 2]) +%!assert (set_slice ([1 2], 32, 3), [1 1 2]) +%!assert (set_slice ([1 2], 32, 4), [1 1 0 2]) +%!assert (set_slice ([1 2], 33, []), full (ones ([1 2]))) +%!assert (set_slice ([1 2], 33, 1), [2 2]) +%!assert (set_slice ([1 2], 33, 2), reshape ([1 1 2 2],[1 2 2])) +%!assert (set_slice ([1 2], 33, 3), reshape ([1 1 0 0 2 2],[1 2 3])) + +## size = [2 2] +%!assert (set_slice ([2 2], 11, []), ones ([2 2])) +%!assert (set_slice ([2 2], 11, 1), [2 1;1 1]) +%!assert (set_slice ([2 2], 11, 2), [1 1;2 1]) +%!assert (set_slice ([2 2], 11, 3), [1 2;1 1]) +%!assert (set_slice ([2 2], 11, 4), [1 1;1 2]) +%!error id=Octave:invalid-resize set_slice ([2 2], 11, 5) +%!error id=Octave:invalid-resize set_slice ([2 2], 11, 6) +%!assert (set_slice ([2 2], 21, []), ones ([2 2])) +%!assert (set_slice ([2 2], 21, 1), [2 2;1 1]) +%!assert (set_slice ([2 2], 21, 2), [1 1;2 2]) +%!assert (set_slice ([2 2], 21, 3), [1 1;1 1;2 2]) +%!assert (set_slice ([2 2], 21, 4), [1 1;1 1;0 0;2 2]) +%!assert (set_slice ([2 2], 22, []), ones ([2 2])) +%!assert (set_slice ([2 2], 22, 1), [2 2;1 1]') +%!assert (set_slice ([2 2], 22, 2), [1 1;2 2]') +%!assert (set_slice ([ 2 2], 22, 3), [1 1;1 1;2 2]') +%!assert (set_slice ([2 2], 22, 4), [1 1;1 1;0 0;2 2]') +%!assert (set_slice ([2 2], 31, []), ones ([2 2])) +%!assert (set_slice ([2 2], 31, 1), [2 2;1 1]) +%!assert (set_slice ([2 2], 31, 2), [1 1;2 2]) +%!assert (set_slice ( [2 2], 31, 3), [1 1;1 1;2 2]) +%!assert (set_slice ([2 2], 31, 4), [1 1;1 1;0 0;2 2]) +%!assert (set_slice ([2 2], 32, []), ones ([2 2])) +%!assert (set_slice ([2 2], 32, 1), [2 2;1 1]') +%!assert (set_slice ([2 2], 32, 2), [1 1;2 2]') +%!assert (set_slice ([ 2 2], 32, 3), [1 1;1 1;2 2]') +%!assert (set_slice ([2 2], 32, 4), [1 1;1 1;0 0;2 2]') +%!assert (set_slice ([2 2], 33, []), ones ([2 2])) +%!assert (set_slice ([2 2], 33, 1), [2 2;2 2]) +%!assert (set_slice ([2 2], 33, 2), reshape ([1 1 1 1 2 2 2 2],[2 2 2])) +%!assert (set_slice ([ 2 2], 33, 3), reshape ([1 1 1 1 0 0 0 0 2 2 2 2],[2 2 3])) diff -r b8157404614f -r 1af8d21608b7 test/struct.tst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/struct.tst Sat Feb 09 21:35:55 2013 -0500 @@ -0,0 +1,266 @@ +## Copyright (C) 2006-2012 John W. Eaton +## +## This file is part of Octave. +## +## Octave is free software; you can redistribute it and/or modify it +## under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 3 of the License, or (at +## your option) any later version. +## +## Octave is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with Octave; see the file COPYING. If not, see +## . + +%% test/octave.test/struct/fieldnames-1.m +%!test +%! s.a = 1; +%! c = fieldnames (s); +%! assert (iscell (c) && strcmp (c{1}, "a")); + +%% test/octave.test/struct/fieldnames-2.m +%!test +%! s.a.b = 1; +%! c = fieldnames (s.a); +%! assert (iscell (c) && strcmp (c{1}, "b")); + +%% test/octave.test/struct/fieldnames-3.m +%!error fieldnames (); + +%% test/octave.test/struct/fieldnames-4.m +%!test +%! s.a = 1; +%! fail ("fieldnames (s, 1)", "Invalid call to fieldnames"); + +%% test/octave.test/struct/fieldnames-5.m +%!error fieldnames (1); + +%% test/octave.test/struct/isfield-1.m +%!test +%! s.aaa = 1; +%! s.a = 2; +%! assert (isfield (s, "a")); + +%% test/octave.test/struct/isfield-2.m +%!test +%! s.aaa = 1; +%! s.a = 2; +%! assert (!(isfield (s, "b"))); + +%% test/octave.test/struct/isfield-3.m +%!error isfield (); + +%% test/octave.test/struct/isfield-4.m +%!test +%! s.aaa = 1; +%! s.a = 2; +%! fail ("isfield (s, 'a', 3);", "Invalid call to isfield"); + +%% test/octave.test/struct/isfield-5.m +%!assert (isfield (1, "m") == 0); + +%% test/octave.test/struct/isfield-6.m +%!test +%! s.a = 2; +%! assert (isfield (s, 2) == 0); + +%% test/octave.test/struct/isstruct-1.m +%!assert (!(isstruct (1))) + +%% test/octave.test/struct/isstruct-2.m +%!assert (!(isstruct ([1, 2]))) + +%% test/octave.test/struct/isstruct-3.m +%!assert (!(isstruct ([]))) + +%% test/octave.test/struct/isstruct-4.m +%!assert (!(isstruct ([1, 2; 3, 4]))) + +%% test/octave.test/struct/isstruct-5.m +%!assert (!(isstruct ("t"))) + +%% test/octave.test/struct/isstruct-6.m +%!assert (!(isstruct ("test"))) + +%% test/octave.test/struct/isstruct-7.m +%!assert (!(isstruct (["test"; "ing"]))) + +%!assert (!(isstruct ({1}))) + +%% test/octave.test/struct/isstruct-8.m +%!test +%! s.a = 1; +%! assert (isstruct (s)); + +%% test/octave.test/struct/isstruct-9.m +%!test +%! s.a.b = 1; +%! assert (isstruct (s.a)); + +%% test/octave.test/struct/isstruct-10.m +%!error isstruct (); + +%% test/octave.test/struct/isstruct-11.m +%!test +%! s.a = 1; +%! fail ("isstruct (s, 1)", "Invalid call to isstruct"); + +## increment element of matrix stored in struct array field +%!test +%! a = struct ("c", {[1, 2, 3], [4, 5, 6], [7, 8, 9]}); +%! a(2).c(3)++; +%! assert (a(2).c, [4, 5, 7]); + +## create struct array by assignment to cs-list +%!test +%! [a(1:2).x] = deal (1, 3); +%! assert (a, struct ("x", {1, 3})); +%! assert ({a(1:2).x}, {1, 3}); + +## assign to subrange of struct array field +%!test +%! b = struct ("name", {"a", "b", "c"; "d", "e", "f"}, "value", 100); +%! [b(1:2, [1,3]).name] = deal ("aaa", "ddd", "ccc", "fff"); +%! assert ({b.name}, {"aaa", "ddd", "b", "e", "ccc", "fff"}); + +## index into nested struct arrays +%!test +%! a = struct ("name", {"a", "b", "c"; "d", "e", "f"}, "value", 0); +%! a(2).value = a; +%! assert (a(2).value(2,3).name, "f"); + +## assign to subrange of field in nested struct array +%!test +%! b = struct ("name", {"a", "b", "c"; "d", "e", "f"}, "value", 0); +%! b(3, 1).value = b; +%! [b(3, 1).value(1, [1, 3]).name] = deal ("aaa", "ccc"); +%! assert (size (b), [3, 3]); +%! assert (b(3,1).value(1, 3).name, "ccc"); + +## test 4-dimensional struct array +%!test +%! c(4, 4, 4, 4).name = "a"; +%! c(3, 3, 3, 3).value = 1; +%! assert (c(2,2,2,2), struct ("name", [], "value", [])); + +## assign to subrange of field in 4D struct array +%!test +%! 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); + +## swap elements of struct array +%!test +%! b = struct ("name", {"a", "b", "c"; "d", "e", "f"}, "value", 0); +%! [b([2, 1], [3, 1]).name] = deal (b([1, 2], [1, 2]).name); +%! assert ({b.name}, {"e", "b", "b", "e", "d", "a"}); + +## test internal ordering of struct array fields +%!test +%! 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)); +%! assert ([d{4, 4, 4, 4}, d{1, 2, 3, 4}, d{3, 3, 3, 3}], +%! [3, 2, 1]); + +## test assignment to mixed cs-list of field element subranges +%!test +%! b = struct ("name", {"a", "b", "c"; "d", "e", "f"}, "value", 100); +%! [b(1:2, [1, 3]).name, b(2, 1:3).value] = ... +%! deal (1, 2, 3, 4, "5", "6", "7"); +%! assert ({b.name}, {1, 2, "b", "e", 3, 4}); +%! assert ({b.value}, {100, "5", 100, "6", 100, "7"}); + +%!error +%! [a(1:3).x] = deal ([1, 5], [3, 7], [8, 9]); +%! [a(2:3).x(2)] = deal (10, 11); + +%!error +%! [a(1:3).x] = deal ([1, 5], [3, 7], [8, 9]); +%! a(2:3).x(2); + +%!error id=Octave:index-out-of-bounds +%! a(1).x.x = 1; +%! a(2).x; + +%!error +%! a = struct ("value", {1, 2, 3, 4, 5}); +%! [a(2:4).value] = 1; + +%!error +%! c(4, 4, 4, 4).name = "a"; +%! c(3, 3, 3, 3).value = 1; +%! c([1, 3], 2, :, [3, 4]).value = 1; + +## test lazy copying in structs: nested assignment to self +%!test +%! a.a = 1; +%! a.b = a; +%! a.b.c = a; +%! assert (a.b.c.b, struct ("a", 1)); + +## test lazy copying in structs: indirect nested assignment to self +%!test +%! a.a = 1; +%! a.b = 2; +%! b.c = a; +%! b.d = 3; +%! c.d = b; +%! c.e = 4; +%! a.b = c; +%! a.b.e = a; +%! assert (a.b.e.b.d.c, struct ("a", 1, "b", 2)); + +## test lazy copying in structs: nested assignment via function +%!function aa = do_nest (a); +%! aa = a; +%! aa.b = a; +%!endfunction +%!test +%! a.c = 1; +%! a = do_nest (a); +%! a = do_nest (a); +%! a = do_nest (a); +%! assert (a.b.b.b, struct ("c", 1)); + +## test lazy copying in structs: nested assignment via function +%!function aa = do_nest (a); +%! aa = a; +%! aa.b = a; +%! aa.b.c = aa; +%!endfunction +%!test +%! a.c = 1; +%! a = do_nest (a); +%! a = do_nest (a); +%! a = do_nest (a); +%! assert (a.b.c.b.b.c.b.b.c.b, struct ("c", 1)); + +## test lazy copying in structs: nested assignment on different levels. +%!test +%! a.b = 1; +%! b.c = a; +%! b.d.e = a; +%! b.f.g.h = a; +%! b.i.j.k.l = a; +%! a.m = b; +%! a.m.c.b = a; +%! assert (a.m.c.b.m.i.j.k.l, struct ("b", 1)); + +## test indexed assignment into empty struct array +%!test +%! s = resize (struct (), 3,2); +%! s(3).foo = 42; +%! assert (s(3), struct ("foo", 42)); + +%!error id=Octave:index-out-of-bounds +%! s = resize (struct (),3,2); +%! s(3).foo = 42; +%! s(7); diff -r b8157404614f -r 1af8d21608b7 test/switch.tst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/switch.tst Sat Feb 09 21:35:55 2013 -0500 @@ -0,0 +1,95 @@ +## Copyright (C) 2006-2012 John W. Eaton +## +## This file is part of Octave. +## +## Octave is free software; you can redistribute it and/or modify it +## under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 3 of the License, or (at +## your option) any later version. +## +## Octave is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with Octave; see the file COPYING. If not, see +## . + +%% test/octave.test/switch/switch-1.m +%!test +%! 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 +%!test +%! a = 1; +%! b = 2; +%! c = 3; +%! +%! x = zeros (1, 4); +%! +%! k = 1; +%! +%! for i = 0:3 +%! switch (i) +%! case a +%! x(k) = a; +%! case b +%! x(k) = b; +%! otherwise +%! x(k) = c; +%! endswitch +%! k++; +%! endfor +%! +%! assert (all (x == [3, 1, 2, 3])); + +%% test/octave.test/switch/switch-3.m +%!test +%! a = 1; +%! b = 2; +%! c = 3; +%! +%! x = zeros (1, 4); +%! +%! k = 1; +%! +%! for i = 0:3 +%! switch (i) +%! case a +%! x(k) = a; +%! endswitch +%! k++; +%! endfor +%! +%! assert (all (x == [0, 1, 0, 0])); + +%!test +%! a = 1; +%! +%! switch 1 +%! otherwise +%! a = 2; +%! endswitch +%! +%! assert (a == 2); + + +%% test/octave.test/switch/switch-4.m +%!error eval ("switch endswitch") + +%% test/octave.test/switch/switch-5.m +%!error eval ("switch case endswitch") + +%% test/octave.test/switch/switch-6.m +%!error eval ("switch 1 default 1; endswitch") + diff -r b8157404614f -r 1af8d21608b7 test/system.tst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/system.tst Sat Feb 09 21:35:55 2013 -0500 @@ -0,0 +1,489 @@ +## Copyright (C) 2006-2012 John W. Eaton +## +## This file is part of Octave. +## +## Octave is free software; you can redistribute it and/or modify it +## under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 3 of the License, or (at +## your option) any later version. +## +## Octave is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with Octave; see the file COPYING. If not, see +## . + +%% test/octave.test/system/cputime-1.m +%!test +%! [t1, u1, s1] = cputime (); +%! for i = 1:200 +%! sin (i); +%! endfor +%! [t2, u2, s2] = cputime (); +%! assert (t1, u1 + s1); +%! assert (t2 == u2 + s2); +%! assert (t2 >= t1); +%! assert (u2 >= u2); +%! assert (s2 >= s2); +%!#assert (t1 == u1 + s1 && t2 == u2 + s2 && t2 >= t1 && u2 >= u2 && s2 >= s2); + +%% test/octave.test/system/tic-toc-1.m +%!test +%! tic (); +%! sleep (2); +%! assert (toc () > 0); + +%% test/octave.test/system/pause-1.m +%!test +%! pause (0); +%! __printf_assert__ ("ok\n"); +%! assert (__prog_output_assert__ ("ok")); + +%% test/octave.test/system/pause-2.m +%!error pause (1, 2) + +%% test/octave.test/system/sleep-1.m +%!test +%! sleep (0); +%! __printf_assert__ ("ok\n"); +%! assert (__prog_output_assert__ ("ok")); + +%% test/octave.test/system/sleep-2.m +%!error sleep () + +%% test/octave.test/system/sleep-3.m +%!error sleep (1, 2) + +%% test/octave.test/system/usleep-1.m +%!test +%! usleep (0); +%! __printf_assert__ ("ok\n"); +%! assert (__prog_output_assert__ ("ok")); + +%% test/octave.test/system/usleep-2.m +%!error usleep () + +%% test/octave.test/system/usleep-3.m +%!error usleep (1, 2) + +%% test/octave.test/system/rename-1.m +%!test +%! from = tmpnam (); +%! to = tmpnam (); +%! id = fopen (from, "wb"); +%! if (id > 0 && fclose (id) == 0) +%! [s, e] = stat (from); +%! if (! e) +%! if (rename (from, to) == 0) +%! [s, e] = stat (from); +%! if (e < 0) +%! [s, e] = stat (to); +%! assert (e == 0); +%! unlink (to); +%! endif +%! endif +%! endif +%! endif + +%% test/octave.test/system/rename-2.m +%!error rename () + +%% test/octave.test/system/rename-3.m +%!error rename ("foo", "bar", 1) + +%% test/octave.test/system/unlink-1.m +%!test +%! nm = tmpnam (); +%! if ((id = fopen (nm, "wb")) > 0) +%! [s, err] = stat (nm); +%! if (! err && fclose (id) == 0 && unlink (nm) == 0) +%! [s, err] = stat (nm); +%! assert (err < 0); +%! endif +%! endif + +%% test/octave.test/system/unlink-2.m +%!error unlink () + +%% test/octave.test/system/unlink-3.m +%!error unlink ("foo", 1) + +%% test/octave.test/system/readdir-1.m +%!test +%! [files, status, msg] = readdir (filesep); +%! assert (iscell (files) && status == 0 && strcmp (msg, "")); + +%% test/octave.test/system/readdir-2.m +%!error readdir () + +%% test/octave.test/system/readdir-3.m +%!error readdir ("foo", 1) + +%% test/octave.test/system/mk-rm-dir-1.m +%!test +%! nm = tmpnam (); +%! e1 = mkdir (nm); +%! [s2, e2] = stat (nm); +%! e3 = rmdir (nm); +%! [s4, e4] = stat (nm); +%! assert ((e1 && strcmp (s2.modestr(1), "d") && e3 && e4 < 0)); + +%% test/octave.test/system/mkdir-1.m +%!error mkdir () + +%% test/octave.test/system/mkdir-2.m +%!error mkdir ("foo", 1, 2) + +%% test/octave.test/system/rmdir-1.m +%!error rmdir () + +%% test/octave.test/system/rmdir-2.m +%!test +%! crr = confirm_recursive_rmdir (); +%! confirm_recursive_rmdir (0); +%! assert (!rmdir ("foo", "s")); +%! confirm_recursive_rmdir (crr); + +%% test/octave.test/system/umask-1.m +%!test +%! orig_umask = umask (0); +%! nm = tmpnam (); +%! id = fopen (nm, "wb"); +%! 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 +%! umask (orig_umask); + +%% test/octave.test/system/umask-2.m +%!error umask () + +%% test/octave.test/system/umask-3.m +%!error umask (1, 2) + +%% test/octave.test/system/stat-1.m +%!test +%! [s, err, msg] = stat (filesep); +%! assert ((err == 0 +%! && isstruct (s) +%! && isfield (s, "dev") +%! && isfield (s, "ino") +%! && isfield (s, "modestr") +%! && isfield (s, "nlink") +%! && isfield (s, "uid") +%! && isfield (s, "gid") +%! && isfield (s, "size") +%! && isfield (s, "atime") +%! && isfield (s, "mtime") +%! && isfield (s, "ctime") +%! && ischar (msg))); + +%% test/octave.test/system/stat-2.m +%!error stat () + +%% test/octave.test/system/stat-3.m +%!error stat ("foo", 1) + +%% test/octave.test/system/lstat-1.m +%!test +%! [s, err, msg] = lstat (filesep); +%! assert ((err == 0 +%! && isstruct (s) +%! && isfield (s, "dev") +%! && isfield (s, "ino") +%! && isfield (s, "modestr") +%! && isfield (s, "nlink") +%! && isfield (s, "uid") +%! && isfield (s, "gid") +%! && isfield (s, "size") +%! && isfield (s, "atime") +%! && isfield (s, "mtime") +%! && isfield (s, "ctime") +%! && ischar (msg))); + +%% test/octave.test/system/lstat-2.m +%!error lstat () + +%% test/octave.test/system/lstat-3.m +%!error lstat ("foo", 1) + +%% test/octave.test/system/glob-1.m +%!assert (iscell (glob ([filesep "*"]))) + +%% test/octave.test/system/glob-2.m +%!error glob () + +%% test/octave.test/system/glob-3.m +%!error glob ("foo", 1) + +%% test/octave.test/system/fnmatch-1.m +%!test +%! string_fill_char = setstr (0); +%! assert ((fnmatch ("a*a", {"aba"; "xxxba"; "aa"}) == [1; 0; 1] +%! && fnmatch ({"a*a"; "b*b"}, "bob") +%! && fnmatch ("x[0-5]*", {"x1"; "x6"}) == [1; 0] +%! && fnmatch ("x[0-5]*", {"x1"; "x6"; "x001"}) == [1; 0; 1] +%! && fnmatch ("x???y", {"xabcy"; "xy"}) == [1; 0])); + +%% test/octave.test/system/fnmatch-2.m +%!error fnmatch () + +%% test/octave.test/system/fnmatch-3.m +%!error fnmatch ("foo", "bar", 3) + +%% test/octave.test/system/file_in_path-1.m +%!assert (ischar (file_in_path (path (), "date.m"))) + +%% test/octave.test/system/file_in_path-2.m +%!error file_in_path ("foo", "bar", 1) + +%% test/octave.test/system/file_in_path-3.m +%!error file_in_path () + +%% test/octave.test/system/file_in_path-4.m +%!error file_in_path ("foo", "bar", "baz", "ooka") + +%% test/octave.test/system/tilde_expand-1.m +%!testif HAVE_GETPWUID +%! x = getpwuid (getuid ()); +%! assert ((strcmp (x.dir, tilde_expand ("~")) +%! && strcmp (x.dir, tilde_expand (sprintf ("~%s", x.name))) +%! && strcmp ("foobar", tilde_expand ("foobar")))); + +%% test/octave.test/system/tilde_expand-2.m +%!error tilde_expand () + +%% test/octave.test/system/tilde_expand-3.m +%!error tilde_expand ("str", 2) + +%% test/octave.test/system/getpgrp-1.m +%!testif HAVE_GETPGRP +%! assert (getpgrp () > 0); + +%% test/octave.test/system/getpgrp-2.m +%!error <... getpgrp> getpgrp (1) + +%% test/octave.test/system/getpid-1.m +%!assert (getpid () > 0) + +%% test/octave.test/system/getpid-2.m +%!error <... getpid> getpid (1) + +%% test/octave.test/system/getppid-1.m +%!testif HAVE_GETPPID +%! assert (getppid () > 0); + +%% test/octave.test/system/getppid-2.m +%!error <... getppid> getppid (1) + +%% test/octave.test/system/geteuid-1.m +%!assert (geteuid () >= 0) + +%% test/octave.test/system/geteuid-2.m +%!error <... geteuid> geteuid (1) + +%% test/octave.test/system/getuid-1.m +%!assert (getuid () >= 0) + +%% test/octave.test/system/getuid-2.m +%!error <... getuid> getuid (1) + +%% test/octave.test/system/getegid-1.m +%!assert (getegid () >= 0) + +%% test/octave.test/system/getegid-2.m +%!error <... getegid> getegid (1) + +%% test/octave.test/system/getgid-1.m +%!assert (getgid () >= 0) + +%% test/octave.test/system/getgid-2.m +%!error <... getgid> getgid (1) + +%% test/octave.test/system/getenv-1.m +%!assert (getenv ("HOME"), tilde_expand ("~")) + +%% test/octave.test/system/getenv-2.m +%!error getenv () + +%% test/octave.test/system/getenv-3.m +%!error getenv ("foo", 1) + +%% test/octave.test/system/getenv-4.m +%!test +%! wns = warning ("query", "Octave:num-to-str"); +%! warning ("on", "Octave:num-to-str"); +%! fail ("getenv (1)", "warning"); +%! warning (wns.state, "Octave:num-to-str"); + +%% test/octave.test/system/putenv-1.m +%!test +%! putenv ("foobar", "baz"); +%! assert (getenv ("foobar"), "baz"); + +%% test/octave.test/system/putenv-2.m +%!error putenv () + +%% test/octave.test/system/putenv-3.m +%!error putenv ("foo", "bar", 1) + +%% test/octave.test/system/putenv-4.m +%!test +%! wns = warning ("query", "Octave:num-to-str"); +%! warning ("on", "Octave:num-to-str"); +%! fail ("putenv (1, 2)","warning"); +%! warning (wns.state, "Octave:num-to-str"); + +%% test/octave.test/system/cd-1.m +%!test +%! xdir = pwd (); +%! cd / +%! d1 = pwd (); +%! cd (xdir); +%! if (ispc () && ! isunix ()) +%! # should be a drive letter +%! assert (length (d1), 3); +%! assert (d1(2), ":"); +%! assert (d1(3), "\\"); +%! else +%! assert ("/", d1); +%! endif +%! assert (pwd(), xdir); + +%% test/octave.test/system/cd-2.m +%!error cd (1) + +%% test/octave.test/system/pwd-1.m +%!assert (ischar (pwd ())) + +%% test/octave.test/system/getpwent-1.m +%!testif HAVE_GETPWENT +%! s = getpwent (); +%! endpwent (); +%! assert ((isstruct (s) +%! && isfield (s, "name") +%! && isfield (s, "passwd") +%! && isfield (s, "uid") +%! && isfield (s, "gid") +%! && isfield (s, "gecos") +%! && isfield (s, "dir") +%! && isfield (s, "shell"))); + +%% test/octave.test/system/getpwent-2.m +%!error getpwent (1) + +%% test/octave.test/system/getpwuid-1.m +%!testif HAVE_GETPWUID +%! x = getpwent (); +%! y = getpwuid (x.uid); +%! endpwent (); +%! assert (strcmp (x.name, y.name) && x.uid == y.uid && x.gid == y.gid); + +%% test/octave.test/system/getpwuid-2.m +%!error getpwuid () + +%% test/octave.test/system/getpwuid-3.m +%!error getpwuid (1, 2) + +%% test/octave.test/system/getpwnam-1.m +%!testif HAVE_GETPWNAM +%! x = getpwent (); +%! y = getpwnam (x.name); +%! endpwent (); +%! assert (strcmp (x.name, y.name) && x.uid == y.uid && x.gid == y.gid); + +%% test/octave.test/system/getpwnam-2.m +%!error getpwnam () + +%% test/octave.test/system/getpwnam-3.m +%!error getpwnam ("foo", 1) + +%% test/octave.test/system/setpwent-1.m +%!testif HAVE_SETPWENT +%! x = getpwent (); +%! setpwent (); +%! y = getpwent (); +%! endpwent (); +%! assert (strcmp (x.name, y.name) && x.uid == y.uid && x.gid == y.gid); + +%% test/octave.test/system/setpwent-2.m +%!error setpwent (1) + +%% test/octave.test/system/endpwent-1.m +%!error endpwent (1) + +%% test/octave.test/system/getgrent-1.m +%!testif HAVE_GETGRENT +%! x = getgrent (); +%! endgrent (); +%! assert ((isstruct (x) +%! && isfield (x, "name") +%! && isfield (x, "passwd") +%! && isfield (x, "gid") +%! && isfield (x, "mem"))); + +%% test/octave.test/system/getgrent-2.m +%!error getgrent (1) + +%% test/octave.test/system/getgrgid-1.m +%!testif HAVE_GETGRGID +%! x = getgrent (); +%! y = getgrgid (x.gid); +%! endgrent (); +%! assert (strcmp (x.name, y.name) && x.gid == y.gid); + +%% test/octave.test/system/getgrgid-2.m +%!error getgrgid () + +%% test/octave.test/system/getgrgid-3.m +%!error getgrgid (1, 2) + +%% test/octave.test/system/getgrnam-1.m +%!testif HAVE_GETGRNAM +%! x = getgrent (); +%! y = getgrnam (x.name); +%! endgrent (); +%! assert (strcmp (x.name, y.name) && x.gid == y.gid); + +%% test/octave.test/system/getgrnam-2.m +%!error getgrnam () + +%% test/octave.test/system/getgrnam-3.m +%!error getgrnam ("foo", 1) + +%% test/octave.test/system/setgrent-1.m +%!testif HAVE_SETGRENT +%! x = getgrent (); +%! setgrent (); +%! y = getgrent (); +%! endgrent (); +%! assert (strcmp (x.name, y.name) && x.gid == y.gid); + +%% test/octave.test/system/setgrent-2.m +%!error setgrent (1) + +%% test/octave.test/system/endgrent-1.m +%!error endgrent (1) + +%% test/octave.test/system/isieee-1.m +%!assert (isieee () == 1 || isieee () == 0) + +%% test/octave.test/system/octave_config_info-1.m +%!assert (isstruct (octave_config_info ())) + +%% test/octave.test/system/getrusage-1.m +%!assert (isstruct (getrusage ())) + diff -r b8157404614f -r 1af8d21608b7 test/test_args.m --- a/test/test_args.m Sat Feb 09 20:05:40 2013 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,236 +0,0 @@ -## Copyright (C) 2006-2012 John W. Eaton -## -## This file is part of Octave. -## -## Octave is free software; you can redistribute it and/or modify it -## under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 3 of the License, or (at -## your option) any later version. -## -## Octave is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with Octave; see the file COPYING. If not, see -## . - -######################################## -## No inputs or no outputs - -## no input or output arguments -%!function f () -%! assert (nargin, 0); -%! assert (nargout, 0); -%!endfunction -%!test -%! f; - -## one input with two possible inputs -%!function f (x, y) -%! assert (nargin, 1); -%! assert (nargout, 0); -%!endfunction -%!test -%! f (1); - -## no inputs, one of multiple outputs -%!function [x, y] = f () -%! assert (nargin, 0); -%! assert (nargout, 1); -%! x = 2; -%!endfunction -%!test -%! assert (f (), 2); - -## one of multiple inputs, one of multiple outputs -%!function [x, y] = f (a, b) -%! assert (nargin, 1); -%! assert (nargout, 1); -%! x = a; -%!endfunction -%!test -%! assert (f (1), 1); - -######################################## -## Varargin, varargout - -## varargin and varargout with no inputs or outputs -%!function [varargout] = f (varargin) -%! assert (nargin, 0); -%! assert (nargout, 0); -%!endfunction -%!test -%! f; - -## varargin and varargout with one input -%!function [varargout] = f (x, varargin) -%! assert (nargin, 1); -%! assert (nargout, 0); -%!endfunction -%!test -%! f (1); - -## varargin and varargout with one output -%!function [x, varargout] = f (varargin) -%! assert (nargin, 0); -%! assert (nargout, 1); -%! x = 2; -%!endfunction -%!test -%! assert (f (), 2); - -## varargin and varargout with one input and output -%!function [varargout] = f (varargin) -%! assert (nargin, 1); -%! assert (nargout, 1); -%! varargout{1} = varargin{1}; -%!endfunction -%!test -%! assert (f (1), 1); - -## multiple inputs, multiple outputs, but not all of either -## WARNING: The original test did not assign the outputs, it just -## requested them, and I think that is supposed to be an error. It also -## still has a non-assigned output argument. -%!function [x, y, z] = f (a, b, c, d, e) -%! assert (nargin, 4); -%! assert (nargout, 2); -%! x = a; -%! y = b; -%!endfunction -%!test -%! [s, t] = f (1, 2, 3, 4); -%! assert ([s t], [1 2]); - -## Fully used varargin and varargout -%!function [varargout] = f (varargin) -%! assert (nargin, 3); -%! assert (nargout, 4); -%! varargout{1} = varargin{1}; -%! varargout{2} = varargin{2}; -%! varargout{3} = varargin{3}; -%! varargout{4} = 4; -%!endfunction -%!test -%! [s, t, u, v] = f (1, 2, 3); -%! assert ([s t u v], [1 2 3 4]); - -## Test default arguments -## numeric -%!function f (x = 0) -%! assert (x, 0); -%!endfunction -%!test -%! f() - -## numeric vector (spaces) -%!function f (x = [0 1 2]) -%! assert (x, [0 1 2]); -%!endfunction -%!test -%! f() - -## numeric vector (range) -%!function f (x = 1:3) -%! assert (x, 1:3); -%!endfunction -%!test -%! f() - -## numeric vector (commas) -%!function f (x = [0,1,2]) -%! assert (x, [0 1 2]); -%!endfunction -%!test -%! f() - -## numeric vector (commas and spaces) -%!function f (x = [0, 1, 2]) -%! assert (x, [0 1 2]); -%!endfunction -%!test -%! f() - -## numeric matrix -%!function f (x = [0, 1, 2;3, 4, 5]) -%! assert (x, [0 1 2;3 4 5]); -%!endfunction -%!test -%! f() - -## empty cell -%!function f (x = {}) -%! assert (x, {}); -%!endfunction -%!test -%! f() - -## full cell -%!function f (x = {1}) -%! assert (x, {1}); -%!endfunction -%!test -%! 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() - -## struct -%!function f (x = struct("a", 3)) -%! assert (x, struct ("a", 3)); -%!endfunction -%!test -%! f() - -## char (double quotes) -%!function f (x = "a") -%! assert (x, "a"); -%!endfunction -%!test -%! f() - -## char (single quotes) -%!function f (x = 'a') -%! assert (x, "a"); -%!endfunction -%!test -%! f() - -## char (string, double quotes) -%!function f (x = "abc123") -%! assert (x, "abc123"); -%!endfunction -%!test -%! f() - -## char (string, double quotes, punctuation) -%!function f (x = "abc123`1234567890-=~!@#$%^&*()_+[]{}|;':\",./<>?\\") -%! assert (x, "abc123`1234567890-=~!@#$%^&*()_+[]{}|;':\",./<>?\\"); -%!endfunction -%!test -%! f() - -## Function handle (builtin) -%!function f (x = @sin) -%! finfo = functions (x); -%! fname = finfo.function; -%! assert (isa (x, "function_handle") && strcmp (fname, "sin")); -%!endfunction -%!test -%! f() - -## Function handle (anonymous) -%!function f (x = @(x) x.^2) -%! finfo = functions (x); -%! ftype = finfo.type; -%! assert (isa (x, "function_handle") && strcmp (ftype, "anonymous")); -%!endfunction -%!test -%! f() - diff -r b8157404614f -r 1af8d21608b7 test/test_bug_31371.m --- a/test/test_bug_31371.m Sat Feb 09 20:05:40 2013 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -%!test -%! % Work around MATLAB bug where f(x)(y) is invalid syntax -%! % (This bug does not apply to Octave) -%! -%! 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 -r b8157404614f -r 1af8d21608b7 test/test_diag_perm.m --- a/test/test_diag_perm.m Sat Feb 09 20:05:40 2013 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,265 +0,0 @@ -## Copyright (C) 2009-2012 E. Jason Riedy -## -## This file is part of Octave. -## -## Octave is free software; you can redistribute it and/or modify it -## under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 3 of the License, or (at -## your option) any later version. -## -## Octave is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with Octave; see the file COPYING. If not, see -## . - -######################################## -## Permutation matrices - -## row permutation -%!test -%! n = 5; -%! A = rand (n); -%! perm = randperm (n); -%! Prow = eye (n) (perm, :); -%! assert (A(perm, :), Prow * A); -%! invperm(perm) = 1:n; -%! assert (Prow \ A, A(invperm, :)); -%! assert (Prow' * A, A(invperm, :)); - -## column permutation -%!test -%! n = 7; -%! A = rand (n); -%! perm = randperm (n); -%! Pcol = eye (n) (:, perm); -%! assert (A(:, perm), A * Pcol); -%! invperm(perm) = 1:n; -%! assert (A / Pcol, A(:, invperm)); -%! assert (A * Pcol.', A(:, invperm)); - -## fall back to a matrix in addition -%!test -%! n = 4; -%! P1 = eye (n) (:, randperm (n)); -%! A = zeros (n) + P1; -%! assert (sum (A), full (ones (1, n))); -%! assert (sum (A, 2), full (ones (n, 1))); - -## preserve dense matrix structure -%!test -%! n = 7; -%! Pc = eye (n) (:, randperm (n)); -%! Pr = eye (n) (randperm (n), :); -%! assert (typeinfo (rand (n) * Pc), "matrix"); -%! assert (typeinfo (Pr * rand (n)), "matrix"); - -## preserve sparse matrix structure -%!test -%! n = 7; -%! Pc = eye (n) (:, randperm (n)); -%! Ac = sprand (n-3, n, .5) + I () * sprand (n-3, n, .5); -%! Pr = eye (n) (randperm (n), :); -%! Ar = sprand (n, n+2, .5); -%! assert (typeinfo (Ac * Pc), "sparse complex matrix"); -%! assert (full (Ac * Pc), full (Ac) * Pc); -%! assert (full (Ac / Pc), full (Ac) / Pc); -%! assert (typeinfo (Pr * Ar), "sparse matrix"); -%! assert (full (Pr * Ar), Pr * full (Ar)); -%! assert (full (Pr \ Ar), Pr \ full (Ar)); - -## structure rules for 1x1 dense / scalar and 1x1 perm -%!test -%! n = 7; -%! P1 = eye (1) (:, [1]); -%! A1 = 1; -%! P = eye (n) (:, randperm (n)); -%! A = rand (n-3, n, .5); -%! assert (typeinfo (A * P1), "matrix"); -%! assert (full (A * P1), full (A) * P1); -%! assert (typeinfo (P1 * A), "matrix"); -%! assert (full (P1 * A), P1 * full (A)); -%! assert (typeinfo (A1 * P), "matrix"); -%! assert (full (A1 * P), full (A1) * P); -%! assert (typeinfo (P * A1), "matrix"); -%! assert (full (P * A1), P * full (A1)); - -## structure rules for 1x1 sparse and 1x1 perm -%!test -%! n = 7; -%! P1 = eye (1) (:, [1]); -%! A1 = sparse (1, 1, 2); -%! P = eye (n) (:, randperm (n)); -%! A = sprand (n-3, n, .5); -%! assert (typeinfo (A * P1), "sparse matrix"); -%! assert (full (A * P1), full (A) * P1); -%! assert (typeinfo (P1 * A), "sparse matrix"); -%! assert (full (P1 * A), P1 * full (A)); -%! assert (typeinfo (A1 * P), "sparse matrix"); -%! assert (full (A1 * P), full (A1) * P); -%! assert (typeinfo (P * A1), "sparse matrix"); -%! assert (full (P * A1), P * full (A1)); - -## permuting a matrix with exceptional values does not introduce new ones. -%!test -%! n = 5; -%! pc = randperm (n); -%! Pc = eye (n) (:, pc); -%! pr = randperm (n); -%! Pr = eye (n) (pr, :); -%! A = rand (n); -%! A(n, n-2) = NaN; -%! A(3, 1) = Inf; -%! assert (Pr * A * Pc, A(pr, pc)); - -## conversion to sparse form -%!test -%! n = 7; -%! P = eye (n) (:, randperm (n)); -%! sP = sparse (P); -%! assert (full (sP), full (P)); -%! assert (size (find (sP), 1), n); -%! [I, J, V] = find (sP); -%! assert (all (V == 1)); - -######################################## -## Diagonal matrices - -## square row scaling -%!test -%! m = 7; -%! n = 11; -%! A = rand (m, n); -%! scalefact = rand (m, 1); -%! Dr = diag (scalefact); -%! assert (Dr * A, repmat (scalefact, 1, n) .* A); -%! assert (Dr \ A, A ./ repmat (scalefact, 1, n)); -%! scalefact(m-1) = Inf; -%! Dr(m-1, m-1) = 0; -%! assert (Dr \ A, A ./ repmat (scalefact, 1, n)); - -## square column scaling -%!test -%! m = 13; -%! n = 11; -%! A = rand (m, n); -%! scalefact = rand (1, n); -%! Dc = diag (scalefact); -%! assert (A * Dc, repmat (scalefact, m, 1) .* A); -%! assert (A / Dc, A ./ repmat (scalefact, m, 1)); -%! scalefact(n-1) = Inf; -%! Dc(n-1, n-1) = 0; -%! assert (A / Dc, A ./ repmat (scalefact, m, 1)); - -## arithmetic -%!test -%! m = 9; -%! n = 7; -%! mn = min (m, n); -%! d1 = rand (mn, 1) + I () * rand (mn, 1); -%! D1 = diag (d1, m, n); -%! d2 = rand (mn, 1); -%! D2 = diag (d2, m, n); -%! D1D2 = D1 + D2; -%! assert (typeinfo (D1D2), "complex diagonal matrix"); -%! assert (diag (D1D2), d1 + d2); -%! D1D2 = D2.' * D1; -%! assert (typeinfo (D1D2), "complex diagonal matrix"); -%! assert (diag (D1D2), d1 .* d2); - -## slicing -%!test -%! m = 13; -%! n = 6; -%! mn = min (m, n); -%! d = rand (mn, 1); -%! D = diag (d, m, n); -%! Dslice = D (1:(m-3), 1:(n-2)); -%! assert (typeinfo (Dslice), "diagonal matrix"); - -## preserve dense matrix structure when scaling -%!assert (typeinfo (rand (8) * (3 * eye (8))), "matrix"); -%!assert (typeinfo ((3 * eye (8)) * rand (8)), "matrix"); - -## preserve sparse matrix structure when scaling -%!assert (typeinfo (sprand (8, 8, .5) * (3 * eye (8))), "sparse matrix"); -%!assert (typeinfo (sprand (8, 8, .5) * (3 * eye (8))'), "sparse matrix"); -%!assert (typeinfo (((3 + 2 * I ()) * eye (8)) * sprand (8, 8, .5)), "sparse complex matrix"); -%!assert (typeinfo (((3 + 2 * I ()) * eye (8))' * sprand (8, 8, .5)), "sparse complex matrix"); -%!assert (typeinfo (sprand (8, 8, .5) * ((3 + 2 * I ()) * eye (8)).'), "sparse complex matrix"); - -## scaling a matrix with exceptional values does not introduce new ones. -%!test -%! n = 6; -%! dr = rand (n, 1); -%! Dr = diag (dr); -%! dc = rand (1, n); -%! Dc = diag (dc); -%! A = rand (n); -%! A(n, n-2) = NaN; -%! A(4, 1) = Inf; -%! assert (Dr * A * Dc, A .* kron (dr, dc), eps); - -## sparse inverse row scaling with a zero factor -%!test -%! n = 8; -%! A = sprand (n, n, .5); -%! scalefact = rand (n, 1); -%! Dr = diag (scalefact); -%! scalefact(n-1) = Inf; -%! Dr(n-1, n-1) = 0; -%! assert (full (Dr \ A), full (A) ./ repmat (scalefact, 1, n)); - -## narrow sparse inverse row scaling -%!test -%! n = 8; -%! A = sprand (n, n, .5); -%! scalefact = rand (n-2, 1); -%! Dr = diag (scalefact, n, n-2); -%! assert (full (Dr \ A), Dr \ full(A)); - -## sparse inverse column scaling with a zero factor -%!test -%! n = 11; -%! A = sprand (n, n, .5); -%! scalefact = rand (1, n); -%! Dc = diag (scalefact); -%! scalefact(n-1) = Inf; -%! Dc(n-1, n-1) = 0; -%! assert (full (A / Dc), full(A) / Dc); - -## short sparse inverse column scaling -%!test -%! n = 7; -%! A = sprand (n, n, .5); -%! scalefact = rand (1, n-2) + I () * rand(1, n-2); -%! Dc = diag (scalefact, n-2, n); -%! assert (full (A / Dc), full(A) / Dc); - -## adding sparse and diagonal stays sparse -%!test -%! n = 9; -%! A = sprand (n, n, .5); -%! D = 2 * eye (n); -%! assert (typeinfo (A + D), "sparse matrix"); -%! assert (typeinfo (A - D), "sparse matrix"); -%! D = D * I () + D; -%! assert (typeinfo (A - D), "sparse complex matrix"); -%! A = A * I () + A; -%! assert (typeinfo (D - A), "sparse complex matrix"); - -## adding sparse and diagonal stays sparse -%!test -%! n = 9; -%! A = sprand (n, n, .5); -%! D = 2 * eye (n); -%! assert (full (A + D), full (A) + D); -%! assert (full (A - D), full (A) - D); -%! D = D * I () + D; -%! assert (full (D + A), D + full (A)); -%! A = A * I () + A; -%! A(6, 4) = nan (); -%! assert (full (D - A), D - full (A)); diff -r b8157404614f -r 1af8d21608b7 test/test_error.m --- a/test/test_error.m Sat Feb 09 20:05:40 2013 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,93 +0,0 @@ -## Copyright (C) 2006-2012 John W. Eaton -## -## This file is part of Octave. -## -## Octave is free software; you can redistribute it and/or modify it -## under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 3 of the License, or (at -## your option) any later version. -## -## Octave is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with Octave; see the file COPYING. If not, see -## . - -## Test %!error usage - -%% test/octave.test/error/error-1.m -%!function g () -%! error ("foo"); -%!endfunction -%!function f () -%! g (); -%!endfunction -%!error f () - -%% test/octave.test/error/error-2.m -%!function g () -%! error ("foo\n"); -%!endfunction -%!function f () -%! g -%!endfunction -%!error f () - -%% test/octave.test/error/error-3.m -%!error error () - -%% test/octave.test/error/error-4.m -%!error error ("foo\n") - -## Test %!warning usage - -%% test/octave.test/error/warning-1.m -%!function g () -%! warning ("foo"); -%!endfunction -%!function f () -%! g; -%!endfunction -%!warning f () - -%% test/octave.test/error/warning-2.m -%!test -%! st.identifier = "backtrace"; -%! ws = warning ("query", "backtrace"); -%! warning ("on", "backtrace"); -%! st.state = "on"; -%! assert(warning ("query", "backtrace"), st); -%! warning ("off", "backtrace"); -%! st.state = "off"; -%! assert(warning ("query", "backtrace"), st); -%! warning (ws.state, "backtrace"); - -## Test usage() function - -%% test/octave.test/error/usage-1.m -%!function g () -%! usage ("foo"); -%!endfunction -%!function f () -%! g (); -%!endfunction -%!error f () - -%% test/octave.test/error/usage-2.m -%!function g () -%! usage ("foo"); -%!endfunction -%!function f () -%! g -%!endfunction -%!error f () - -%% test/octave.test/error/usage-3.m -%!error usage () - -%% test/octave.test/error/usage-4.m -%!error usage ("foo\n") - diff -r b8157404614f -r 1af8d21608b7 test/test_eval-catch.m --- a/test/test_eval-catch.m Sat Feb 09 20:05:40 2013 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,73 +0,0 @@ -## Copyright (C) 2006-2012 John W. Eaton -## -## This file is part of Octave. -## -## Octave is free software; you can redistribute it and/or modify it -## under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 3 of the License, or (at -## your option) any later version. -## -## Octave is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with Octave; see the file COPYING. If not, see -## . - -%% test/octave.test/eval-catch/eval-catch-1.m -%!test -%! eval ("clear a; a;", ""); - -%% test/octave.test/eval-catch/eval-catch-2.m -%!test -%! eval ("", "error ('Should not get here');"); - -%% test/octave.test/eval-catch/eval-catch-3.m -%!test -%! eval ("clear a; a; x = 0;", "x = 1;"); -%! assert (x, 1); - -%% test/octave.test/eval-catch/eval-catch-5.m -%!test -%! eval ("clear a; a; str = '';", "str=lasterr;"); -%! assert (lasterr()(1:13), "'a' undefined"); -%! assert (str(1:13), "'a' undefined"); - -%% test/octave.test/eval-catch/eval-catch-6.m -%!test -%! eval ("error ('user-defined error'); str = '';", "str = lasterr;"); -%! assert (lasterr()(1:18), "user-defined error"); -%! assert (str(1:18), "user-defined error"); - -%% test/octave.test/eval-catch/eval-catch-7.m -%!function ms = mangle (s) -%! ## Wrap angle brackets around S. -%! ms = cstrcat ("<", s, ">"); -%!endfunction -%!test -%! eval ("clear a; a; str='';", "str = mangle (lasterr);"); -%! assert (mangle(lasterr)(1:14), "<'a' undefined"); -%! assert (str(1:14), "<'a' undefined"); - -%% test/octave.test/eval-catch/eval-catch-8.m -%!test -%! eval ("eval (\"clear a; a;str1='';\", \"str1=lasterr;\"); clear b; b; str2='';", -%! "str2 = lasterr;"); -%! assert (str1(1:13), "'a' undefined"); -%! assert (str2(1:13), "'b' undefined"); - -%% test/octave.test/eval-catch/eval-catch-9.m -%!test -%! eval ("clear a; a; str1='';", -%! "eval (\"clear b; b; str2='';\", \"str2=lasterr;\"); str1=lasterr;"); -%! assert (str1(1:13), "'b' undefined"); -%! assert (str2(1:13), "'b' undefined"); - -%% test/octave.test/eval-catch/eval-catch-10.m -%!test -%! eval ("eval (\"clear a; a; str='';\",\"error (cstrcat (\\\"rethrow: \\\", lasterr));str='';\");", -%! "str=lasterr;"); -%! assert (str(1:22), "rethrow: 'a' undefined"); - diff -r b8157404614f -r 1af8d21608b7 test/test_for.m --- a/test/test_for.m Sat Feb 09 20:05:40 2013 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,111 +0,0 @@ -## Copyright (C) 2006-2012 John W. Eaton -## -## This file is part of Octave. -## -## Octave is free software; you can redistribute it and/or modify it -## under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 3 of the License, or (at -## your option) any later version. -## -## Octave is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with Octave; see the file COPYING. If not, see -## . - -%% test/octave.test/for/for-1.m -%!test -%! for i = 1 -%! __printf_assert__ ("%d", i); -%! end -%! __printf_assert__ ("\n"); -%! assert (__prog_output_assert__ ("1")); - -%% test/octave.test/for/for-2.m -%!test -%! for i = 1:4 -%! __printf_assert__ ("%d", i); -%! endfor -%! __printf_assert__ ("\n"); -%! assert (__prog_output_assert__ ("1234")); - -%% test/octave.test/for/for-3.m -%!test -%! for i = [1,2,3,4] -%! __printf_assert__ ("%d", i); -%! endfor -%! __printf_assert__ ("\n"); -%! assert (__prog_output_assert__ ("1234")); - -%% test/octave.test/for/for-4.m -%!test -%! for i = [1,2;3,4] -%! __printf_assert__ ("%d", i(1,1)); -%! __printf_assert__ ("%d", i(2,1)); -%! endfor -%! __printf_assert__ ("\n"); -%! assert (__prog_output_assert__ ("1324")); - -%% test/octave.test/for/for-5.m -%!test -%! for i = I -%! __printf_assert__ ("%d", imag (i)); -%! endfor -%! __printf_assert__ ("\n"); -%! assert (__prog_output_assert__ ("1")); - -%% test/octave.test/for/for-6.m -%!test -%! for i = [1,2,3,4]*I -%! __printf_assert__ ("%d", imag (i)); -%! endfor -%! __printf_assert__ ("\n"); -%! assert (__prog_output_assert__ ("1234")); - -%% test/octave.test/for/for-7.m -%!test -%! for i = [1,2;3,4]*I -%! __printf_assert__ ("%d", imag (i(1,1))); -%! __printf_assert__ ("%d", imag (i(2,1))); -%! endfor -%! __printf_assert__ ("\n"); -%! assert (__prog_output_assert__ ("1324")); - -%% test/octave.test/for/for-8.m -%!test -%! for i = [1,2,3,4] -%! if (i > 2) -%! break; -%! endif -%! __printf_assert__ ("%d", i); -%! endfor -%! __printf_assert__ ("\n"); -%! assert (__prog_output_assert__ ("12")); - -%% test/octave.test/for/for-9.m -%!test -%! for i = [1,2,3,4] -%! if (i < 3) -%! continue; -%! endif -%! __printf_assert__ ("%d", i); -%! endfor -%! __printf_assert__ ("\n"); -%! assert (__prog_output_assert__ ("34")); - -%!test -%! a = [1,3;2,4]; -%! j = 0; -%! for i = cat (3, a, 4 + a) -%! assert (i, [1;2] + 2*j++) -%! endfor - -%!test -%! a = {1,3;2,4}; -%! j = 0; -%! for i = cat (3, a, cellfun(@(x) 4 + x, a, "UniformOutput", 0)) -%! assert (i, {1 + 2*j; 2 + 2*j++}) -%! endfor diff -r b8157404614f -r 1af8d21608b7 test/test_func.m --- a/test/test_func.m Sat Feb 09 20:05:40 2013 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,192 +0,0 @@ -## Copyright (C) 2008-2012 David Bateman -## -## This file is part of Octave. -## -## Octave is free software; you can redistribute it and/or modify it -## under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 3 of the License, or (at -## your option) any later version. -## -## Octave is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## 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 -## 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. - -%!function __fntestfunc__ (fn, mn, varargin) -%! typ = {"double", "complex", "logical", "sparse", "complex sparse", ... -%! "logical sparse", "int8", "int16", "int32", "int64", "uint8", ... -%! "uint16", "uint32", "uint64", "char", "cell", "struct", ... -%! "single", "single complex"}; -%! -%! cmplx = [2, 5, 18]; -%! nlogical = [3, 6]; -%! ninteger = [7, 8, 9, 10, 11, 12, 13, 14]; -%! nsparse = [4, 5, 6]; -%! skip = {}; -%! -%! if (length (varargin) > 0 && iscell (varargin{1})) -%! skip = varargin{1}; -%! varargin(1) = []; -%! endif -%! -%! for i = 1 : length (typ) -%! if (any (strcmp (skip, typ {i}))) -%! continue; -%! endif -%! m = mn; -%! -%! if (any (nsparse == i)) -%! if (ndims (m) > 2) -%! sz = size (m); -%! m = reshape (m, [sz(1), prod(sz(2:end))]); -%! endif -%! if (any (cmplx == i)) -%! m = sparse ((1 + 1i) * m); -%! else -%! m = sparse (m); -%! endif -%! else -%! if (any (cmplx == i)) -%! m = (1 + 1i) * m; -%! endif -%! endif -%! if (any (nlogical == i)) -%! m = cast (m, "logical"); -%! endif -%! if (any (ninteger == i)) -%! m = cast (m, typ{i}); -%! endif -%! if (strcmp (typ{i}, "cell")) -%! m = num2cell (m); -%! elseif (strcmp (typ{i}, "struct")) -%! m = struct ("fld", num2cell (m)); -%! endif -%! -%! y = feval (fn, m, varargin{:}); -%! y2 = feval (fn, reshape (mn, size (m)), varargin{:}); -%! if (!strcmp (class (y), class (m)) || -%! issparse (y) != issparse (m) || !size_equal (y, y2)) -%! error ("failed for type %s\n", typ{i}); -%! endif -%! if (!(strcmp (typ{i}, "cell") || strcmp (typ{i}, "struct")) && -%! any (vec (cast (real (y), "double")) != -%! vec (feval (fn , cast (real (m), "double"), varargin{:})))) -%! error ("failed for type %s\n", typ{i}); -%! endif -%! endfor -%!endfunction - -%!shared m0, m1, m2, m3 -%! m0 = [1:5]; -%! m1 = reshape ([1 : 30], [5, 6]); -%! m2 = reshape ([1 : 30], [5, 1, 6]); -%! m3 = []; - -%!test -%! __fntestfunc__("triu", m1, {"struct"}); -%!test -%! __fntestfunc__ ("triu", m1, {"struct"}, -1); -%!test -%! __fntestfunc__ ("triu", m1, {"struct"}, 1); -%!test -%! __fntestfunc__("triu", m3, {"struct"}); -%!test -%! __fntestfunc__ ("tril", m1, {"struct"}); -%!test -%! __fntestfunc__ ("tril", m1, {"struct"}, -1); -%!test -%! __fntestfunc__ ("tril", m1, {"struct"}, 1); -%!test -%! __fntestfunc__("tril", m3, {"struct"}); -%!test -%! __fntestfunc__ ("squeeze", m2); -%!test -%! __fntestfunc__ ("squeeze", m3); -%!test -%! __fntestfunc__ ("permute", m1, [2, 1]); -%!test -%! __fntestfunc__ ("permute", m2, {"sparse", "logical sparse", "complex sparse"}, [3, 1, 2]); -%!test -%! __fntestfunc__ ("permute", m3, [2, 1]); -%!test -%! __fntestfunc__ ("ipermute", m1, [2, 1]); -%!test -%! __fntestfunc__ ("ipermute", m2, {"sparse", "logical sparse", "complex sparse"}, [3, 1, 2]); -%!test -%! __fntestfunc__ ("ipermute", m3, [2, 1]); -%!test -%! __fntestfunc__ ("shiftdim", m2, 1); -%!test -%! __fntestfunc__ ("shiftdim", m2, {"sparse", "logical sparse", "complex sparse"}, -1); -%!test -%! __fntestfunc__ ("shiftdim", m3, 1); -%!test -%! __fntestfunc__ ("circshift", m2, 1); -%!test -%! __fntestfunc__ ("circshift", m2, [1, -1]); -%!test -%! __fntestfunc__ ("circshift", m3, 1); -%!test -%! __fntestfunc__ ("reshape", m2, [6, 5]); -%!test -%! __fntestfunc__ ("reshape", m3, [1, 0]); -%!test -%! __fntestfunc__ ("diag", m0, {"struct"}); -%!test -%! __fntestfunc__ ("diag", m0, {"struct"}, 1); -%!test -%! __fntestfunc__ ("diag", m0, {"struct"}, -1); -%!test -%! __fntestfunc__ ("diag", m1, {"struct"}); -%!test -%! __fntestfunc__ ("diag", m1, {"struct"}, 1); -%!test -%! __fntestfunc__ ("diag", m1, {"struct"}, -1); -%!test -%! __fntestfunc__ ("diag", m3, {"struct"}); -%!test -%! __fntestfunc__ ("fliplr", m1); -%!test -%! __fntestfunc__ ("fliplr", m3); -%!test -%! __fntestfunc__ ("flipud", m1); -%!test -%! __fntestfunc__ ("flipud", m3); -%!test -%! __fntestfunc__ ("flipdim", m1, 2); -%!test -%! __fntestfunc__ ("flipdim", m3, 2); -%!test -%! __fntestfunc__ ("transpose", m1); -%!test -%! __fntestfunc__ ("transpose", m3); -%!test -%! __fntestfunc__ ("ctranspose", m1); -%!test -%! __fntestfunc__ ("ctranspose", m3); -%!test -%! __fntestfunc__ ("rot90", m1); -%!test -%! __fntestfunc__ ("rot90", m1, 2); -%!test -%! __fntestfunc__ ("rot90", m1, -1); -%!test -%! __fntestfunc__ ("rot90", m3); -%!test -%! __fntestfunc__ ("rotdim", m2, 1, [1, 2]); -%!test -%! __fntestfunc__ ("rotdim", m2, 2, [1, 2]); -%!test -%! __fntestfunc__ ("rotdim", m2, -1, [1, 2]); -%!test -%! __fntestfunc__ ("rotdim", m3, 1, [1, 2]); diff -r b8157404614f -r 1af8d21608b7 test/test_global.m --- a/test/test_global.m Sat Feb 09 20:05:40 2013 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,91 +0,0 @@ -## Copyright (C) 2006-2012 John W. Eaton -## -## This file is part of Octave. -## -## Octave is free software; you can redistribute it and/or modify it -## under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 3 of the License, or (at -## your option) any later version. -## -## Octave is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with Octave; see the file COPYING. If not, see -## . - -%% test/octave.test/global/global-1.m -%!test -%! global G = 1; -%! assert (G,1); - -%% test/octave.test/global/global-2.m -%!function f () -%! global G; -%! assert (G,1); -%!endfunction -%!test -%! global G = 1; -%! f; - -%% test/octave.test/global/global-3.m -%!function f () -%! fail ("G"); -%!endfunction -%!test -%! global G = 1; -%! f(); - -%% test/octave.test/global/global-4.m -%!function f () -%! global H = 1; -%!endfunction -%!test -%! f; -%! fail ("H"); - -%% test/octave.test/global/global-5.m -%!function f () -%! global H = 1; -%!endfunction -%!test -%!function g () -%! fail ("H"); -%!test -%! g(); - -%% test/octave.test/global/global-6.m -%!function f () -%! global H = 1; -%!endfunction -%!function g () -%! global H; -%! assert (H,1); -%!endfunction -%!test -%! f(); -%! g(); - -%% test/octave.test/global/global-7.m -%!test -%!function f () -%! global H = 1; -%!endfunction -%!test -%! fail ("H"); - -%% test/octave.test/global/global-8.m -%!function f () -%! global H = 1; -%!endfunction -%!function g () -%! global H; -%! assert (H,1); -%!endfunction -%!test -%! f; -%! clear H; -%! g; - diff -r b8157404614f -r 1af8d21608b7 test/test_if.m --- a/test/test_if.m Sat Feb 09 20:05:40 2013 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,87 +0,0 @@ -## Copyright (C) 2006-2012 John W. Eaton -## -## This file is part of Octave. -## -## Octave is free software; you can redistribute it and/or modify it -## under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 3 of the License, or (at -## your option) any later version. -## -## Octave is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with Octave; see the file COPYING. If not, see -## . - -%% test/octave.test/if/if-1.m -%!test -%! i = 0; -%! if (i == 0) -%! i++; -%! __printf_assert__ ("%d\n", i); -%! endif -%! assert (__prog_output_assert__ ("1")); - -%% test/octave.test/if/if-2.m -%!test -%! if (eye (2)) -%! __printf_assert__ ("fail\n"); -%! else -%! __printf_assert__ ("pass\n"); -%! end -%! assert (__prog_output_assert__ ("pass")); - -%% test/octave.test/if/if-3.m -%!test -%! x = 2; -%! if (eye (2)) -%! __printf_assert__ ("fail\n"); -%! elseif (x) -%! __printf_assert__ ("pass\n"); -%! endif -%! assert (__prog_output_assert__ ("pass")); - -%% test/octave.test/if/if-4.m -%!test -%! x = 0; -%! y = -2; -%! if (eye (2)) -%! __printf_assert__ ("fail\n"); -%! elseif (x) -%! __printf_assert__ ("fail\n"); -%! elseif (y) -%! __printf_assert__ ("pass\n"); -%! end -%! assert (__prog_output_assert__ ("pass")); - -%% test/octave.test/if/if-5.m -%!test -%! x = 0; -%! y = -2; -%! if (eye (2)) -%! __printf_assert__ ("fail\n"); -%! elseif (x) -%! __printf_assert__ ("fail\n"); -%! elseif (x) -%! __printf_assert__ ("fail\n"); -%! else -%! __printf_assert__ ("pass\n"); -%! endif -%! assert (__prog_output_assert__ ("pass")); - -%% test/octave.test/if/if-6.m -%!test -%! x = 0; -%! y = -2; -%! if (y) -%! __printf_assert__ ("pass\n"); -%! elseif (x) -%! __printf_assert__ ("fail\n"); -%! elseif (x) -%! __printf_assert__ ("fail\n"); -%! end -%! assert (__prog_output_assert__ ("pass")); - diff -r b8157404614f -r 1af8d21608b7 test/test_index.m --- a/test/test_index.m Sat Feb 09 20:05:40 2013 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,212 +0,0 @@ -## Copyright (C) 2006-2012 John W. Eaton -## -## This file is part of Octave. -## -## Octave is free software; you can redistribute it and/or modify it -## under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 3 of the License, or (at -## your option) any later version. -## -## Octave is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with Octave; see the file COPYING. If not, see -## . - -%!test -%! a = []; -%! assert (isempty (a)); - -%!shared a -%! a = 1; -%!assert (a(1), 1) -%!assert (a(:), 1) -%!assert (a(:,:), 1) -%!assert (a(1,:), 1) -%!assert (a(:,1),1) -%!assert (isempty (a(logical (0)))) -%!error a(-1) -%!error a(2) -%!error a(2,:) -%!error a(:,2) -%!error a(-1,:) -%!error a(:,-1) -%!error a([1,2,3]) -%!error a([1;2;3]) -%!error a([1,2;3,4]) -%!error a([0,1]) -%!error a([0;1]) -%!error a([-1,0]) -%!error a([-1;0]) - -%!shared a, a_prime, mid_a -%! a = [4,3,2,1]; -%! a_prime = [4;3;2;1]; -%! mid_a = [3,2]; - -%!assert (a(1),4) -%!assert (a(2),3) -%!assert (all (a(:) == a_prime)) -%!assert (all (a(1,:) == a)) -%!assert (a(:,3),2) -%!assert (all (a(:,:) == a)) -%!assert (all (a(logical ([0,1,1,0])) == mid_a)) -%!error a(0) -%!error a(5) -%!error a(0,1) -%!assert (isempty (a(logical (0),:))) -%!error a(:,0) -%!assert (isempty (a([]))) -%!assert (isempty (a([],:))) -%!assert (isempty (a(:,[]))) - -%!shared a, a_fvec, a_col_1, a_col_2, a_row_1, a_row_2 -%! a = [1,2;3,4]; -%! a_fvec = [1;3;2;4]; -%! a_col_1 = [1;3]; -%! a_col_2 = [2;4]; -%! a_row_1 = [1,2]; -%! a_row_2 = [3,4]; - -%!assert (all (all (a(:,:) == a))) -%!assert (all (a(:) == a_fvec)) -%!error a(0) -%!assert (a(2), 3) - -%% Additional tests - -%!shared a, b -%! a = [1,2;3,4]; -%! b = a; -%! b(:,:,2) = [5,6;7,8]; - -%!assert (a(:), [1;3;2;4]) -%!assert (a(1:2), [1,3]) -%!assert (a(:,:), [1,2;3,4]) -%!assert (a(:,1), [1;3]) -%!assert (a(1,1), 1) -%!assert (a(1:2,1), [1;3]) -%!assert (a(:,:,1), [1,2;3,4]) - -%!test -%! c(:,:,1) = [1,2;3,4]; -%! c(:,:,2) = [1,2;3,4]; -%! assert (a(:,:,[1,1]), c) - -%!test -%! c(:,:,1,1) = [1,2;3,4]; -%! c(:,:,1,2) = [1,2;3,4]; -%! assert (a(:,:,1,[1,1]), c) - -%!test -%! c(:,:,1,1) = [1,2;3,4]; -%! c(:,:,2,1) = [1,2;3,4]; -%! c(:,:,1,2) = [1,2;3,4]; -%! c(:,:,2,2) = [1,2;3,4]; -%! assert (a(:,:,[1,1],[1,1]), c) - -%!assert (a(1,[]), zeros (1,0)) -%!assert (a(1,[],[1,1]), zeros (1,0,2)) -%!assert (a(1,1,[]), zeros (1,1,0)) - -%!test -%! c (1:10,1) = 1:10; -%! assert (c, [1:10]'); - -%!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(:,1,1), [1;3]) -%!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(:,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)) - -%!shared x -%! # Dummy shared block to clear any previous definitions -%! x = 1; - -%!test -%! a(1,:) = [1,3]; -%! assert (a, [1,3]); - -%!test -%! a(1,:) = [1;3]; -%! assert (a, [1,3]); - -%!test -%! a(:,1) = [1;3]; -%! assert (a, [1;3]); - -%!test -%! a = [1,2;3,4]; -%! b (1,:,:) = a; -%! assert (b, reshape (a, [1,2,2])); - -%!test -%! a(1,1:4,2) = reshape (1:4, [1,1,4]); -%! b(:,:,2) = 1:4; -%! assert (a, b); - -%!test -%! a(:,:,:) = 1:4; -%! assert (a, [1:4]); - -%!test -%! a(:,:,1) = 1:4;; -%! assert (a, [1:4]); - -%!test -%! a(:,:,1) = [1:4]'; -%! assert (a, [1:4]'); - -%!test -%! a(:,:,1) = reshape (1:4,[1,1,4]); -%! assert (a, [1:4]'); - -%!test -%! a(:,1,:) = 1:4; -%! assert (a, reshape (1:4,[1,1,4])); - -%!test -%! a(:,1,:) = [1:4]'; -%! assert (a, [1:4]'); - -%!test -%! a(:,1,:) = reshape (1:4,[1,1,4]);; -%! assert (a, [1:4]'); - -%!test -%! a(1,:,:) = 1:4; -%! assert (a, reshape (1:4,[1,1,4])); - -%!test -%! a(1,:,:) = [1:4]'; -%! assert (a, [1:4]); - -%!test -%! a(1,:,:) = reshape (1:4,[1,1,4]); -%! assert (a, [1:4]); - -%!test -%! a(1,:,:,:) = reshape (1:4,[1,1,4]); -%! assert (a, reshape (1:4,[1,1,1,4])); - -%!error (a(1:2,1:2) = 1:4) - -%!shared x -%! x = 1:5; -%!error x(i) -%!error x(j) -%!error x(1+i) diff -r b8157404614f -r 1af8d21608b7 test/test_io.m --- a/test/test_io.m Sat Feb 09 20:05:40 2013 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,616 +0,0 @@ -## Copyright (C) 2006-2012 John W. Eaton -## -## This file is part of Octave. -## -## Octave is free software; you can redistribute it and/or modify it -## under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 3 of the License, or (at -## your option) any later version. -## -## Octave is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with Octave; see the file COPYING. If not, see -## . - -## 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. - -%% test/octave.test/io/load-save.m -%!function [ret, files] = testls (input) -%! ## flag a1 global so as to test the storage of global flags -%! global a1; -%! -%! ## Input or output, so as to be able to exchange between versions -%! if (nargin < 1) -%! input = 0; -%! endif -%! -%! ## Setup some variable to be saved or compared to loaded variables -%! -%! ## scalar -%! a1 = 1; -%! ## matrix -%! persistent a2 = hilb(3); -%! ## complex scalar -%! persistent a3 = 1 + 1i; -%! ## complex matrix -%! persistent a4 = hilb(3) + 1i*hilb(3); -%! ## bool -%! persistent a5 = (1 == 1); -%! ## bool matrix -%! persistent a6 = ([ones(1,5), zeros(1,5)] == ones (1,10)); -%! ## range -%! persistent a7 = 1:10; -%! ## structure -%! persistent a8 = struct ("a", a1, "b", a3); -%! ## cell array -%! persistent a9 = {a1, a3}; -%! ## string -%! persistent a10 = ["test"; "strings"]; -%! ## int8 array -%! persistent a11 = int8 (floor (256*rand (2,2))); -%! ## int16 array -%! persistent a12 = int16 (floor (65536*rand (2,2))); -%! ## int32 array -%! persistent a13 = int32 (floor (1e6*rand (2,2))); -%! ## int64 array -%! persistent a14 = int64 (floor (10*rand (2,2))); -%! ## uint8 array -%! persistent a15 = uint8 (floor (256*rand (2,2))); -%! ## uint16 array -%! persistent a16 = uint16 (floor (65536*rand (2,2))); -%! ## int32 array -%! persistent a17 = uint32 (floor (1e6*rand (2,2))); -%! ## uint64 array -%! persistent a18 = uint64 (floor (10*rand (2,2))); -%! ## sparse -%! persistent a19 = sprandn (100,100,0.01); -%! ## complex sparse -%! persistent a20 = sprandn (100,100,0.01) + 1i * sprandn (100,100,0.01); -%! -%! ret = 0; -%! -%! files = {"text.mat", "binary.mat", "mat5.mat", "mat7.mat"}; -%! opts = {"-z -text", "-z -binary", "-z -mat", "-v7"}; -%! tols = {2*eps, 0, 0, 0}; -%! -%! vars = "a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 a18 a19 a20"; -%! if (! input) -%! for i = 1:length (files) -%! eval (sprintf ("save %s %s %s", opts{i}, files{i}, vars)); -%! endfor -%! else -%! b1 = a1; b2 = a2; b3 = a3; b4 = a4; b5 = a5; -%! b6 = a6; b7 = a7; b8 = a8; b9 = a9; -%! b10 = a10; b11 = a11; b12 = a12; b13 = a13; b14 = a14; b15 = a15; -%! b16 = a16; b17 = a17; b18 = a18; b19 = a19; b20 = a20; -%! -%! for i = length (files) -%! -%! clear a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 a19 a20; -%! -%! file = files{i}; -%! tol = tols{i}; -%! -%! load (file); -%! -%! assert (a1, b1, tol); -%! assert (a2, b2, tol); -%! assert (a3, b3, tol); -%! assert (a4, b4, tol); -%! -%! if (! isequal (a5, b5)) -%! error ("failed: %s boolean", file); -%! endif -%! -%! if (! strcmp (file, "mat5") && ! strcmp (file, "mat7")) -%! if (! isequal (a6, b6)) -%! error ("failed: %s boolean matrix", file); -%! endif -%! endif -%! -%! assert ([a7], [b7], tol); -%! -%! 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 -%! -%! if (! isequal (a11, b11)) -%! error ("failed: %s int8", file); -%! endif -%! -%! if (! isequal (a12, b12)) -%! error ("failed: %s int16", file); -%! endif -%! -%! if (! isequal (a13, b13)) -%! error ("failed: %s int32", file); -%! endif -%! -%! if (! isequal (a14, b14)) -%! error ("failed: %s int64", file); -%! endif -%! -%! if (! isequal (a15, b15)) -%! error ("failed: %s uint8", file); -%! endif -%! -%! if (! isequal (a16, b16)) -%! error ("failed: %s uint16", file); -%! endif -%! -%! if (! isequal (a17, b17)) -%! error ("failed: %s uint32", file); -%! endif -%! -%! if (! isequal (a18, b18)) -%! error ("failed: %s uint64", file); -%! endif -%! -%! assert (a19, b19, tol); -%! assert (a20, b20, tol); -%! -%! ## Test for global flags -%! if (! isglobal ("a1") || isglobal ("a2") || isglobal ("a3") -%! || isglobal ("a4") || isglobal ("a5") || isglobal ("a6") -%! || isglobal ("a7") || isglobal ("a8") || isglobal ("a9") -%! || isglobal ("a10") || isglobal ("a11") || isglobal ("a12") -%! || isglobal ("a13") || isglobal ("a14") || isglobal ("a15") -%! || isglobal ("a16") || isglobal ("a17") || isglobal ("a18") -%! || isglobal ("a19") || isglobal ("a20")) -%! error ("failed: %s global test", file); -%! endif -%! endfor -%! endif -%! -%! ret = 1; -%!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"); -%! -%! assert (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 -binary struct.dat -struct STR matrix_fld str*_fld; -%! STR = load ("struct.dat"); -%! -%! assert (!isfield(STR,"scalar_fld") && ... -%! STR.matrix_fld == [1.1,2;3,4] && ... -%! STR.string_fld == "Octave" && ... -%! STR.struct_fld.x == 0 && ... -%! STR.struct_fld.y == 1); -%! -%! delete struct.dat; - -%!test -%! matrix1 = rand (100, 2); -%! save -ascii matrix.ascii matrix1 -%! matrix2 = load ("matrix.ascii"); -%! assert (matrix1, matrix2, 1e-9) -%! -%! delete matrix.ascii; - -%!error load ("") - -%% FIXME: This test is disabled as it writes to stdout and there is no easy -%% way to recover output. Need to spawn new octave process and pipe stdout -%% somewhere to treat this case. -%% test/octave.test/io/puts-1.m -%!#test -%! puts ("foo\n"); - -%% test/octave.test/io/puts-2.m -%!assert (puts (1),-1) - -%% test/octave.test/io/puts-3.m -%!error puts () - -%% test/octave.test/io/puts-4.m -%!error puts (1, 2) - -%!assert (sscanf ('123456', '%10c'), '123456') -%!assert (sscanf ('123456', '%10s'), '123456') - -%!assert (sscanf (['ab'; 'cd'], '%s'), 'acbd') - -%!assert (sscanf ('02:08:30', '%i:%i:%i'), [2; 0]); -%!assert (sscanf ('02:08:30', '%d:%d:%d'), [2; 8; 30]); - -%!assert (sscanf ('0177 08', '%i'), [127; 0; 8]); -%!assert (sscanf ('0177 08', '%d'), [177; 8]); - -%!test -%! [val, count, msg, pos] = sscanf ("3I2", "%f"); -%! assert (val, 3); -%! assert (count, 1); -%! assert (msg, ""); -%! assert (pos, 2); - -%!test -%! [val, count, msg, pos] = sscanf ("3In2", "%f"); -%! assert (val, 3); -%! assert (count, 1); -%! assert (msg, ""); -%! assert (pos, 2); - -%!test -%! [val, count, msg, pos] = sscanf ("3Inf2", "%f"); -%! assert (val, [3; Inf; 2]); -%! assert (count, 3); -%! assert (msg, ""); -%! assert (pos, 6); - -%% test/octave.test/io/sscanf-1.m -%!test -%! [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))); - -%% test/octave.test/io/sscanf-2.m -%!error sscanf () - -%% test/octave.test/io/sscanf-3.m -%!error sscanf (1, 2) - -%% test/octave.test/io/sscanf-4.m -%!error sscanf ("foo", "bar", "C", 1) - -%% test/octave.test/io/sscanf-5.m -%!test -%! [x, n] = sscanf (" 0.024000 0.200 0.200 2.000 1987 5 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 2 0 0 1 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 4 5 1 2 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4 5 9 10 7 4 12 7 4 9 5 10 10 6 8 4 7 2 4 7 2 6 8 4 11 3 3 9 7 6 7 3 8 7 4 8 5 3 7 4 5 5 7 4 6 7 5 5 3 5 2 5 4 1 2 0 0 1 0.140000 3.100 3.100 7.800 1361810 3 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 3 2 1 0 0 0 1 1 1 2 0 0 0 0 1 0 2 2 2 1 0 0 3 3 0 2 0 6 2 3 1 0 3 3 1 2 2 5 3 5 3 3 2 2 7 3 2 2 3 4 2 3 4 4 1 3 7 4 5 4 2 3 5 4 2 1 3 6 3 4 3 8 7 6 5 3 5 11 5 5 3 3 7 3 6 4 4 2 4 4 4 1 5 5 9 6 6 9 3 10 8 6 8 3 10 8 16 16 13 18 23 29 25 19 19 20 27 19 22 27 24 21 15 18 11 20 21 17 12 5 18 6 12 7 9 11 7 12 11 4 8 8 4 8 7 7 2 6 4 4 9 6 9 3 4 7 7 7 4 10 4 11 5 8 8 8 5 4 4 8 6 4 9 8 12 12 8 5 8 3 10 8 7 5 3 5 6 8 5 6 10 7 2 11 2 5 5 6 8 10 2 7 5 5 14 2 7 3 9 3 5 2 8 2 3 4 4 7 9 5 4 7 6 7 5 6 3 5 4 7 6 7 7 9 3 0 2 1 1 1 0 0 0.142000 3.150 3.150 7.900 1429499 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 3 1 2 1 1 0 0 0 3 0 2 2 1 0 3 0 2 1 3 0 0 1 1 3 1 2 4 1 5 3 5 1 0 7 1 3 2 3 2 2 2 3 0 0 1 3 6 3 2 2 4 4 4 6 4 3 6 4 10 3 7 2 5 4 7 4 5 8 4 7 4 1 7 11 5 2 10 2 11 3 7 8 10 9 6 3 5 3 6 3 10 11 5 5 9 7 10 8 9 5 15 11 9 18 18 15 24 17 23 17 19 25 17 24 18 37 16 17 21 17 14 20 17 15 15 9 4 11 7 3 8 10 8 8 6 8 3 4 5 8 4 6 3 9 9 6 2 10 4 4 3 8 4 9 1 7 5 9 7 10 9 10 4 6 5 8 6 6 10 10 6 5 7 6 6 10 5 7 8 8 8 7 7 11 12 8 3 10 6 9 13 11 4 6 7 6 3 10 5 8 4 7 7 7 5 8 4 9 5 5 7 6 6 7 11 11 7 8 5 3 5 7 7 10 3 3 6 5 7 9 2 3 7 1 0 0 0 0 1 0.144000 3.200 3.200 8.000 1493946 3 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 2 3 0 0 1 2 1 1 1 4 1 0 1 0 1 2 1 3 1 1 1 1 2 1 1 3 2 6 0 4 0 1 4 2 4 5 2 1 3 0 2 2 4 2 3 2 4 3 5 4 4 4 1 5 1 3 4 5 6 4 7 2 8 8 8 5 3 6 0 7 3 2 2 5 7 5 7 5 8 9 6 4 3 6 8 6 10 2 5 6 3 3 6 6 6 6 17 5 10 6 6 11 11 13 12 21 26 18 24 21 24 23 30 18 22 20 24 19 13 17 25 22 17 15 8 13 7 10 8 9 6 7 9 8 7 8 9 7 7 6 12 5 9 9 12 9 12 6 9 7 10 7 7 4 9 7 4 2 7 4 5 8 8 9 7 6 7 5 9 4 8 13 6 5 4 7 9 6 7 7 9 4 4 5 8 10 9 10 6 6 7 9 12 11 8 8 9 11 5 8 7 5 5 8 5 9 10 5 5 11 11 6 8 8 4 8 5 5 5 4 7 4 5 6 5 6 6 7 7 4 2 6 3 2 1 0 0 0 0 0 0.146000 3.250 3.250 8.100 1562352 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 2 0 2 0 1 2 1 1 0 0 1 0 1 2 0 0 0 3 1 2 0 4 4 2 0 0 2 3 2 0 1 3 3 4 0 1 4 3 3 4 5 5 4 2 1 4 2 5 3 2 7 6 3 5 6 5 5 5 1 5 2 7 4 8 7 4 6 5 7 5 3 5 8 1 6 4 6 8 7 6 7 6 3 4 6 3 5 8 4 10 3 3 11 6 5 3 9 6 4 3 17 9 11 11 24 13 15 14 25 26 26 21 17 32 32 22 18 25 29 29 27 24 21 12 23 14 12 11 9 17 7 9 11 3 7 6 5 5 12 3 6 8 7 4 7 11 10 8 9 5 8 2 10 9 8 10 10 7 7 4 7 5 7 7 9 10 8 7 7 16 6 8 10 5 6 6 12 12 7 11 11 8 9 7 8 12 10 7 8 7 11 8 9 7 7 4 9 4 7 14 9 8 8 13 9 8 7 13 5 9 5 7 4 9 5 7 8 7 8 7 3 10 9 3 4 4 4 5 2 6 6 3 5 10 4 4 2 3 0 1 0 0 0.148000 3.300 3.300 8.200 1630559 3 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 4 2 1 1 1 2 1 2 0 2 1 5 0 1 1 4 0 2 1 4 5 3 0 1 1 1 2 1 3 3 3 1 1 1 1 1 3 4 6 6 8 8 4 3 2 7 2 2 1 7 4 4 5 1 10 6 4 4 4 3 3 3 6 11 6 4 5 4 8 5 5 9 4 5 5 7 6 4 13 12 3 6 7 5 2 7 9 7 8 8 4 7 6 4 10 6 8 9 9 9 13 15 17 23 25 13 16 24 22 26 21 27 24 24 21 21 21 15 17 22 25 21 22 17 14 11 8 12 5 9 7 8 5 11 10 6 6 5 9 13 10 9 8 8 8 6 4 9 10 9 9 7 8 7 5 7 8 14 13 5 14 5 12 11 8 9 6 5 4 9 13 7 10 13 11 11 8 5 9 10 8 7 6 7 13 3 13 8 7 13 17 5 8 5 10 7 12 7 6 6 9 7 8 8 11 8 11 9 11 11 8 5 6 10 4 9 3 10 8 7 10 8 7 8 10 10 7 4 11 5 7 8 2 4 3 0 0 1 0 1 0.150000 3.350 3.350 8.300 1707576 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 2 1 2 1 0 2 0 2 3 1 3 2 2 2 2 0 2 1 4 3 2 2 3 1 2 1 0 2 2 4 2 5 3 3 5 2 8 4 5 4 2 3 6 7 6 1 0 7 4 7 7 6 5 4 3 4 6 6 7 6 2 7 4 4 2 5 5 6 9 3 3 3 6 6 5 3 5 7 8 8 6 8 8 6 8 3 9 6 6 8 8 6 4 8 6 6 10 4 11 6 11 15 23 16 8 17 20 21 19 24 15 14 19 21 30 25 21 15 19 16 18 21 21 15 14 12 16 8 10 12 7 10 9 8 10 10 7 9 8 10 12 6 6 9 11 6 5 9 12 6 7 12 7 5 6 8 5 9 4 11 9 8 8 10 7 6 10 7 11 13 7 4 13 11 8 11 9 16 6 12 11 10 10 19 2 9 11 8 7 8 8 6 13 6 10 12 12 9 12 9 9 8 7 7 9 6 12 8 4 9 9 8 5 7 8 9 5 12 5 7 5 9 10 9 10 3 6 6 8 7 11 3 5 5 4 2 0 0 0 0 0.152000 3.400 3.400 8.400 1777231 3 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 1 1 0 0 1 1 3 1 0 3 4 2 3 3 3 3 3 2 1 1 1 1 3 3 0 1 8 0 0 5 3 7 4 4 4 4 4 3 5 2 2 5 3 6 1 7 6 1 2 2 5 2 1 6 6 8 7 7 5 10 4 1 6 9 3 4 5 3 5 8 4 9 8 11 8 3 2 7 7 9 10 9 10 8 6 8 6 8 7 10 8 7 3 8 4 10 7 6 8 9 6 5 16 9 19 24 23 17 23 24 22 30 21 15 23 27 20 20 20 18 20 23 18 17 15 19 17 18 13 9 4 4 7 12 7 10 4 8 6 10 5 6 13 2 3 8 7 8 7 3 11 8 7 9 7 19 7 8 9 6 14 8 8 11 10 11 13 14 10 16 8 9 13 8 9 9 12 7 12 11 6 9 15 5 9 9 9 11 11 13 6 10 6 4 12 9 9 12 11 8 6 9 16 10 10 10 8 10 10 6 7 4 1 15 6 8 4 9 13 11 8 10 11 9 8 3 3 6 6 7 9 4 6 8 7 4 2 1 2 2 1 0 0.154000 3.450 3.450 8.500 1849489 6 0 0 0 0 0 0 0 0 0 0 0 1 1 3 0 1 2 2 0 1 4 1 1 0 1 0 2 1 0 0 1 1 1 1 6 3 6 1 3 1 3 3 0 6 0 4 2 7 4 6 4 4 3 7 4 5 7 5 5 2 3 9 9 2 5 5 3 9 4 2 7 6 2 8 2 5 7 12 6 5 4 5 10 4 12 10 6 4 14 7 9 10 11 7 7 7 7 3 9 7 4 3 8 7 5 7 9 6 8 9 6 8 8 12 6 5 11 12 13 11 13 21 26 19 23 25 18 23 22 23 23 18 27 20 15 20 25 24 19 18 12 14 13 15 8 15 10 11 7 9 13 11 12 13 11 11 7 11 13 6 5 10 6 6 10 8 14 5 14 11 8 5 9 7 10 10 8 7 15 13 3 13 12 18 15 7 10 9 10 8 15 9 6 8 9 10 10 9 5 7 7 5 10 11 13 12 12 12 10 6 17 10 11 9 4 8 7 6 6 9 12 8 16 18 7 5 10 8 12 10 15 6 13 11 6 10 16 10 11 16 8 9 5 11 10 14 11 5 2 5 7 3 1 1 0 1 0 0.156000 3.500 3.500 8.600 1920727 4 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 1 0 2 1 2 0 3 0 1 1 0 1 0 3 0 4 4 1 3 1 2 3 3 4 3 1 2 3 9 5 2 3 7 3 3 6 5 2 6 1 4 3 2 3 6 5 1 8 3 8 5 3 7 6 13 11 9 5 8 7 7 5 8 7 4 8 6 4 10 4 6 5 6 9 9 12 6 7 10 9 9 8 8 3 8 9 8 8 2 12 11 13 8 13 7 8 6 6 9 6 8 16 13 14 16 16 22 20 21 21 17 20 18 19 22 20 11 20 22 21 14 19 15 23 17 15 12 14 19 16 10 11 14 11 9 11 9 12 8 16 14 9 6 18 10 11 7 10 11 17 10 13 8 10 12 9 12 7 7 10 10 11 11 9 8 8 14 10 10 9 14 9 14 13 9 19 16 17 4 11 8 12 11 10 21 6 10 8 9 12 9 7 7 12 7 16 14 10 13 6 13 8 9 10 6 10 8 7 10 4 6 11 19 12 6 7 5 8 11 10 12 13 9 6 10 5 11 11 4 14 10 7 2 6 5 1 2 5 1 1 0 0 0.158000 3.550 3.550 8.700 1999833 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 2 2 3 2 2 2 1 2 3 0 1 0 1 3 2 0 0 3 2 3 2 5 7 0 3 4 1 10 7 7 4 5 2 3 4 3 8 3 6 4 4 4 8 2 3 4 5 5 7 1 6 7 8 1 6 8 1 4 4 11 9 4 7 11 9 10 5 6 8 4 3 9 7 9 11 5 5 8 8 4 8 7 8 11 9 12 6 4 13 4 12 10 6 9 11 10 11 10 11 11 11 14 15 14 23 18 17 29 16 26 23 15 19 14 18 19 22 31 13 21 20 12 16 15 14 18 17 15 8 12 14 13 10 10 10 10 10 13 11 6 8 11 8 14 8 10 11 11 8 10 13 5 14 7 12 9 10 10 12 15 18 8 6 9 9 12 8 9 20 14 16 10 11 14 5 5 13 6 11 9 11 15 6 9 13 11 7 8 7 10 8 16 12 11 8 10 14 11 17 11 8 16 13 9 10 5 10 17 13 14 16 8 10 9 11 5 10 9 10 12 8 11 12 11 8 6 7 12 15 13 12 7 13 5 0 3 2 0 0 0 0 0.160000 3.600 3.600 8.800 2073149 3 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 2 1 2 1 2 2 1 0 2 2 1 0 3 6 4 5 5 2 2 2 5 5 3 6 4 6 4 5 2 4 4 3 2 4 6 3 3 6 5 7 4 5 7 5 3 5 6 13 5 3 10 5 9 7 4 5 6 5 10 6 5 5 6 6 4 14 7 6 11 6 9 10 9 8 5 3 8 10 10 6 6 8 9 5 6 14 7 11 10 9 9 11 13 8 4 5 10 12 6 16 8 8 7 19 20 23 10 16 27 25 23 19 26 21 16 20 21 24 18 25 8 11 13 16 18 13 22 18 9 16 4 16 10 12 13 9 7 9 8 17 11 10 13 10 14 4 9 12 16 8 9 16 17 13 11 14 8 8 13 9 11 15 10 11 14 8 6 4 9 11 18 9 9 8 9 15 11 11 11 9 6 13 13 10 7 8 10 15 14 9 7 4 10 12 17 10 14 13 10 10 12 20 9 7 6 11 15 11 10 8 9 6 10 13 17 6 8 9 6 13 13 16 10 15 5 11 14 11 12 6 5 12 9 4 9 2 4 1 1 0 0 0 0.162000 3.650 3.650 8.900 2156456 5 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 2 0 1 1 3 2 3 4 3 3 2 1 3 6 5 2 3 4 4 3 6 2 3 4 4 5 5 3 4 1 4 5 9 3 3 4 3 3 8 5 6 12 2 10 3 4 6 8 9 8 8 2 2 7 5 8 2 8 9 7 2 6 8 6 5 8 2 7 5 6 13 5 6 8 11 6 10 5 6 3 8 10 11 10 10 14 10 11 8 11 8 12 6 12 5 15 12 13 10 13 13 18 23 12 21 18 21 23 20 30 20 23 26 24 24 21 21 29 19 21 16 23 20 13 19 13 16 11 15 13 13 11 8 11 14 14 13 4 16 15 18 13 9 19 8 11 6 9 14 8 13 12 13 10 13 10 14 11 13 11 8 10 13 11 11 14 11 8 14 11 10 9 14 12 14 18 8 12 7 13 12 10 14 14 8 12 17 11 13 9 12 12 15 7 9 13 17 11 11 11 12 17 12 11 16 15 8 9 12 7 13 15 11 16 7 10 7 14 5 18 10 10 8 8 6 6 13 14 6 9 11 9 9 3 5 1 1 3 0 0 0.164000 3.700 3.700 9.000 2234753 3 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 4 1 4 2 1 3 1 1 3 2 3 3 1 3 6 2 4 4 3 3 3 6 5 2 6 4 1 3 3 7 1 4 4 6 12 4 5 2 6 4 9 3 1 8 11 5 2 7 6 3 8 4 7 3 8 3 9 6 7 8 9 2 7 6 9 6 15 6 9 5 9 4 9 17 15 10 2 10 6 8 12 12 11 12 10 9 7 11 8 7 5 11 10 14 16 7 7 7 13 15 10 16 17 21 19 14 18 24 19 27 27 24 20 22 24 21 20 14 24 17 17 18 32 15 12 13 15 12 8 14 11 11 19 11 14 15 18 10 5 12 11 11 9 15 9 7 9 16 12 9 12 10 15 9 18 7 11 12 14 7 20 8 10 13 14 11 6 6 9 11 8 10 16 8 17 13 17 9 16 11 10 9 13 20 17 14 12 10 13 11 9 9 17 20 10 16 8 14 13 14 18 15 15 8 10 12 11 22 12 13 9 12 9 11 14 19 12 12 8 8 12 11 19 11 11 12 15 11 15 13 9 9 10 9 4 9 4 2 1 0 0 0.166000 3.750 3.750 9.100 2327990 3 0 0 0 0 0 0 0 0 0 0 0 0 0 3 2 2 0 1 2 2 1 1 0 0 3 1 4 2 6 4 2 4 3 2 5 5 2 3 1 3 1 2 10 2 7 4 3 4 3 3 4 3 10 6 9 6 3 8 5 5 3 4 4 6 8 4 4 7 5 5 11 14 5 3 6 8 8 7 10 11 7 17 7 11 10 8 7 8 12 13 11 12 6 13 9 7 7 6 5 8 13 10 10 14 11 11 8 12 15 14 9 13 10 9 18 13 18 12 23 14 17 24 15 23 25 31 19 17 29 19 19 19 26 25 19 17 22 19 19 19 11 11 12 22 21 8 10 18 10 14 19 17 13 14 10 6 9 10 15 11 5 13 13 11 11 17 16 9 7 14 7 19 6 10 13 7 12 18 14 7 12 15 13 13 9 13 13 13 12 12 14 12 19 10 16 18 18 12 8 10 10 9 7 14 9 11 13 12 8 15 12 11 10 12 11 17 15 19 14 14 12 7 7 12 11 15 16 12 11 12 10 19 19 12 14 12 15 11 20 13 7 18 9 15 19 16 11 5 9 8 6 2 4 0 2 0 1 0.168000 3.800 3.800 9.200 2406866 3 0 0 0 0 0 0 0 0 0 0 1 0 2 0 1 0 2 3 2 3 1 2 1 2 2 5 2 1 2 3 2 2 2 5 3 5 3 3 1 3 6 8 6 1 3 9 6 3 6 10 5 5 7 4 5 7 12 9 5 7 5 6 6 8 3 5 4 7 8 5 6 5 8 13 4 10 2 10 9 7 7 16 9 10 9 13 8 12 9 13 15 9 15 9 10 11 6 6 6 7 7 6 8 15 9 8 9 6 12 12 11 14 12 11 13 8 17 18 18 11 14 19 14 25 21 15 10 15 19 27 23 22 24 17 19 18 12 16 22 21 25 9 25 15 19 15 21 15 8 11 13 12 10 12 7 13 11 17 11 13 10 16 19 14 23 11 8 12 13 10 9 17 4 14 10 7 10 17 14 11 11 20 18 13 8 12 6 8 13 12 23 15 14 15 16 9 14 9 13 14 17 11 17 11 10 15 17 11 6 12 12 14 15 17 12 16 16 8 17 15 15 10 15 11 10 15 12 13 9 12 9 12 15 12 6 18 7 15 14 12 21 18 11 10 18 11 19 11 7 11 3 2 5 4 0 1 1 0.170000 3.850 3.850 9.300 2508471 7 0 0 0 0 0 0 0 0 0 0 0 0 0 1 3 1 2 1 4 3 3 1 2 7 0 3 2 2 2 2 5 2 3 2 3 3 4 3 7 3 5 3 4 4 6 2 3 10 4 11 3 13 7 7 5 6 3 8 10 6 6 4 10 11 4 12 7 8 9 7 7 8 4 6 7 9 9 5 9 11 5 14 9 10 7 9 8 8 5 6 11 13 14 10 10 10 10 8 9 9 9 9 14 14 13 11 8 18 9 10 9 16 12 13 15 13 10 17 16 20 14 22 20 26 29 29 27 24 20 37 21 24 13 18 13 28 24 22 25 21 13 14 15 9 11 18 8 16 17 16 13 12 16 11 11 17 15 11 15 10 11 12 13 12 12 20 15 14 15 16 12 17 15 15 12 10 14 14 17 15 19 15 13 13 11 12 16 14 17 16 8 16 12 8 14 13 13 10 10 9 12 11 19 20 13 11 4 15 11 14 11 20 18 18 13 20 12 20 21 15 15 12 13 18 18 11 16 9 14 9 18 11 10 11 20 11 13 17 13 13 12 14 16 10 12 12 23 12 11 12 8 8 1 0 1 2 0 0.172000 3.900 3.900 9.400 2591210 3 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 4 4 3 2 1 3 3 2 3 0 3 6 1 3 1 5 5 4 3 9 9 0 4 7 5 3 5 5 8 7 3 3 5 5 8 5 11 10 8 10 3 6 6 6 7 7 8 8 12 9 6 10 8 7 10 8 8 10 4 6 12 20 4 6 11 7 9 10 7 5 10 6 12 11 7 13 13 16 12 6 8 14 13 9 7 5 14 17 17 10 12 11 6 13 11 17 3 23 13 21 12 21 28 11 23 30 28 23 24 26 26 17 21 15 27 23 33 16 22 25 11 20 22 23 21 20 7 21 13 16 12 16 16 13 18 18 9 13 16 15 9 20 13 19 15 8 9 11 14 13 10 9 10 16 15 14 17 15 19 16 12 14 12 14 14 16 19 19 4 24 8 12 15 16 11 15 14 20 14 13 13 14 16 19 14 13 19 14 18 23 15 15 4 14 17 14 8 10 15 20 11 15 19 12 9 13 12 11 16 12 16 13 14 16 13 16 16 19 19 12 11 10 19 15 15 14 12 5 11 18 17 10 13 12 9 6 2 0 0 1 0 0.174000 3.950 3.950 9.500 2675515 3 0 0 0 0 0 0 0 0 0 0 0 2 0 1 1 0 2 1 2 3 3 1 3 1 3 7 5 3 6 4 3 9 4 5 2 5 3 3 3 6 9 5 5 2 6 8 5 8 4 8 5 6 5 6 4 6 3 7 11 6 9 9 3 6 6 7 6 8 7 9 12 18 6 9 8 11 11 8 14 15 15 11 15 13 9 19 10 15 14 9 4 18 5 8 10 8 10 13 9 12 11 8 8 12 6 15 8 9 9 18 7 17 21 9 13 18 14 21 24 18 22 17 26 15 21 23 25 19 26 23 20 27 17 27 20 26 15 22 15 19 15 16 24 12 15 24 13 13 17 11 7 10 21 15 15 16 13 20 22 12 16 12 16 15 14 18 11 12 14 14 24 10 13 16 19 8 11 18 19 15 15 23 16 16 11 12 18 11 13 14 16 10 14 13 18 12 15 15 14 8 11 17 12 22 13 12 14 15 10 11 15 19 15 12 17 8 21 23 13 19 11 8 12 15 11 14 15 19 15 10 17 9 16 14 18 14 16 14 14 23 14 14 13 16 12 14 15 14 9 14 7 5 2 3 1 1 1 0.176000 4.000 4.000 9.600 2779386 5 0 0 0 0 0 0 0 0 0 0 0 0 2 2 3 0 1 3 0 6 2 6 3 1 5 0 4 1 6 5 1 6 3 6 5 6 2 5 4 5 3 9 8 5 7 5 8 4 12 8 12 6 8 5 7 5 7 10 5 5 6 7 9 7 10 7 10 10 8 12 10 6 13 10 11 12 11 10 10 16 9 6 12 9 11 17 10 11 10 14 11 16 7 11 13 12 10 17 14 11 13 12 10 13 16 16 17 17 15 14 11 8 15 13 27 22 14 19 17 22 22 27 18 28 19 27 32 24 33 21 17 23 12 27 25 20 20 17 22 14 15 22 21 14 9 16 12 19 16 17 16 16 20 14 18 15 14 18 10 12 9 16 12 12 10 13 19 12 12 15 14 15 22 12 11 15 18 19 18 10 6 11 14 10 23 17 14 16 19 10 10 16 19 17 23 16 18 19 18 16 12 14 14 14 13 11 10 24 21 22 26 18 18 18 14 17 5 13 17 11 13 16 14 18 16 9 15 15 18 16 14 21 13 22 17 9 8 16 17 16 16 19 7 20 19 18 16 10 6 10 6 3 5 1 0 0 2 0.178000 4.050 4.050 9.700 2869617 3 0 0 0 0 0 0 0 0 0 0 0 2 2 2 0 1 4 1 3 2 2 1 2 3 2 2 4 4 7 5 6 5 3 6 6 5 7 8 1 5 2 3 5 5 8 10 7 6 10 9 6 8 9 7 8 10 15 4 10 5 8 8 6 11 8 8 11 7 5 8 14 5 11 7 13 10 9 7 8 9 14 12 10 9 11 6 14 15 14 13 11 9 18 18 10 14 14 10 12 16 12 9 8 14 15 6 11 11 12 10 14 12 11 18 13 13 27 16 23 23 20 21 32 20 18 25 22 24 32 25 34 19 23 21 25 22 25 19 23 19 21 16 19 16 18 9 18 6 13 12 13 18 12 8 19 14 14 11 16 13 15 14 21 11 14 14 13 11 20 14 14 26 10 22 16 18 15 20 24 18 19 19 16 14 14 14 21 13 19 18 20 13 17 11 17 14 22 17 15 15 20 8 21 15 16 16 23 17 13 19 21 20 12 15 18 15 19 15 18 17 20 15 13 14 24 18 15 15 14 18 20 19 17 19 20 21 21 15 19 19 17 11 16 16 11 23 10 20 13 10 5 10 2 3 1 1 0 0.180000 4.100 4.100 9.800 2975040 3 0 0 0 0 0 0 0 0 0 1 0 0 1 2 2 4 4 2 4 4 1 2 5 0 3 3 5 2 5 5 4 9 2 7 8 4 8 3 11 6 10 4 7 8 6 6 5 8 8 7 11 4 4 11 12 7 11 7 10 11 7 11 11 10 9 7 13 12 18 8 14 12 14 12 8 8 16 10 10 14 16 10 6 8 15 15 15 22 13 19 18 12 6 11 10 7 12 12 24 15 17 9 17 21 10 17 18 14 14 14 9 22 11 23 17 15 23 32 20 11 12 20 15 23 30 20 25 19 26 29 19 27 23 15 19 11 30 16 21 24 18 18 14 8 6 25 13 21 13 13 19 13 21 25 23 18 14 14 13 20 12 14 8 10 25 14 15 20 15 10 15 16 21 8 15 20 21 20 13 16 15 20 11 18 17 17 9 12 24 19 13 18 17 20 14 15 20 10 23 19 25 8 7 13 14 11 15 18 13 10 12 10 17 11 24 16 17 11 12 13 16 20 14 26 12 17 13 14 16 16 6 20 16 23 22 11 17 16 14 25 19 17 21 22 19 13 19 16 18 10 11 7 4 6 0 0 2 0.182000 4.150 4.150 9.900 3083416 6 0 0 0 0 0 0 0 0 0 0 0 2 1 1 4 1 3 4 3 5 6 2 1 4 2 3 5 6 6 7 2 4 1 11 7 5 2 6 6 8 9 8 12 7 11 9 6 12 7 8 9 6 6 8 11 6 6 8 11 8 11 12 11 13 9 10 7 9 6 11 9 13 12 12 8 14 15 8 9 8 8 11 22 16 6 11 16 15 9 13 12 12 13 11 15 9 9 16 14 14 12 21 12 12 12 16 19 10 15 18 8 16 14 16 16 21 30 22 9 25 19 19 26 23 33 25 22 21 19 21 20 20 21 20 26 20 29 27 25 25 21 20 25 21 21 18 14 19 15 6 20 18 16 20 16 13 13 15 15 15 15 22 16 15 15 11 21 19 11 19 13 14 15 17 21 12 18 12 22 18 21 18 13 23 15 18 9 21 11 14 23 18 21 25 18 22 15 21 23 15 15 16 19 21 18 19 21 17 13 24 23 22 19 14 20 22 15 14 14 20 20 23 13 18 15 18 20 20 24 9 12 17 21 21 12 16 17 16 16 21 26 19 15 21 22 24 15 11 13 13 6 8 1 4 0 1 0 0.184000 4.200 4.200 10.00 3174897 3 0 0 0 0 0 0 0 0 0 0 0 1 1 2 3 0 5 4 3 3 0 7 3 2 4 2 8 6 4 5 9 3 8 6 4 2 7 6 8 7 9 3 5 8 5 9 7 7 6 11 14 7 12 9 9 5 15 12 14 15 12 9 11 5 8 13 11 12 10 9 17 12 11 8 17 11 19 11 15 9 11 7 15 14 16 16 16 7 12 10 14 13 13 16 16 11 15 13 14 12 16 11 12 13 17 10 13 19 11 17 11 13 14 13 10 19 19 23 24 22 24 24 31 19 23 22 28 21 25 29 17 23 17 21 30 22 19 25 27 27 22 23 23 17 25 17 20 17 12 23 21 9 17 20 16 19 16 17 20 9 16 11 22 16 15 12 15 17 23 24 16 16 18 26 11 16 20 18 10 14 17 26 19 17 15 17 19 12 21 20 24 17 27 13 16 18 19 23 14 19 14 10 11 18 19 6 15 21 23 25 17 17 18 21 27 20 17 18 20 25 22 20 18 22 18 17 15 24 16 15 22 18 22 14 20 20 22 18 22 25 19 26 12 19 19 13 12 16 19 14 9 7 5 4 2 0 2 0.186000 4.250 4.250 10.10 3283256 3 0 0 0 0 0 0 0 0 1 0 0 1 1 4 1 5 2 5 5 3 4 6 3 2 4 7 8 2 6 6 4 10 7 8 7 5 4 4 9 8 18 10 7 6 6 13 12 10 13 10 7 15 4 7 10 13 12 8 8 13 5 14 6 9 14 9 10 16 12 13 11 8 12 11 10 13 9 11 15 17 23 18 13 10 12 11 12 14 14 14 10 12 12 16 13 15 13 13 14 18 10 13 17 14 14 14 12 12 8 18 14 23 20 16 19 16 16 16 27 18 21 19 20 19 37 22 21 22 28 24 26 18 21 28 21 22 21 21 22 16 15 13 22 22 27 22 11 13 20 10 17 16 19 20 30 18 25 8 7 22 18 17 14 23 16 17 11 16 24 19 18 22 15 15 23 16 13 15 22 14 8 12 18 13 15 22 17 15 15 17 27 21 19 21 24 17 10 12 14 19 17 22 18 19 17 28 19 15 14 16 28 17 20 15 11 22 18 19 16 21 17 24 19 22 22 20 10 20 18 18 18 21 18 23 18 32 26 21 21 22 20 22 16 17 20 22 21 17 13 13 11 9 5 0 1 1 1 0.188000 4.300 4.300 10.20 3396610 5 0 0 0 0 0 0 0 0 0 0 0 1 2 3 0 2 5 5 4 3 3 5 1 2 3 6 9 3 3 3 8 7 2 9 5 7 5 11 8 9 7 6 9 6 4 5 8 6 10 9 14 10 15 6 7 13 15 10 13 7 15 10 10 11 14 14 6 7 17 13 19 3 13 9 6 13 13 14 10 11 12 16 17 13 10 15 15 19 19 11 11 15 11 13 9 13 20 8 18 14 18 23 23 23 15 19 20 14 11 7 18 16 15 22 28 20 24 22 25 17 20 39 24 26 25 25 33 25 25 25 33 15 29 18 29 18 12 18 23 17 24 28 22 16 20 33 23 18 23 26 23 15 24 16 16 16 16 17 15 15 16 14 11 9 23 17 13 13 18 12 19 20 30 20 20 15 21 19 16 18 20 23 19 15 10 11 15 19 13 22 22 18 19 16 19 23 16 10 25 23 20 21 20 31 19 19 18 15 22 18 14 13 21 18 19 22 19 16 17 21 14 20 26 18 26 22 19 26 19 20 22 15 13 24 23 15 21 21 21 27 18 22 19 24 17 22 16 18 23 10 12 3 5 3 3 0 0 0.190000 4.350 4.350 10.30 3502025 3 0 0 0 0 0 0 0 0 0 0 0 0 3 0 3 2 3 4 4 3 4 5 10 7 6 6 4 5 12 10 6 6 13 10 6 7 14 9 6 13 10 12 16 3 9 9 7 5 6 13 11 10 8 11 19 12 14 13 16 13 14 9 12 14 13 14 16 10 14 7 16 18 16 9 15 11 20 15 10 14 14 11 14 17 10 6 16 10 15 12 17 17 20 15 7 12 23 15 8 13 12 8 16 15 20 16 16 20 14 11 20 24 23 20 16 18 27 25 31 27 27 25 21 31 27 20 23 24 32 17 21 34 27 17 19 19 25 30 27 21 24 28 30 19 26 21 14 16 21 23 27 8 17 21 17 11 23 15 22 15 18 10 17 20 23 18 18 17 19 22 15 22 21 19 23 18 18 26 17 18 26 18 24 15 22 23 23 19 23 25 23 24 26 10 21 16 32 23 18 19 24 21 28 26 22 19 19 14 30 21 24 23 22 21 13 27 20 27 24 15 20 22 22 13 25 14 19 32 21 18 18 23 22 22 14 18 20 24 14 19 20 18 17 24 29 27 20 12 18 17 11 9 2 3 2 1 0 0.192000 4.400 4.400 10.40 3593938 3 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1 2 3 4 7 8 1 5 6 8 3 7 5 4 9 8 8 7 7 9 7 9 9 15 5 7 8 15 14 9 9 13 8 8 15 10 7 10 9 10 14 7 8 18 16 17 11 14 15 13 8 15 8 15 18 16 16 22 12 8 16 13 10 13 13 10 21 11 10 16 16 13 13 17 16 20 23 13 22 16 14 15 22 19 22 15 22 24 16 16 16 19 12 15 16 17 20 18 19 26 17 23 18 32 20 28 36 22 25 30 29 31 36 24 24 21 29 24 32 29 30 23 34 19 33 34 25 20 31 27 24 16 14 21 20 13 24 17 28 13 24 16 26 15 26 21 11 15 20 13 20 18 25 23 18 24 26 22 16 22 14 13 16 20 24 25 19 29 20 15 20 16 25 26 21 22 17 24 22 21 17 23 23 15 19 30 23 17 21 19 18 21 26 14 29 24 20 33 19 15 20 23 28 19 23 25 15 19 17 31 23 18 29 26 25 14 24 25 18 19 19 24 35 31 23 23 14 15 19 11 20 19 24 17 16 9 10 12 3 2 2 0 1 0.194000 4.450 4.450 10.50 3712573 7 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 5 3 5 4 3 11 3 10 4 6 7 8 5 5 5 8 9 12 7 7 11 8 6 7 9 10 13 10 6 13 9 9 9 11 14 14 12 13 10 6 13 13 15 12 13 19 8 14 13 16 11 13 14 15 9 15 16 13 16 17 17 17 23 18 16 19 10 13 18 16 10 9 21 11 22 14 20 14 18 13 15 12 13 14 16 14 15 20 29 17 14 18 8 15 21 15 19 15 22 20 17 15 23 26 16 26 24 23 23 23 23 30 24 29 28 26 35 33 31 22 23 22 20 37 22 27 33 26 27 26 17 16 18 27 22 21 24 18 18 18 17 15 18 14 19 24 22 15 20 21 15 19 25 15 16 26 19 22 29 20 16 13 15 16 32 24 23 13 33 17 22 18 18 23 24 22 21 20 26 21 16 22 18 18 16 15 26 26 17 22 21 13 25 24 13 23 18 18 25 32 20 24 21 17 19 24 24 23 33 19 19 21 32 18 22 23 19 23 32 18 31 22 25 23 23 31 29 21 16 20 20 15 22 14 12 5 10 9 2 1 0 1 0.196000 4.500 4.500 10.60 3829518 3 0 0 0 0 0 0 0 0 0 0 1 2 2 1 6 2 6 5 9 3 5 6 8 6 3 8 10 7 11 9 4 8 9 5 11 10 13 9 16 13 10 9 5 12 9 15 10 13 9 12 18 14 19 9 13 14 12 13 21 17 17 18 16 13 12 16 14 18 10 15 15 16 11 15 22 17 19 17 11 12 26 12 17 19 18 21 20 27 17 18 19 21 14 19 16 12 16 21 20 18 8 17 17 13 13 18 15 19 15 19 20 28 21 29 27 27 34 24 26 31 25 24 16 17 23 23 30 28 18 28 32 28 37 18 26 18 16 33 21 31 21 20 22 19 20 25 18 18 20 11 17 20 22 23 14 14 17 18 20 25 20 19 20 22 19 16 33 25 21 21 24 18 16 22 29 22 16 27 26 28 21 20 22 17 25 23 20 23 18 16 19 26 22 21 22 23 15 20 19 17 23 19 20 15 22 18 22 26 23 23 31 17 29 18 13 15 19 18 24 22 28 22 17 23 24 26 21 23 25 24 29 26 18 41 24 29 22 27 23 28 16 30 24 18 23 19 17 18 21 17 14 8 2 5 2 0 0 0.198000 4.550 4.550 10.70 3950740 3 0 0 0 0 0 0 0 0 0 1 1 1 2 1 3 7 5 6 7 7 7 4 5 6 4 1 8 9 10 9 8 10 8 12 6 10 8 10 8 11 9 10 15 7 11 8 13 11 13 15 15 17 12 10 8 17 12 9 14 12 14 11 14 21 14 15 20 18 16 8 15 22 24 14 10 18 14 15 16 12 10 16 21 16 25 17 20 17 17 20 15 24 15 17 22 25 17 13 22 18 20 19 11 21 22 21 16 21 24 16 22 17 21 17 24 22 24 35 27 24 28 24 32 37 34 25 24 29 37 37 25 28 21 23 24 22 21 20 25 22 32 19 21 22 24 20 21 20 22 18 27 17 14 20 22 22 22 14 19 20 20 21 23 22 14 20 21 23 20 18 23 20 25 31 24 18 22 14 23 22 21 23 27 27 20 21 18 22 23 24 23 21 18 22 17 22 21 35 15 24 24 12 27 30 27 28 22 31 24 24 19 27 24 28 23 25 26 35 27 22 29 21 24 18 19 26 33 29 31 23 25 19 24 26 21 10 23 24 26 28 20 27 26 17 29 22 18 14 22 8 10 11 4 4 1 2 0 0.200000 4.600 4.600 10.80 4068161 5 0 0 0 0 0 0 0 0 0 0 1 1 0 1 5 5 2 9 3 11 6 9 8 7 7 8 3 3 13 10 8 7 5 8 13 8 7 14 12 10 7 15 13 13 11 12 12 14 12 13 12 10 15 11 14 7 16 15 8 15 13 15 13 18 13 17 21 15 12 13 13 17 18 18 18 16 19 20 17 14 17 24 13 12 18 19 19 13 21 18 26 21 23 16 14 18 19 13 33 13 19 20 14 20 23 14 26 19 22 21 21 16 27 30 25 28 22 32 21 30 27 31 21 30 22 27 27 31 27 21 17 38 41 17 21 20 19 30 24 27 20 20 21 30 20 19 19 31 25 24 13 21 23 19 24 33 24 17 20 17 12 25 23 18 24 11 24 25 22 33 20 11 22 31 21 20 26 27 21 26 24 14 23 23 20 20 26 28 10 20 27 24 22 17 27 28 20 23 23 33 20 24 26 32 33 29 21 25 24 17 18 19 27 26 20 24 26 24 24 26 21 19 24 21 36 32 18 33 33 20 23 25 33 19 27 25 27 24 27 21 21 23 28 18 27 25 19 24 15 17 12 15 7 2 1 0 0 ", "%f ", Inf); -%! assert (rows (x) == n); - -%% Note use fprintf so output not sent to stdout -%% test/octave.test/io/printf-1.m -%!test -%! nm = tmpnam (); -%! 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); -%! assert (x, 8); -%! assert (str, "test:1"); - -%% test/octave.test/io/printf-2.m -%!error printf (1) - -%% test/octave.test/io/printf-3.m -%!error printf () - -%% 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 -%!error sprintf (1) - -%% test/octave.test/io/sprintf-3.m -%!error sprintf () - -%% 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 -%! if (j == 1) -%! mode_list = ["w"; "r"; "a"]; -%! elseif (j == 2) -%! mode_list = ["w+"; "r+"; "a+"]; -%! endif -%! nm = tmpnam (); -%! for k = 1:3 -%! mode = deblank (mode_list (k,:)); -%! [id, err] = fopen (nm, mode, arch); -%! if (id < 0) -%! __printf_assert__ ("open failed: %s (%s, %s): %s\n", nm, mode, arch, err); -%! status = 0; -%! break; -%! else -%! fclose (id); -%! endif -%! tmp_mode = cstrcat (mode, "b"); -%! [id, err] = fopen (nm, tmp_mode, arch); -%! if (id < 0) -%! __printf_assert__ ("open failed: %s (%s, %s): %s\n", nm, tmp_mode, arch, err); -%! status = 0; -%! break; -%! else -%! fclose (id); -%! endif -%! tmp_mode = cstrcat (mode, "t"); -%! [id, err] = fopen (nm, tmp_mode, arch); -%! if (id < 0) -%! __printf_assert__ ("open failed: %s (%s, %s): %s\n", nm, tmp_mode, arch, err); -%! status = 0; -%! break; -%! else -%! fclose (id); -%! endif -%! endfor -%! unlink (nm); -%! if (status == 0) -%! break; -%! endif -%! endfor -%! if (status == 0) -%! break; -%! endif -%! endfor -%! -%! assert (status == 1); - -%% test/octave.test/io/fopen-2.m -%!test -%! s.a = 1; -%! fail ("fopen (s)"); - -%% test/octave.test/io/fopen-3.m -%!error fopen ("foo", "x") - -%% test/octave.test/io/fopen-4.m -%! fopen ("foo", "wb", "noodle"); -%! assert (__prog_output_assert__ ("error:")); - -%% test/octave.test/io/fopen-5.m -%!error fopen () - -%% test/octave.test/io/fopen-6.m -%!error fopen ("foo", "wb", "native", 1) - -%% test/octave.test/io/fclose-1.m -%!error fclose (0) - -%% test/octave.test/io/fclose-2.m -%!error fclose (1, 2) - -%% test/octave.test/io/tmpnam-1.m -%!assert (ischar (tmpnam ())) - -%% test/octave.test/io/tmpnam-2.m -%!warning tmpnam (1); - -%% test/octave.test/io/tmpnam-3.m -%!warning tmpnam ("foo", 1); - -%% test/octave.test/io/tmpnam-4.m -%!error tmpnam (1, 2, 3) - -%% test/octave.test/io/binary-io-1.m -%!test -%! type_list = ["char"; "char*1"; "integer*1"; "int8"; -%! "schar"; "signed char"; "uchar"; "unsigned char"; -%! "short"; "ushort"; "unsigned short"; "int"; -%! "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"); -%! if (id > 0) -%! for i = 1:n -%! fwrite (id, i, deblank (type_list(i,:))); -%! 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")); - -%% test/octave.test/io/file-pos-1.m -%!test -%! nm = tmpnam (); -%! id = fopen (nm, "wb"); -%! if (id > 0) -%! fprintf (id, "%d\n", 1:100); -%! fclose (id); -%! id = fopen (nm, "rb"); -%! if (id > 0) -%! for i = 1:101 -%! fgets (id); -%! endfor -%! if (feof (id)) -%! fclose (id); -%! id = fopen (nm, "rb"); -%! pos_one = ftell (id); -%! s_one = fgets (id); -%! for i = 1:48 -%! s = fgets (id); -%! endfor -%! pos_fifty = ftell (id); -%! s_fifty = fgets (id); -%! fseek (id, pos_one, SEEK_SET); -%! s_one_x = fgets (id); -%! fseek (id, pos_fifty, SEEK_SET); -%! s_fifty_x = fgets (id); -%! if (s_one == s_one_x && s_fifty == s_fifty_x) -%! frewind (id); -%! s_one_x = fgets (id); -%! if (s_one != s_one_x) -%! error ("bombed!!"); -%! endif -%! endif -%! endif -%! endif -%! endif -%! unlink (nm); - -%% test/octave.test/io/fputs-1.m -%!error fputs () - -%% test/octave.test/io/fputs-2.m -%!error fputs (1, "foo", 1) - -%% test/octave.test/io/fputs-3.m -%!assert (fputs (1, 1),-1) - -%% test/octave.test/io/fgetl-1.m -%!error fgetl () - -%% test/octave.test/io/fgetl-2.m -%!error fgetl (1, 2, 3) - -%% test/octave.test/io/fgetl-3.m -%!error fgetl ("foo", 1) - -%% test/octave.test/io/fgets-1.m -%!error fgets () - -%% test/octave.test/io/fgets-2.m -%!error fgets (1, 2, 3) - -%% test/octave.test/io/fgets-3.m -%!error fgets ("foo", 1) - -%% test/octave.test/io/fprintf-1.m -%!error fprintf () - -%% test/octave.test/io/fprintf-2.m -%!error fprintf (1) - -%% test/octave.test/io/fprintf-3.m -%!test -%! s.a = 1; -%! fail ("fprintf (s)", "Invalid call to fprintf"); - -%% test/octave.test/io/fprintf-4.m -%!error fprintf (1, 1) - -%% test/octave.test/io/fprintf-5.m -%!error fprintf (-1, "foo") - -%% test/octave.test/io/fscanf-1.m -%!error fscanf () - -%% test/octave.test/io/fscanf-2.m -%!error fscanf (1) - -%% test/octave.test/io/fscanf-3.m -%!error fscanf ("foo", "bar") - -%% test/octave.test/io/fread-1.m -%!error fread () - -%% test/octave.test/io/fread-2.m -%!error fread (1, 2, "char", 1, "native", 2) - -%% test/octave.test/io/fread-3.m -%!error fread ("foo") - -%% test/octave.test/io/fwrite-1.m -%!error fwrite () - -%% test/octave.test/io/fwrite-2.m -%!error fwrite (1, rand (10), "char", 1, "native", 2) - -%% test/octave.test/io/fwrite-3.m -%!error fwrite ("foo", 1) - -%% test/octave.test/io/feof-1.m -%!error feof () - -%% test/octave.test/io/feof-2.m -%!error feof (1, 2) - -%% test/octave.test/io/feof-3.m -%!error feof ("foo") - -%% test/octave.test/io/ferror-1.m -%!error ferror () - -%% test/octave.test/io/ferror-2.m -%!error ferror (1, 'clear', 2) - -%% test/octave.test/io/ferror-3.m -%!error ferror ("foo") - -%% test/octave.test/io/ftell-1.m -%!error ftell () - -%% test/octave.test/io/ftell-2.m -%!error ftell (1, 2) - -%% test/octave.test/io/ftell-3.m -%!error ftell ("foo") - -%% test/octave.test/io/fseek-1.m -%!error fseek () - -%% test/octave.test/io/fseek-2.m -%!error fseek (1, 0, SEEK_SET, 1) - -%% test/octave.test/io/fseek-3.m -%!error fseek ("foo", 0, SEEK_SET) - -%% test/octave.test/io/frewind-1.m -%!error frewind () - -%% test/octave.test/io/frewind-2.m -%!error frewind (1, 2) - -%% test/octave.test/io/frewind-3.m -%!error frewind ("foo") - diff -r b8157404614f -r 1af8d21608b7 test/test_line_continue.m --- a/test/test_line_continue.m Sat Feb 09 20:05:40 2013 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,80 +0,0 @@ -## Copyright (C) 2006-2012 John W. Eaton -## -## This file is part of Octave. -## -## Octave is free software; you can redistribute it and/or modify it -## under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 3 of the License, or (at -## your option) any later version. -## -## Octave is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with Octave; see the file COPYING. If not, see -## . - -%!shared x, a, b -%! x = [1,2]; -%! a = 1; -%! b = 2; - -%!test -%! y = [a... # comments here ok -%! b]; -%! assert (y, x); - -%!test -%! x = [1;2]; -%! y = [a... # comments here ok -%! ;\ -%! -%! b]; -%! assert (y, x); - -%!assert (1 + ... -%! 2 - \# comments here ok -%! 3 / ... # comments here ok -%! -1,6); - -%!function y = f (a,... -%! b, ... -%! c, ... % comments ok -%! x, # continuation characters not required in parens -%! y, \# but they should work too. -%! z) -%! -%! y = 1; -%!endfunction -%! -%!assert (f (), 1) - -%!test -%!assert (1 == 1 -%! && 2 == 2 -%! || 3 == 5); - -%!test -%! x = [1, ... -%! -%! ... -%! -%! 2]; -%! y = [1;2]; -%! assert (y, x); - -%!test -%! x = [1 ,... -%! 2]; -%! y = [1,2]; -%! assert (y, x); - -%% test/oc tave.test/contin/contin-16.m -%!test -%! x = [ 1 , ... -%! 2]; -%! y = [1,2]; -%! assert (y, x); - diff -r b8157404614f -r 1af8d21608b7 test/test_logical_index.m --- a/test/test_logical_index.m Sat Feb 09 20:05:40 2013 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,73 +0,0 @@ -## Copyright (C) 2006-2012 John W. Eaton -## -## This file is part of Octave. -## -## Octave is free software; you can redistribute it and/or modify it -## under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 3 of the License, or (at -## your option) any later version. -## -## Octave is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with Octave; see the file COPYING. If not, see -## . - -%!test -%! a = []; -%! fail ("a(0);"); - -%!shared a -%! a = 2; -%!assert (a(1), 2); -%!error id=Octave:index-out-of-bounds a(logical ([1,1])) - -%!shared a -%! a = [9,8,7,6]; -%!assert (isempty (a(logical ([0,0,0,0])))) -%!assert (a(logical ([1,1,1,1])), [9,8,7,6]) -%!assert (a(logical ([0,1,1,0])), [8,7]) -%!assert (a(logical ([1,1])), [9,8]) - -%!shared a -%! a = [9,8;7,6]; -%!assert (isempty (a(logical ([0,0,0,0])))) -%!assert (a(logical ([1,1,1,1])), [9,7,8,6]) -%!assert (a(logical ([0,1,1,0])), [7,8]) -%!assert (a(logical (0:1),logical (0:1)), 6) -%!assert (a(logical (0:1),2:-1:1), [6,7]) -%!assert (a(logical (0:1),logical ([0,1])), 6) -%!assert (a(logical (0:1),[2,1]), [6,7]) -%!assert (a(logical (0:1),:), [7,6]) -%!assert (a(logical (0:1),1), 7) -%!assert (a(logical (0:1),logical ([1,1])), [7,6]) -%!assert (a(2:-1:1,logical (0:1)), [6;8]) -%!assert (a(2:-1:1,logical ([0,1])), [6;8]) -%!assert (a(2:-1:1,logical ([1,1])), [7,6;9,8]) -%!assert (a(logical ([0,1]),logical (0:1)), 6) -%!assert (a(logical ([0,1]),2:-1:1), [6,7]) -%!assert (a(logical ([0,1]),logical ([0,1])), 6) -%!assert (a(logical ([0,1]),[2,1]), [6,7]) -%!assert (a(logical ([0,1]),:), [7,6]) -%!assert (a(logical ([0,1]),1), 7) -%!assert (a(logical ([0,1]),logical ([1,1])), [7,6]) -%!assert (a([2,1],logical (0:1)), [6;8]) -%!assert (a([2,1],logical ([0,1])), [6;8]) -%!assert (a([2,1],logical ([1,1])), [7,6;9,8]) -%!assert (a(:,logical (0:1)), [8;6]) -%!assert (a(:,logical ([0,1])), [8;6]) -%!assert (a(:,logical ([1,1])), [9,8;7,6]) -%!assert (a(1,logical (0:1)), 8) -%!assert (a(1,logical ([0,1])), 8) -%!assert (a(1,logical ([1,1])), [9,8]) -%!assert (a(logical ([1,1]),logical (0:1)), [8;6]) -%!assert (a(logical ([1,1]),2:-1:1), [8,9;6,7]) -%!assert (a(logical ([1,1]),logical ([0,1])), [8;6]) -%!assert (a(logical ([1,1]),[2,1]), [8,9;6,7]) -%!assert (a(logical ([1,1]),:), [9,8;7,6]) -%!assert (a(logical ([1,1]),1), [9;7]) -%!assert (a(logical ([1,1]),logical ([1,1])), [9,8;7,6]) - diff -r b8157404614f -r 1af8d21608b7 test/test_null_assign.m --- a/test/test_null_assign.m Sat Feb 09 20:05:40 2013 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,63 +0,0 @@ -## Copyright (C) 2008-2012 Jaroslav Hajek -## -## This file is part of Octave. -## -## Octave is free software; you can redistribute it and/or modify it -## under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 3 of the License, or (at -## your option) any later version. -## -## Octave is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with Octave; see the file COPYING. If not, see -## . - -%!test -%! a = 1:3; a(:) = []; assert (size (a), [0, 0]) -%!test -%! a = 1:3; a(1:3) = []; assert (size (a), [1, 0]) -%!test -%! a = (1:3).'; a(1:3) = []; assert (size (a), [0, 1]) -%!test -%! a = ones (3); a(:,:) = []; assert (size (a), [0, 3]) -%!test -%! a = ones (3); a(1:3,:) = []; assert (size (a), [0, 3]) -%!test -%! a = ones (3); a(:,1:3) = []; assert (size (a), [3, 0]) -%!test -%! a = ones (3); fail ("a(1:2,1:2) = []", ".*"); -%!test -%! a = ones (3); fail ("a(1:3,1:3) = []", ".*"); - -## null strings should delete. [,] and [;] should delete. -%!test -%! a = ones (3); a(1:2,:) = [,]; assert (size (a), [1,3]) -%!test -%! a = ones (3); a(1:2,:) = [;]; assert (size (a), [1,3]) -%!test -%! a = ones (3); a(1:2,:) = ''; assert (size (a), [1,3]) -%!test -%! a = ones (3); a(1:2,:) = ""; assert (size (a), [1,3]) - -## null matrix stored anywhere should lose its special status -%!test -%! a = ones (3); b = []; fail ("a(:,1:3) = b", ".") -%!test -%! a = ones (3); b{1} = []; fail ("a(:,1:3) = b{1}", ".") -%!test -%! a = ones (3); b.x = []; fail ("a(:,1:3) = b.x", ".") - -## filtering a null matrix through a function should not delete -%!test -%! a = ones (3); fail ("a(:,1:3) = double ([])") - -## subsasgn should work the same way -%!test -%! a = ones (3); a = subsasgn (a, substruct ('()', {':',1:2}), []); assert (size (a), [3,1]) -%!test -%! a = ones (3); b = []; fail ("subsasgn (a, substruct ('()', {':',1:2}), b)", ".") - diff -r b8157404614f -r 1af8d21608b7 test/test_parser.m --- a/test/test_parser.m Sat Feb 09 20:05:40 2013 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,259 +0,0 @@ -## Copyright (C) 2010-2012 John W. Eaton -## -## This file is part of Octave. -## -## Octave is free software; you can redistribute it and/or modify it -## under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 3 of the License, or (at -## your option) any later version. -## -## Octave is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with Octave; see the file COPYING. If not, see -## . - -## Tests for parser problems belong in this file. -## We need many more tests here! - -%!assert ({1 2 {3 4}}, {1,2,{3,4}}) -%!assert ({1, 2 {3 4}}, {1,2,{3,4}}) -%!assert ({1 2, {3 4}}, {1,2,{3,4}}) -%!assert ({1 2 {3, 4}}, {1,2,{3,4}}) -%!assert ({1, 2, {3 4}}, {1,2,{3,4}}) -%!assert ({1 2,{3 4}}, {1,2,{3,4}}) -%!assert ({1 2,{3,4}}, {1,2,{3,4}}) -%!assert ({1,2,{3 4}}, {1,2,{3,4}}) - -## Tests for operator precedence as documented in section 8.8 of manual -## There are 13 levels of precedence from "parentheses and indexing" (highest) -## down to "statement operators" (lowest). -## -## Level 13 (parentheses and indexing) -## Overrides all other levels -%!test -%! a.b = 1; -%! assert (a. b++, 1) -%! assert (a.b, 2) -%! clear a; -%! a.b = [0 1]; -%! b = 2; -%! assert (a.b', [0;1]) -%! assert (!a .b, logical ([1 0])) -%! assert (3*a .b, [0 3]) -%! assert (a. b-1, [-1 0]) -%! assert (a. b:3, 0:3) -%! assert (a. b>0.5, logical ([0 1])) -%! assert (a. b&0, logical ([0 0])) -%! assert (a. b|0, logical ([0 1])) -%! a.b = [1 2]; -%! assert (a. b&&0, false) -%! assert (a. b||0, true) -%! a.b += a. b*2; -%! assert (a.b, [3 6]) -## Level 12 (postfix increment and decrement) -%!test -%! a = [3 5]; -%! assert (2.^a ++, [8 32]) -%! assert (a, [4 6]) -%! assert (a--', [4; 6]) -%! assert (a, [3 5]) -%! a = 0; -%! assert (!a --, true) -%! assert (-a ++, 1) -%! assert (3*a ++, 0) -%! assert (a++-2, -1) -%! assert (1:a ++, 1:2) -%! assert (4>a++, true) -%! a = [0 -1]; -%! assert ([1 1] & a++, logical ([0 1])) -%! assert ([0 0] | a++, logical ([1 0])) -%! a = 0; -%! assert (1 && a ++, false) -%! assert (0 || a --, true) -%! a = 5; b = 2; -%! b +=a ++; -%! assert (b, 7) - -## Level 11 (transpose and exponentiation) -%!test -%! assert (-2 ^2, -4) -%! assert (!0 ^0, false) -%! assert (2*3 ^2, 18) -%! assert (2+3 ^2, 11) -%! assert ([1:10](1:2 ^2), [1 2 3 4]) -%! assert (3>2 ^2, false) -%! assert (1&0 ^0, true) -%! assert (0|0 ^0, true) -%! assert (1&&0 ^0, true) -%! assert (0||0 ^0, true) -%! a = 3; -%! a *= 0 ^0; -%! assert (a, 3) -## Level 10 (unary plus/minus, prefix increment/decrement, not) -%!test -%! a = 2; -%! assert (++ a*3, 9) -%! assert (-- a-2, 0) -%! assert (a, 2) -%! assert (! a-2, -2) -%! assert ([1:10](++ a:5), 3:5) -%! a = [1 0]; -%! assert (! a>=[1 0], [false true]) -%! a = 0; -%! assert (++ a&1, true) -%! assert (-- a|0, false) -%! assert (-- a&&1, true) -%! assert (++ a||0, false) -%! a = 3; -%! a *= ++a; -%! assert (a, 16) -## Level 9 (multiply, divide) -%!test -%! assert (3+4 * 5, 23) -%! assert (5 * 1:6, [5 6]) -%! assert (3>1 * 5, false) -%! assert (1&1 * 0, false) -%! assert (1|1 * 0, true) -%! assert (1&&1 * 0, false) -%! assert (1||1 * 0, true) -%! a = 3; -%! a /= a * 2; -%! assert (a, 0.5) -## Level 8 (add, subtract) -%!test -%! assert ([2 + 1:6], 3:6) -%! assert (3>1 + 5, false) -%! assert (1&1 - 1, false) -%! assert (0|1 - 2, true) -%! assert (1&&1 - 1, false) -%! assert (0||1 - 2, true) -%! a = 3; -%! a *= 1 + 1; -%! assert (a, 6) -## Level 7 (colon) -%!test -%! assert (5:-1: 3>4, [true false false]) -%! assert (1: 3&1, [true true true]) -%! assert (1: 3|0, [true true true]) -%! assert (-1: 3&&1, false) -%! assert (-1: 3||0, false) -%! a = [1:3]; -%! a += 3 : 5; -%! assert (a, [4 6 8]) -## Level 6 (relational) -%!test -%! assert (0 == -1&0, false) -%! assert (1 == -1|0, false) -%! assert (0 == -1&&0, false) -%! assert (1 == -1||0, false) -%! a = 2; -%! a *= 3 > 1; -%! assert (a, 2) -## Level 5 (element-wise and) -%!test -%! assert (0 & 1|1, true) -%! assert ([0 1] & 1&&1, false) -%! assert (0 & 1||1, true) -%! a = 2; -%! a *= 3 & 1; -%! assert (a, 2) -## Level 4 (element-wise or) -%!test -%! assert ([0 1] | 1&&0, false) -%! assert ([0 1] | 1||0, true) -%! a = 2; -%! a *= 0 | 1; -%! assert (a, 2) -## Level 3 (logical and) -%!test -%! assert (0 && 1||1, true) -%! a = 2; -%! a *= 3 && 1; -%! assert (a, 2) -## Level 2 (logical or) -%!test -%! a = 2; -%! a *= 0 || 1; -%! assert (a, 2) - -## Tests for operator precedence within each level where ordering should -## be left to right except for postfix and assignment operators. - -## Level 13 (parentheses and indexing) -%!test -%! a.b1 = 2; -%! assert (a.(strcat('b','1'))++, 2) -%! assert (a.b1, 3) -%! b = {1 2 3 4 5}; -%! assert (b{(a. b1 + 1)}, 4) -%! b = 1:5; -%! assert (b(a. b1 + 1), 4) -%! assert ([2 3].^2', [4; 9]) -## Level 12 (postfix increment and decrement) -## No tests possible since a++-- is not valid -## Level 11 (transpose and exponentiation) -## Note: Exponentiation works left to right for compatibility with Matlab. -%! assert (2^3**2, 64) -%! assert ([2 3].^2.', [4;9]) -%! assert ([2 3].'.^2, [4;9]) -%! assert (3*4i'.', 0 - 12i) -%! assert (3*4i.'.', 0 + 12i) -## Level 10 (unary plus/minus, prefix increment/decrement, not) -%!test -%! assert (+-+1, -1) -%! a = -1; -%! assert (!++a, true) -%! assert (a, 0) -%! assert (-~a, -1) -%! assert (!~--a, true) -%! assert (a, -1) -## Level 9 (multiply, divide) -%!test -%! assert (3 * 4 / 5, 2.4) -%! assert (3 ./ 4 .* 5, 3.75) -%! assert (2 * 4 \ 6, 0.75) -%! assert (2 .\ 4 .* 6, 12) -## Level 8 (add, subtract) -%!test -%! assert (-3 - 4 + 1 + 3 * 2, 0) -## Level 7 (colon) -## No tests possible because colon operator can't be combined with second colon operator -## Level 6 (relational) -%!test -%! assert (0 < 1 <= 0.5 == 0 >= 0.5 > 0, true) -%! assert (1 < 1 == 0 != 0, true) -%! assert (1 < 1 == 0 ~= 0, true) -## Level 5 (element-wise and) -## No tests possible. Only one operator (&) at this precedence level and operation is associative. -## Level 4 (element-wise or) -## No tests possible. Only one operator (|) at this precedence level and operation is associative. -## Level 3 (logical and) -%!test -%! a = 1; -%! assert (1 && 0 && ++a, false) -%! assert (a, 1) -## Level 2 (logical or) -%!test -%! a = 1; -%! assert (0 || 1 || ++a, true) -%! assert (a, 1) -## Level 1 (assignment) -%!test -%! a = 2; b = 5; c = 7; -%! assert (a += b *= c += 1, 42) -%! assert (b == 40 && c == 8) - -## Test creation of anonymous functions - -%!test -%! af_in_cell = {@(x) [1 2]}; -%! assert (af_in_cell{1}(), [1, 2]); - -%!test -%! R = @(rot) [cos(rot) -sin(rot); sin(rot) cos(rot)]; -%! assert (R(pi/2), [cos(pi/2), -sin(pi/2); sin(pi/2),cos(pi/2)]); - diff -r b8157404614f -r 1af8d21608b7 test/test_prefer.m --- a/test/test_prefer.m Sat Feb 09 20:05:40 2013 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,227 +0,0 @@ -## Copyright (C) 2006-2012 John W. Eaton -## -## This file is part of Octave. -## -## Octave is free software; you can redistribute it and/or modify it -## under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 3 of the License, or (at -## your option) any later version. -## -## Octave is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with Octave; see the file COPYING. If not, see -## . - -%% test/octave.test/prefer/prefer-1.m -%!test -%! m = [3 2]; -%! assert (all (m == (3:-1:2))); - -%% test/octave.test/prefer/prefer-2.m -%!test -%! m = [3, -%! 2]; -%! assert (all (m == (3:-1:2)')); - -%% test/octave.test/prefer/prefer-3.m -%!test -%! a = 2; -%! assert ([a - 1], 1); - -%% test/octave.test/prefer/prefer-4.m -%!test -%! m = [3,2]; -%! fail ("[m ']"); - -%% test/octave.test/prefer/prefer-5.m -%!assert (all ([3 2] == (3:-1:2))); - -%% test/octave.test/prefer/prefer-6.m -%!assert (all ([3, 2] == (3:-1:2))); - -%% test/octave.test/prefer/prefer-7.m -%!test -%! m = [3,2]; -%! assert (all ([m (1)] == (3:-1:1))); - -%% test/octave.test/prefer/prefer-8.m -%!test -%! m = [3,2]; -%! assert ([m(1)],3); - -%% test/octave.test/prefer/prefer-10.m -%!test -%! a = 2; -%! assert ([a- 1], 1); - -%% test/octave.test/prefer/prefer-11.m -%!test -%! a = 1; -%! assert (all ([a -1] == (1:-2:-1))); - -%% test/octave.test/prefer/prefer-12.m -%!test -%! wsn = warning ("query", "Octave:str-to-num"); -%! warning ("off", "Octave:str-to-num"); -%! assert ("d" + 0, 100); -%! warning (wsn.state, "Octave:str-to-num"); - -%% test/octave.test/prefer/prefer-13.m -%!test -%! wsn = warning ("query", "Octave:str-to-num"); -%! warning ("on", "Octave:str-to-num"); -%! fail ("'d' + 0", "warning"); -%! warning (wsn.state, "Octave:str-to-num"); - -%% test/octave.test/prefer/prefer-14.m -%!test -%! wir = warning ("query", "Ocave:imag-to-real"); -%! warning ("off", "Ocave:imag-to-real"); -%! assert (eye (1+i), 1); -%! warning (wir.state, "Ocave:imag-to-real"); - -%% test/octave.test/prefer/prefer-15.m -%!test -%! wir = warning ("query", "Ocave:imag-to-real"); -%! warning ("on", "Ocave:imag-to-real"); -%! fail ("eye (1+i)", "warning"); -%! warning (wir.state, "Ocave:imag-to-real"); - -%% test/octave.test/prefer/prefer-17.m -%!test -%! wrre = warning ("query", "Octave:resize-on-range-error"); -%! warning ("off", "Octave:resize-on-range-error"); -%! 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; -%! a(1) = 1; a(2) = 2; -%! assert (all (a == [1,2])); - -%% test/octave.test/prefer/prefer-21.m -%!test -%! ped = print_empty_dimensions (); -%! print_empty_dimensions (0); -%! a = cell (1, 1); -%! b = type ("-q", "a"); -%! assert (!isempty (findstr (b{1}, "[]"))); -%! assert (isempty (findstr (b{1} ,"[](0x0)"))); -%! print_empty_dimensions (ped); - -%% test/octave.test/prefer/prefer-22.m -%!test -%! ped = print_empty_dimensions (); -%! print_empty_dimensions (1); -%! a = cell (1, 1); -%! b = type ("-q", "a"); -%! assert (!isempty (findstr (b{1}, "[](0x0)"))); -%! print_empty_dimensions (ped); - -%% test/octave.test/prefer/prefer-23.m -%!assert (all (size (inv ([])) == [0, 0])); - -%% test/octave.test/prefer/prefer-24.m -%!assert (all (svd ([]) == zeros (0, 1))); - -%% test/octave.test/prefer/prefer-27.m -%!test -%! sp = save_precision (); -%! save_precision (1); -%! x = pi; -%! nm = tmpnam (); -%! save("-text", nm, "x"); -%! clear x; -%! load (nm); -%! unlink (nm); -%! assert (x,3); -%! save_precision (sp); - -%% test/octave.test/prefer/prefer-28.m -%!test -%! sp = save_precision (); -%! save_precision (5); -%! x = pi; -%! nm = tmpnam (); -%! save("-text", nm, "x"); -%! clear x; -%! load (nm); -%! unlink (nm); -%! assert (x, 3.1416); -%! save_precision (sp); - -%% FIXME: How to capture standard output for comparison? -%% test/octave.test/prefer/prefer-29.m -%!function f () -%! 1 -%!endfunction -%!#test -%! sf = silent_functions (); -%! silent_functions (0); -%! f -%! assert (??); -%! silent_functions (sf); - -%% FIXME Same problem as above!!! -%% test/octave.test/prefer/prefer-30.m -%!function f () -%! 1 -%!endfunction -%!#test -%! sf = silent_functions (); -%! silent_functions (1); -%! f -%! assert (??); -%! silent_functions (sf); - -%% test/octave.test/prefer/prefer-32.m -%!test -%! wndz = warning ("query", "Octave:neg-dim-as-zero"); -%! warning ("on", "Octave:neg-dim-as-zero"); -%! fail ("eye (-1) == []", "warning"); -%! warning (wndz.state, "Octave:neg-dim-as-zero"); - -%% test/octave.test/prefer/prefer-33.m -%!test -%! wndz = warning ("query", "Octave:neg-dim-as-zero"); -%! warning ("off", "Octave:neg-dim-as-zero"); -%! assert (all (size (eye (-1)) == [0, 0])); -%! warning (wndz.state, "Octave:neg-dim-as-zero"); - -%% test/octave.test/prefer/prefer-34.m -%!test -%! watv = warning ("query", "Octave:assign-as-truth-value"); -%! warning ("off", "Octave:assign-as-truth-value"); -%! if (x = 1) 1; endif -%! warning (watv.state, "Octave:assign-as-truth-value"); - -%% test/octave.test/prefer/prefer-35.m -%!test -%! watv = warning ("query", "Octave:assign-as-truth-value"); -%! warning ("on", "Octave:assign-as-truth-value"); -%! fail ("if (x = 1) 1; endif", "warning"); -%! warning (watv.state, "Octave:assign-as-truth-value"); - -%% test/octave.test/prefer/prefer-38.m -%!test -%! wdbz = warning ("query", "Octave:divide-by-zero"); -%! warning ("off", "Octave:divide-by-zero"); -%! assert (isinf (1/0)); -%! warning (wdbz.state, "Octave:divide-by-zero"); - -%% test/octave.test/prefer/prefer-39.m -%!test -%! wdbz = warning ("query", "Octave:divide-by-zero"); -%! warning ("on", "Octave:divide-by-zero"); -%! a = 1; -%! b = 0; -%! fail ("isinf (a/b);", "warning") -%! warning (wdbz.state, "Octave:divide-by-zero"); - diff -r b8157404614f -r 1af8d21608b7 test/test_range.m --- a/test/test_range.m Sat Feb 09 20:05:40 2013 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,74 +0,0 @@ -## Copyright (C) 2007-2012 John W. Eaton -## -## This file is part of Octave. -## -## Octave is free software; you can redistribute it and/or modify it -## under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 3 of the License, or (at -## your option) any later version. -## -## Octave is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with Octave; see the file COPYING. If not, see -## . - -## Test values of range - -%!assert (full (1:9), [ 1 2 3 4 5 6 7 8 9 ]) -%!assert (full (1:0.4:3), [ 1.0 1.4 1.8 2.2 2.6 3.0 ]) -%!assert (full (9:1), zeros (1,0)) -%!assert (full (9:-1:1), [ 9 8 7 6 5 4 3 2 1 ]) -%!assert (full (1:-1:9), zeros (1,0)) -%!assert (full (1:1:1), 1) -%!assert (full (i:2i:10i), zeros (1,0)) - -## Test mixing integer range with other types - -%!shared expect, r, z -%! expect = [ 1 2 3 4 5 6 7 8 9 -%! 0 0 0 0 0 0 0 0 0 ]; -%! z = zeros (1,9); -%! r = 1:9; - -%!assert ([ r ; z ], expect) -%!assert ([ r ; single(z) ], single (expect)) -%!assert ([ r ; logical(z) ], expect) -%!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)) - -## Test mixing non-integer range with other types - -%!shared expect, r, z -%! expect = [ 1.0 1.4 1.8 2.2 2.6 3.0 -%! 0 0 0 0 0 0 ]; -%! z = zeros (1,6); -%! r = 1:0.4:3; - -%!assert ([ r ; z ], expect) -%!assert ([ r ; single(z) ], single (expect)) -%!assert ([ r ; logical(z) ], expect) -%!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)) - diff -r b8157404614f -r 1af8d21608b7 test/test_recursion.m --- a/test/test_recursion.m Sat Feb 09 20:05:40 2013 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -## Copyright (C) 2006-2012 John W. Eaton -## -## This file is part of Octave. -## -## Octave is free software; you can redistribute it and/or modify it -## under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 3 of the License, or (at -## your option) any later version. -## -## Octave is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with Octave; see the file COPYING. If not, see -## . - -%% test/octave.test/recursion/recursion-1.m -%!function y = f (x) -%! if (x == 1) -%! y = x; -%! return; -%! else -%! y = x * f (x-1); -%! endif -%!endfunction -%! -%!assert(f (5), 120); - -%% test/octave.test/recursion/recursion-2.m -%!function y = f (x) -%! if (x == 1) -%! y = x; -%! return; -%! else -%! y = f (x-1) * x; -%! endif -%!endfunction -%! -%!assert(f (5), 120); - -%%FIXME: Need test for maximum recursion depth diff -r b8157404614f -r 1af8d21608b7 test/test_return.m --- a/test/test_return.m Sat Feb 09 20:05:40 2013 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ -## Copyright (C) 2006-2012 John W. Eaton -## -## This file is part of Octave. -## -## Octave is free software; you can redistribute it and/or modify it -## under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 3 of the License, or (at -## your option) any later version. -## -## Octave is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with Octave; see the file COPYING. If not, see -## . - -%% test/octave.test/return/return-1.m -%!function y = f () -%! y = 1; -%! return; -%! y = 2; -%!endfunction -%! -%!assert(f(), 1) - -%% test/octave.test/return/return-2.m -%!test -%! return; - diff -r b8157404614f -r 1af8d21608b7 test/test_slice.m --- a/test/test_slice.m Sat Feb 09 20:05:40 2013 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,180 +0,0 @@ -## Copyright (C) 2007-2012 John W. Eaton -## -## This file is part of Octave. -## -## Octave is free software; you can redistribute it and/or modify it -## under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 3 of the License, or (at -## your option) any later version. -## -## Octave is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with Octave; see the file COPYING. If not, see -## . - -%!function x = set_slice (size, dim, slice) -%! x = ones (size); -%! switch dim -%! case 11 -%! x(slice) = 2; -%! case 21 -%! x(slice, :) = 2; -%! case 22 -%! x(:, slice) = 2; -%! case 31 -%! x(slice, :, :) = 2; -%! case 32 -%! x(:, slice, :) = 2; -%! case 33 -%! x(:, :, slice) = 2; -%! otherwise -%! error("invalid dim, '%d'", dim); -%! endswitch -%!endfunction - -## size = [2 0] -%!assert (set_slice ([2 0], 11, []), zeros ([2 0])) -%!error id=Octave:invalid-resize set_slice ([2 0], 11, 1) -%!error id=Octave:invalid-resize set_slice ([2 0], 11, 2) -%!error id=Octave:invalid-resize set_slice ([2 0], 11, 3) -%!assert (set_slice ([2 0], 21, []), zeros ([2 0])) -%!assert (set_slice ([2 0], 21, 1), zeros ([2 0])) -%!assert (set_slice ([2 0], 21, 2), zeros ([2 0])) -%!assert (set_slice ([2 0], 21, 3), zeros ([3 0])) -%!assert (set_slice ([2 0], 22, []), zeros ([2 0])) -%!assert (set_slice ([2 0], 22, 1), [2 2]') -%!assert (set_slice ([2 0], 22, 2), [0 0;2 2]') -%!assert (set_slice ([2 0], 22, 3), [0 0;0 0;2 2]') -%!assert (set_slice ([2 0], 31, []), zeros ([2 0])) -%!assert (set_slice ([2 0], 31, 1), zeros ([2 0])) -%!assert (set_slice ([2 0], 31, 2), zeros ([2 0])) -%!assert (set_slice ([2 0], 31, 3), zeros ([3 0])) -%!assert (set_slice ([2 0], 32, []), zeros ([2 0])) -%!assert (set_slice ([2 0], 32, 1), [2 2]') -%!assert (set_slice ([2 0], 32, 2), [0 0;2 2]') -%!assert (set_slice ([2 0], 32, 3), [0 0;0 0;2 2]') -%!assert (set_slice ([2 0], 33, []), zeros ([2 0])) -%!assert (set_slice ([2 0], 33, 1), zeros ([2 0])) -%!assert (set_slice ([2 0], 33, 2), zeros ([2 0 2])) -%!assert (set_slice ([2 0], 33, 3), zeros ([2 0 3])) - -## size = [0 2] -%!assert (set_slice ([0 2], 11, []), zeros ([0 2])) -%!assert (set_slice ([0 2], 11, 1), 2) -%!assert (set_slice ([0 2], 11, 2), [0, 2]) -%!assert (set_slice ([0 2], 11, 3), [0, 0, 2]) -%!assert (set_slice ([0 2], 21, []), zeros ([0 2])) -%!assert (set_slice ([0 2], 21, 1), [2 2]) -%!assert (set_slice ([0 2], 21, 2), [0 0;2 2]) -%!assert (set_slice ([0 2], 21, 3), [0 0;0 0;2 2]) -%!assert (set_slice ([0 2], 22, []), zeros ([0 2])) -%!assert (set_slice ([0 2], 22, 1), zeros ([0 2])) -%!assert (set_slice ([0 2], 22, 2), zeros ([0 2])) -%!assert (set_slice ([0 2], 22, 3), zeros ([0 3])) -%!assert (set_slice ([0 2], 31, []), zeros ([0 2])) -%!assert (set_slice ([0 2], 31, 1), [2 2]) -%!assert (set_slice ([0 2], 31, 2), [0 0;2 2]) -%!assert (set_slice ([0 2], 31, 3), [0 0;0 0;2 2]) -%!assert (set_slice ([0 2], 32, []), zeros ([0 2])) -%!assert (set_slice ([0 2], 32, 1), zeros ([0 2])) -%!assert (set_slice ([0 2], 32, 2), zeros ([0 2])) -%!assert (set_slice ([0 2], 32, 3), zeros ([0 3])) -%!assert (set_slice ([0 2], 33, []), zeros ([0 2])) -%!assert (set_slice ([0 2], 33, 1), zeros ([0 2])) -%!assert (set_slice ([0 2], 33, 2), zeros ([0 2 2])) -%!assert (set_slice ([0 2], 33, 3), zeros ([0 2 3])) - -## size = [2 1] -%!assert (set_slice ([2 1], 11, []), ones ([2 1])) -%!assert (set_slice ([2 1], 11, 1), [2 1]') -%!assert (set_slice ([2 1], 11, 2), [1 2]') -%!assert (set_slice ([2 1], 11, 3), [1 1 2]') -%!assert (set_slice ([2 1], 11, 4), [1 1 0 2]') -%!assert (set_slice ([2 1], 21, []), ones ([2 1])) -%!assert (set_slice ([2 1], 21, 1), [2 1]') -%!assert (set_slice ([2 1], 21, 2), [1 2]') -%!assert (set_slice ([2 1], 21, 3), [1 1 2]') -%!assert (set_slice ([2 1], 21, 4), [1 1 0 2]') -%!assert (set_slice ([2 1], 22, []), ones ([2 1])) -%!assert (set_slice ([2 1], 22, 1), [2 2]') -%!assert (set_slice ([2 1], 22, 2), [1 1;2 2]') -%!assert (set_slice ([2 1], 22, 3), [1 1;0 0;2 2]') -%!assert (set_slice ([2 1], 31, []), ones ([2 1])) -%!assert (set_slice ([2 1], 31, 1), [2 1]') -%!assert (set_slice ([2 1], 31, 2), [1 2]') -%!assert (set_slice ([2 1], 31, 3), [1 1 2]') -%!assert (set_slice ([2 1], 31, 4), [1 1 0 2]') -%!assert (set_slice ([2 1], 32, []), ones ([2 1])) -%!assert (set_slice ([2 1], 32, 1), [2 2]') -%!assert (set_slice ([2 1], 32, 2), [1 1;2 2]') -%!assert (set_slice ([2 1], 32, 3), [1 1;0 0;2 2]') -%!assert (set_slice ([2 1], 33, []), ones ([2 1])) -%!assert (set_slice ([2 1], 33, 1), [2 2]') -%!assert (set_slice ([2 1], 33, 2), reshape ([1 1 2 2],[2 1 2])) -%!assert (set_slice ([2 1], 33, 3), reshape ([1 1 0 0 2 2],[2 1 3])) - -## size = [1 2] -%!assert (set_slice ([1 2], 11, []), full (ones ([1 2]))) -%!assert (set_slice ([1 2], 11, 1), [2 1]) -%!assert (set_slice ([1 2], 11, 2), [1 2]) -%!assert (set_slice ([1 2], 11, 3), [1 1 2]) -%!assert (set_slice ([1 2], 11, 4), [1 1 0 2]) -%!assert (set_slice ([1 2], 21, []), full (ones ([1 2]))) -%!assert (set_slice ([1 2], 21, 1), [2 2]) -%!assert (set_slice ([1 2], 21, 2), [1 1;2 2]) -%!assert (set_slice ([1 2], 21, 3), [1 1;0 0;2 2]) -%!assert (set_slice ([1 2], 22, []), full (ones ([1 2]))) -%!assert (set_slice ([1 2], 22, 1), [2 1]) -%!assert (set_slice ([1 2], 22, 2), [1 2]) -%!assert (set_slice ([1 2], 22, 3), [1 1 2]) -%!assert (set_slice ([1 2], 22, 4), [1 1 0 2]) -%!assert (set_slice ([1 2], 31, []), full (ones ([1 2]))) -%!assert (set_slice ([1 2], 31, 1), [2 2]) -%!assert (set_slice ([1 2], 31, 2), [1 1;2 2]) -%!assert (set_slice ([1 2], 31, 3), [1 1;0 0;2 2]) -%!assert (set_slice ([1 2], 32, []), full (ones ([1 2]))) -%!assert (set_slice ([1 2], 32, 1), [2 1]) -%!assert (set_slice ([1 2], 32, 2), [1 2]) -%!assert (set_slice ([1 2], 32, 3), [1 1 2]) -%!assert (set_slice ([1 2], 32, 4), [1 1 0 2]) -%!assert (set_slice ([1 2], 33, []), full (ones ([1 2]))) -%!assert (set_slice ([1 2], 33, 1), [2 2]) -%!assert (set_slice ([1 2], 33, 2), reshape ([1 1 2 2],[1 2 2])) -%!assert (set_slice ([1 2], 33, 3), reshape ([1 1 0 0 2 2],[1 2 3])) - -## size = [2 2] -%!assert (set_slice ([2 2], 11, []), ones ([2 2])) -%!assert (set_slice ([2 2], 11, 1), [2 1;1 1]) -%!assert (set_slice ([2 2], 11, 2), [1 1;2 1]) -%!assert (set_slice ([2 2], 11, 3), [1 2;1 1]) -%!assert (set_slice ([2 2], 11, 4), [1 1;1 2]) -%!error id=Octave:invalid-resize set_slice ([2 2], 11, 5) -%!error id=Octave:invalid-resize set_slice ([2 2], 11, 6) -%!assert (set_slice ([2 2], 21, []), ones ([2 2])) -%!assert (set_slice ([2 2], 21, 1), [2 2;1 1]) -%!assert (set_slice ([2 2], 21, 2), [1 1;2 2]) -%!assert (set_slice ([2 2], 21, 3), [1 1;1 1;2 2]) -%!assert (set_slice ([2 2], 21, 4), [1 1;1 1;0 0;2 2]) -%!assert (set_slice ([2 2], 22, []), ones ([2 2])) -%!assert (set_slice ([2 2], 22, 1), [2 2;1 1]') -%!assert (set_slice ([2 2], 22, 2), [1 1;2 2]') -%!assert (set_slice ([ 2 2], 22, 3), [1 1;1 1;2 2]') -%!assert (set_slice ([2 2], 22, 4), [1 1;1 1;0 0;2 2]') -%!assert (set_slice ([2 2], 31, []), ones ([2 2])) -%!assert (set_slice ([2 2], 31, 1), [2 2;1 1]) -%!assert (set_slice ([2 2], 31, 2), [1 1;2 2]) -%!assert (set_slice ( [2 2], 31, 3), [1 1;1 1;2 2]) -%!assert (set_slice ([2 2], 31, 4), [1 1;1 1;0 0;2 2]) -%!assert (set_slice ([2 2], 32, []), ones ([2 2])) -%!assert (set_slice ([2 2], 32, 1), [2 2;1 1]') -%!assert (set_slice ([2 2], 32, 2), [1 1;2 2]') -%!assert (set_slice ([ 2 2], 32, 3), [1 1;1 1;2 2]') -%!assert (set_slice ([2 2], 32, 4), [1 1;1 1;0 0;2 2]') -%!assert (set_slice ([2 2], 33, []), ones ([2 2])) -%!assert (set_slice ([2 2], 33, 1), [2 2;2 2]) -%!assert (set_slice ([2 2], 33, 2), reshape ([1 1 1 1 2 2 2 2],[2 2 2])) -%!assert (set_slice ([ 2 2], 33, 3), reshape ([1 1 1 1 0 0 0 0 2 2 2 2],[2 2 3])) diff -r b8157404614f -r 1af8d21608b7 test/test_struct.m --- a/test/test_struct.m Sat Feb 09 20:05:40 2013 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,266 +0,0 @@ -## Copyright (C) 2006-2012 John W. Eaton -## -## This file is part of Octave. -## -## Octave is free software; you can redistribute it and/or modify it -## under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 3 of the License, or (at -## your option) any later version. -## -## Octave is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with Octave; see the file COPYING. If not, see -## . - -%% test/octave.test/struct/fieldnames-1.m -%!test -%! s.a = 1; -%! c = fieldnames (s); -%! assert (iscell (c) && strcmp (c{1}, "a")); - -%% test/octave.test/struct/fieldnames-2.m -%!test -%! s.a.b = 1; -%! c = fieldnames (s.a); -%! assert (iscell (c) && strcmp (c{1}, "b")); - -%% test/octave.test/struct/fieldnames-3.m -%!error fieldnames (); - -%% test/octave.test/struct/fieldnames-4.m -%!test -%! s.a = 1; -%! fail ("fieldnames (s, 1)", "Invalid call to fieldnames"); - -%% test/octave.test/struct/fieldnames-5.m -%!error fieldnames (1); - -%% test/octave.test/struct/isfield-1.m -%!test -%! s.aaa = 1; -%! s.a = 2; -%! assert (isfield (s, "a")); - -%% test/octave.test/struct/isfield-2.m -%!test -%! s.aaa = 1; -%! s.a = 2; -%! assert (!(isfield (s, "b"))); - -%% test/octave.test/struct/isfield-3.m -%!error isfield (); - -%% test/octave.test/struct/isfield-4.m -%!test -%! s.aaa = 1; -%! s.a = 2; -%! fail ("isfield (s, 'a', 3);", "Invalid call to isfield"); - -%% test/octave.test/struct/isfield-5.m -%!assert (isfield (1, "m") == 0); - -%% test/octave.test/struct/isfield-6.m -%!test -%! s.a = 2; -%! assert (isfield (s, 2) == 0); - -%% test/octave.test/struct/isstruct-1.m -%!assert (!(isstruct (1))) - -%% test/octave.test/struct/isstruct-2.m -%!assert (!(isstruct ([1, 2]))) - -%% test/octave.test/struct/isstruct-3.m -%!assert (!(isstruct ([]))) - -%% test/octave.test/struct/isstruct-4.m -%!assert (!(isstruct ([1, 2; 3, 4]))) - -%% test/octave.test/struct/isstruct-5.m -%!assert (!(isstruct ("t"))) - -%% test/octave.test/struct/isstruct-6.m -%!assert (!(isstruct ("test"))) - -%% test/octave.test/struct/isstruct-7.m -%!assert (!(isstruct (["test"; "ing"]))) - -%!assert (!(isstruct ({1}))) - -%% test/octave.test/struct/isstruct-8.m -%!test -%! s.a = 1; -%! assert (isstruct (s)); - -%% test/octave.test/struct/isstruct-9.m -%!test -%! s.a.b = 1; -%! assert (isstruct (s.a)); - -%% test/octave.test/struct/isstruct-10.m -%!error isstruct (); - -%% test/octave.test/struct/isstruct-11.m -%!test -%! s.a = 1; -%! fail ("isstruct (s, 1)", "Invalid call to isstruct"); - -## increment element of matrix stored in struct array field -%!test -%! a = struct ("c", {[1, 2, 3], [4, 5, 6], [7, 8, 9]}); -%! a(2).c(3)++; -%! assert (a(2).c, [4, 5, 7]); - -## create struct array by assignment to cs-list -%!test -%! [a(1:2).x] = deal (1, 3); -%! assert (a, struct ("x", {1, 3})); -%! assert ({a(1:2).x}, {1, 3}); - -## assign to subrange of struct array field -%!test -%! b = struct ("name", {"a", "b", "c"; "d", "e", "f"}, "value", 100); -%! [b(1:2, [1,3]).name] = deal ("aaa", "ddd", "ccc", "fff"); -%! assert ({b.name}, {"aaa", "ddd", "b", "e", "ccc", "fff"}); - -## index into nested struct arrays -%!test -%! a = struct ("name", {"a", "b", "c"; "d", "e", "f"}, "value", 0); -%! a(2).value = a; -%! assert (a(2).value(2,3).name, "f"); - -## assign to subrange of field in nested struct array -%!test -%! b = struct ("name", {"a", "b", "c"; "d", "e", "f"}, "value", 0); -%! b(3, 1).value = b; -%! [b(3, 1).value(1, [1, 3]).name] = deal ("aaa", "ccc"); -%! assert (size (b), [3, 3]); -%! assert (b(3,1).value(1, 3).name, "ccc"); - -## test 4-dimensional struct array -%!test -%! c(4, 4, 4, 4).name = "a"; -%! c(3, 3, 3, 3).value = 1; -%! assert (c(2,2,2,2), struct ("name", [], "value", [])); - -## assign to subrange of field in 4D struct array -%!test -%! 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); - -## swap elements of struct array -%!test -%! b = struct ("name", {"a", "b", "c"; "d", "e", "f"}, "value", 0); -%! [b([2, 1], [3, 1]).name] = deal (b([1, 2], [1, 2]).name); -%! assert ({b.name}, {"e", "b", "b", "e", "d", "a"}); - -## test internal ordering of struct array fields -%!test -%! 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)); -%! assert ([d{4, 4, 4, 4}, d{1, 2, 3, 4}, d{3, 3, 3, 3}], -%! [3, 2, 1]); - -## test assignment to mixed cs-list of field element subranges -%!test -%! b = struct ("name", {"a", "b", "c"; "d", "e", "f"}, "value", 100); -%! [b(1:2, [1, 3]).name, b(2, 1:3).value] = ... -%! deal (1, 2, 3, 4, "5", "6", "7"); -%! assert ({b.name}, {1, 2, "b", "e", 3, 4}); -%! assert ({b.value}, {100, "5", 100, "6", 100, "7"}); - -%!error -%! [a(1:3).x] = deal ([1, 5], [3, 7], [8, 9]); -%! [a(2:3).x(2)] = deal (10, 11); - -%!error -%! [a(1:3).x] = deal ([1, 5], [3, 7], [8, 9]); -%! a(2:3).x(2); - -%!error id=Octave:index-out-of-bounds -%! a(1).x.x = 1; -%! a(2).x; - -%!error -%! a = struct ("value", {1, 2, 3, 4, 5}); -%! [a(2:4).value] = 1; - -%!error -%! c(4, 4, 4, 4).name = "a"; -%! c(3, 3, 3, 3).value = 1; -%! c([1, 3], 2, :, [3, 4]).value = 1; - -## test lazy copying in structs: nested assignment to self -%!test -%! a.a = 1; -%! a.b = a; -%! a.b.c = a; -%! assert (a.b.c.b, struct ("a", 1)); - -## test lazy copying in structs: indirect nested assignment to self -%!test -%! a.a = 1; -%! a.b = 2; -%! b.c = a; -%! b.d = 3; -%! c.d = b; -%! c.e = 4; -%! a.b = c; -%! a.b.e = a; -%! assert (a.b.e.b.d.c, struct ("a", 1, "b", 2)); - -## test lazy copying in structs: nested assignment via function -%!function aa = do_nest (a); -%! aa = a; -%! aa.b = a; -%!endfunction -%!test -%! a.c = 1; -%! a = do_nest (a); -%! a = do_nest (a); -%! a = do_nest (a); -%! assert (a.b.b.b, struct ("c", 1)); - -## test lazy copying in structs: nested assignment via function -%!function aa = do_nest (a); -%! aa = a; -%! aa.b = a; -%! aa.b.c = aa; -%!endfunction -%!test -%! a.c = 1; -%! a = do_nest (a); -%! a = do_nest (a); -%! a = do_nest (a); -%! assert (a.b.c.b.b.c.b.b.c.b, struct ("c", 1)); - -## test lazy copying in structs: nested assignment on different levels. -%!test -%! a.b = 1; -%! b.c = a; -%! b.d.e = a; -%! b.f.g.h = a; -%! b.i.j.k.l = a; -%! a.m = b; -%! a.m.c.b = a; -%! assert (a.m.c.b.m.i.j.k.l, struct ("b", 1)); - -## test indexed assignment into empty struct array -%!test -%! s = resize (struct (), 3,2); -%! s(3).foo = 42; -%! assert (s(3), struct ("foo", 42)); - -%!error id=Octave:index-out-of-bounds -%! s = resize (struct (),3,2); -%! s(3).foo = 42; -%! s(7); diff -r b8157404614f -r 1af8d21608b7 test/test_switch.m --- a/test/test_switch.m Sat Feb 09 20:05:40 2013 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,95 +0,0 @@ -## Copyright (C) 2006-2012 John W. Eaton -## -## This file is part of Octave. -## -## Octave is free software; you can redistribute it and/or modify it -## under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 3 of the License, or (at -## your option) any later version. -## -## Octave is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with Octave; see the file COPYING. If not, see -## . - -%% test/octave.test/switch/switch-1.m -%!test -%! 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 -%!test -%! a = 1; -%! b = 2; -%! c = 3; -%! -%! x = zeros (1, 4); -%! -%! k = 1; -%! -%! for i = 0:3 -%! switch (i) -%! case a -%! x(k) = a; -%! case b -%! x(k) = b; -%! otherwise -%! x(k) = c; -%! endswitch -%! k++; -%! endfor -%! -%! assert (all (x == [3, 1, 2, 3])); - -%% test/octave.test/switch/switch-3.m -%!test -%! a = 1; -%! b = 2; -%! c = 3; -%! -%! x = zeros (1, 4); -%! -%! k = 1; -%! -%! for i = 0:3 -%! switch (i) -%! case a -%! x(k) = a; -%! endswitch -%! k++; -%! endfor -%! -%! assert (all (x == [0, 1, 0, 0])); - -%!test -%! a = 1; -%! -%! switch 1 -%! otherwise -%! a = 2; -%! endswitch -%! -%! assert (a == 2); - - -%% test/octave.test/switch/switch-4.m -%!error eval ("switch endswitch") - -%% test/octave.test/switch/switch-5.m -%!error eval ("switch case endswitch") - -%% test/octave.test/switch/switch-6.m -%!error eval ("switch 1 default 1; endswitch") - diff -r b8157404614f -r 1af8d21608b7 test/test_system.m --- a/test/test_system.m Sat Feb 09 20:05:40 2013 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,489 +0,0 @@ -## Copyright (C) 2006-2012 John W. Eaton -## -## This file is part of Octave. -## -## Octave is free software; you can redistribute it and/or modify it -## under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 3 of the License, or (at -## your option) any later version. -## -## Octave is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with Octave; see the file COPYING. If not, see -## . - -%% test/octave.test/system/cputime-1.m -%!test -%! [t1, u1, s1] = cputime (); -%! for i = 1:200 -%! sin (i); -%! endfor -%! [t2, u2, s2] = cputime (); -%! assert (t1, u1 + s1); -%! assert (t2 == u2 + s2); -%! assert (t2 >= t1); -%! assert (u2 >= u2); -%! assert (s2 >= s2); -%!#assert (t1 == u1 + s1 && t2 == u2 + s2 && t2 >= t1 && u2 >= u2 && s2 >= s2); - -%% test/octave.test/system/tic-toc-1.m -%!test -%! tic (); -%! sleep (2); -%! assert (toc () > 0); - -%% test/octave.test/system/pause-1.m -%!test -%! pause (0); -%! __printf_assert__ ("ok\n"); -%! assert (__prog_output_assert__ ("ok")); - -%% test/octave.test/system/pause-2.m -%!error pause (1, 2) - -%% test/octave.test/system/sleep-1.m -%!test -%! sleep (0); -%! __printf_assert__ ("ok\n"); -%! assert (__prog_output_assert__ ("ok")); - -%% test/octave.test/system/sleep-2.m -%!error sleep () - -%% test/octave.test/system/sleep-3.m -%!error sleep (1, 2) - -%% test/octave.test/system/usleep-1.m -%!test -%! usleep (0); -%! __printf_assert__ ("ok\n"); -%! assert (__prog_output_assert__ ("ok")); - -%% test/octave.test/system/usleep-2.m -%!error usleep () - -%% test/octave.test/system/usleep-3.m -%!error usleep (1, 2) - -%% test/octave.test/system/rename-1.m -%!test -%! from = tmpnam (); -%! to = tmpnam (); -%! id = fopen (from, "wb"); -%! if (id > 0 && fclose (id) == 0) -%! [s, e] = stat (from); -%! if (! e) -%! if (rename (from, to) == 0) -%! [s, e] = stat (from); -%! if (e < 0) -%! [s, e] = stat (to); -%! assert (e == 0); -%! unlink (to); -%! endif -%! endif -%! endif -%! endif - -%% test/octave.test/system/rename-2.m -%!error rename () - -%% test/octave.test/system/rename-3.m -%!error rename ("foo", "bar", 1) - -%% test/octave.test/system/unlink-1.m -%!test -%! nm = tmpnam (); -%! if ((id = fopen (nm, "wb")) > 0) -%! [s, err] = stat (nm); -%! if (! err && fclose (id) == 0 && unlink (nm) == 0) -%! [s, err] = stat (nm); -%! assert (err < 0); -%! endif -%! endif - -%% test/octave.test/system/unlink-2.m -%!error unlink () - -%% test/octave.test/system/unlink-3.m -%!error unlink ("foo", 1) - -%% test/octave.test/system/readdir-1.m -%!test -%! [files, status, msg] = readdir (filesep); -%! assert (iscell (files) && status == 0 && strcmp (msg, "")); - -%% test/octave.test/system/readdir-2.m -%!error readdir () - -%% test/octave.test/system/readdir-3.m -%!error readdir ("foo", 1) - -%% test/octave.test/system/mk-rm-dir-1.m -%!test -%! nm = tmpnam (); -%! e1 = mkdir (nm); -%! [s2, e2] = stat (nm); -%! e3 = rmdir (nm); -%! [s4, e4] = stat (nm); -%! assert ((e1 && strcmp (s2.modestr(1), "d") && e3 && e4 < 0)); - -%% test/octave.test/system/mkdir-1.m -%!error mkdir () - -%% test/octave.test/system/mkdir-2.m -%!error mkdir ("foo", 1, 2) - -%% test/octave.test/system/rmdir-1.m -%!error rmdir () - -%% test/octave.test/system/rmdir-2.m -%!test -%! crr = confirm_recursive_rmdir (); -%! confirm_recursive_rmdir (0); -%! assert (!rmdir ("foo", "s")); -%! confirm_recursive_rmdir (crr); - -%% test/octave.test/system/umask-1.m -%!test -%! orig_umask = umask (0); -%! nm = tmpnam (); -%! id = fopen (nm, "wb"); -%! 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 -%! umask (orig_umask); - -%% test/octave.test/system/umask-2.m -%!error umask () - -%% test/octave.test/system/umask-3.m -%!error umask (1, 2) - -%% test/octave.test/system/stat-1.m -%!test -%! [s, err, msg] = stat (filesep); -%! assert ((err == 0 -%! && isstruct (s) -%! && isfield (s, "dev") -%! && isfield (s, "ino") -%! && isfield (s, "modestr") -%! && isfield (s, "nlink") -%! && isfield (s, "uid") -%! && isfield (s, "gid") -%! && isfield (s, "size") -%! && isfield (s, "atime") -%! && isfield (s, "mtime") -%! && isfield (s, "ctime") -%! && ischar (msg))); - -%% test/octave.test/system/stat-2.m -%!error stat () - -%% test/octave.test/system/stat-3.m -%!error stat ("foo", 1) - -%% test/octave.test/system/lstat-1.m -%!test -%! [s, err, msg] = lstat (filesep); -%! assert ((err == 0 -%! && isstruct (s) -%! && isfield (s, "dev") -%! && isfield (s, "ino") -%! && isfield (s, "modestr") -%! && isfield (s, "nlink") -%! && isfield (s, "uid") -%! && isfield (s, "gid") -%! && isfield (s, "size") -%! && isfield (s, "atime") -%! && isfield (s, "mtime") -%! && isfield (s, "ctime") -%! && ischar (msg))); - -%% test/octave.test/system/lstat-2.m -%!error lstat () - -%% test/octave.test/system/lstat-3.m -%!error lstat ("foo", 1) - -%% test/octave.test/system/glob-1.m -%!assert (iscell (glob ([filesep "*"]))) - -%% test/octave.test/system/glob-2.m -%!error glob () - -%% test/octave.test/system/glob-3.m -%!error glob ("foo", 1) - -%% test/octave.test/system/fnmatch-1.m -%!test -%! string_fill_char = setstr (0); -%! assert ((fnmatch ("a*a", {"aba"; "xxxba"; "aa"}) == [1; 0; 1] -%! && fnmatch ({"a*a"; "b*b"}, "bob") -%! && fnmatch ("x[0-5]*", {"x1"; "x6"}) == [1; 0] -%! && fnmatch ("x[0-5]*", {"x1"; "x6"; "x001"}) == [1; 0; 1] -%! && fnmatch ("x???y", {"xabcy"; "xy"}) == [1; 0])); - -%% test/octave.test/system/fnmatch-2.m -%!error fnmatch () - -%% test/octave.test/system/fnmatch-3.m -%!error fnmatch ("foo", "bar", 3) - -%% test/octave.test/system/file_in_path-1.m -%!assert (ischar (file_in_path (path (), "date.m"))) - -%% test/octave.test/system/file_in_path-2.m -%!error file_in_path ("foo", "bar", 1) - -%% test/octave.test/system/file_in_path-3.m -%!error file_in_path () - -%% test/octave.test/system/file_in_path-4.m -%!error file_in_path ("foo", "bar", "baz", "ooka") - -%% test/octave.test/system/tilde_expand-1.m -%!testif HAVE_GETPWUID -%! x = getpwuid (getuid ()); -%! assert ((strcmp (x.dir, tilde_expand ("~")) -%! && strcmp (x.dir, tilde_expand (sprintf ("~%s", x.name))) -%! && strcmp ("foobar", tilde_expand ("foobar")))); - -%% test/octave.test/system/tilde_expand-2.m -%!error tilde_expand () - -%% test/octave.test/system/tilde_expand-3.m -%!error tilde_expand ("str", 2) - -%% test/octave.test/system/getpgrp-1.m -%!testif HAVE_GETPGRP -%! assert (getpgrp () > 0); - -%% test/octave.test/system/getpgrp-2.m -%!error <... getpgrp> getpgrp (1) - -%% test/octave.test/system/getpid-1.m -%!assert (getpid () > 0) - -%% test/octave.test/system/getpid-2.m -%!error <... getpid> getpid (1) - -%% test/octave.test/system/getppid-1.m -%!testif HAVE_GETPPID -%! assert (getppid () > 0); - -%% test/octave.test/system/getppid-2.m -%!error <... getppid> getppid (1) - -%% test/octave.test/system/geteuid-1.m -%!assert (geteuid () >= 0) - -%% test/octave.test/system/geteuid-2.m -%!error <... geteuid> geteuid (1) - -%% test/octave.test/system/getuid-1.m -%!assert (getuid () >= 0) - -%% test/octave.test/system/getuid-2.m -%!error <... getuid> getuid (1) - -%% test/octave.test/system/getegid-1.m -%!assert (getegid () >= 0) - -%% test/octave.test/system/getegid-2.m -%!error <... getegid> getegid (1) - -%% test/octave.test/system/getgid-1.m -%!assert (getgid () >= 0) - -%% test/octave.test/system/getgid-2.m -%!error <... getgid> getgid (1) - -%% test/octave.test/system/getenv-1.m -%!assert (getenv ("HOME"), tilde_expand ("~")) - -%% test/octave.test/system/getenv-2.m -%!error getenv () - -%% test/octave.test/system/getenv-3.m -%!error getenv ("foo", 1) - -%% test/octave.test/system/getenv-4.m -%!test -%! wns = warning ("query", "Octave:num-to-str"); -%! warning ("on", "Octave:num-to-str"); -%! fail ("getenv (1)", "warning"); -%! warning (wns.state, "Octave:num-to-str"); - -%% test/octave.test/system/putenv-1.m -%!test -%! putenv ("foobar", "baz"); -%! assert (getenv ("foobar"), "baz"); - -%% test/octave.test/system/putenv-2.m -%!error putenv () - -%% test/octave.test/system/putenv-3.m -%!error putenv ("foo", "bar", 1) - -%% test/octave.test/system/putenv-4.m -%!test -%! wns = warning ("query", "Octave:num-to-str"); -%! warning ("on", "Octave:num-to-str"); -%! fail ("putenv (1, 2)","warning"); -%! warning (wns.state, "Octave:num-to-str"); - -%% test/octave.test/system/cd-1.m -%!test -%! xdir = pwd (); -%! cd / -%! d1 = pwd (); -%! cd (xdir); -%! if (ispc () && ! isunix ()) -%! # should be a drive letter -%! assert (length (d1), 3); -%! assert (d1(2), ":"); -%! assert (d1(3), "\\"); -%! else -%! assert ("/", d1); -%! endif -%! assert (pwd(), xdir); - -%% test/octave.test/system/cd-2.m -%!error cd (1) - -%% test/octave.test/system/pwd-1.m -%!assert (ischar (pwd ())) - -%% test/octave.test/system/getpwent-1.m -%!testif HAVE_GETPWENT -%! s = getpwent (); -%! endpwent (); -%! assert ((isstruct (s) -%! && isfield (s, "name") -%! && isfield (s, "passwd") -%! && isfield (s, "uid") -%! && isfield (s, "gid") -%! && isfield (s, "gecos") -%! && isfield (s, "dir") -%! && isfield (s, "shell"))); - -%% test/octave.test/system/getpwent-2.m -%!error getpwent (1) - -%% test/octave.test/system/getpwuid-1.m -%!testif HAVE_GETPWUID -%! x = getpwent (); -%! y = getpwuid (x.uid); -%! endpwent (); -%! assert (strcmp (x.name, y.name) && x.uid == y.uid && x.gid == y.gid); - -%% test/octave.test/system/getpwuid-2.m -%!error getpwuid () - -%% test/octave.test/system/getpwuid-3.m -%!error getpwuid (1, 2) - -%% test/octave.test/system/getpwnam-1.m -%!testif HAVE_GETPWNAM -%! x = getpwent (); -%! y = getpwnam (x.name); -%! endpwent (); -%! assert (strcmp (x.name, y.name) && x.uid == y.uid && x.gid == y.gid); - -%% test/octave.test/system/getpwnam-2.m -%!error getpwnam () - -%% test/octave.test/system/getpwnam-3.m -%!error getpwnam ("foo", 1) - -%% test/octave.test/system/setpwent-1.m -%!testif HAVE_SETPWENT -%! x = getpwent (); -%! setpwent (); -%! y = getpwent (); -%! endpwent (); -%! assert (strcmp (x.name, y.name) && x.uid == y.uid && x.gid == y.gid); - -%% test/octave.test/system/setpwent-2.m -%!error setpwent (1) - -%% test/octave.test/system/endpwent-1.m -%!error endpwent (1) - -%% test/octave.test/system/getgrent-1.m -%!testif HAVE_GETGRENT -%! x = getgrent (); -%! endgrent (); -%! assert ((isstruct (x) -%! && isfield (x, "name") -%! && isfield (x, "passwd") -%! && isfield (x, "gid") -%! && isfield (x, "mem"))); - -%% test/octave.test/system/getgrent-2.m -%!error getgrent (1) - -%% test/octave.test/system/getgrgid-1.m -%!testif HAVE_GETGRGID -%! x = getgrent (); -%! y = getgrgid (x.gid); -%! endgrent (); -%! assert (strcmp (x.name, y.name) && x.gid == y.gid); - -%% test/octave.test/system/getgrgid-2.m -%!error getgrgid () - -%% test/octave.test/system/getgrgid-3.m -%!error getgrgid (1, 2) - -%% test/octave.test/system/getgrnam-1.m -%!testif HAVE_GETGRNAM -%! x = getgrent (); -%! y = getgrnam (x.name); -%! endgrent (); -%! assert (strcmp (x.name, y.name) && x.gid == y.gid); - -%% test/octave.test/system/getgrnam-2.m -%!error getgrnam () - -%% test/octave.test/system/getgrnam-3.m -%!error getgrnam ("foo", 1) - -%% test/octave.test/system/setgrent-1.m -%!testif HAVE_SETGRENT -%! x = getgrent (); -%! setgrent (); -%! y = getgrent (); -%! endgrent (); -%! assert (strcmp (x.name, y.name) && x.gid == y.gid); - -%% test/octave.test/system/setgrent-2.m -%!error setgrent (1) - -%% test/octave.test/system/endgrent-1.m -%!error endgrent (1) - -%% test/octave.test/system/isieee-1.m -%!assert (isieee () == 1 || isieee () == 0) - -%% test/octave.test/system/octave_config_info-1.m -%!assert (isstruct (octave_config_info ())) - -%% test/octave.test/system/getrusage-1.m -%!assert (isstruct (getrusage ())) - diff -r b8157404614f -r 1af8d21608b7 test/test_transpose.m --- a/test/test_transpose.m Sat Feb 09 20:05:40 2013 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,86 +0,0 @@ -## Copyright (C) 2006-2012 John W. Eaton -## -## This file is part of Octave. -## -## Octave is free software; you can redistribute it and/or modify it -## under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 3 of the License, or (at -## your option) any later version. -## -## Octave is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with Octave; see the file COPYING. If not, see -## . - -%% Basic tests -%!test -%! scalar = 2; -%! assert (scalar', 2); - -%!test -%! range = 1:4; -%! assert (range', [1;2;3;4]); - -%!test -%! vector = [1;2;3;4]; -%! assert (vector', [1,2,3,4]); - -%!test -%! matrix = [1,2;3,4]; -%! assert (matrix', [1,3;2,4]); - -%% Basic tests on complex numbers -%!test -%! scalar = 2i; -%! assert (scalar', -2i); - -%!test -%! range = (1:4)*i; -%! assert (range', [-1i;-2i;-3i;-4i]); - -%!test -%! vector = [1;2;3;4]*i; -%! assert (vector', [-1i,-2i,-3i,-4i]); - -%!test -%! matrix = [1,2;3,4]*i; -%! assert (matrix', [-1i,-3i;-2i,-4i]); - -%% Test non-Hermitian transpose -%!test -%! scalar = 2i; -%! assert (scalar.', 2i); - -%!test -%! range = (1:4)*i; -%! assert (range.', [1i;2i;3i;4i]); - -%!test -%! vector = [1;2;3;4]*i; -%! assert (vector.', [1i,2i,3i,4i]); - -%!test -%! matrix = [1,2;3,4]*i; -%! assert (matrix.', [1i,3i;2i,4i]); - -%% Basic tests on float complex numbers -%!test -%! scalar = single (2i); -%! assert (scalar', single (-2i)); - -%!test -%! range = single ((1:4)*i); -%! assert (range', single ([-1i;-2i;-3i;-4i])); - -%!test -%! vector = single ([1;2;3;4]*i); -%! assert (vector', single ([-1i,-2i,-3i,-4i])); - -%!test -%! matrix = single ([1,2;3,4]*i); -%! assert (matrix', single ([-1i,-3i;-2i,-4i])); - diff -r b8157404614f -r 1af8d21608b7 test/test_try.m --- a/test/test_try.m Sat Feb 09 20:05:40 2013 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,139 +0,0 @@ -## Copyright (C) 2006-2012 John W. Eaton -## -## This file is part of Octave. -## -## Octave is free software; you can redistribute it and/or modify it -## under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 3 of the License, or (at -## your option) any later version. -## -## Octave is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with Octave; see the file COPYING. If not, see -## . - -%% test/octave.test/try/try-1.m -%!test -%! try -%! catch -%! error ("Shoudn't get here"); -%! end_try_catch - -%% test/octave.test/try/try-2.m -%!test -%! try -%! clear a; -%! a; -%! catch -%! end_try_catch -%! a = 1; -%! assert (a,1); - -%% test/octave.test/try/try-3.m -%!test -%! clear x; -%! try -%! clear a; -%! a; -%! x = 1; -%! catch -%! end_try_catch -%! a = 2; -%! assert (!exist ('x')); -%! assert (a,2); - -%% test/octave.test/try/try-4.m -%!test -%! try -%! clear a; -%! a; -%! catch -%! x = 1; -%! end_try_catch -%! assert (exist ('x')); - -%% test/octave.test/try/try-5.m -%!test -%! try -%! clear a; -%! a; -%! error ("Shoudn't get here"); -%! catch -%! assert (lasterr()(1:13), "'a' undefined"); -%! end_try_catch -%! assert (lasterr()(1:13), "'a' undefined"); - -%% test/octave.test/try/try-6.m -%!test -%! try -%! error ("user-defined error"); -%! catch -%! assert (lasterr, "user-defined error"); -%! end_try_catch - -%% test/octave.test/try/try-7.m -%!function ms = mangle (s) -%! ## Wrap angle brackets around S. -%! ms = cstrcat ("<", s, ">"); -%!endfunction -%!test -%! try -%! clear a; -%! a; -%! error ("Shoudn't get here"); -%! catch -%! assert (mangle (lasterr)(1:14), "<'a' undefined"); -%! end_try_catch - -%% test/octave.test/try/try-8.m -%!test -%! try -%! try -%! clear a; -%! a; -%! error ("Shoudn't get here"); -%! catch -%! assert (lasterr()(1:13), "'a' undefined"); -%! end_try_catch -%! clear b; -%! b; -%! error ("Shoudn't get here"); -%! catch -%! assert (lasterr()(1:13), "'b' undefined"); -%! end_try_catch - -%% test/octave.test/try/try-9.m -%!test -%! try -%! clear a; -%! a; -%! error ("Shoudn't get here"); -%! catch -%! try -%! assert (lasterr()(1:13), "'a' undefined"); -%! clear b; -%! b; -%! error ("Shoudn't get here"); -%! catch -%! assert (lasterr()(1:13), "'b' undefined"); -%! end_try_catch -%! end_try_catch - -%% test/octave.test/try/try-10.m -%!test -%! try -%! try -%! clear a; -%! a; -%! error ("Shoudn't get here"); -%! catch -%! error (cstrcat ("rethrow: ", lasterr)); -%! end_try_catch -%! catch -%! assert (lasterr()(1:22), "rethrow: 'a' undefined"); -%! end_try_catch - diff -r b8157404614f -r 1af8d21608b7 test/test_unwind.m --- a/test/test_unwind.m Sat Feb 09 20:05:40 2013 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,60 +0,0 @@ -## Copyright (C) 2006-2012 John W. Eaton -## -## This file is part of Octave. -## -## Octave is free software; you can redistribute it and/or modify it -## under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 3 of the License, or (at -## your option) any later version. -## -## Octave is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with Octave; see the file COPYING. If not, see -## . - -%% test/octave.test/unwind/unwind-1.m -%!function y = f (x) -%! global g; -%! save_g = g; -%! unwind_protect -%! g = 0; -%! y = g; -%! [1,2;x]; -%! g = 1; -%! y = [y, g]; -%! unwind_protect_cleanup -%! g = save_g; -%! y = [y, g]; -%! end_unwind_protect -%!endfunction -%! -%!test -%! global g = -1; -%! y = f ([3,4]); -%! assert (y, [0,1,-1]); - -%% test/octave.test/unwind/unwind-2.m -%!function y = f (x) -%! global g; -%! save_g = g; -%! unwind_protect -%! g = 0; -%! y = g; -%! [1,2;x]; -%! g = 1; -%! y = [y, g]; -%! unwind_protect_cleanup -%! g = save_g; -%! y = [y, g]; -%! assert (y, [0,-1]); -%! end_unwind_protect -%!endfunction -%! -%!test -%! global g = -1; -%! fail ("y = f (3);", "mismatch"); - diff -r b8157404614f -r 1af8d21608b7 test/test_while.m --- a/test/test_while.m Sat Feb 09 20:05:40 2013 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,70 +0,0 @@ -## Copyright (C) 2006-2012 John W. Eaton -## -## This file is part of Octave. -## -## Octave is free software; you can redistribute it and/or modify it -## under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 3 of the License, or (at -## your option) any later version. -## -## Octave is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with Octave; see the file COPYING. If not, see -## . - -%% test/octave.test/while/while-1.m -%!test -%! i = 0; -%! while (eye (2)) -%! i++; -%! __printf_assert__ ("%d\n", i); -%! endwhile -%! assert (__prog_output_assert__ ("")); - -%% test/octave.test/while/while-2.m -%!test -%! i = 5; -%! while (--i) -%! __printf_assert__ ("%d", i); -%! endwhile -%! __printf_assert__ ("\n"); -%! assert (__prog_output_assert__ ("4321")); - -%% test/octave.test/while/while-3.m -%!test -%! i = 5; -%! while (i) -%! i--; -%! __printf_assert__ ("%d", i); -%! endwhile -%! __printf_assert__ ("\n"); -%! assert (__prog_output_assert__ ("43210")); - -%% test/octave.test/while/while-4.m -%!test -%! i = 0; -%! while (i++ < 20) -%! if (i > 2) -%! break; -%! endif -%! __printf_assert__ ("%d", i); -%! endwhile -%! __printf_assert__ ("\n"); -%! assert (__prog_output_assert__ ("12")); - -%% test/octave.test/while/while-5.m -%!test -%! i = 0; -%! while (++i < 5) -%! if (i < 3) -%! continue; -%! endif -%! __printf_assert__ ("%d", i); -%! endwhile -%! __printf_assert__ ("\n"); -%! assert (__prog_output_assert__ ("34")); - diff -r b8157404614f -r 1af8d21608b7 test/transpose.tst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/transpose.tst Sat Feb 09 21:35:55 2013 -0500 @@ -0,0 +1,86 @@ +## Copyright (C) 2006-2012 John W. Eaton +## +## This file is part of Octave. +## +## Octave is free software; you can redistribute it and/or modify it +## under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 3 of the License, or (at +## your option) any later version. +## +## Octave is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with Octave; see the file COPYING. If not, see +## . + +%% Basic tests +%!test +%! scalar = 2; +%! assert (scalar', 2); + +%!test +%! range = 1:4; +%! assert (range', [1;2;3;4]); + +%!test +%! vector = [1;2;3;4]; +%! assert (vector', [1,2,3,4]); + +%!test +%! matrix = [1,2;3,4]; +%! assert (matrix', [1,3;2,4]); + +%% Basic tests on complex numbers +%!test +%! scalar = 2i; +%! assert (scalar', -2i); + +%!test +%! range = (1:4)*i; +%! assert (range', [-1i;-2i;-3i;-4i]); + +%!test +%! vector = [1;2;3;4]*i; +%! assert (vector', [-1i,-2i,-3i,-4i]); + +%!test +%! matrix = [1,2;3,4]*i; +%! assert (matrix', [-1i,-3i;-2i,-4i]); + +%% Test non-Hermitian transpose +%!test +%! scalar = 2i; +%! assert (scalar.', 2i); + +%!test +%! range = (1:4)*i; +%! assert (range.', [1i;2i;3i;4i]); + +%!test +%! vector = [1;2;3;4]*i; +%! assert (vector.', [1i,2i,3i,4i]); + +%!test +%! matrix = [1,2;3,4]*i; +%! assert (matrix.', [1i,3i;2i,4i]); + +%% Basic tests on float complex numbers +%!test +%! scalar = single (2i); +%! assert (scalar', single (-2i)); + +%!test +%! range = single ((1:4)*i); +%! assert (range', single ([-1i;-2i;-3i;-4i])); + +%!test +%! vector = single ([1;2;3;4]*i); +%! assert (vector', single ([-1i,-2i,-3i,-4i])); + +%!test +%! matrix = single ([1,2;3,4]*i); +%! assert (matrix', single ([-1i,-3i;-2i,-4i])); + diff -r b8157404614f -r 1af8d21608b7 test/try.tst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/try.tst Sat Feb 09 21:35:55 2013 -0500 @@ -0,0 +1,139 @@ +## Copyright (C) 2006-2012 John W. Eaton +## +## This file is part of Octave. +## +## Octave is free software; you can redistribute it and/or modify it +## under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 3 of the License, or (at +## your option) any later version. +## +## Octave is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with Octave; see the file COPYING. If not, see +## . + +%% test/octave.test/try/try-1.m +%!test +%! try +%! catch +%! error ("Shoudn't get here"); +%! end_try_catch + +%% test/octave.test/try/try-2.m +%!test +%! try +%! clear a; +%! a; +%! catch +%! end_try_catch +%! a = 1; +%! assert (a,1); + +%% test/octave.test/try/try-3.m +%!test +%! clear x; +%! try +%! clear a; +%! a; +%! x = 1; +%! catch +%! end_try_catch +%! a = 2; +%! assert (!exist ('x')); +%! assert (a,2); + +%% test/octave.test/try/try-4.m +%!test +%! try +%! clear a; +%! a; +%! catch +%! x = 1; +%! end_try_catch +%! assert (exist ('x')); + +%% test/octave.test/try/try-5.m +%!test +%! try +%! clear a; +%! a; +%! error ("Shoudn't get here"); +%! catch +%! assert (lasterr()(1:13), "'a' undefined"); +%! end_try_catch +%! assert (lasterr()(1:13), "'a' undefined"); + +%% test/octave.test/try/try-6.m +%!test +%! try +%! error ("user-defined error"); +%! catch +%! assert (lasterr, "user-defined error"); +%! end_try_catch + +%% test/octave.test/try/try-7.m +%!function ms = mangle (s) +%! ## Wrap angle brackets around S. +%! ms = cstrcat ("<", s, ">"); +%!endfunction +%!test +%! try +%! clear a; +%! a; +%! error ("Shoudn't get here"); +%! catch +%! assert (mangle (lasterr)(1:14), "<'a' undefined"); +%! end_try_catch + +%% test/octave.test/try/try-8.m +%!test +%! try +%! try +%! clear a; +%! a; +%! error ("Shoudn't get here"); +%! catch +%! assert (lasterr()(1:13), "'a' undefined"); +%! end_try_catch +%! clear b; +%! b; +%! error ("Shoudn't get here"); +%! catch +%! assert (lasterr()(1:13), "'b' undefined"); +%! end_try_catch + +%% test/octave.test/try/try-9.m +%!test +%! try +%! clear a; +%! a; +%! error ("Shoudn't get here"); +%! catch +%! try +%! assert (lasterr()(1:13), "'a' undefined"); +%! clear b; +%! b; +%! error ("Shoudn't get here"); +%! catch +%! assert (lasterr()(1:13), "'b' undefined"); +%! end_try_catch +%! end_try_catch + +%% test/octave.test/try/try-10.m +%!test +%! try +%! try +%! clear a; +%! a; +%! error ("Shoudn't get here"); +%! catch +%! error (cstrcat ("rethrow: ", lasterr)); +%! end_try_catch +%! catch +%! assert (lasterr()(1:22), "rethrow: 'a' undefined"); +%! end_try_catch + diff -r b8157404614f -r 1af8d21608b7 test/unwind.tst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/unwind.tst Sat Feb 09 21:35:55 2013 -0500 @@ -0,0 +1,60 @@ +## Copyright (C) 2006-2012 John W. Eaton +## +## This file is part of Octave. +## +## Octave is free software; you can redistribute it and/or modify it +## under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 3 of the License, or (at +## your option) any later version. +## +## Octave is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with Octave; see the file COPYING. If not, see +## . + +%% test/octave.test/unwind/unwind-1.m +%!function y = f (x) +%! global g; +%! save_g = g; +%! unwind_protect +%! g = 0; +%! y = g; +%! [1,2;x]; +%! g = 1; +%! y = [y, g]; +%! unwind_protect_cleanup +%! g = save_g; +%! y = [y, g]; +%! end_unwind_protect +%!endfunction +%! +%!test +%! global g = -1; +%! y = f ([3,4]); +%! assert (y, [0,1,-1]); + +%% test/octave.test/unwind/unwind-2.m +%!function y = f (x) +%! global g; +%! save_g = g; +%! unwind_protect +%! g = 0; +%! y = g; +%! [1,2;x]; +%! g = 1; +%! y = [y, g]; +%! unwind_protect_cleanup +%! g = save_g; +%! y = [y, g]; +%! assert (y, [0,-1]); +%! end_unwind_protect +%!endfunction +%! +%!test +%! global g = -1; +%! fail ("y = f (3);", "mismatch"); + diff -r b8157404614f -r 1af8d21608b7 test/while.tst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/while.tst Sat Feb 09 21:35:55 2013 -0500 @@ -0,0 +1,70 @@ +## Copyright (C) 2006-2012 John W. Eaton +## +## This file is part of Octave. +## +## Octave is free software; you can redistribute it and/or modify it +## under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 3 of the License, or (at +## your option) any later version. +## +## Octave is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with Octave; see the file COPYING. If not, see +## . + +%% test/octave.test/while/while-1.m +%!test +%! i = 0; +%! while (eye (2)) +%! i++; +%! __printf_assert__ ("%d\n", i); +%! endwhile +%! assert (__prog_output_assert__ ("")); + +%% test/octave.test/while/while-2.m +%!test +%! i = 5; +%! while (--i) +%! __printf_assert__ ("%d", i); +%! endwhile +%! __printf_assert__ ("\n"); +%! assert (__prog_output_assert__ ("4321")); + +%% test/octave.test/while/while-3.m +%!test +%! i = 5; +%! while (i) +%! i--; +%! __printf_assert__ ("%d", i); +%! endwhile +%! __printf_assert__ ("\n"); +%! assert (__prog_output_assert__ ("43210")); + +%% test/octave.test/while/while-4.m +%!test +%! i = 0; +%! while (i++ < 20) +%! if (i > 2) +%! break; +%! endif +%! __printf_assert__ ("%d", i); +%! endwhile +%! __printf_assert__ ("\n"); +%! assert (__prog_output_assert__ ("12")); + +%% test/octave.test/while/while-5.m +%!test +%! i = 0; +%! while (++i < 5) +%! if (i < 3) +%! continue; +%! endif +%! __printf_assert__ ("%d", i); +%! endwhile +%! __printf_assert__ ("\n"); +%! assert (__prog_output_assert__ ("34")); +