Mercurial > hg > octave-nkf
changeset 5590:1ad66ea35fe5
[project @ 2006-01-06 00:24:05 by jwe]
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2005-12-14 David Bateman <dbateman@free.fr> + * Makeconf.in: Remove OCTAVE_PROG_RUNTEST. + * alocal.m4: Remove OCTAVE_PROG_RUNTEST. + * Makeconf.in: New tests of regex and pcre. 2005-12-13 John W. Eaton <jwe@octave.org>
--- a/aclocal.m4 +++ b/aclocal.m4 @@ -535,24 +535,6 @@ AC_DEFINE_UNQUOTED(GNUPLOT_HAS_FRAMES, $GNUPLOT_HAS_FRAMES, [Define if your gnuplot program supports multiple plot windows.]) ]) dnl -dnl Is DejaGNU installed? -dnl -dnl OCTAVE_PROG_RUNTEST -AC_DEFUN(OCTAVE_PROG_RUNTEST, -[if test "$cross_compiling" = yes; then - RUNTEST=runtest - AC_MSG_RESULT(assuming $RUNTEST exists on $canonical_host_type host) - AC_SUBST(RUNTEST) -else - AC_CHECK_PROG(RUNTEST, runtest, runtest, []) - if test -z "$RUNTEST"; then - warn_runtest="I didn't find runtest -- install DejaGNU if you want to run \`make check'" - AC_MSG_WARN($warn_runtest) - fi - AC_SUBST(RUNTEST) -fi -]) -dnl dnl Is gperf installed? dnl dnl OCTAVE_PROG_GPERF
--- a/configure.in +++ b/configure.in @@ -29,7 +29,7 @@ EXTERN_CXXFLAGS="$CXXFLAGS" AC_INIT -AC_REVISION($Revision: 1.494 $) +AC_REVISION($Revision: 1.495 $) AC_PREREQ(2.57) AC_CONFIG_SRCDIR([src/octave.cc]) AC_CONFIG_HEADER(config.h) @@ -1544,7 +1544,6 @@ AC_PROG_LN_S OCTAVE_PROG_NM -OCTAVE_PROG_RUNTEST AC_PROG_INSTALL INSTALL_SCRIPT='${INSTALL}' @@ -1892,11 +1891,6 @@ warn_msg_printed=true fi -if test -n "$warn_runtest"; then - AC_MSG_WARN($warn_runtest) - warn_msg_printed=true -fi - if test -n "$warn_umfpack"; then AC_MSG_WARN($warn_umfpack) warn_msg_printed=true
--- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,31 @@ +2005-12-14 David Bateman <dbateman@free.fr> + + * build_sparse_tests.sh: New script to build sparse matrix tests. + * fntests.m: New script to run the octave test code, with "make check". + * Makefile.in (DISTDIRS): Delete. + (dist): Simplify. + (OCTAVE_SCRIPT_PATH): Include . and $(srcdir). + (check): Run tests with fntest.m instead of runtest. + (test_sparse.m): New target. + (clean): Remove fntests.log instead of octave.log and octave.sum. + + * tests/test_args.m, tests/test_infnan.m, tests/test_set.m, + tests/test_arith.m, tests/test_io.m, tests/test_signal.m, + tests/test_audio.m, tests/test_linalg.m, tests/test_sparse.m, + tests/test_contin.m, tests/test_logical-wfi-f.m, tests/test_stats.m, + tests/test_control.m, tests/test_logical-wfi-t.m, tests/test_string.m, + tests/test_diffeq.m, tests/test_matrix.m, tests/test_struct.m, + tests/test_error.m, tests/test_nonlin.m, tests/test_switch.m, + tests/test_eval-catch.m, tests/test_number.m, tests/test_system.m, + tests/test_eval.m, tests/test_optim.m, tests/test_transpose.m, + tests/test_for.m, tests/test_plot.m, tests/test_try.m, + tests/test_global.m, tests/test_poly.m, tests/test_unix.m, + tests/test_if.m, tests/test_prefer.m, tests/test_unwind.m, + tests/test_image.m, tests/test_quad.m, tests/test_while.m, + tests/test_index-wfi-f.m, tests/test_recursion.m, + tests/test_index-wfi-t.m, tests/test_return.m: Initial of conversion + of DejaGnu tests to test/assert infrastructure. + 2005-05-11 John W. Eaton <jwe@octave.org> * config/unix.exp: Start Octave with -H.
--- a/test/Makefile.in +++ b/test/Makefile.in @@ -14,15 +14,13 @@ include $(TOPDIR)/Makeconf -SOURCES = +SOURCES = $(wildcard $(srcdir)/test_*.m) -DISTFILES = Makefile.in $(SOURCES) ChangeLog - -SUBDIRS = +DISTFILES = ChangeLog Makefile.in build_sparse_tests.sh fntests.m $(SOURCES) OCTAVE_BINARY = ../src/octave -OCTAVE_SCRIPT_PATH = .:$(TOPDIR)/src//:$(srcdir)/../scripts// +OCTAVE_SCRIPT_PATH = .//:$(TOPDIR)/src//:$(srcdir):$(srcdir)/../scripts// ifeq ($(SHARED_LIBS), true) OCTAVE_LD_LIBRARY_PATH = `pwd`/../src:`pwd`/../liboctave:`pwd`/../libcruft @@ -34,25 +32,16 @@ SET_LD_LIBRARY_PATH = @library_path_var@="$(XLD_LIBRARY_PATH)" endif -# Complete directory trees to distribute. -DISTDIRS = config octave.test - all: check .PHONY: all -check: - @if test -n "$(RUNTEST)"; then \ - $(SET_LD_LIBRARY_PATH) $(RUNTEST) \ - OCTAVE="$(OCTAVE_BINARY)" \ - OCTAVE_SCRIPT_PATH="$(OCTAVE_SCRIPT_PATH)" \ - --tool octave --srcdir $(srcdir) $(RUNTEST_FLAGS) $(testsuite); \ - else \ - echo "***"; \ - echo "*** Sorry, I can't run tests without DejaGnu"; \ - echo "***"; \ - fi +check: test_sparse.m + $(SET_LD_LIBRARY_PATH) $(OCTAVE_BINARY) \ + -f -q -H -p $(OCTAVE_SCRIPT_PATH) $(srcdir)/fntests.m $(srcdir) +.PHONY: check -.PHONY: check +test_sparse.m: build_sparse_tests.sh + $(srcdir)/build_sparse_tests.sh install install-strip: all .PHONY: install install-strip @@ -67,7 +56,7 @@ etags $(SOURCES) clean: - rm -f octave.log octave.sum + rm -f fntests.log .PHONY: clean mostlyclean: @@ -83,5 +72,4 @@ dist: ln $(DISTFILES) ../`cat ../.fname`/test - for dir in $(DISTDIRS); do ln -s ../../test/$$dir ../`cat ../.fname`/test; done .PHONY: dist
new file mode 100755 --- /dev/null +++ b/test/build_sparse_tests.sh @@ -0,0 +1,1066 @@ +#!/bin/sh + +# Some tests are commented out because they are known to be broken! +# Search for "# fails" + +# ./buildtest.sh preset +# creates test_sparse.m with preset tests. +# Use "test test_sparse" from octave to run the tests. +# +# ./buildtest.sh random +# Creates test_sprandom.m with randomly generated matrices. + +# buildtest.sh generates tests for real and complex sparse matrices. +# Also, we want to run both fixed tests with known outputs (quick tests) +# and longer tests with unknown outputs (thorough tests). This requires +# two sets of tests --- one which uses preset matrices and another which +# uses randomly generated matrices. +# +# The tests are mostly identical for each case but the code is different, +# so it is important that the tests be run on all cases. Because our test +# harness doesn't have support for looping or macros (it is only needed +# for new data types), but sh does, we use sh to generate inline versions of +# the tests for each case. +# +# Our 'macros' use shared variables as parameters. This allows us to +# for example define A complex and include all the unary ops tests, +# then set A=real(A) and include all the unary ops tests. Thus the +# same tests work for real and complex. For binary tests it is even +# more complicated because we want full X sparse, sparse X full and +# sparse X sparse tested. +# +# We use the following macros: +# +# gen_section +# place a separator in the test file +# gen_function +# define the function definion +# helper gen_specific +# specific tests such as error handling and null input +# helper gen_eat_zeros +# make sure sparse-scalar ops which generate 0 work +# gen_specific_tests +# specific and eat zeros tests +# helper gen_ordering_tests +# ordered comparison operators for real valued tests +# helper gen_sparsesparse_ordering_tests +# ordered comparison operators for real valued sparse-sparse tests +# helper gen_elementop_tests +# element-wise matrix binary operators, including scalar-matrix ops. +# horizontal/vertical concatenation are here as well. +# helper gen_sparsesparse_elementop_tests +# element-wise matrix binary operators, for sparse-sparse ops. +# horizontal/vertical concatenation are here as well. +# helper gen_divop_tests +# left and right matrix division operators of rectangular matrices. +# Needs QR solvers +# helper gen_square_divop_tests +# left and right matrix division operators of square matrices. +# helper gen_matrixop_tests +# rectangular matrix binary operators: * +# helper gen_matrixdiag_tests +# Tests extract of diag and creation of diagonal matrices using +# diag and spdiags functions +# helper gen_matrixreshape_tests +# Test the reshape function on sparse matrices +# helper print_mapper_test +# sub-helper function of gen_mapper_tests to print individual tests +# helper gen_mapper_tests +# Tests all of the one argument mapper functions. There are a few +# specific tests that abs, real and imag return real values. +# helper gen_unaryop_tests +# functions and operators which transform a single matrix +# helper gen_save_tests +# Tests the load/save functionality for ascii/binary and hdf5 formats +# gen_scalar_tests +# element ops for real and complex scalar and sparse +# gen_rectangular_tests +# unary, element, and matrix tests for a and full/sparse b +# gen_square_tests +# operations which require square matrices: lu, inv, \ +# A square non-singular matrix is defined from the rectangular +# inputs A and B. +# gen_assembly_tests +# test for sparse constructors with 'sum' vs. 'unique' +# gen_select_tests +# indexing tests +# gen_solver_tests +# Tests the solve function with triangular/banded, etc matrices + +case $1 in + random) preset=false ;; + preset) preset=true ;; + '') preset=true ;; + *) echo "buildtest.sh random|preset" && exit 1 ;; +esac + +if $preset; then + TESTS=test_sparse.m +else + TESTS=test_sprandom.m +fi + +# create initial file +cat >$TESTS <<EOF +## THIS IS AN AUTOMATICALLY GENERATED FILE --- DO NOT EDIT --- +## instead modify build_sparse_tests.sh to generate the tests that you want. +EOF + + +# define all functions + + +# ======================================================= +# Section separator + +gen_section() { +cat >>$TESTS <<EOF + +# ============================================================== + +EOF +} + + +# ======================================================= +# Specific preset tests + +# ======================================================= +# If a sparse operation yields zeros, then those elements +# of the returned sparse matrix should be eaten. +gen_eat_zeros() { +cat >>$TESTS <<EOF +%% Make sure newly introduced zeros get eaten +%!assert(nnz(sparse([bf,bf,1]).^realmax),1); +%!assert(nnz(sparse([1,bf,bf]).^realmax),1); +%!assert(nnz(sparse([bf,bf,bf]).^realmax),0); + +%!assert(nnz(sparse([bf;bf;1]).^realmax),1); +%!assert(nnz(sparse([1;bf;bf]).^realmax),1); +%!assert(nnz(sparse([0.5;bf;bf]).^realmax),0); + +%!assert(nnz(sparse([bf,bf,1])*realmin),1); +%!assert(nnz(sparse([1,bf,bf])*realmin),1); +%!assert(nnz(sparse([bf,bf,bf])*realmin),0); + +%!assert(nnz(sparse([bf;bf;1])*realmin),1); +%!assert(nnz(sparse([1;bf;bf])*realmin),1); +%!assert(nnz(sparse([bf;bf;bf])*realmin),0); + +EOF +} + +gen_specific() { +cat >>$TESTS <<EOF + +%!test # segfault test from edd@debian.org +%! n = 510; +%! sparse(kron((1:n)', ones(n,1)), kron(ones(n,1), (1:n)'), ones(n)); + +%% segfault tests from Fabian@isas-berlin.de +%% Note that the last four do not fail, but rather give a warning +%% of a singular matrix, which is consistent with the full matrix +%% behaviour. They are therefore disabled.. +%!assert(spinv(sparse([1,1;1,1+i])),sparse([1-1i,1i;1i,-1i]),10*eps); +% !error spinv( sparse( [1,1;1,1] ) ); +% !error spinv( sparse( [0,0;0,1] ) ); +% !error spinv( sparse( [0,0;0,1+i] ) ); +% !error spinv( sparse( [0,0;0,0] ) ); + +%% error handling in constructor +%!error sparse(1,[2,3],[1,2,3]); +%!error sparse([1,1],[1,1],[1,2],3,3,"bogus"); +%!error sparse([1,3],[1,-4],[3,5],2,2); +%!error sparse([1,3],[1,-4],[3,5i],2,2); +%!error sparse(-1,-1,1); +EOF +} + + +gen_specific_tests() { + gen_section + gen_specific + gen_section + echo '%!shared bf' >> $TESTS + echo '%!test bf=realmin;' >> $TESTS + gen_eat_zeros + echo '%!test bf=realmin+realmin*1i;' >> $TESTS + gen_eat_zeros + cat >>$TESTS <<EOF +%!assert(nnz(sparse([-1,realmin,realmin]).^1.5),1); +%!assert(nnz(sparse([-1,realmin,realmin,1]).^1.5),2); + +%!assert(nnz(sparse(1,1,0)),0); # Make sure scalar v==0 doesn't confuse matters +%!assert(nnz(sparse(eye(3))*0),0); +%!assert(nnz(sparse(eye(3))-sparse(eye(3))),0); + +%!test +%! wdbz=warn_divide_by_zero; +%! warn_divide_by_zero=0; +%! assert(sparse(eye(3))/0,sparse(eye(3)/0,1)); +%! warn_divide_by_zero=wdbz; + +EOF +} + + +# ======================================================= +# Main function definition + +gen_function() { + if $preset; then + cat >>$TESTS <<EOF +## +## test_sparse +## +## 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"); +endfunction + +EOF + else + cat >>$TESTS <<EOF +## +## test_sprandom +## +## total_passes=0; total_tests=0; +## for i=1:10 +## [passes,tests] = sprandomtest; +## total_passes += passes; +## total_tests += tests; +## end +## The test log is appended to sprandomtest.log +function [passes,total] = test_sprandom + warning("untested --- fix the source in buildtests.sh"); + disp("appending test output to sprandomtest.log"); + fid = fopen("sprandomtest.log","at"); + test("test_sprandom","normal",fid); + ##[passes, total] = test("sprandomtest","normal",fid); + fclose(fid); +endfunction + +EOF + fi + +} + + +# ======================================================= +# matrix ops + +# test ordered comparisons: uses as,af,bs,bf +gen_ordering_tests() { + cat >>$TESTS <<EOF +%% real values can be ordered (uses as,af) +%!assert(as<=bf,sparse(af<=bf,true)) +%!assert(bf<=as,sparse(bf<=af,true)) + +%!assert(as>=bf,sparse(af>=bf,true)) +%!assert(bf>=as,sparse(bf>=af,true)) + +%!assert(as<bf,sparse(af<bf,true)) +%!assert(bf<as,sparse(bf<af,true)) + +%!assert(as>bf,sparse(af>bf,true)) +%!assert(bf>as,sparse(bf>af,true)) + +EOF +} + +gen_sparsesparse_ordering_tests() { + cat >>$TESTS <<EOF +%!assert(as<=bs,sparse(af<=bf,true)) +%!assert(as>=bs,sparse(af>=bf,true)) +%!assert(as<bs,sparse(af<bf,true)) +%!assert(as>bs,sparse(af>bf,true)) +EOF +} + +# test element-wise binary operations: uses as,af,bs,bf,scalar +gen_elementop_tests() { + cat >>$TESTS <<EOF +%% Elementwise binary tests (uses as,af,bs,bf,scalar) +%!assert(as==bs,sparse(af==bf,true)) +%!assert(bf==as,sparse(bf==af,true)) + +%!assert(as!=bf,sparse(af!=bf,true)) +%!assert(bf!=as,sparse(bf!=af,true)) + +%!assert(as+bf,af+bf) +%!assert(bf+as,bf+af) + +%!assert(as-bf,af-bf) +%!assert(bf-as,bf-af) + +%!assert(as.*bf,sparse(af.*bf,true)) +%!assert(bf.*as,sparse(bf.*af,true)) + +%!assert(as./bf,sparse(af./bf,true),100*eps) +%!assert(bf.\as,sparse(bf.\af,true),100*eps) + +%!test +%! sv = as.^bf; +%! fv = af.^bf; +%! idx = find(af~=0); +%! assert(sv(:)(idx),sparse(fv(:)(idx),true),100*eps) + +EOF +} + +gen_sparsesparse_elementop_tests() { + cat >>$TESTS <<EOF +%!assert(as==bs,sparse(af==bf,true)) +%!assert(as!=bs,sparse(af!=bf,true)) +%!assert(as+bs,sparse(af+bf,true)) +%!assert(as-bs,sparse(af-bf,true)) +%!assert(as.*bs,sparse(af.*bf,true)) +%!assert(as./bs,sparse(af./bf,true),100*eps); +%!test +%! sv = as.^bs; +%! fv = af.^bf; +%! idx = find(af~=0); +%! assert(sv(:)(idx),sparse(fv(:)(idx),true),100*eps) + +EOF +} + +# test matrix-matrix left and right division: uses as,af,bs,bf +gen_divop_tests() { + cat >>$TESTS <<EOF +%% Matrix-matrix operators (uses af,as,bs,bf) +%!assert(as/bf,af/bf,100*eps) +%!assert(af/bs,af/bf,100*eps) +%!assert(as/bs,sparse(af/bf,true),100*eps) +%!assert(bs\af',bf\af',100*eps) +%!assert(bf\as',bf\af',100*eps) +%!assert(bs\as',sparse(bf\af',true),100*eps) + +EOF +} + +# test matrix-matrix left and right division: uses as,af,bs,bf +gen_square_divop_tests() { + cat >>$TESTS <<EOF +%% Matrix-matrix operators (uses af,as,bs,bf) +%!assert(as/bf,af/bf,100*eps) +%!assert(af/bs,af/bf,100*eps) +%!assert(as/bs,sparse(af/bf,true),100*eps) +%!assert(bs\af',bf\af',100*eps) +%!assert(bf\as',bf\af',100*eps) +%!assert(bs\as',sparse(bf\af',true),100*eps) + +EOF +} + +# test matrix-matrix operations: uses as,af,bs,bf +gen_matrixop_tests() { + cat >>$TESTS <<EOF +%% Matrix-matrix operators (uses af,as,bs,bf) +%!assert(as*bf',af*bf') +%!assert(af*bs',af*bf') +%!assert(as*bs',sparse(af*bf',true)) + +EOF +} + +# test diagonal operations +gen_matrixdiag_tests() { + cat >>$TESTS <<EOF +%% Matrix diagonal tests (uses af,as,bf,bs) +%!assert(spdiag(as),sparse(diag(af),true)) +%!assert(spdiag(bs),sparse(diag(bf),true)) +%!assert(spdiag(as,1),sparse(diag(af,1),true)) +%!assert(spdiag(bs,1),sparse(diag(bf,1),true)) +%!assert(spdiag(as,-1),sparse(diag(af,-1),true)) +%!assert(spdiag(bs,-1),sparse(diag(bf,-1),true)) +%!assert(spdiag(as(:)),sparse(diag(af(:)),true)) +%!assert(spdiag(as(:),1),sparse(diag(af(:),1),true)) +%!assert(spdiag(as(:),-1),sparse(diag(af(:),-1),true)) +%!assert(spdiag(as(:)'),sparse(diag(af(:)'),true)) +%!assert(spdiag(as(:)',1),sparse(diag(af(:)',1),true)) +%!assert(spdiag(as(:)',-1),sparse(diag(af(:)',-1),true)) +%!assert(spdiags(as,[0,1]),[diag(af,0),diag(af,1)]) +%!test [tb,tc]=spdiags(as); +%! assert(spdiags(tb,tc,sparse(zeros(size(as)))),as) +%! assert(spdiags(tb,tc,size(as,1),size(as,2)),as) + +EOF +} + +# test matrix reshape operations +gen_matrixreshape_tests() { + cat >>$TESTS <<EOF +%% Matrix diagonal tests (uses af,as,bf,bs) +%!assert(reshape(as,1,prod(size(as))),sparse(reshape(af,1,prod(size(af))),true)) +%!assert(reshape(as,prod(size(as)),1),sparse(reshape(af,prod(size(af)),1),true)) +%!assert(reshape(as,fliplr(size(as))),sparse(reshape(af,fliplr(size(af))),true)) +%!assert(reshape(bs,1,prod(size(as))),sparse(reshape(bf,1,prod(size(af))),true)) +%!assert(reshape(bs,prod(size(as)),1),sparse(reshape(bf,prod(size(af)),1),true)) +%!assert(reshape(bs,fliplr(size(as))),sparse(reshape(bf,fliplr(size(af))),true)) + +EOF +} + +# test mapper matrix operations: uses as,af +print_mapper_test() { +echo "%!assert($1(as),sparse($1(af),1))" >>$TESTS +} + +print_real_mapper_test() { + cat >>$TESTS <<EOF +%!test +%! wn2s = warn_num_to_str; +%! warn_num_to_str = 0; +%! if isreal(af) +%! assert($1(as),sparse($1(af),1)) +%! endif +%! warn_num_to_str = wn2s; + +EOF +} + +gen_mapper_tests() { +echo "%% Unary matrix tests (uses af,as)">>$TESTS +print_mapper_test abs +print_mapper_test acos +print_mapper_test acosh +print_mapper_test angle +print_mapper_test arg +print_mapper_test asin +print_mapper_test asinh +print_mapper_test atan +print_mapper_test atanh +print_mapper_test ceil +print_mapper_test conj +print_mapper_test cos +print_mapper_test cosh +print_mapper_test exp +print_mapper_test finite +print_mapper_test fix +print_mapper_test floor +print_mapper_test imag +print_mapper_test isinf +print_mapper_test isna +print_mapper_test isnan +print_mapper_test log +#print_mapper_test log10 ## fails with different NaN, not a problem +print_mapper_test real +print_mapper_test round +print_mapper_test sign +print_mapper_test sin +print_mapper_test sinh +print_mapper_test sqrt +print_mapper_test tan +print_mapper_test tanh + +# Specific tests for certain mapper functions + cat >>$TESTS <<EOF +%!assert(issparse(abs(as))&&isreal(abs(as))) +%!assert(issparse(real(as))&&isreal(real(as))) +%!assert(issparse(imag(as))&&isreal(imag(as))) + +EOF +} + +gen_real_mapper_tests() { +echo "%% Unary matrix tests (uses af,as)">>$TESTS +print_real_mapper_test erf +print_real_mapper_test erfc +#print_real_mapper_test gamma +print_real_mapper_test isalnum +print_real_mapper_test isalpha +print_real_mapper_test isascii +print_real_mapper_test iscntrl +print_real_mapper_test isdigit +print_real_mapper_test isgraph +print_real_mapper_test islower +print_real_mapper_test isprint +print_real_mapper_test ispunct +print_real_mapper_test isspace +print_real_mapper_test isupper +print_real_mapper_test isxdigit +#print_real_mapper_test lgamma + +# Specific tests for certain mapper functions + cat >>$TESTS <<EOF + +%% These mapper functions always return a full matrix +%!test +%! wn2s = warn_num_to_str; +%! warn_num_to_str = 0; +%! if isreal(af) +%! assert(toascii(as),toascii(af)) +%! assert(tolower(as),tolower(af)) +%! assert(toupper(as),toupper(af)) +%! endif +%! warn_num_to_str = wn2s; + +EOF +} + +# test matrix operations: uses as,af +gen_unaryop_tests() { + cat >>$TESTS <<EOF +%% Unary matrix tests (uses af,as) +%!assert(issparse(as)) +%!assert(!issparse(af)) +%!assert(!(issparse(af)&&iscomplex(af))) +%!assert(!(issparse(af)&&isreal(af))) +%!assert(spsum(as),sparse(sum(af),true)) +%!assert(spsum(as,1),sparse(sum(af,1),true)) +%!assert(spsum(as,2),sparse(sum(af,2),true)) +%!assert(spcumsum(as),sparse(cumsum(af),true)) +%!assert(spcumsum(as,1),sparse(cumsum(af,1),true)) +%!assert(spcumsum(as,2),sparse(cumsum(af,2),true)) +%!assert(spsumsq(as),sparse(sumsq(af),true)) +%!assert(spsumsq(as,1),sparse(sumsq(af,1),true)) +%!assert(spsumsq(as,2),sparse(sumsq(af,2),true)) +%!assert(spprod(as),sparse(prod(af),true)) +%!assert(spprod(as,1),sparse(prod(af,1),true)) +%!assert(spprod(as,2),sparse(prod(af,2),true)) +%!assert(spcumprod(as),sparse(cumprod(af),true)) +%!assert(spcumprod(as,1),sparse(cumprod(af,1),true)) +%!assert(spcumprod(as,2),sparse(cumprod(af,2),true)) + +%!assert(spmin(as),sparse(min(af),true)) +%!assert(spmin(as(:)),min(af(:))) +%!assert(spmin(as,[],1),sparse(min(af,[],1),true)) +%!assert(spmin(as,[],2),sparse(min(af,[],2),true)) +%!assert(spmin(as,[],1),sparse(min(af,[],1),true)) +%!assert(spmin(as,0),sparse(min(af,0),true)) +%!assert(spmin(as,bs),sparse(min(af,bf),true)) +%!assert(spmax(as),sparse(max(af),true)) +%!assert(spmax(as(:)),max(af(:))) +%!assert(spmax(as,[],1),sparse(max(af,[],1),true)) +%!assert(spmax(as,[],2),sparse(max(af,[],2),true)) +%!assert(spmax(as,[],1),sparse(max(af,[],1),true)) +%!assert(spmax(as,0),sparse(max(af,0),true)) +%!assert(spmax(as,bs),sparse(max(af,bf),true)) + +%!assert(as==as) +%!assert(as==af) +%!assert(af==as) +%!test +%! [ii,jj,vv,nr,nc] = spfind(as); +%! assert(af,full(sparse(ii,jj,vv,nr,nc))); +%!assert(nnz(as),sum(af(:)!=0)) +%!assert(nnz(as),nnz(af)) +%!assert(issparse(as.')) +%!assert(issparse(as')) +%!assert(issparse(-as)) +%!assert(~as,sparse(~af,true)) +%!assert(as.', sparse(af.',true)); +%!assert(as', sparse(af',true)); +%!assert(-as, sparse(-af,true)); +%!assert(~as, sparse(~af,true)); +%!error [i,j]=size(af);as(i-1,j+1); +%!error [i,j]=size(af);as(i+1,j-1); +%!test +%! [Is,Js,Vs] = spfind(as); +%! [If,Jf,Vf] = find(af); +%! assert(Is,If); +%! assert(Js,Jf); +%! assert(Vs,Vf); +%!error as(0,1); +%!error as(1,0); +%!assert(spfind(as),find(af)) +%!test +%! [i,j,v] = spfind(as); +%! [m,n] = size(as); +%! x = sparse(i,j,v,m,n); +%! assert(x,as); +%!test +%! [i,j,v,m,n] = spfind(as); +%! x = sparse(i,j,v,m,n); +%! assert(x,as); +%!assert(issparse(horzcat(as,as))); +%!assert(issparse(vertcat(as,as))); +%!assert(issparse(cat(1,as,as))); +%!assert(issparse(cat(2,as,as))); +%!assert(issparse([as,as])); +%!assert(issparse([as;as])); +%!assert(horzcat(as,as), sparse([af,af])); +%!assert(vertcat(as,as), sparse([af;af])); +%!assert(horzcat(as,as,as), sparse([af,af,af])); +%!assert(vertcat(as,as,as), sparse([af;af;af])); +%!assert([as,as], sparse([af,af])); +%!assert([as;as], sparse([af;af])); +%!assert([as,as,as], sparse([af,af,af])); +%!assert([as;as;as], sparse([af;af;af])); +%!assert(cat(2,as,as), sparse([af,af])); +%!assert(cat(1,as,as), sparse([af;af])); +%!assert(cat(2,as,as,as), sparse([af,af,af])); +%!assert(cat(1,as,as,as), sparse([af;af;af])); +%!assert(issparse([as,af])); +%!assert(issparse([af,as])); +%!assert([as,af], sparse([af,af])); +%!assert([as;af], sparse([af;af])); + +EOF +} + +# operations which require square matrices. +gen_square_tests() { +# The \ and / operator tests on square matrices + gen_square_divop_tests + + cat >>$TESTS <<EOF +%!assert(spdet(bs+speye(size(bs))),det(bf+eye(size(bf))),100*eps*abs(det(bf+eye(size(bf))))) + +%!test +%! [l,u]=splu(sparse([1,1;1,1])); +%! assert(l*u,[1,1;1,1],10*eps); + +%!test +%! [l,u]=splu(sparse([1,1;1,1+i])); +%! assert(l,sparse([1,2,2],[1,1,2],1),10*eps); +%! assert(u,sparse([1,1,2],[1,2,2],[1,1,1i]),10*eps); + +%!test ;# permuted LU +%! [L,U] = splu(bs); +%! assert(L*U,bs,1e-10); + +%!test ;# simple LU + row permutations +%! [L,U,P] = splu(bs); +%! assert(P'*L*U,bs,1e-10); +%! # triangularity +%! [i,j,v]=spfind(L); +%! assert(i-j>=0); +%! [i,j,v]=spfind(U); +%! assert(j-i>=0); + +%!test ;# simple LU + row/col permutations +%! [L,U,P,Q] = splu(bs); +%! assert(P'*L*U*Q',bs,1e-10); +%! # triangularity +%! [i,j,v]=spfind(L); +%! assert(i-j>=0); +%! [i,j,v]=spfind(U); +%! assert(j-i>=0); + +%!test ;# LU with fixed column permutation +%! [L,U,P] = splu(bs,colamd(bs)); +%! assert(P'*L*U,bs,1e-10); +%! # triangularity +%! [i,j,v]=spfind(L); +%! assert(i-j>=0); +%! [i,j,v]=spfind(U(:,colamd(bs))); +%! assert(j-i>=0); + +%!test ;# LU with initial column permutation +%! [L,U,P,Q] = splu(bs,colamd(bs)); +%! assert(P'*L*U*Q',bs,1e-10); +%! # triangularity +%! [i,j,v]=spfind(L); +%! assert(i-j>=0); +%! [i,j,v]=spfind(U); +%! assert(j-i>=0); + +%!test ;# inverse +%! assert(spinv(bs)*bs,sparse(eye(rows(bs))),1e-10); + +%!assert(bf\as',bf\af',100*eps); +%!assert(bs\af',bf\af',100*eps); +%!assert(bs\as',sparse(bf\af'),100*eps); + +EOF +} + +# Cholesky tests +gen_cholesky_tests() { + cat >>$TESTS <<EOF +%!assert(spchol(bs)'*spchol(bs),bs,1e-10); +%!assert(splchol(bs)*splchol(bs)',bs,1e-10); +%!assert(splchol(bs),spchol(bs)',1e-10); + +%!test ;# Return Partial Cholesky factorization +%! [RS,PS] = spchol(bs); +%! assert(RS'*RS,bs,1e-10); +%! assert(PS,0); +%! [LS,PS] = splchol(bs); +%! assert(LS*LS',bs,1e-10); +%! assert(PS,0); + +%!test ;# Permuted Cholesky factorization +%! [RS,PS,QS] = spchol(bs); +%! assert(RS'*RS,QS*bs*QS',1e-10); +%! assert(PS,0); +%! [LS,PS,QS] = splchol(bs); +%! assert(LS*LS',QS*bs*QS',1e-10); +%! assert(PS,0); + +EOF +} + +# test scalar operations: uses af and real scalar bf; modifies as,bf,bs +gen_scalar_tests() { + echo '%!test as=sparse(af);' >> $TESTS + echo '%!test bs=bf;' >> $TESTS + gen_elementop_tests + gen_ordering_tests + echo '%!test bf=bf+1i;' >>$TESTS + echo '%!test bs=bf;' >> $TESTS + gen_elementop_tests +} + +# test matrix operations: uses af and bf; modifies as,bs +gen_rectangular_tests() { + echo '%!test as=sparse(af);' >> $TESTS + echo '%!test bs=sparse(bf);' >>$TESTS + gen_mapper_tests + gen_real_mapper_tests + gen_unaryop_tests + gen_elementop_tests + gen_sparsesparse_elementop_tests + gen_matrixop_tests + # gen_divop_tests # Disable rectangular \ and / for now + gen_matrixdiag_tests + gen_matrixreshape_tests +} + + +# ======================================================= +# sparse assembly tests + +gen_assembly_tests() { +cat >>$TESTS <<EOF +%%Assembly tests +%!test +%! m=max([m;r(:)]); +%! n=max([n;c(:)]); +%! funiq=fsum=zeros(m,n); +%! funiq(r(:) + m*(c(:)-1) ) = ones(size(r(:))); +%! funiq = sparse(funiq); +%! for k=1:length(r), fsum(r(k),c(k)) += 1; end +%! fsum = sparse(fsum); +%!assert(sparse(r,c,1),sparse(fsum(1:max(r),1:max(c)))); +%!assert(sparse(r,c,1,"sum"),sparse(fsum(1:max(r),1:max(c)))); +%!assert(sparse(r,c,1,"unique"),sparse(funiq(1:max(r),1:max(c)))); +%!assert(sparse(r,c,1,m,n),sparse(fsum)); +%!assert(sparse(r,c,1,m,n,"sum"),sparse(fsum)); +%!assert(sparse(r,c,1,m,n,"unique"),sparse(funiq)); + +%!assert(sparse(r,c,1i),sparse(fsum(1:max(r),1:max(c))*1i)); +%!assert(sparse(r,c,1i,"sum"),sparse(fsum(1:max(r),1:max(c))*1i)); +%!assert(sparse(r,c,1i,"unique"),sparse(funiq(1:max(r),1:max(c))*1i)); +%!assert(sparse(r,c,1i,m,n),sparse(fsum*1i)); +%!assert(sparse(r,c,1i,m,n,"sum"),sparse(fsum*1i)); +%!assert(sparse(r,c,1i,m,n,"unique"),sparse(funiq*1i)); + +%!test +%! if (issparse(funiq)) +%! assert(sparse(full(1i*funiq)),sparse(1i*funiq)); +%! endif + +%!assert(sparse(full(funiq)),funiq); + + +EOF +} + +# ======================================================= +# sparse selection tests + +gen_select_tests() { + cat >>$TESTS <<EOF +%!test as=sparse(af); + +%% Point tests +%!test idx=ridx(:)+rows(as)*(cidx(:)-1); +%!assert(sparse(as(idx),true),sparse(af(idx),true)); +%!assert(as(idx),sparse(af(idx),true)); +%!assert(as(idx'),sparse(af(idx'),true)); +%!assert(as([idx,idx]),sparse(af([idx,idx]),true)); +%!error(as(reshape([idx;idx],[1,length(idx),2]))); + +%% Slice tests +%!assert(as(ridx,cidx), sparse(af(ridx,cidx),true)) +%!assert(as(ridx,:), sparse(af(ridx,:),true)) +%!assert(as(:,cidx), sparse(af(:,cidx),true)) +%!assert(as(:,:), sparse(af(:,:),true)) + +%% Test 'end' keyword +%!assert(as(end),af(end)) +%!assert(as(1,end), af(1,end)) +%!assert(as(end,1), af(end,1)) +%!assert(as(end,end), af(end,end)) +%!assert(as(2:end,2:end), sparse(af(2:end,2:end),true)) +%!assert(as(1:end-1,1:end-1), sparse(af(1:end-1,1:end-1),true)) +EOF +} + +# ======================================================= +# sparse save and load tests + +gen_save_tests() { + cat >>$TESTS <<EOF +%!test # save ascii +%! savefile= tmpnam(); +%! as_save=as; save("-text",savefile,"bf","as_save","af"); +%! clear as_save; +%! load(savefile,"as_save"); +%! unlink(savefile); +%! assert(as_save,sparse(af)); +%!test # save binary +%! savefile= tmpnam(); +%! as_save=as; save("-binary",savefile,"bf","as_save","af"); +%! clear as_save; +%! load(savefile,"as_save"); +%! unlink(savefile); +%! assert(as_save,sparse(af)); +%!test # save hdf5 +%! savefile= tmpnam(); +%! as_save=as; save("-hdf5",savefile,"bf","as_save","af"); +%! clear as_save; +%! load(savefile,"as_save"); +%! unlink(savefile); +%! assert(as_save,sparse(af)); +%!test # save matlab +%! savefile= tmpnam(); +%! as_save=as; save("-mat",savefile,"bf","as_save","af"); +%! clear as_save; +%! load(savefile,"as_save"); +%! unlink(savefile); +%! assert(as_save,sparse(af)); +EOF +} + +# ============================================================= +# Specific solver tests for matrices that will test all of the solver +# code. Uses alpha and beta +# +# Note these tests can still fail with a singular matrix, as sprandn +# is used and QR solvers not implemented. However, that should happen +# rarely +gen_solver_tests() { + +if $preset; then + cat >>$TESTS <<EOF +%! n=8; +%! lf=diag(1:n);lf(n-1,1)=0.5*alpha;lf(n,2)=0.25*alpha;ls=sparse(lf); +%! uf=diag(1:n);uf(1,n-1)=2*alpha;uf(2,n)=alpha;us=sparse(uf); +%! ts=spdiags(ones(n,3),-1:1,n,n)+diag(1:n); tf = full(ts); +EOF +else + cat >>$TESTS <<EOF +%! n=floor(lognormal_rnd(8,2)+1)' +%! ls = tril(sprandn(8,8,0.2),-1).*alpha + n*speye(8); lf = full(ls); +%! us = triu(sprandn(8,8,0.2),1).*alpha + n*speye(8); uf = full(us); +%! ts = spdiags(randn(8,3),-1:1,8,8).*alpha; tf = full(ts); +EOF +fi + +cat >>$TESTS <<EOF +%! df = diag(1:n).* alpha; ds = sparse(df); +%! pdf = df(randperm(n),randperm(n)); pds = sparse(pdf); +%! plf = lf(randperm(n),randperm(n)); pls = sparse(plf); +%! puf = uf(randperm(n),randperm(n)); pus = sparse(puf); +%! bs = spdiags(repmat([1:n]',1,4),-2:1,n,n).*alpha; bf = full(bs); +%! cf = lf + lf'; cs = sparse(cf); +%! bcf = bf + bf'; bcs = sparse(bcf); +%! tcf = tf + tf'; tcs = sparse(tcf); +%! xf = diag(1:n) + fliplr(diag(1:n)).*beta; xs = sparse(xf); +%!assert(ds\xf,df\xf),1e-10; +%!assert(ds\xs,sparse(df\xf,1),1e-10); +%!assert(pds\xf,pdf\xf,1e-10); +%!assert(pds\xs,sparse(pdf\xf,1),1e-10); +%!assert(ls\xf,lf\xf,1e-10); +%!assert(sparse(ls\xs),sparse(lf\xf),1e-10); +%!assert(pls\xf,plf\xf,1e-10); +%!assert(sparse(pls\xs),sparse(plf\xf),1e-10); +%!assert(us\xf,uf\xf,1e-10); +%!assert(sparse(us\xs),sparse(uf\xf),1e-10); +%!assert(pus\xf,puf\xf,1e-10); +%!assert(sparse(pus\xs),sparse(puf\xf),1e-10); +%!assert(bs\xf,bf\xf,1e-10); +%!assert(sparse(bs\xs),sparse(bf\xf),1e-10); +%!assert(cs\xf,cf\xf,1e-10); +%!assert(sparse(cs\xs),sparse(cf\xf),1e-10); +%!assert(bcs\xf,bcf\xf,1e-10); +%!assert(sparse(bcs\xs),sparse(bcf\xf),1e-10); +%!assert(ts\xf,tf\xf,1e-10); +%!assert(sparse(ts\xs),sparse(tf\xf),1e-10); +%!assert(tcs\xf,tcf\xf,1e-10); +%!assert(sparse(tcs\xs),sparse(tcf\xf),1e-10); + +EOF +} + + +# ============================================================= +# Putting it all together: defining the combined tests + + +# initial function +gen_function +gen_section + +# specific tests +if $preset; then + gen_specific_tests + gen_section +fi + +# scalar operations +echo '%!shared as,af,bs,bf' >> $TESTS +if $preset; then + echo '%!test af=[1+1i,2-1i,0,0;0,0,0,3+2i;0,0,0,4];' >> $TESTS + echo '%!test bf=3;' >>$TESTS +else + cat >>$TESTS <<EOF +%!test +%! % generate m,n from 1 to <5000 +%! m=floor(lognormal_rnd(8,2)+1); +%! n=floor(lognormal_rnd(8,2)+1); +%! as=sprandn(m,n,0.3); af = full(as+1i*sprandn(as)); +%! bf = randn; +EOF +fi + +gen_scalar_tests +gen_section + +# rectangular operations +if $preset; then + echo '%!test af=[1+1i,2-1i,0,0;0,0,0,3+2i;0,0,0,4];' >> $TESTS + echo '%!test bf=[0,1-1i,0,0;2+1i,0,0,0;3-1i,2+3i,0,0];' >> $TESTS +else + cat >>$TESTS <<EOF +%!test +%! m=floor(lognormal_rnd(8,2)+1); +%! n=floor(lognormal_rnd(8,2)+1); +%! as=sprandn(m,n,0.3); af = full(as+1i*sprandn(as)); +%! bs=sprandn(m,n,0.3); bf = full(bs+1i*sprandn(bs)); +EOF +fi + +gen_rectangular_tests +gen_section +gen_save_tests +gen_section +echo '%!test bf=real(bf);' >> $TESTS +gen_rectangular_tests +gen_section +gen_sparsesparse_ordering_tests +gen_section +echo '%!test af=real(af);' >> $TESTS +gen_rectangular_tests +gen_section +gen_save_tests +gen_section +echo '%!test bf=bf+1i*(bf~=0);' >> $TESTS +gen_rectangular_tests +gen_section + +# square operations +if $preset; then + echo '%!test af=[1+1i,2-1i,0,0;0,0,0,3+2i;0,0,0,4];' >> $TESTS + echo '%! as=sparse(af);' >> $TESTS + echo '%!test bf=[0,1-1i,0,0;2+1i,0,0,0;3-1i,2+3i,0,0];' >> $TESTS +else + cat >>$TESTS <<EOF +%!test +%! m=floor(lognormal_rnd(8,2)+1); +%! n=floor(lognormal_rnd(8,2)+1); +%! as=sprandn(m,n,0.3); af = full(as+1i*sprandn(as)); +%! bs=sprandn(m,n,0.3); bf = full(bs+1i*sprandn(bs)); +EOF +fi + +cat >>$TESTS <<EOF +%!test ;# invertible matrix +%! bf=af'*bf+max(abs([af(:);bf(:)]))*sparse(eye(columns(as))); +%! bs=sparse(bf); + +EOF + +gen_square_tests +gen_section +echo '%!test bf=real(bf);' >> $TESTS +echo '%! bs=sparse(bf);' >> $TESTS +gen_square_tests +gen_section +echo '%!test af=real(af);' >> $TESTS +echo '%! as=sparse(af);' >> $TESTS +gen_square_tests +gen_section +echo '%!test bf=bf+1i*(bf~=0);' >> $TESTS +echo '%! bs=sparse(bf);' >> $TESTS +gen_square_tests +gen_section + +# cholesky tests +if $preset; then + echo '%!test bf=[5,0,1+1i,0;0,5,0,1-2i;1-1i,0,5,0;0,1+2i,0,5];' >> $TESTS + echo '%! bs=sparse(bf);' >> $TESTS +else + echo '# This has a small chance of failing to create a positive definite matrix' >> $TESTS + echo '%!test n=floor(lognormal_rnd(8,2)+1)' >> $TESTS + echo '%! bs = n*speye(n,n) + sprandn(n,n,0.3); bf = full(bs);' >> $TESTS +fi + +gen_cholesky_tests +gen_section +echo '%!test bf=real(bf);' >> $TESTS +echo '%! bs=sparse(bf);' >> $TESTS +gen_cholesky_tests +gen_section + +# assembly tests +echo '%!shared r,c,m,n,fsum,funiq' >>$TESTS +if $use_preset; then + cat >>$TESTS <<EOF +%!test +%! r=[1,1,2,1,2,3]; +%! c=[2,1,1,1,2,1]; +%! m=n=0; +EOF +else + cat >>$TESTS <<EOF +%!test +%! % generate m,n from 1 to <5000 +%! m=floor(lognormal_rnd(8,2)+1); +%! n=floor(lognormal_rnd(8,2)+1); +%! nz=ceil((m+n)/2); +%! r=floor(rand(5,nz)*n)+1; +%! c=floor(rand(5,nn)*m)+1; +EOF +fi +gen_assembly_tests #includes real and complex tests +gen_section + +# slicing tests +echo '%!shared ridx,cidx,idx,as,af' >>$TESTS +if $use_preset; then + cat >>$TESTS <<EOF +%!test +%! af=[1+1i,2-1i,0,0;0,0,0,3+2i;0,0,0,4]; +%! ridx=[1,3]; cidx=[2,3]; +EOF +else + cat >>$TESTS <<EOF +%!test +%! % generate m,n from 1 to <5000 +%! m=floor(lognormal_rnd(8,2)+1); +%! n=floor(lognormal_rnd(8,2)+1); +%! as=sprandn(m,n,0.3); af = full(as+1i*sprandn(as)); +%! ridx = ceil(m*rand(1,ceil(rand*m)) +%! cidx = ceil(n*rand(1,ceil(rand*n)) +EOF +fi +gen_select_tests +echo '%!test af=real(af);' >> $TESTS +gen_select_tests +gen_section +echo '%!shared alpha,beta,df,pdf,lf,plf,uf,puf,bf,cf,bcf,tf,tcf,xf,ds,pds,ls,pls,us,pus,bs,cs,bcs,ts,tcs,xs' >>$TESTS +echo '%!test alpha=1;beta=1;' >> $TESTS +gen_solver_tests +echo '%!test alpha=1;beta=1i;' >> $TESTS +gen_solver_tests +echo '%!test alpha=1i;beta=1;' >> $TESTS +gen_solver_tests +echo '%!test alpha=1i;beta=1i;' >> $TESTS +gen_solver_tests +gen_section
new file mode 100644 --- /dev/null +++ b/test/fntests.m @@ -0,0 +1,141 @@ +clear all; + +global topsrcdir; + +currdir = canonicalize_file_name ("."); + +if (nargin == 1) + xdir = argv{1}; +else + xdir = "."; +endif + +srcdir = canonicalize_file_name (xdir); +topsrcdir = canonicalize_file_name (fullfile (xdir, "..")); + +if (strcmp (currdir, srcdir)) + testdirs = {srcdir}; +else + testdirs = {currdir, srcdir}; +endif + +src_tree = canonicalize_file_name (fullfile (topsrcdir, "src")); +script_tree = canonicalize_file_name (fullfile (topsrcdir, "scripts")); +fundirs = {src_tree, script_tree}; + +function [dp, dn] = runtestdir (fid, d); + lst = dir(d); + dp = dn = 0; + for i = 1:length(lst) + nm = lst(i).name; + if (length(nm) > 5 && strcmp(nm(1:5),"test_") && + strcmp(nm((end-1):end),".m")) + [p,n] = test(nm(1:(end-2)),"quiet",fid); + printf(" %s -> passes %d of %d\n",nm,p,n); + dp +=p; + dn += n; + endif + endfor +endfunction + +function y = hastests (f) + fid = fopen(f); + str = fscanf(fid,"%s"); + if (findstr(str,"%!test") || + findstr(str,"%!assert") || + findstr(str,"%!error") || + findstr(str,"%!warning")) + y = 1; + else + y = 0; + endif + fclose(fid); +endfunction + +function [dp, dn] = runtestscript (fid, d, ident); + global topsrcdir + lst = dir(d); + dp = dn = 0; + for i=1:length(lst) + nm = lst(i).name; + if (lst(i).isdir && !strcmp(nm,".") && !strcmp(nm,"..") && + !strcmp(nm,"CVS")) + [p, n] = runtestscript (fid, [d, "/",nm], [ident," "]); + dp += p; + dn += n; + endif + endfor + for i=1:length(lst) + nm = lst(i).name; + if ((length(nm) > 3 && strcmp(nm((end-2):end),".cc")) || + (length(nm) > 2 && strcmp(nm((end-1):end),".m"))) + f = fullfile (d, nm); + ## Only run if it contains %!test, %!assert %!error or %!warning + if (hastests(f)) + [p, n] = test(f,"quiet",fid); + dp += p; + dn += n; + endif + endif + endfor + printf("%s%s -> passes %d of %d tests\n", ident, + strrep (d, topsrcdir, "..."), dp, dn); +## printf("%s%s -> passes %d of %d tests\n", ident, d, dp, dn); +endfunction + +function printf_assert(varargin) + global _assert_printf; + _assert_printf=cat(2,_assert_printf,sprintf(varargin{:})); +endfunction + +function ret = prog_output_assert(str) + global _assert_printf; + if (isempty(_assert_printf)) + ret = isempty(str); + elseif (_assert_printf(end) == "\n") + ret = strcmp(_assert_printf(1:(end-1)),str); + else + ret = strcmp(_assert_printf,str); + endif + _assert_printf = ""; +endfunction + +pso = page_screen_output; +warn_state = warning("query","quiet"); +warning("on","quiet"); +try + page_screen_output =0; + fid=fopen("fntests.log","wt"); + if (fid < 0) + error("could not open fntests.log for writing"); + endif + test("","explain",fid); + dp=dn=0; + printf("\nIntegrated test scripts\n"); + for i=1:length(fundirs) + [p,n] = runtestscript(fid,fundirs{i}," "); + dp+=p; + dn+=n; + endfor + printf("\nFixed test scripts\n"); + for i=1:length(testdirs) + [p, n] = runtestdir (fid, testdirs{i}); + dp+=p; + dn+=n; + endfor + printf("---> passes %d out of %d tests",dp,dn); + if dp==dn + printf("\n---> success"); + endif; + disp(""); + printf("see fntests.log for details"); + disp(""); + fclose(fid); + page_screen_output = pso; + warning(warn_state.state,"quiet"); +catch + page_screen_output = pso; + warning(warn_state.state,"quiet"); + disp(lasterr()); +end_try_catch +
new file mode 100644 --- /dev/null +++ b/test/test_args.m @@ -0,0 +1,80 @@ +%% Automatically generated from DejaGNU files + +%% test/octave.test/args/args-1.m +%!function f () +%! printf_assert ("nargin: %d, nargout: %d\n", nargin, nargout); +%!test +%! f; +%! assert(prog_output_assert("nargin: 0, nargout: 0")); + +%% test/octave.test/args/args-2.m +%!function f (x, y) +%! printf_assert ("nargin: %d, nargout: %d\n", nargin, nargout); +%!test +%! f (1); +%! assert(prog_output_assert("nargin: 1, nargout: 0")); + +%% test/octave.test/args/args-3.m +%!function [x, y] = f () +%! printf_assert ("nargin: %d, nargout: %d\n", nargin, nargout); +%! x = 2; +%!test +%! x = f (); +%! assert(prog_output_assert("nargin: 0, nargout: 1")); + +%% test/octave.test/args/args-4.m +%!function [x, y] = f (a, b) +%! printf_assert ("nargin: %d, nargout: %d\n", nargin, nargout); +%! x = a; +%!test +%! z = f (1); +%! assert(prog_output_assert("nargin: 1, nargout: 1")); + +%% test/octave.test/args/args-5.m +%!function [varargout] = f (varargin) +%! printf_assert ("nargin: %d, nargout: %d\n", nargin, nargout); +%!test +%! f; +%! assert(prog_output_assert("nargin: 0, nargout: 0")); + +%% test/octave.test/args/args-6.m +%!function [varargout] = f (x, varargin) +%! printf_assert ("nargin: %d, nargout: %d\n", nargin, nargout); +%!test +%! f (1); +%! assert(prog_output_assert("nargin: 1, nargout: 0")); + +%% test/octave.test/args/args-7.m +%!function [x, varargout] = f (varargin) +%! printf_assert ("nargin: %d, nargout: %d\n", nargin, nargout); +%! x = 2; +%!test +%! x = f (); +%! assert(prog_output_assert("nargin: 0, nargout: 1")); + +%% test/octave.test/args/args-8.m +%!function [varargout] = f (varargin) +%! printf_assert ("nargin: %d, nargout: %d\n", nargin, nargout); +%! varargout{1} = (varargin{1}); +%!test +%! z = f (1); +%! assert(prog_output_assert("nargin: 1, nargout: 1")); + +%% test/octave.test/args/args-9.m +%!function [x, y, z] = f (a, b, c, d, e) +%! printf_assert ("nargin: %d, nargout: %d\n", nargin, nargout); +%!test +%! [s, t] = f (1, 2, 3, 4); +%! assert(prog_output_assert("nargin: 4, nargout: 2")); + +%% test/octave.test/args/args-10.m +%!function [varargout] = f (varargin) +%! printf_assert ("nargin: %d, nargout: %d\n", nargin, nargout); +%! varargout{1} = 1; +%! varargout{2} = 2; +%! varargout{3} = 3; +%! varargout{4} = 4; +%!test +%! [s, t, u, v] = f (1, 2, 3); +%! assert(prog_output_assert("nargin: 3, nargout: 4")); +
new file mode 100644 --- /dev/null +++ b/test/test_arith.m @@ -0,0 +1,796 @@ +%% Automatically generated from DejaGNU files + +%% test/octave.test/arith/beta-1.m +%!test +%! a=[1, 1.5, 2, 3]; +%! b=[4, 3, 2, 1]; +%! v1=beta(a,b); +%! v2=beta(b,a); +%! v3=gamma(a).*gamma(b)./gamma(a+b); +%! assert(all(abs(v1-v2)<sqrt(eps)) && all(abs(v2-v3)<sqrt(eps))); + +%% test/octave.test/arith/beta-2.m +%!error beta(); + +%% test/octave.test/arith/beta-3.m +%!error beta(1); + +%% test/octave.test/arith/betainc-1.m +%!test +%! a=[1, 1.5, 2, 3]; +%! b=[4, 3, 2, 1]; +%! v1=betainc(1,a,b); +%! v2=[1,1,1,1]; +%! x = [.2, .4, .6, .8]; +%! v3=betainc(x, a, b); +%! v4 = 1-betainc(1.-x, b, a); +%! assert(all(abs(v1-v2)<sqrt(eps)) && all(abs(v3-v4)<sqrt(eps))); + +%% test/octave.test/arith/betainc-2.m +%!error <... betainc:.*> betainc(); + +%% test/octave.test/arith/betainc-3.m +%!error <... betainc:.*> betainc(1); + +%% test/octave.test/arith/betainc-4.m +%!error <... betainc:.*> betainc(1,2); + +%% test/octave.test/arith/ceil-1.m +%!assert(all (ceil ([2, 1.1, -1.1, -1]) == [2, 2, -1, -1])); + +%% test/octave.test/arith/ceil-2.m +%!assert(all (ceil ([2+2i, 1.1+1.1i, -1.1-1.1i, -1-i]) == [2+2i, 2+2i, -1-i, -1-i])); + +%% test/octave.test/arith/ceil-3.m +%!error ceil (); + +%% test/octave.test/arith/ceil-4.m +%!error ceil (1, 2); + +%% test/octave.test/arith/erf-1.m +%!test +%! x=[0,.5,1]; +%! v=[0, .520499877813047, .842700792949715]; +%! assert(all(abs(erf(x)-v)<1.e-10) && all(abs(erf(-x)+v)<1.e-10) && all(abs(erfc(x)+v-1)<1.e-10) && all(abs(erfinv(v)-x)<1.e-10)); + +%% test/octave.test/arith/erf-2.m +%!error erf(); + +%% test/octave.test/arith/erf-3.m +%!error erf(1,2); + +%% test/octave.test/arith/exp-1.m +%!assert(all (abs (exp ([0, 1, -1, -1000]) - [1, e, 1/e, 0]) < sqrt (eps))); + +%% test/octave.test/arith/exp-2.m +%!assert(abs (exp (1+i) - e * (cos (1) + sin (1) * i)) < sqrt (eps)); + +%% test/octave.test/arith/exp-3.m +%!error exp (); + +%% test/octave.test/arith/exp-4.m +%!error exp (1, 2); + +%% test/octave.test/arith/exp-5.m +%!assert(exp (Inf) == Inf && exp (-Inf) == 0 && isnan (exp (NaN))); + +%% test/octave.test/arith/fix-1.m +%!assert(all (fix ([1.1, 1, -1.1, -1]) == [1, 1, -1, -1])); + +%% test/octave.test/arith/fix-2.m +%!assert(all (fix ([1.1+1.1i, 1+i, -1.1-1.1i, -1-i]) == [1+i, 1+i, -1-i, -1-i])); + +%% test/octave.test/arith/fix-3.m +%!error fix (); + +%% test/octave.test/arith/fix-4.m +%!error fix (1, 2); + +%% test/octave.test/arith/floor-1.m +%!assert(all (floor ([2, 1.1, -1.1, -1]) == [2, 1, -2, -1])); + +%% test/octave.test/arith/floor-2.m +%!assert(all (floor ([2+2i, 1.1+1.1i, -1.1-1.1i, -1-i]) == [2+2i, 1+i, -2-2i, -1-i])); + +%% test/octave.test/arith/floor-3.m +%!error floor (); + +%% test/octave.test/arith/floor-4.m +%!error floor (1, 2); + +%% test/octave.test/arith/gamma-1.m +%!test +%! x = [.5, 1, 1.5, 2, 3, 4, 5]; +%! v = [sqrt(pi), 1, .5*sqrt(pi), 1, 2, 6, 24]; +%! assert(all(abs(gamma(x) - v) < sqrt(eps)) && all(abs(lgamma(x) - log(v)) < sqrt(eps)) +%! ); + +%% test/octave.test/arith/gamma-2.m +%!error gamma(); + +%% test/octave.test/arith/gamma-3.m +%!error gamma(1,2); + +%% test/octave.test/arith/gammainc-1.m +%!test +%! a = [.5 .5 .5 .5 .5]; +%! x = [0 1 2 3 4]; +%! v1 = sqrt(pi)*erf(x)./gamma(a); +%! v3 = gammainc(x.*x,a); +%! assert(all (abs(v1 - v3) < sqrt(eps))); + +%% test/octave.test/arith/gcd-1.m +%!assert((gcd (200, 300, 50, 35) == gcd ([200, 300, 50, 35]) +%! && gcd ([200, 300, 50, 35]) == 5)); + +%% test/octave.test/arith/gcd-2.m +%!error <... gcd:.*> gcd (); + +%% test/octave.test/arith/gcd-3.m +%!test +%! s.a = 1; +%! fail("gcd (s)"); + +%% test/octave.test/arith/lcm-1.m +%!assert(lcm (3, 5, 7, 15) == lcm ([3, 5, 7, 15]) && lcm ([3, 5, 7,15]) == 105); + +%% test/octave.test/arith/lcm-2.m +%!error lcm (); + +%% test/octave.test/arith/lcm-3.m +%!test +%! s.a = 1; +%! fail("lcm (s)"); + +%% test/octave.test/arith/max-1.m +%!assert(max ([1, 4, 2, 3]) == 4 && max ([1; -10; 5; -2]) == 5); + +%% test/octave.test/arith/max-2.m +%!assert(all (max ([4, i 4.999; -2, 2, 3+4i]) == [4, 2, 3+4i])); + +%% test/octave.test/arith/max-3.m +%!error <... max:.*> max (); + +%% test/octave.test/arith/max-4.m +%!error <... max:.*> max (1, 2, 3, 4); + +%% test/octave.test/arith/min-1.m +%!assert(min ([1, 4, 2, 3]) == 1 && min ([1; -10; 5; -2]) == -10); + +%% test/octave.test/arith/min-2.m +%!assert(all (min ([4, i; -2, 2]) == [-2, i])); + +%% test/octave.test/arith/min-3.m +%!error <... min:.*> min (); + +%% test/octave.test/arith/min-4.m +%!error <... min:.*> min (1, 2, 3, 4); + +%% test/octave.test/arith/pow2-1.m +%!test +%! x = [3, 0, -3]; +%! v = [8, 1, .125]; +%! assert(all (abs (pow2 (x) - v) < sqrt (eps))); + +%% test/octave.test/arith/pow2-2.m +%!test +%! x = [3, 0, -3, 4, 0, -4, 5, 0, -5]; +%! y = [-2, -2, -2, 1, 1, 1, 3, 3, 3]; +%! z = x .* (2 .^ y); +%! assert(all (abs (pow2 (x,y) - z) < sqrt (eps)) +%! ); + +%% test/octave.test/arith/pow2-3.m +%!error pow2(); + +%% test/octave.test/arith/rem-1.m +%!assert(all (all (rem ([1, 2, 3; -1, -2, -3], 2) == [1, 0, 1; -1, 0, -1]))); + +%% test/octave.test/arith/rem-2.m +%!assert(all (all (rem ([1, 2, 3; -1, -2, -3], 2 * ones (2, 3)) +%! == [1, 0, 1; -1, 0, -1]))); + +%% test/octave.test/arith/rem-3.m +%!error rem (); + +%% test/octave.test/arith/rem-4.m +%!error rem (1, 2, 3); + +%% test/octave.test/arith/rem-5.m +%!error rem ([1, 2], [3, 4, 5]); + +%% test/octave.test/arith/rem-6.m +%!error rem (i, 1); + +%% test/octave.test/arith/round-1.m +%!assert((round (1) == 1 && round (1.1) == 1 && round (5.5) == 6 +%! && round (i) == i && round (2.5+3.5i) == 3+4i && round (-2.6) == -3)); + +%% test/octave.test/arith/round-2.m +%!assert(all (all (round ([1.1, -2.4; -3.7, 7.1]) == [1, -2; -4, 7]))); + +%% test/octave.test/arith/round-3.m +%!error round (); + +%% test/octave.test/arith/round-4.m +%!error round (1, 2); + +%% test/octave.test/arith/sign-1.m +%!assert(sign (-2) == -1 && sign (3) == 1 && sign (0) == 0); + +%% test/octave.test/arith/sign-2.m +%!assert(all (all (sign ([1, -pi; e, 0]) == [1, -1; 1, 0]))); + +%% test/octave.test/arith/sign-3.m +%!error sign (); + +%% test/octave.test/arith/sign-4.m +%!error sign (1, 2); + +%% test/octave.test/arith/sqrt-1.m +%!assert((sqrt (4) == 2 && sqrt (-1) == i +%! && abs (sqrt (1+i) - exp (0.5 * log (1+i))) < sqrt (eps))); + +%% test/octave.test/arith/sqrt-2.m +%!test +%! t1 = exp (0.5 * log (i)); +%! t2 = exp (0.5 * log (1-i)); +%! assert(all (all (abs (sqrt ([4, -4; i, 1-i]) - [2, 2i; t1, t2]) < sqrt (eps)))); + +%% test/octave.test/arith/sqrt-3.m +%!error sqrt (); + +%% test/octave.test/arith/sqrt-4.m +%!error sqrt (1, 2); + +%% test/octave.test/arith/abs-1.m +%!assert(abs (1) == 1 && abs (-3.5) == 3.5 && abs (3+4i) == 5 && abs (3-4i) == 5); + +%% test/octave.test/arith/abs-2.m +%!assert(all (all (abs ([1.1, 3i; 3+4i, -3-4i]) == [1.1, 3; 5, 5]))); + +%% test/octave.test/arith/abs-3.m +%!error abs (); + +%% test/octave.test/arith/abs-4.m +%!error abs (1, 2); + +%% test/octave.test/arith/xor-1.m +%!assert((xor ([1, 1, 0, 0], [0, 1, 0, 1]) == [1, 0, 0, 1] +%! && xor ([i, i, 0, 0], [1, 0, 1, 0]) == [0, 1, 1, 0])); + +%% test/octave.test/arith/xor-2.m +%!assert(all (all (xor (eye (2), fliplr (eye (2))) == ones (2)))); + +%% test/octave.test/arith/xor-3.m +%!error xor (); + +%% test/octave.test/arith/xor-4.m +%!error xor (1, 2, 3); + +%% test/octave.test/arith/arg-1.m +%!assert(arg (1) == 0 && arg (i) == pi/2 && arg (-1) == pi && arg (-i) == -pi/2); + +%% test/octave.test/arith/arg-2.m +%!assert(all (all (arg ([1, i; -1, -i]) == [0, pi/2; pi, -pi/2]))); + +%% test/octave.test/arith/arg-3.m +%!error arg (); + +%% test/octave.test/arith/arg-4.m +%!error arg (1, 2); + +%% test/octave.test/arith/conj-1.m +%!assert(conj (1) == 1 && conj (i) == -i && conj (1+i) == 1-i && conj (1-i) == 1+i); + +%% test/octave.test/arith/conj-2.m +%!assert(all (all (conj ([-1, -i; -1+i, -1-i]) == [-1, i; -1-i, -1+i]))); + +%% test/octave.test/arith/conj-3.m +%!error conj (); + +%% test/octave.test/arith/conj-4.m +%!error conj (1, 2); + +%% test/octave.test/arith/imag-1.m +%!assert(imag (1) == 0 && imag (i) == 1 && imag (1+i) == 1); + +%% test/octave.test/arith/imag-2.m +%!assert(all (all (imag ([i, 1; 1, i]) == eye (2)))); + +%% test/octave.test/arith/imag-3.m +%!error imag (); + +%% test/octave.test/arith/imag-4.m +%!error imag (1, 2); + +%% test/octave.test/arith/real-1.m +%!assert(real (1) == 1 && real (i) == 0 && real (1+i) == 1); + +%% test/octave.test/arith/real-2.m +%!assert(all (all (real ([1, i; i, 1]) == eye (2)))); + +%% test/octave.test/arith/real-3.m +%!error real (); + +%% test/octave.test/arith/real-4.m +%!error real (1, 2); + +%% test/octave.test/arith/log-1.m +%!assert(all (abs (log ([1, e, e^2]) - [0, 1, 2]) < sqrt (eps))); + +%% test/octave.test/arith/log-2.m +%!error log (); + +%% test/octave.test/arith/log-3.m +%!error log (1, 2); + +%% test/octave.test/arith/log10-1.m +%!assert(all (abs (log10 ([0.01, 0.1, 1, 10, 100]) - [-2, -1, 0, 1, 2]) < sqrt (eps))); + +%% test/octave.test/arith/log10-2.m +%!error log10 (); + +%% test/octave.test/arith/log10-3.m +%!error log10 (1, 2); + +%% test/octave.test/arith/log2-1.m +%!assert(all (abs (log2 ([1/4, 1/2, 1, 2, 4]) - [-2, -1, 0, 1, 2]) < sqrt (eps))); + +%% test/octave.test/arith/log2-2.m +%!error log2 (); + +%% test/octave.test/arith/log2-3.m +%!error log2 (1, 2); + +%% test/octave.test/arith/sin-1.m +%!test +%! rt2 = sqrt (2); +%! rt3 = sqrt (3); +%! x = [0, pi/6, pi/4, pi/3, pi/2, 2*pi/3, 3*pi/4, 5*pi/6, pi]; +%! v = [0, 1/2, rt2/2, rt3/2, 1, rt3/2, rt2/2, 1/2, 0]; +%! assert(all (abs (sin (x) - v) < sqrt (eps))); + +%% test/octave.test/arith/sin-2.m +%!error sin (); + +%% test/octave.test/arith/sin-3.m +%!error sin (1, 2); + +%% test/octave.test/arith/cos-1.m +%!test +%! rt2 = sqrt (2); +%! rt3 = sqrt (3); +%! x = [0, pi/6, pi/4, pi/3, pi/2, 2*pi/3, 3*pi/4, 5*pi/6, pi]; +%! v = [1, rt3/2, rt2/2, 1/2, 0, -1/2, -rt2/2, -rt3/2, -1]; +%! assert(all (abs (cos (x) - v) < sqrt (eps))); + +%% test/octave.test/arith/cos-2.m +%!error cos (); + +%% test/octave.test/arith/cos-3.m +%!error cos (1, 2); + +%% test/octave.test/arith/tan-1.m +%!test +%! rt2 = sqrt (2); +%! rt3 = sqrt (3); +%! x = [0, pi/6, pi/4, pi/3, 2*pi/3, 3*pi/4, 5*pi/6, pi]; +%! v = [0, rt3/3, 1, rt3, -rt3, -1, -rt3/3, 0]; +%! assert(all (abs (tan (x) - v) < sqrt (eps))); + +%% test/octave.test/arith/tan-2.m +%!error tan (); + +%% test/octave.test/arith/tan-3.m +%!error tan (1, 2); + +%% test/octave.test/arith/sec-1.m +%!test +%! rt2 = sqrt (2); +%! rt3 = sqrt (3); +%! x = [0, pi/6, pi/4, pi/3, 2*pi/3, 3*pi/4, 5*pi/6, pi]; +%! v = [1, 2*rt3/3, rt2, 2, -2, -rt2, -2*rt3/3, -1]; +%! assert(all (abs (sec (x) - v) < sqrt (eps))); + +%% test/octave.test/arith/sec-2.m +%!error sec (); + +%% test/octave.test/arith/sec-3.m +%!error sec (1, 2); + +%% test/octave.test/arith/csc-1.m +%!test +%! rt2 = sqrt (2); +%! rt3 = sqrt (3); +%! x = [pi/6, pi/4, pi/3, pi/2, 2*pi/3, 3*pi/4, 5*pi/6]; +%! v = [2, rt2, 2*rt3/3, 1, 2*rt3/3, rt2, 2]; +%! assert(all (abs (csc (x) - v) < sqrt (eps))); + +%% test/octave.test/arith/csc-2.m +%!error csc (); + +%% test/octave.test/arith/csc-3.m +%!error csc (1, 2); + +%% test/octave.test/arith/cot-1.m +%!test +%! rt2 = sqrt (2); +%! rt3 = sqrt (3); +%! x = [pi/6, pi/4, pi/3, pi/2, 2*pi/3, 3*pi/4, 5*pi/6]; +%! v = [rt3, 1, rt3/3, 0, -rt3/3, -1, -rt3]; +%! assert(all (abs (cot (x) - v) < sqrt (eps))); + +%% test/octave.test/arith/cot-2.m +%!error cot (); + +%% test/octave.test/arith/cot-3.m +%!error cot (1, 2); + +%% test/octave.test/arith/asin-1.m +%!test +%! rt2 = sqrt (2); +%! rt3 = sqrt (3); +%! v = [0, pi/6, pi/4, pi/3, pi/2, pi/3, pi/4, pi/6, 0]; +%! x = [0, 1/2, rt2/2, rt3/2, 1, rt3/2, rt2/2, 1/2, 0]; +%! assert(all (abs (asin (x) - v) < sqrt (eps)) +%! +%! ); + +%% test/octave.test/arith/asin-2.m +%!error asin (); + +%% test/octave.test/arith/asin-3.m +%!error asin (1, 2); + +%% test/octave.test/arith/acos-1.m +%!test +%! rt2 = sqrt (2); +%! rt3 = sqrt (3); +%! v = [0, pi/6, pi/4, pi/3, pi/2, 2*pi/3, 3*pi/4, 5*pi/6, pi]; +%! x = [1, rt3/2, rt2/2, 1/2, 0, -1/2, -rt2/2, -rt3/2, -1]; +%! assert(all (abs (acos (x) - v) < sqrt (eps)) +%! +%! ); + +%% test/octave.test/arith/acos-2.m +%!error acos (); + +%% test/octave.test/arith/acos-3.m +%!error acos (1, 2); + +%% test/octave.test/arith/atan-1.m +%!test +%! rt2 = sqrt (2); +%! rt3 = sqrt (3); +%! v = [0, pi/6, pi/4, pi/3, -pi/3, -pi/4, -pi/6, 0]; +%! x = [0, rt3/3, 1, rt3, -rt3, -1, -rt3/3, 0]; +%! assert(all (abs (atan (x) - v) < sqrt (eps)) +%! +%! ); + +%% test/octave.test/arith/atan-2.m +%!error atan (); + +%% test/octave.test/arith/atan-3.m +%!error atan (1, 2); + +%% test/octave.test/arith/asec-1.m +%!test +%! rt2 = sqrt (2); +%! rt3 = sqrt (3); +%! v = [0, pi/6, pi/4, pi/3, 2*pi/3, 3*pi/4, 5*pi/6, pi]; +%! x = [1, 2*rt3/3, rt2, 2, -2, -rt2, -2*rt3/3, -1]; +%! assert(all (abs (asec (x) - v) < sqrt (eps)) +%! +%! ); + +%% test/octave.test/arith/asec-2.m +%!error asec (); + +%% test/octave.test/arith/asec-3.m +%!error asec (1, 2); + +%% test/octave.test/arith/acsc-1.m +%!test +%! rt2 = sqrt (2); +%! rt3 = sqrt (3); +%! v = [pi/6, pi/4, pi/3, pi/2, pi/3, pi/4, pi/6]; +%! x = [2, rt2, 2*rt3/3, 1, 2*rt3/3, rt2, 2]; +%! assert(all (abs (acsc (x) - v) < sqrt (eps)) +%! ); + +%% test/octave.test/arith/acsc-2.m +%!error acsc (); + +%% test/octave.test/arith/acsc-3.m +%!error acsc (1, 2); + +%% test/octave.test/arith/acot-1.m +%!test +%! rt2 = sqrt (2); +%! rt3 = sqrt (3); +%! x = [rt3, 1, rt3/3, 0, -rt3/3, -1, -rt3]; +%! v = [pi/6, pi/4, pi/3, pi/2, -pi/3, -pi/4, -pi/6]; +%! assert(all (abs (acot (x) - v) < sqrt (eps)) +%! +%! ); + +%% test/octave.test/arith/acot-2.m +%!error acot (); + +%% test/octave.test/arith/acot-3.m +%!error acot (1, 2); + +%% test/octave.test/arith/sinh-1.m +%!test +%! x = [0, pi/2*i, pi*i, 3*pi/2*i]; +%! v = [0, i, 0, -i]; +%! assert(all (abs (sinh (x) - v) < sqrt (eps))); + +%% test/octave.test/arith/sinh-2.m +%!error sinh (); + +%% test/octave.test/arith/sinh-3.m +%!error sinh (1, 2); + +%% test/octave.test/arith/cosh-1.m +%!test +%! x = [0, pi/2*i, pi*i, 3*pi/2*i]; +%! v = [1, 0, -1, 0]; +%! assert(all (abs (cosh (x) - v) < sqrt (eps))); + +%% test/octave.test/arith/cosh-2.m +%!error cosh (); + +%% test/octave.test/arith/cosh-3.m +%!error cosh (1, 2); + +%% test/octave.test/arith/tanh-1.m +%!test +%! x = [0, pi*i]; +%! v = [0, 0]; +%! assert(all (abs (tanh (x) - v) < sqrt (eps))); + +%% test/octave.test/arith/tanh-2.m +%!error tanh (); + +%% test/octave.test/arith/tanh-3.m +%!error tanh (1, 2); + +%% test/octave.test/arith/sech-1.m +%!test +%! x = [0, pi*i]; +%! v = [1, -1]; +%! assert(all (abs (sech (x) - v) < sqrt (eps))); + +%% test/octave.test/arith/sech-2.m +%!error sech (); + +%% test/octave.test/arith/sech-3.m +%!error sech (1, 2); + +%% test/octave.test/arith/csch-1.m +%!test +%! x = [pi/2*i, 3*pi/2*i]; +%! v = [-i, i]; +%! assert(all (abs (csch (x) - v) < sqrt (eps))); + +%% test/octave.test/arith/csch-2.m +%!error csch (); + +%% test/octave.test/arith/csch-3.m +%!error csch (1, 2); + +%% test/octave.test/arith/coth-1.m +%!test +%! x = [pi/2*i, 3*pi/2*i]; +%! v = [0, 0]; +%! assert(all (abs (coth (x) - v) < sqrt (eps))); + +%% test/octave.test/arith/coth-2.m +%!error coth (); + +%% test/octave.test/arith/coth-3.m +%!error coth (1, 2); + +%% test/octave.test/arith/asinh-1.m +%!test +%! v = [0, pi/2*i, 0, -pi/2*i]; +%! x = [0, i, 0, -i]; +%! assert(all (abs (asinh (x) - v) < sqrt (eps)) +%! ); + +%% test/octave.test/arith/asinh-2.m +%!error asinh (); + +%% test/octave.test/arith/asinh-3.m +%!error asinh (1, 2); + +%% test/octave.test/arith/acosh-1.m +%!test +%! v = [0, pi/2*i, pi*i, pi/2*i]; +%! x = [1, 0, -1, 0]; +%! assert(all (abs (acosh (x) - v) < sqrt (eps)) +%! ); + +%% test/octave.test/arith/acosh-2.m +%!error acosh (); + +%% test/octave.test/arith/acosh-3.m +%!error acosh (1, 2); + +%% test/octave.test/arith/atanh-1.m +%!test +%! v = [0, 0]; +%! x = [0, 0]; +%! assert(all (abs (atanh (x) - v) < sqrt (eps)) +%! ); + +%% test/octave.test/arith/atanh-2.m +%!error atanh (); + +%% test/octave.test/arith/atanh-3.m +%!error atanh (1, 2); + +%% test/octave.test/arith/asech-1.m +%!test +%! v = [0, pi*i]; +%! x = [1, -1]; +%! assert(all (abs (asech (x) - v) < sqrt (eps)) +%! ); + +%% test/octave.test/arith/asech-2.m +%!error asech (); + +%% test/octave.test/arith/asech-3.m +%!error asech (1, 2); + +%% test/octave.test/arith/acsch-1.m +%!test +%! v = [pi/2*i, -pi/2*i]; +%! x = [-i, i]; +%! assert(all (abs (acsch (x) - v) < sqrt (eps)) +%! ); + +%% test/octave.test/arith/acsch-2.m +%!error acsch (); + +%% test/octave.test/arith/acsch-3.m +%!error acsch (1, 2); + +%% test/octave.test/arith/acoth-1.m +%!test +%! rt2 = sqrt (2); +%! rt3 = sqrt (3); +%! v = -i*[pi/6, pi/4, pi/3, -pi/3, -pi/4, -pi/6]; +%! x = i*[rt3, 1, rt3/3, -rt3/3, -1, -rt3]; +%! assert(all (abs (acoth (x) - v) < sqrt (eps))); + +%% test/octave.test/arith/acoth-2.m +%!error acoth (); + +%% test/octave.test/arith/acoth-3.m +%!error acoth (1, 2); + +%% test/octave.test/arith/atan2-1.m +%!test +%! rt2 = sqrt (2); +%! rt3 = sqrt (3); +%! v = [0, pi/6, pi/4, pi/3, -pi/3, -pi/4, -pi/6, 0]; +%! y = [0, rt3, 1, rt3, -rt3, -1, -rt3, 0]; +%! x = [1, 3, 1, 1, 1, 1, 3, 1]; +%! assert(all (abs (atan2 (y, x) - v) < sqrt (eps)) +%! ); + +%% test/octave.test/arith/atan2-2.m +%!error <... atan2:.*> atan2 (); + +%% test/octave.test/arith/atan2-3.m +%!error <... atan2:.*> atan2 (1, 2, 3); + +%% test/octave.test/arith/sum-1.m +%!assert((sum ([1, 2, 3]) == 6 && sum ([-1; -2; -3]) == -6 +%! && sum ([i, 2+i, -3+2i, 4]) == 3+4i)); + +%% test/octave.test/arith/sum-2.m +%!assert(all (all (sum ([1, 2, 3; i, 2i, 3i; 1+i, 2+2i, 3+3i]) == [2+2i, 4+4i, 6+6i]))); + +%% test/octave.test/arith/sum-3.m +%!error <... sum:.*> sum (); + +%% test/octave.test/arith/sum-4.m +%!assert((all (sum ([1, 2; 3, 4], 1) == [4, 6]) +%! && all (sum ([1, 2; 3, 4], 2) == [3; 7]) +%! && sum (zeros (1, 0)) == 0 +%! && all (size (sum (zeros (1, 0), 1)) == [1, 0]) +%! && sum (zeros (1, 0), 2) == 0 +%! && sum (zeros (0, 1)) == 0 +%! && sum (zeros (0, 1), 1) == 0 +%! && all (size (sum (zeros (0, 1), 2)) == [0, 1]) +%! && all (size (sum (zeros (2, 0))) == [1, 0]) +%! && all (size (sum (zeros (2, 0), 1)) == [1, 0]) +%! && all (sum (zeros (2, 0), 2) == [0; 0]) +%! && all (sum (zeros (0, 2)) == [0, 0]) +%! && all (sum (zeros (0, 2), 1) == [0, 0]) +%! && all (size (sum (zeros (0, 2), 2)) == [0, 1]))); + +%% test/octave.test/arith/prod-1.m +%!assert((prod ([1, 2, 3]) == 6 && prod ([-1; -2; -3]) == -6 +%! && prod ([i, 2+i, -3+2i, 4]) == -4-32i)); + +%% test/octave.test/arith/prod-2.m +%!assert(all (all (prod ([1, 2, 3; i, 2i, 3i; 1+i, 2+2i, 3+3i]) +%! == [-1+i, -8+8i, -27+27i]))); + +%% test/octave.test/arith/prod-3.m +%!error <... prod:.*> prod (); + +%% test/octave.test/arith/prod-4.m +%!assert((all (prod ([1, 2; 3, 4], 1) == [3, 8]) +%! && all (prod ([1, 2; 3, 4], 2) == [2; 12]) +%! && prod (zeros (1, 0)) == 1 +%! && all (size (prod (zeros (1, 0), 1)) == [1, 0]) +%! && prod (zeros (1, 0), 2) == 1 +%! && prod (zeros (0, 1)) == 1 +%! && prod (zeros (0, 1), 1) == 1 +%! && all (size (prod (zeros (0, 1), 2)) == [0, 1]) +%! && all (size (prod (zeros (2, 0))) == [1, 0]) +%! && all (size (prod (zeros (2, 0), 1)) == [1, 0]) +%! && all (prod (zeros (2, 0), 2) == [1; 1]) +%! && all (prod (zeros (0, 2)) == [1, 1]) +%! && all (prod (zeros (0, 2), 1) == [1, 1]) +%! && all (size (prod (zeros (0, 2), 2)) == [0, 1]))); + +%% test/octave.test/arith/cumsum-1.m +%!assert((cumsum ([1, 2, 3]) == [1, 3, 6] && cumsum ([-1; -2; -3]) == [-1; -3; -6] +%! && cumsum ([i, 2+i, -3+2i, 4]) == [i, 2+2i, -1+4i, 3+4i])); + +%% test/octave.test/arith/cumsum-2.m +%!assert(all (all (cumsum ([1, 2, 3; i, 2i, 3i; 1+i, 2+2i, 3+3i]) +%! == [1, 2, 3; 1+i, 2+2i, 3+3i; 2+2i, 4+4i, 6+6i]))); + +%% test/octave.test/arith/cumsum-3.m +%!error <... cumsum:.*> cumsum (); + +%% test/octave.test/arith/cumsum-4.m +%!assert((all (cumsum ([1, 2; 3, 4], 1) == [1, 2; 4, 6]) +%! && all (cumsum ([1, 2; 3, 4], 2) == [1, 3; 3, 7]))); + +%% test/octave.test/arith/cumprod-1.m +%!assert((cumprod ([1, 2, 3]) == [1, 2, 6] && cumprod ([-1; -2; -3]) == [-1; 2; -6] +%! && cumprod ([i, 2+i, -3+2i, 4]) == [i, -1+2i, -1-8i, -4-32i])); + +%% test/octave.test/arith/cumprod-2.m +%!assert(all (all (cumprod ([1, 2, 3; i, 2i, 3i; 1+i, 2+2i, 3+3i]) +%! == [1, 2, 3; i, 4i, 9i; -1+i, -8+8i, -27+27i]))); + +%% test/octave.test/arith/cumprod-3.m +%!error <... cumprod:.*> cumprod (); + +%% test/octave.test/arith/cumprod-4.m +%!assert((all (cumprod ([2, 3; 4, 5], 1) == [2, 3; 8, 15]) +%! && all (cumprod ([2, 3; 4, 5], 2) == [2, 6; 4, 20]))); + +%% test/octave.test/arith/sumsq-1.m +%!assert(sumsq ([1, 2, 3]) == 14 && sumsq ([-1; -2; 4i]) == 21); + +%% test/octave.test/arith/sumsq-2.m +%!assert(all (all (sumsq ([1, 2, 3; 2, 3, 4; 4i, 6i, 2]) == [21, 49, 29]))); + +%% test/octave.test/arith/sumsq-3.m +%!error <... sumsq:.*> sumsq (); + +%% test/octave.test/arith/sumsq-4.m +%!assert((all (sumsq ([1, 2; 3, 4], 1) == [10, 20]) +%! && all (sumsq ([1, 2; 3, 4], 2) == [5; 25]))); + +%% test/octave.test/arith/bincoeff-1.m +%!assert(bincoeff (5, 2) == 10 && bincoeff (50, 6) == 15890700); + +%% test/octave.test/arith/bincoeff-2.m +%!error bincoeff (); + +%% test/octave.test/arith/bincoeff-3.m +%!error bincoeff (1, 2, 3); +
new file mode 100644 --- /dev/null +++ b/test/test_audio.m @@ -0,0 +1,2 @@ +%% Automatically generated from DejaGNU files +
new file mode 100644 --- /dev/null +++ b/test/test_contin.m @@ -0,0 +1,147 @@ +%% Automatically generated from DejaGNU files + +%% test/octave.test/contin/contin-1.m +%!test +%! x = [1,2]; +%! a = 1; +%! b = 2; +%! y = [a... # comments here ok +%! b]; +%! assert(all (y == x)); + +%% test/octave.test/contin/contin-2.m +%!test +%! x = [1,2]; +%! a = 1; +%! b = 2; +%! y = [a... # comments here ok +%! b]; +%! assert(all (y == x)); + +%% test/octave.test/contin/contin-3.m +%!test +%! x = [1,2]; +%! a = 1; +%! b = 2; +%! y = [a... # comments here ok +%! b]; +%! assert(all (y == x)); + +%% test/octave.test/contin/contin-4.m +%!test +%! x = [1,2]; +%! a = 1; +%! b = 2; +%! y = [a... # comments ok here +%! b]; +%! assert(all (y == x)); + +%% test/octave.test/contin/contin-5.m +%!test +%! x = [1,2]; +%! a = 1; +%! b = 2; +%! y = [a... # comments here ok +%! b]; +%! assert(all (y == x)); + +%% test/octave.test/contin/contin-6.m +%!test +%! x = [1,2]; +%! a = 1; +%! b = 2; +%! y = [a... # comments here ok +%! b]; +%! assert(all (y == x)); + +%% test/octave.test/contin/contin-7.m +%!test +%! x = [1;2]; +%! a = 1; +%! b = 2; +%! y = [a... # comments here ok +%! ;\ +%! +%! b]; +%! assert(all (y == x)); + +%% test/octave.test/contin/contin-8.m +%!test +%! x = [1;2]; +%! a = 1; +%! b = 2; +%! y = [a... # comments here ok +%! ;\ +%! +%! b]; +%! assert(all (y == x)); + +%% test/octave.test/contin/contin-9.m +%!test +%! x = [1;2]; +%! a = 1; +%! b = 2; +%! y = [a... # comments here ok +%! ;\ +%! +%! b]; +%! assert(all (y == x)); + +%% test/octave.test/contin/contin-10.m +%!assert(1 + ... +%! 2 - \# comments here ok +%! 3 / ... # comments here ok +%! -1,6); + +%% test/octave.test/contin/contin-11.m +%!function y = f (a,... +%! b, ... +%! c, ... % comments ok +%! x, # continuation characters not required in parens +%! y, \# but they should work too. +%! z) +%! +%! y = 1; +%!test +%! assert(f (),1); + +%% test/octave.test/contin/contin-12.m +%!test +%!assert(1 == 1 +%! && 2 == 2 +%! || 3 == 5); + +%% test/octave.test/contin/contin-13.m +%!test +%! x = [1, ... +%! +%! ... +%! +%! 2]; +%! y = [1;2]; +%! assert(all (y == x)); + +%% test/octave.test/contin/contin-14.m +%!test +%! x = [1, ... +%! +%! ... +%! +%! 2]; +%! y = [1;2]; +%! assert(all (y == x)); + +%% test/octave.test/contin/contin-15.m +%!test +%! x = [1,... +%! 2]; +%! y = [1,2]; +%! assert(all (y == x)); + +%% test/octave.test/contin/contin-16.m +%!test +%! x = [ 1 , ... +%! 2]; +%! y = [1,2]; +%! assert(all (y == x)); +
new file mode 100644 --- /dev/null +++ b/test/test_control.m @@ -0,0 +1,2 @@ +%% Automatically generated from DejaGNU files +
new file mode 100644 --- /dev/null +++ b/test/test_diffeq.m @@ -0,0 +1,162 @@ +%% Automatically generated from DejaGNU files + +%% test/octave.test/diffeq/lsode-1.m +%% dassl-1.m +%% +%% Test lsode() function +%% +%% Author: David Billinghurst (David.Billinghurst@riotinto.com.au) +%% Comalco Research and Technology +%% 20 May 1998 +%% +%% Problem +%% +%% y1' = -y2, y1(0) = 1 +%% y2' = y1, y2(0) = 0 +%% +%% Solution +%% +%% y1(t) = cos(t) +%% y2(t) = sin(t) +%!function xdot = f (x, t) +%! xdot = [-x(2); x(1)]; +%!test +%! +%! x0 = [1; 0]; +%! xdot0 = [0; 1]; +%! t = (0:1:10)'; +%! +%! tol = 500 * lsode_options ("relative tolerance"); +%! +%! +%! x = lsode ("f", x0, t); +%! +%! y = [cos(t), sin(t)]; +%! +%! assert(all (all (abs (x - y) < tol))); + +%% test/octave.test/diffeq/lsode-2.m +%!function xdotdot = f (x, t) +%! xdotdot = [x(2); -x(1)]; +%!test +%! +%! x0 = [1; 0]; +%! t = [0; 2*pi]; +%! tol = 100 * dassl_options ("relative tolerance"); +%! +%! x = lsode ("f", x0, t); +%! +%! y = [1, 0; 1, 0]; +%! +%! assert(all (all (abs (x - y) < tol))); + +%% test/octave.test/diffeq/lsode-3.m +%!function xdot = f (x, t) +%! xdot = x; +%!test +%! +%! x0 = 1; +%! t = [0; 1]; +%! tol = 100 * dassl_options ("relative tolerance"); +%! +%! x = lsode ("f", x0, t); +%! +%! y = [1; e]; +%! +%! assert(all (all (abs (x - y) < tol))); + +%% test/octave.test/diffeq/lsode_options-1.m +%!test +%! lsode_options ("absolute tolerance", eps); +%! assert(lsode_options ("absolute tolerance") == eps); + +%% test/octave.test/diffeq/lsode_options-2.m +%!error <... lsode_options:.*> lsode_options (); + +%% test/octave.test/diffeq/lsode_options-3.m +%!error <... lsode_options:.*> lsode_options ("foo", 1, 2); + +%% test/octave.test/diffeq/dassl-1.m +%% dassl-1.m +%% +%% Test dassl() function +%% +%% Author: David Billinghurst (David.Billinghurst@riotinto.com.au) +%% Comalco Research and Technology +%% 20 May 1998 +%% +%% Problem +%% +%% y1' = -y2, y1(0) = 1 +%% y2' = y1, y2(0) = 0 +%% +%% Solution +%% +%% y1(t) = cos(t) +%% y2(t) = sin(t) +%!function res = f (x, xdot, t) +%! res = [xdot(1)+x(2); xdot(2)-x(1)]; +%!test +%! +%! x0 = [1; 0]; +%! xdot0 = [0; 1]; +%! t = (0:1:10)'; +%! +%! tol = 100 * dassl_options ("relative tolerance"); +%! +%! +%! [x, xdot] = dassl ("f", x0, xdot0, t); +%! +%! y = [cos(t), sin(t)]; +%! +%! assert(all (all (abs (x - y) < tol))); + +%% test/octave.test/diffeq/dassl-2.m +%% dassl-2.m +%% +%% Test dassl() function +%% +%% Author: David Billinghurst (David.Billinghurst@riotinto.com.au) +%% Comalco Research and Technology +%% 20 May 1998 +%% +%% Based on SLATEC quick check for DASSL by Linda Petzold +%% +%% Problem +%% +%% x1' + 10*x1 = 0, x1(0) = 1 +%% x1 + x2 = 1, x2(0) = 0 +%% +%% +%% Solution +%% +%% x1(t) = exp(-10*t) +%% x2(t) = 1 - x(1) +%!function res = f (x, xdot, t) +%! res = [xdot(1)+10*x(1); x(1)+x(2)-1]; +%!test +%! +%! x0 = [1; 0]; +%! xdot0 = [-10; 10]; +%! t = (0:0.2:1)'; +%! +%! tol = 500 * dassl_options ("relative tolerance"); +%! +%! +%! [x, xdot] = dassl ("f", x0, xdot0, t); +%! +%! y = [exp(-10*t), 1-exp(-10*t)]; +%! +%! assert(all (all (abs (x - y) < tol))); + +%% test/octave.test/diffeq/dassl_options-1.m +%!test +%! dassl_options ("absolute tolerance", eps); +%! assert(dassl_options ("absolute tolerance") == eps); + +%% test/octave.test/diffeq/dassl_options-2.m +%!error <... dassl_options:.*> dassl_options (); + +%% test/octave.test/diffeq/dassl_options-3.m +%!error <... dassl_options:.*> dassl_options ("foo", 1, 2); +
new file mode 100644 --- /dev/null +++ b/test/test_error.m @@ -0,0 +1,67 @@ +%% Automatically generated from DejaGNU files + +%% test/octave.test/error/error-1.m +%!function g () +%! error ("foo"); +%!function f () +%! g (); +%!error <foo> f (); + +%% test/octave.test/error/error-2.m +%!function g () +%! error ("foo\n"); +%!function f () +%! g +%!error <foo> f (); + +%% test/octave.test/error/error-3.m +%!error error (); + +%% test/octave.test/error/error-4.m +%!error <foo> error ("foo\n"); + +%% XXX FIXME XXX Why can't I use %!warning <foo> f; +%% test/octave.test/error/warning-1.m +%!function g () +%! warning ("foo"); +%!function f () +%! g; +%!test +%! fail("f","warning","foo"); + +%% 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"); + +%% XXX FIXME XXX This test no longer makes sense with new warning syntax +%% test/octave.test/error/warning-3.m +%!#warning <foo> warning ("foo", 1); + +%% test/octave.test/error/usage-1.m +%!function g () +%! usage ("foo"); +%!function f () +%! g (); +%!error <usage:> f (); + +%% test/octave.test/error/usage-2.m +%!function g () +%! usage ("foo"); +%!function f () +%! g +%!error <usage:> f (); + +%% test/octave.test/error/usage-3.m +%!error usage (); + +%% test/octave.test/error/usage-4.m +%!error <foo> usage ("foo\n"); +
new file mode 100644 --- /dev/null +++ b/test/test_eval-catch.m @@ -0,0 +1,58 @@ +%% Automatically generated from DejaGNU files + +%% 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('Shouldn't get here');"); + +%% test/octave.test/eval-catch/eval-catch-3.m +%!test +%! eval ("clear a; a; x = 0;", "x = 1;"); +%! assert (x, 1); + +%% XXX FIXME XXX This is redundant with the changes to the above +%% test/octave.test/eval-catch/eval-catch-4.m + +%% test/octave.test/eval-catch/eval-catch-5.m +%!test +%! eval ("clear a; a; str = '';", "str=lasterr;"); +%! assert(lasterr()(1:20),"error: `a' undefined"); +%! assert(str(1:20),"error: `a' undefined"); + +%% test/octave.test/eval-catch/eval-catch-6.m +%!test +%! eval ("error (\"user-defined error\"); str = '';", "str = lasterr;"); +%! assert(lasterr()(1:25),"error: user-defined error"); +%! assert(str(1:25),"error: user-defined error"); + +%% test/octave.test/eval-catch/eval-catch-7.m +%!function ms = mangle (s) +%! ## Wrap angle brackets around S. +%! ms = strcat ("<", s, ">"); +%!test +%! eval ("clear a; a; str='';", "str = mangle (lasterr);"); +%! assert(mangle(lasterr)(1:21),"<error: `a' undefined"); +%! assert(str(1:21),"<error: `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:20),"error: `a' undefined"); +%! assert(str2(1:20),"error: `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:20),"error: `b' undefined"); +%! assert(str2(1:20),"error: `b' undefined"); + +%% test/octave.test/eval-catch/eval-catch-10.m +%!test +%! eval ("eval (\"clear a; a; str='';\",\"error (strcat (\\\"rethrow: \\\", lasterr));str='';\");", +%! "str=lasterr;"); +%! assert(str(1:36),"error: rethrow: error: `a' undefined");
new file mode 100644 --- /dev/null +++ b/test/test_eval.m @@ -0,0 +1,80 @@ +%% Automatically generated from DejaGNU files + +%% test/octave.test/eval/eval-1.m +%!test +%! x = 1; +%! assert(eval ("x"),1); + +%% test/octave.test/eval/eval-2.m +%!test +%! x = 1; +%! assert(eval ("x;")); + +%% test/octave.test/eval/eval-3.m +%!test +%! x = 1 +%! assert(eval ("x;"),1); + +%% XXX FIXME XXX +%% Disable this test as adding the ";" is redundant with eval-1 and +%% in any case is a syntax error with assert +%% test/octave.test/eval/eval-4.m +%!#test +%! x = 1; +%! assert(eval ("x");,1); + +%% test/octave.test/eval/eval-5.m +%!test +%! eval ("flipud = 2;"); +%! assert(flipud,2); + +%% test/octave.test/eval/eval-6.m +%!function y = f () +%! eval ("flipud = 2;"); +%! y = flipud; +%!test +%! assert(f,2); + +%% test/octave.test/eval/eval-7.m +%!test +%! eval ("x = 1"); +%! assert(x,1); + +%% test/octave.test/eval/eval-8.m +%!test +%! eval ("x = 1;") +%! assert(x,1); + +%% test/octave.test/eval/eval-9.m +%!test +%! eval ("x = 1;"); +%! assert(x,1); + +%% test/octave.test/eval/eval-10.m +%! eval ("x = 1") +%! assert(x,1); + +%% test/octave.test/eval/eval-11.m +%!test +%! x = 1; +%! y = eval ("x"); +%! assert(y,1); + +%% test/octave.test/eval/eval-12.m +%!test +%! x = 1; +%! y = eval ("x;"); +%! assert(y,1); + +%% test/octave.test/eval/eval-13.m +%!test +%! x = 1; +%! y = eval ("x;"); +%! assert(y,1); + +%% test/octave.test/eval/eval-14.m +%!test +%! x = 1; +%! y = eval ("x"); +%! assert(y,1); +
new file mode 100644 --- /dev/null +++ b/test/test_for.m @@ -0,0 +1,82 @@ +%% Automatically generated from DejaGNU files + +%% 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")); +
new file mode 100644 --- /dev/null +++ b/test/test_global.m @@ -0,0 +1,66 @@ +%% Automatically generated from DejaGNU files + +%% 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); +%!test +%! global G = 1; +%! f; + +%% test/octave.test/global/global-3.m +%!function f () +%! fail("G"); +%!test +%! global G = 1; +%! f(); + +%% test/octave.test/global/global-4.m +%!function f () +%! global H = 1; +%!test +%! f; +%! fail("H"); + +%% test/octave.test/global/global-5.m +%!function f () +%! global H = 1; +%!test +%!function g () +%! fail("H"); +%!test +%! g(); + +%% test/octave.test/global/global-6.m +%!function f () +%! global H = 1; +%!function g () +%! global H; +%! assert(H,1); +%!test +%! f(); +%! g(); + +%% test/octave.test/global/global-7.m +%!test +%!function f () +%! global H = 1; +%!test +%! fail("H"); + +%% test/octave.test/global/global-8.m +%!function f () +%! global H = 1; +%!function g () +%! global H; +%! assert(H,1) +%!test +%! f; +%! clear H +%! g; +
new file mode 100644 --- /dev/null +++ b/test/test_if.m @@ -0,0 +1,71 @@ +%% Automatically generated from DejaGNU files + +%% 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")); +
new file mode 100644 --- /dev/null +++ b/test/test_image.m @@ -0,0 +1,2 @@ +%% Automatically generated from DejaGNU files +
new file mode 100644 --- /dev/null +++ b/test/test_index-wfi-f.m @@ -0,0 +1,429 @@ +%% Automatically generated from DejaGNU files + +%% test/octave.test/index-wfi-f/s-1.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = []; +%! assert(isempty (a)); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-f/s-2.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = 1; +%! assert(a(1),1); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-f/s-3.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = 1; +%! assert(a(:),1); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-f/s-4.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = 1; +%! assert(a(:,:),1); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-f/s-5.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = 1; +%! assert(a(1,:),1); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-f/s-6.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = 1; +%! assert(a(:,1),1); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-f/s-7.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = 1; +%! assert(isempty (a(logical (0)))); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-f/s-8.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = 1; +%! fail("a(-1)"); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-f/s-9.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = 1; +%! fail("a(2);"); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-f/s-10.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = 1; +%! fail("a(2,:);"); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-f/s-11.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = 1; +%! fail("a(:,2);"); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-f/s-12.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = 1; +%! fail("a(-1,:);"); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-f/s-13.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = 1; +%! fail("a(:,-1);"); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-f/s-14.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = 1; +%! fail("a([1,2,3]);"); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-f/s-15.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = 1; +%! fail("a([1;2;3]);"); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-f/s-16.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = 1; +%! fail("a([1,2;3,4]);"); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-f/s-17.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = 1; +%! fail("a([0,1]);"); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-f/s-18.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = 1; +%! fail("a([0;1]);"); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-f/s-19.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = 1; +%! fail("a([-1,0]);"); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-f/s-20.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = 1; +%! fail("a([-1;0]);"); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-f/v-1.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = [4,3,2,1]; +%! a_prime = [4;3;2;1]; +%! mid_a = [3,2]; +%! assert(a(1),4); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-f/v-2.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = [4,3,2,1]; +%! a_prime = [4;3;2;1]; +%! mid_a = [3,2]; +%! assert(a(2),3); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-f/v-3.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = [4,3,2,1]; +%! a_prime = [4;3;2;1]; +%! mid_a = [3,2]; +%! assert(all (a(:) == a_prime)); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-f/v-4.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = [4,3,2,1]; +%! a_prime = [4;3;2;1]; +%! mid_a = [3,2]; +%! assert(all (a(1,:) == a)); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-f/v-5.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = [4,3,2,1]; +%! a_prime = [4;3;2;1]; +%! mid_a = [3,2]; +%! assert(a(:,3),2); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-f/v-6.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = [4,3,2,1]; +%! a_prime = [4;3;2;1]; +%! mid_a = [3,2]; +%! assert(all (a(:,:) == a)); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-f/v-7.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = [4,3,2,1]; +%! a_prime = [4;3;2;1]; +%! mid_a = [3,2]; +%! assert(all (a(logical ([0,1,1,0])) == mid_a)); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-f/v-8.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = [4,3,2,1]; +%! a_prime = [4;3;2;1]; +%! mid_a = [3,2]; +%! fail("a(0);"); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-f/v-9.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = [4,3,2,1]; +%! a_prime = [4;3;2;1]; +%! mid_a = [3,2]; +%! fail("a(5);"); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-f/v-10.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = [4,3,2,1]; +%! a_prime = [4;3;2;1]; +%! mid_a = [3,2]; +%! fail("a(0,1);"); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-f/v-11.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = [4,3,2,1]; +%! a_prime = [4;3;2;1]; +%! mid_a = [3,2]; +%! assert(isempty (a(logical (0),:))); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-f/v-12.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = [4,3,2,1]; +%! a_prime = [4;3;2;1]; +%! mid_a = [3,2]; +%! fail("a(:,0);"); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-f/v-13.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = [4,3,2,1]; +%! a_prime = [4;3;2;1]; +%! mid_a = [3,2]; +%! assert(isempty (a([]))); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-f/v-14.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = [4,3,2,1]; +%! a_prime = [4;3;2;1]; +%! mid_a = [3,2]; +%! assert(isempty (a([],:))); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-f/v-15.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = [4,3,2,1]; +%! a_prime = [4;3;2;1]; +%! mid_a = [3,2]; +%! assert(isempty (a(:,[]))); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-f/m-1.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! 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))); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-f/m-2.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! 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 (a(:) == a_fvec)); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-f/m-3.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! 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]; +%! fail("a(0);"); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-f/m-4.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! 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(a(2),3); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-f/misc.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = [1,2;3,4]; +%! b = a; +%! b(:,:,2) = [5,6;7,8]; +%! a1 = [1; 3; 2; 4]; +%! a2 = [1, 3]; +%! a3 = [1, 2; 3, 4]; +%! a4 = [1; 3]; +%! a5 = 1; +%! a6 = [1; 3]; +%! a7 = [1, 2; 3, 4]; +%! a8(:,:,1) = [1, 2; 3, 4]; +%! a8(:,:,2) = [1, 2; 3, 4]; +%! a9(:,:,1,1) = [1, 2; 3, 4]; +%! a9(:,:,1,2) = [1, 2; 3, 4]; +%! a10(:,:,1,1) = [1, 2; 3, 4]; +%! a10(:,:,2,1) = [1, 2; 3, 4]; +%! a10(:,:,1,2) = [1, 2; 3, 4]; +%! a10(:,:,2,2) = [1, 2; 3, 4]; +%! a11 = zeros (1, 0); +%! a12 = zeros (1, 0, 2); +%! a13 = zeros (1, 1, 0); +%! b1 = [1; 3; 2; 4; 5; 7; 6; 8]; +%! b2 = [1, 2, 5, 6; 3, 4, 7, 8]; +%! b3 = [1; 3]; +%! b4(:,:,1) = [1, 2; 3, 4]; +%! b4(:,:,2) = [5, 6; 7, 8]; +%! b5 = [1; 3]; +%! b6(:,:,1,1) = [1; 3]; +%! b6(:,:,1,2) = [1; 3]; +%! b7 = 5; +%! b8 = [5, 6]; +%! b9 = [1, 2, 5, 6]; +%! b10 = zeros (1, 0, 2); +%! b11 = zeros (1, 0); +%! +%! assert(a(:),a1); +%! assert(a(1:2), a2); +%! assert(a(:,:), a3); +%! assert(a(:,1), a4); +%! assert(a(1,1), a5); +%! assert(a(1:2,1), a6); +%! assert(a(:,:,1), a7); +%! assert(a(:,:,[1,1]), a8); +%! assert(a(:,:,1,[1,1]), a9); +%! assert(a(:,:,[1,1],[1,1]), a10); +%! assert(a(1,[]), a11); +%! assert(a(1,[],[1,1]), a12); +%! assert(a(1,1,[]), a13); +%! assert(b(:), b1); +%! assert(b(:,:), b2); +%! assert(b(:,1), b3); +%! assert(b(:,:,:), b4); +%! assert(b(:,1,1), b5); +%! assert(b(:,1,1,[1,1]), b6); +%! assert(b(1,3), b7); +%! assert(b(1,[3,4]), b8); +%! assert(b(1,1:4), b9); +%! assert(b(1,[],:), b10); +%! assert(b(1,[]), b11); +%! warn_fortran_indexing = wfi; +
new file mode 100644 --- /dev/null +++ b/test/test_index-wfi-t.m @@ -0,0 +1,365 @@ +%% Automatically generated from DejaGNU files + +%% test/octave.test/index-wfi-t/s-1.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = []; +%! assert(isempty (a)); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-t/s-2.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = 1; +%! assert(a(1),1); +%! warn_fortran_indexing = wfi; +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-t/s-3.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = 1; +%! assert(a(:),1); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-t/s-4.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = 1; +%! assert(a(:,:),1); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-t/s-5.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = 1; +%! assert(a(1,:),1); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-t/s-6.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = 1; +%! assert(a(:,1),1); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-t/s-7.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = 1; +%! assert(isempty (a(logical (0)))); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-t/s-8.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = 1; +%! fail("a(-1);"); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-t/s-9.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = 1; +%! fail("a(2);"); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-t/s-10.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = 1; +%! fail("a(2,:);"); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-t/s-11.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = 1; +%! fail("a(:,2);"); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-t/s-12.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = 1; +%! fail("a(-1,:);"); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-t/s-13.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = 1; +%! fail("a(:,-1);"); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-t/s-14.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = 1; +%! fail("a([1,2,3]);"); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-t/s-15.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = 1; +%! fail("a([1;2;3]);"); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-t/s-16.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = 1; +%! fail("a([1,2;3,4]);"); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-t/s-17.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = 1; +%! fail("a([0,1]);"); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-t/s-18.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = 1; +%! fail("a([0;1]);"); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-t/s-19.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = 1; +%! fail("a([-1,0]);"); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-t/s-20.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = 1; +%! fail("a([-1;0]);"); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-t/v-1.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = [4,3,2,1]; +%! a_prime = [4;3;2;1]; +%! mid_a = [3,2]; +%! assert(a(1),4); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-t/v-2.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = [4,3,2,1]; +%! a_prime = [4;3;2;1]; +%! mid_a = [3,2]; +%! assert(a(2),3); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-t/v-3.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = [4,3,2,1]; +%! a_prime = [4;3;2;1]; +%! mid_a = [3,2]; +%! assert(all (a(:) == a_prime)); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-t/v-4.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = [4,3,2,1]; +%! a_prime = [4;3;2;1]; +%! mid_a = [3,2]; +%! assert(all (a(1,:) == a)); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-t/v-5.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = [4,3,2,1]; +%! a_prime = [4;3;2;1]; +%! mid_a = [3,2]; +%! assert(a(:,3),2); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-t/v-6.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = [4,3,2,1]; +%! a_prime = [4;3;2;1]; +%! mid_a = [3,2]; +%! assert(all (a(:,:) == a)); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-t/v-7.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = [4,3,2,1]; +%! a_prime = [4;3;2;1]; +%! mid_a = [3,2]; +%! assert(all (a(logical ([0,1,1,0])) == mid_a)); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-t/v-8.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = [4,3,2,1]; +%! a_prime = [4;3;2;1]; +%! mid_a = [3,2]; +%! fail("a(0);"); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-t/v-9.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = [4,3,2,1]; +%! a_prime = [4;3;2;1]; +%! mid_a = [3,2]; +%! fail("a(5);"); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-t/v-10.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = [4,3,2,1]; +%! a_prime = [4;3;2;1]; +%! mid_a = [3,2]; +%! fail("a(0,1);"); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-t/v-11.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = [4,3,2,1]; +%! a_prime = [4;3;2;1]; +%! mid_a = [3,2]; +%! assert(isempty (a(logical (0),:))); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-t/v-12.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = [4,3,2,1]; +%! a_prime = [4;3;2;1]; +%! mid_a = [3,2]; +%! fail("a(:,0);"); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-t/v-13.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = [4,3,2,1]; +%! a_prime = [4;3;2;1]; +%! mid_a = [3,2]; +%! assert(isempty (a([]))); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-t/v-14.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = [4,3,2,1]; +%! a_prime = [4;3;2;1]; +%! mid_a = [3,2]; +%! assert(isempty (a([],:))); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-t/v-15.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = [4,3,2,1]; +%! a_prime = [4;3;2;1]; +%! mid_a = [3,2]; +%! assert(isempty (a(:,[]))); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-t/m-1.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! 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))); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-t/m-2.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! 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 (a(:) == a_fvec)); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-t/m-3.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! 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]; +%! fail("a(0);"); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/index-wfi-t/m-4.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! 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]; +%! fail("a(2);","warning"); +%! warn_fortran_indexing = wfi; +
new file mode 100644 --- /dev/null +++ b/test/test_infnan.m @@ -0,0 +1,47 @@ +%% Automatically generated from DejaGNU files + +%% test/octave.test/infnan/infnan-1.m +%!test +%! a = Inf; +%! assert(!(finite (a))); + +%% test/octave.test/infnan/infnan-2.m +%!test +%! a = Inf; +%! assert(isinf (a)); + +%% test/octave.test/infnan/infnan-3.m +%!test +%! a = Inf; +%! assert(!(isnan (a))); + +%% test/octave.test/infnan/infnan-4.m +%!test +%! b = NaN; +%! assert(!(finite (b))); + +%% test/octave.test/infnan/infnan-5.m +%!test +%! b = NaN; +%! assert(!(isinf (b))); + +%% test/octave.test/infnan/infnan-6.m +%!test +%! b = NaN; +%! assert(isnan (b)); + +%% test/octave.test/infnan/infnan-7.m +%!test +%! c = rand (); +%! assert(finite (c)); + +%% test/octave.test/infnan/infnan-8.m +%!test +%! c = rand (); +%! assert(!(isinf (c))); + +%% test/octave.test/infnan/infnan-9.m +%!test +%! c = rand (); +%! assert(!(isnan (c))); +
new file mode 100644 --- /dev/null +++ b/test/test_io.m @@ -0,0 +1,555 @@ +%% Automatically generated from DejaGNU files + +%% 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 +%! +%! ## Force the random seed to be the same +%! rand("seed",1); +%! +%! ## Setup some variable to be saved or compared to loaded variables +%! +%! ## scalar +%! a1 = 1; +%! ## matrix +%! a2 = hilb(3); +%! ## complex scalar +%! a3 = 1 + 1i; +%! ## complex matrix +%! a4 = hilb(3) + 1i*hilb(3); +%! ## bool +%! a5 = (1 == 1); +%! ## bool matrix +%! a6 = ([ones(1,5), zeros(1,5)] == ones(1,10)); +%! ## range +%! a7 = 1:10; +%! ## structure +%! a8.a = a1; +%! a8.b = a3; +%! ## cell array +%! a9{1} = a1; +%! a9{2} = a3; +%! ## string +%! a10 = ["test"; "strings"]; +%! ## int8 array +%! a11 = int8(floor(256*rand(2,2))); +%! ## int16 array +%! a12 = int16(floor(65536*rand(2,2))); +%! ## int32 array +%! a13 = int32(floor(1e6*rand(2,2))); +%! ## int64 array +%! a14 = int64(floor(10*rand(2,2))); +%! ## uint8 array +%! a15 = uint8(floor(256*rand(2,2))); +%! ## uint16 array +%! a16 = uint16(floor(65536*rand(2,2))); +%! ## int32 array +%! a17 = uint32(floor(1e6*rand(2,2))); +%! ## uint64 array +%! a18 = uint64(floor(10*rand(2,2))); +%! ## sparse +%! a19 = sprandn(100,100,0.01); +%! ## complex sparse +%! a20 = sprandn(100,100,0.01) + 1i * sprandn(100,100,0.01); +%! +%! ret = 0; +%! +%! files = {"ascii.mat", "binary.mat", "mat5.mat", "mat7.mat"}; +%! opts = {"-z -text", "-z -binary", "-z -mat", "-v7"}; +%! +%! 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 (["save " 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 f = files +%! +%! clear a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 a19 a20; +%! +%! file = f{1}; +%! +%! eval(["load -force " file]); +%! +%! if (a1 != b1) +%! error(["failed: " file " scalar"]) +%! endif +%! if (a2 != b2) +%! error(["failed: " file " matrix"]); +%! endif +%! if (a3 != b3) +%! error(["failed: " file " complex scalar"]); +%! endif +%! if (a4 != b4) +%! error(["failed: " file " complex matrix"]); +%! endif +%! if (a5 != b5) +%! error(["failed: " file " boolean"]); +%! endif +%! if (!strcmp (file,"mat5") && !strcmp(file,"mat7")) +%! if (a6 != b6) +%! error(["failed: " file " boolean matrix"]); +%! endif +%! endif +%! if (a7 != b7) +%! error(["failed: " file " range"]); +%! endif +%! +%! ## != not implemented for structs!!!! +%! if (!isstruct(a8) || (length(fieldnames(a8)) != 2) || !isfield(a8,"a") +%! || !isfield(a8,"b") || (a8.a != b8.a) || (a8.b != b8.b)) +%! error(["failed: " file " struct"]); +%! endif +%! +%! ## != not implemented for cell arrays!!!! +%! if (!iscell(a9) || (size(a9) != size(b9)) || (a9{1} != b9{1}) +%! || (a9{2} != b9{2})) +%! error(["failed: " file " cell"]); +%! endif +%! +%! if (a10 != b10) +%! error(["failed: " file " string"]); +%! endif +%! +%! if (a11 != b11) +%! error(["failed: " file " int8"]); +%! endif +%! +%! if (a12 != b12) +%! error(["failed: " file " int16"]); +%! endif +%! +%! if (a13 != b13) +%! error(["failed: " file " int32"]); +%! endif +%! +%! if (a14 != b14) +%! error(["failed: " file " int64"]); +%! endif +%! +%! if (a15 != b15) +%! error(["failed: " file " uint8"]); +%! endif +%! +%! if (a16 != b16) +%! error(["failed: " file " uint16"]); +%! endif +%! +%! if (a17 != b17) +%! error(["failed: " file " uint32"]); +%! endif +%! +%! if (a18 != b18) +%! error(["failed: " file " uint64"]); +%! endif +%! +%! if (a19 != b19) +%! error(["failed: " file " sparse"]); +%! endif +%! +%! if (a20 != b20) +%! error(["failed: " file " complex sparse"]); +%! endif +%! +%! ## 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: " file " global test"]); +%! endif +%! endfor +%! endif +%! +%! ret = 1; +%! +%!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); + +%% XXX FIXME XXX Disable this test 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:.*> puts (); + +%% test/octave.test/io/puts-4.m +%!error <... puts:.*> puts (1, 2); + +%% 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 && isstr (m1) +%! && v2 == [1; 2] && c2 == 2 && isstr (m2))); + +%% test/octave.test/io/sscanf-2.m +%!error <... sscanf:.*> sscanf (); + +%% test/octave.test/io/sscanf-3.m +%!error sscanf (1, 2); + +%% test/octave.test/io/sscanf-4.m +%!error <... sscanf:.*> 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 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8 2 10 4 13 9 9 12 4 5 9 7 9 5 7 4 8 9 6 7 8 10 8 7 5 7 11 6 4 4 4 6 4 9 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 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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:.*> printf (); + +%% test/octave.test/io/sprintf-1.m +%!test +%! [s, msg, status] = sprintf ("%s: %d\n", "test", 1); +%! +%! assert(s == "test: 1\n" && isstr (msg) && status == 8); + +%% test/octave.test/io/sprintf-2.m +%!error sprintf (1); + +%% test/octave.test/io/sprintf-3.m +%!error <... sprintf:.*> 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 = strcat (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 = strcat (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 +%! 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:.*> fopen (); + +%% test/octave.test/io/fopen-6.m +%!error <... fopen:.*> fopen ("foo", "wb", "native", 1); + +%% test/octave.test/io/fclose-1.m +%!error fclose (0); + +%% test/octave.test/io/fclose-2.m +%!error <... fclose:.*> fclose (1, 2); + +%% test/octave.test/io/tmpnam-1.m +%!assert(isstr (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:.*> 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:.*> fputs (); + +%% test/octave.test/io/fputs-2.m +%!error <... fputs:.*> 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:.*> fgetl (); + +%% test/octave.test/io/fgetl-2.m +%!error <... fgetl:.*> fgetl (1, 2, 3); + +%% test/octave.test/io/fgetl-3.m +%!error fgetl ("foo", 1); + +%% test/octave.test/io/fgets-1.m +%!error <... fgets:.*> fgets (); + +%% test/octave.test/io/fgets-2.m +%!error <... fgets:.*> fgets (1, 2, 3); + +%% test/octave.test/io/fgets-3.m +%!error fgets ("foo", 1); + +%% test/octave.test/io/fprintf-1.m +%!error <... fprintf:.*> fprintf (); + +%% test/octave.test/io/fprintf-2.m +%!error <... fprintf:.*> fprintf (1); + +%% test/octave.test/io/fprintf-3.m +%!test +%! s.a = 1; +%! fail("fprintf (s)","... 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:.*> fscanf (); + +%% test/octave.test/io/fscanf-2.m +%!error <... fscanf:.*> fscanf (1); + +%% test/octave.test/io/fscanf-3.m +%!error fscanf ("foo", "bar"); + +%% test/octave.test/io/fread-1.m +%!error <... fread:.*> fread (); + +%% test/octave.test/io/fread-2.m +%!error <... fread:.*> 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:.*> fwrite (); + +%% test/octave.test/io/fwrite-2.m +%!error <... fwrite:.*> 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:.*> feof (); + +%% test/octave.test/io/feof-2.m +%!error <... feof:.*> feof (1, 2); + +%% test/octave.test/io/feof-3.m +%!error feof ("foo"); + +%% XXX FIXME XXX trimerr in test.m finds and strips ".*ferror:"!! +%% So use fail for the next two tests instead. +%% test/octave.test/io/ferror-1.m +%!test +%! fail("ferror ();","... ferror:.*"); + +%% test/octave.test/io/ferror-2.m +%!test +%! fail("ferror (1, \"clear\", 2);","... ferror:.*"); + +%% test/octave.test/io/ferror-3.m +%!error ferror ("foo"); + +%% test/octave.test/io/ftell-1.m +%!error <... ftell:.*> ftell (); + +%% test/octave.test/io/ftell-2.m +%!error <... ftell:.*> ftell (1, 2); + +%% test/octave.test/io/ftell-3.m +%!error ftell ("foo"); + +%% test/octave.test/io/fseek-1.m +%!error <... fseek:.*> fseek (); + +%% test/octave.test/io/fseek-2.m +%!error <... fseek:.*> 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:.*> frewind (); + +%% test/octave.test/io/frewind-2.m +%!error <... frewind:.*> frewind (1, 2); + +%% test/octave.test/io/frewind-3.m +%!error frewind ("foo"); +
new file mode 100644 --- /dev/null +++ b/test/test_linalg.m @@ -0,0 +1,376 @@ +%% Automatically generated from DejaGNU files + +%% test/octave.test/linalg/cond-1.m +%!assert(abs (cond ([1, 2; 2, 1]) - 3) < sqrt (eps)); + +%% test/octave.test/linalg/cond-2.m +%!assert(cond ([1, 2, 3; 4, 5, 6; 7, 8, 9]) > 1.0e+16); + +%% test/octave.test/linalg/cond-3.m +%!error cond (); + +%% test/octave.test/linalg/cond-4.m +%!error cond (1, 2); + +%% test/octave.test/linalg/det-1.m +%!assert(det ([1, 2; 3, 4]) == -2); + +%% test/octave.test/linalg/det-2.m +%!error <... det:.*> det (); + +%% test/octave.test/linalg/det-3.m +%!error <... det:.*> det (1, 2); + +%% test/octave.test/linalg/det-4.m +%!error det ([1, 2; 3, 4; 5, 6]); + +%% test/octave.test/linalg/eig-1.m +%!assert(all (abs (eig ([1, 2; 2, 1]) - [-1; 3]) < sqrt (eps))); + +%% test/octave.test/linalg/eig-2.m +%!test +%! [v, d] = eig ([1, 2; 2, 1]); +%! x = 1 / sqrt (2); +%! assert(((abs (d - [-1, 0; 0, 3]) < sqrt (eps)) +%! && (abs (v - [-x, x; x, x]) < sqrt (eps)))); + +%% test/octave.test/linalg/eig-3.m +%!error <... eig:.*> eig (); + +%% test/octave.test/linalg/eig-4.m +%!error <... eig:.*> eig ([1, 2; 3, 4], 2); + +%% test/octave.test/linalg/eig-5.m +%!error eig ([1, 2; 3, 4; 5, 6]); + +%% test/octave.test/linalg/expm-1.m +%!test +%! arg = [-49, 24; -64, 31]; +%! result = [-0.735758758144742, 0.551819099658089; +%! -1.471517599088239, 1.103638240715556]; +%! assert(all (all (abs (expm (arg) - result) < 128*eps))); + +%% test/octave.test/linalg/expm-2.m +%!test +%! arg = [1, 1; 0, 1]; +%! result = [2.718281828459045, 2.718281828459045; +%! 0.000000000000000, 2.718281828459045]; +%! assert(all (all (abs (expm (arg) - result) < 4*eps))); + +%% test/octave.test/linalg/expm-3.m +%!test +%! arg = diag ([6, 6, 6], 1); +%! result = [1, 6, 18, 36; +%! 0, 1, 6, 18; +%! 0, 0, 1, 6; +%! 0, 0, 0, 1]; +%! assert(all (all (expm (arg) == result))); + +%% test/octave.test/linalg/expm-4.m +%!error <expm:> expm(); + +%% test/octave.test/linalg/expm-5.m +%!error <expm:> expm(1,2); + +%% test/octave.test/linalg/expm-6.m +%% test/octave.test/linalg/inv-1.m +%!assert(all (all (abs (inv ([1, 2; 3, 4]) - [-2, 1; 1.5, -0.5]) < sqrt (eps)))); + +%% test/octave.test/linalg/inv-2.m +%!error <... inv:.*> inv (); + +%% test/octave.test/linalg/inv-3.m +%!error <... inv:.*> inv ([1, 2; 3, 4], 2); + +%% test/octave.test/linalg/inv-4.m +%!error inv ([1, 2; 3, 4; 5, 6]); + +%% test/octave.test/linalg/trace-1.m +%!assert(trace ([1, 2; 3, 4]) == 5); + +%% test/octave.test/linalg/trace-2.m +%!assert(trace ([1, 2; 3, 4; 5, 6]) == 5); + +%% test/octave.test/linalg/trace-3.m +%!assert(trace ([1, 3, 5; 2, 4, 6]) == 5); + +%% test/octave.test/linalg/trace-4.m +%!error trace (); + +%% test/octave.test/linalg/trace-5.m +%!error trace (1, 2); + +%% test/octave.test/linalg/chol-1.m +%!test +%! rt2 = sqrt (2); +%! assert(all (all (abs (chol ([2, 1; 1, 1]) - [rt2, 1/rt2; 0, 1/rt2]) < sqrt (eps)))); + +%% test/octave.test/linalg/chol-2.m +%!error chol ([1, 2; 3, 4]); + +%% test/octave.test/linalg/chol-3.m +%!error chol ([1, 2; 3, 4; 5, 6]); + +%% test/octave.test/linalg/chol-4.m +%!error <... chol:.*> chol (); + +%% test/octave.test/linalg/chol-5.m +%!error <... chol:.*> chol (1, 2); + +%% test/octave.test/linalg/hess-1.m +%!test +%! a = [1, 2, 3; 5, 4, 6; 8, 7, 9]; +%! [p, h] = hess (a); +%! assert(size (p) == [3, 3] && size (h) == [3, 3] && abs (a - p * h * p') < sqrt (eps)); + +%% test/octave.test/linalg/hess-2.m +%!error <... hess:.*> hess (); + +%% test/octave.test/linalg/hess-3.m +%!error <... hess:.*> hess ([1, 2; 3, 4], 2); + +%% test/octave.test/linalg/hess-4.m +%!error hess ([1, 2; 3, 4; 5, 6]); + +%% test/octave.test/linalg/lu-1.m +%!assert(all (all (lu ([1, 2; 3, 4]) - [1/3, 1; 1, 0] < eps))); + +%% test/octave.test/linalg/lu-2.m +%!test +%! [l, u] = lu ([1, 2; 3, 4]); +%! assert(((abs (l - [1/3, 1; 1, 0]) < sqrt (eps)) +%! && abs (u - [3, 4; 0, 2/3]) < sqrt (eps))); + +%% test/octave.test/linalg/lu-3.m +%!test +%! [l, u, p] = lu ([1, 2; 3, 4]); +%! assert((abs (l - [1, 0; 1/3, 1]) < sqrt (eps) +%! && abs (u - [3, 4; 0, 2/3]) < sqrt (eps) +%! && abs (p - [0, 1; 1, 0]) < sqrt (eps))); + +%% test/octave.test/linalg/lu-4.m +%!error <... lu:.*> lu (); + +%% test/octave.test/linalg/lu-5.m +%!error <... lu:.*> lu ([1, 2; 3, 4], 2); + +%% test/octave.test/linalg/lu-6.m +%!test +%! [l u p] = lu ([1, 2; 3, 4; 5, 6]); +%! assert((abs (l - [1, 0; 1/5, 1; 3/5, 1/2]) < sqrt (eps) +%! && abs (u - [5, 6; 0, 4/5]) < sqrt (eps) +%! && abs (p - [0, 0, 1; 1, 0, 0; 0 1 0]) < sqrt (eps))); + +%% test/octave.test/linalg/qr-1.m +%!test +%! a = [0, 2, 1; 2, 1, 2]; +%! +%! [q, r] = qr (a); +%! +%! [qe, re] = qr (a, 0); +%! +%! assert((size (q) == [2, 2] && size (r) == [2, 3] +%! && abs (q * r - a) < sqrt (eps) +%! && size (qe) == [2, 2] && size (re) == [2, 3] +%! && abs (qe * re - a) < sqrt (eps))); + +%% test/octave.test/linalg/qr-2.m +%!test +%! a = [0, 2, 1; 2, 1, 2]; +%! +%! [q, r, p] = qr (a); # not giving right dimensions. XXX FIXME XXX +%! +%! [qe, re, pe] = qr (a, 0); +%! +%! assert((size (q) == [2, 2] && size (r) == [2, 3] && size (p) == [3, 3] +%! && abs (q * r - a * p) < sqrt (eps) +%! && size (qe) == [2, 2] && size (re) == [2, 3] && size (pe) == [1, 3] +%! && abs (qe * re - a(:,pe)) < sqrt (eps))); + +%% test/octave.test/linalg/qr-3.m +%!test +%! a = [0, 2; 2, 1; 1, 2]; +%! +%! [q, r] = qr (a); +%! +%! [qe, re] = qr (a, 0); +%! +%! assert((size (q) == [3, 3] && size (r) == [3, 2] +%! && abs (a - q * r) < sqrt (eps) +%! && size (qe) == [3, 2] && size (re) == [2, 2] +%! && abs (a - qe * re) < sqrt (eps))); + +%% test/octave.test/linalg/qr-4.m +%!test +%! a = [0, 2; 2, 1; 1, 2]; +%! +%! [q, r, p] = qr (a); +%! +%! [qe, re, pe] = qr (a, 0); +%! +%! assert((size (q) == [3, 3] && size (r) == [3, 2] && size (p) == [2, 2] +%! && abs (a * p - q * r) < sqrt (eps) +%! && size (qe) == [3, 2] && size (re) == [2, 2] && size (pe) == [1, 2] +%! && abs (a(:,pe) - qe * re) < sqrt (eps))); + +%% test/octave.test/linalg/qr-5.m +%!error <... qr:.*> qr (); + +%% test/octave.test/linalg/qr-6.m +%!error <... qr:.*> qr ([1, 2; 3, 4], 0, 2); + +%% test/octave.test/linalg/qr-7.m +%!function retval = testqr (q, r, a, p) +%! tol = 10*eps; +%! retval = 0; +%! if (nargin == 3) +%! n1 = norm (q*r-a); +%! n2 = norm (q'*q-eye(columns(q))); +%! retval = (n1 < tol && n2 < tol); +%! else +%! n1 = norm (q'*q-eye(columns(q))); +%! retval = (n1 < tol); +%! if (isvector (p)) +%! n2 = norm (q*r-a(:,p)); +%! retval = (retval && n2 < tol); +%! else +%! n2 = norm (q*r - a*p); +%! retval = (retval && n2 < tol); +%! endif +%! endif +%!test +%! +%! t = ones (24, 1); +%! j = 1; +%! +%! if 0 # eliminate big matrix tests +%! a = rand(5000,20); +%! [q,r]=qr(a,0); t(j++) = testqr(q,r,a); +%! [q,r]=qr(a',0); t(j++) = testqr(q,r,a'); +%! [q,r,p]=qr(a,0); t(j++) = testqr(q,r,a,p); +%! [q,r,p]=qr(a',0); t(j++) = testqr(q,r,a',p); +%! +%! a = a+1i*eps; +%! [q,r]=qr(a,0); t(j++) = testqr(q,r,a); +%! [q,r]=qr(a',0); t(j++) = testqr(q,r,a'); +%! [q,r,p]=qr(a,0); t(j++) = testqr(q,r,a,p); +%! [q,r,p]=qr(a',0); t(j++) = testqr(q,r,a',p); +%! endif +%! +%! a = [ ones(1,15); sqrt(eps)*eye(15) ]; +%! [q,r]=qr(a); t(j++) = testqr(q,r,a); +%! [q,r]=qr(a'); t(j++) = testqr(q,r,a'); +%! [q,r,p]=qr(a); t(j++) = testqr(q,r,a,p); +%! [q,r,p]=qr(a'); t(j++) = testqr(q,r,a',p); +%! +%! a = a+1i*eps; +%! [q,r]=qr(a); t(j++) = testqr(q,r,a); +%! [q,r]=qr(a'); t(j++) = testqr(q,r,a'); +%! [q,r,p]=qr(a); t(j++) = testqr(q,r,a,p); +%! [q,r,p]=qr(a'); t(j++) = testqr(q,r,a',p); +%! +%! a = [ ones(1,15); sqrt(eps)*eye(15) ]; +%! [q,r]=qr(a,0); t(j++) = testqr(q,r,a); +%! [q,r]=qr(a',0); t(j++) = testqr(q,r,a'); +%! [q,r,p]=qr(a,0); t(j++) = testqr(q,r,a,p); +%! [q,r,p]=qr(a',0); t(j++) = testqr(q,r,a',p); +%! +%! a = a+1i*eps; +%! [q,r]=qr(a,0); t(j++) = testqr(q,r,a); +%! [q,r]=qr(a',0); t(j++) = testqr(q,r,a'); +%! [q,r,p]=qr(a,0); t(j++) = testqr(q,r,a,p); +%! [q,r,p]=qr(a',0); t(j++) = testqr(q,r,a',p); +%! +%! a = [ +%! 611 196 -192 407 -8 -52 -49 29 +%! 196 899 113 -192 -71 -43 -8 -44 +%! -192 113 899 196 61 49 8 52 +%! 407 -192 196 611 8 44 59 -23 +%! -8 -71 61 8 411 -599 208 208 +%! -52 -43 49 44 -599 411 208 208 +%! -49 -8 8 59 208 208 99 -911 +%! 29 -44 52 -23 208 208 -911 99 +%! ]; +%! [q,r] = qr(a); +%! +%! assert(all (t) && norm(q*r-a) < 5000*eps); + +%% test/octave.test/linalg/schur-1.m +%!test +%! a = [1, 2, 3; 4, 5, 9; 7, 8, 6]; +%! [u, s] = schur (a); +%! assert(size (u) == [3, 3] && size (s) == [3, 3] && abs (s - u' * a * u) < sqrt (eps)); + +%% test/octave.test/linalg/schur-2.m +%!error <... schur:.*> schur (); + +%% test/octave.test/linalg/schur-3.m +%!test +%! warn_num_to_str = 1; +%! fail("schur ([1, 2; 3, 4], 2)","warning"); + +%% test/octave.test/linalg/schur-4.m +%!error schur ([1, 2, 3; 4, 5, 6]); + +%% test/octave.test/linalg/svd-1.m +%!assert(all (abs (svd ([1, 2; 2, 1]) - [3; 1]) < sqrt (eps))); + +%% test/octave.test/linalg/svd-2.m +%!test +%! [u, s, v] = svd ([1, 2; 2, 1]); +%! x = 1 / sqrt (2); +%! assert(((abs (u - [-x, -x; -x, x]) < sqrt (eps)) +%! && (abs (s - [3, 0; 0, 1]) < sqrt (eps)) +%! && (abs (v - [-x, x; -x, -x]) < sqrt (eps)))); + +%% test/octave.test/linalg/svd-3.m +%!test +%! a = [1, 2, 3; 4, 5, 6]; +%! [u, s, v] = svd (a); +%! assert((size (u) == [2, 2] && size (s) == [2, 3] && size (v) == [3, 3] +%! && abs (a - u * s * v') < sqrt (eps))); + +%% test/octave.test/linalg/svd-4.m +%!test +%! a = [1, 2; 3, 4; 5, 6]; +%! [u, s, v] = svd (a); +%! assert((size (u) == [3, 3] && size (s) == [3, 2] && size (v) == [2, 2] +%! && abs (a - u * s * v') < sqrt (eps))); + +%% test/octave.test/linalg/svd-5.m +%!test +%! a = [1, 2, 3; 4, 5, 6]; +%! [u, s, v] = svd (a, 1); +%! assert((size (u) == [2, 2] && size (s) == [2, 2] && size (v) == [3, 2] +%! && abs (a - u * s * v') < sqrt (eps))); + +%% test/octave.test/linalg/svd-6.m +%!test +%! a = [1, 2; 3, 4; 5, 6]; +%! [u, s, v] = svd (a, 1); +%! assert((size (u) == [3, 2] && size (s) == [2, 2] && size (v) == [2, 2] +%! && abs (a - u * s * v') < sqrt (eps))); + +%% test/octave.test/linalg/svd-7.m +%!error <... svd:.*> svd (); + +%% test/octave.test/linalg/svd-8.m +%!error <... svd:.*> svd ([1, 2; 4, 5], 2, 3); + +%% test/octave.test/linalg/svd-9.m +%!error <... svd:.*> [u, v] = svd ([1, 2; 3, 4]); + +%% test/octave.test/linalg/syl-1.m +%!test +%! x = syl ([1, 2; 3, 4], [5, 6; 7, 8], [9, 10; 11, 12]); +%! assert(all (all (abs (x - [-1/2, -2/3; -2/3, -1/2]) < sqrt (eps)))); + +%% test/octave.test/linalg/syl-2.m +%!error <... syl:.*> syl (); + +%% test/octave.test/linalg/syl-3.m +%!error <... syl:.*> syl (1, 2, 3, 4); + +%% test/octave.test/linalg/syl-4.m +%!error syl ([1, 2; 3, 4], [1, 2, 3; 4, 5, 6], [4, 3]); +
new file mode 100644 --- /dev/null +++ b/test/test_logical-wfi-f.m @@ -0,0 +1,354 @@ +%% Automatically generated from DejaGNU files + +%% test/octave.test/logical-wfi-f/s-1.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = []; +%! fail("a(0);"); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-f/s-2.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = 2; +%! assert(a(1) == 2); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-f/s-3.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = 2; +%! assert(a(1) == 2); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-f/s-4.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = 2; +%! assert(all (a(logical ([1,1])) == [2,2])); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-f/v-1.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = [9,8,7,6]; +%! assert(isempty (a(logical ([0,0,0,0])))); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-f/v-2.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = [9,8,7,6]; +%! assert(all (a(logical ([1,1,1,1])) == [9,8,7,6])); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-f/v-3.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = [9,8,7,6]; +%! assert(all (a(logical ([0,1,1,0])) == [8,7])); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-f/v-4.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = [9,8,7,6]; +%! assert(all (a(logical ([1,1])) == [9,9])); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-f/m-1.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = [9,8;7,6]; +%! assert(isempty (a(logical ([0,0,0,0])))); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-f/m-2.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = [9,8;7,6]; +%! assert(all (a(logical ([1,1,1,1])) == [9;7;8;6])); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-f/m-3.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = [9,8;7,6]; +%! assert(all (a(logical ([0,1,1,0])) == [7;8])); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-f/m-4.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = [9,8;7,6]; +%! assert(a(logical (0:1),logical (0:1)) == 6); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-f/m-5.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = [9,8;7,6]; +%! assert(all (a(logical (0:1),2:-1:1) == [6,7])); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-f/m-6.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = [9,8;7,6]; +%! assert(a(logical (0:1),logical ([0,1])) == 6); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-f/m-7.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = [9,8;7,6]; +%! assert(all (a(logical (0:1),[2,1]) == [6,7])); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-f/m-8.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = [9,8;7,6]; +%! assert(all (a(logical (0:1),:) == [7,6])); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-f/m-9.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = [9,8;7,6]; +%! assert(a(logical (0:1),1) == 7); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-f/m-10.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = [9,8;7,6]; +%! assert(all (a(logical (0:1),logical ([1,1])) == [7,6])); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-f/m-11.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = [9,8;7,6]; +%! assert(all (a(2:-1:1,logical (0:1)) == [6;8])); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-f/m-12.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = [9,8;7,6]; +%! assert(all (a(2:-1:1,logical ([0,1])) == [6;8])); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-f/m-13.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = [9,8;7,6]; +%! assert(all (all (a(2:-1:1,logical ([1,1])) == [7,6;9,8]))); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-f/m-14.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = [9,8;7,6]; +%! assert(a(logical ([0,1]),logical (0:1)) == 6); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-f/m-15.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = [9,8;7,6]; +%! assert(all (a(logical ([0,1]),2:-1:1) == [6,7])); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-f/m-16.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = [9,8;7,6]; +%! assert(a(logical ([0,1]),logical ([0,1])) == 6); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-f/m-17.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = [9,8;7,6]; +%! assert(all (a(logical ([0,1]),[2,1]) == [6,7])); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-f/m-18.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = [9,8;7,6]; +%! assert(all (a(logical ([0,1]),:) == [7,6])); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-f/m-19.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = [9,8;7,6]; +%! assert(a(logical ([0,1]),1) == 7); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-f/m-20.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = [9,8;7,6]; +%! assert(all (a(logical ([0,1]),logical ([1,1])) == [7,6])); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-f/m-21.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = [9,8;7,6]; +%! assert(all (a([2,1],logical (0:1)) == [6;8])); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-f/m-22.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = [9,8;7,6]; +%! assert(all (a([2,1],logical ([0,1])) == [6;8])); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-f/m-23.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = [9,8;7,6]; +%! assert(all (all (a([2,1],logical ([1,1])) == [7,6;9,8]))); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-f/m-24.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = [9,8;7,6]; +%! assert(all (a(:,logical (0:1)) == [8;6])); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-f/m-25.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = [9,8;7,6]; +%! assert(all (a(:,logical ([0,1])) == [8;6])); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-f/m-26.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = [9,8;7,6]; +%! assert(all (all (a(:,logical ([1,1])) == [9,8;7,6]))); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-f/m-27.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = [9,8;7,6]; +%! assert(a(1,logical (0:1)) == 8); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-f/m-28.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = [9,8;7,6]; +%! assert(a(1,logical ([0,1])) == 8); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-f/m-29.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = [9,8;7,6]; +%! assert(all (a(1,logical ([1,1])) == [9,8])); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-f/m-30.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = [9,8;7,6]; +%! assert(all (a(logical ([1,1]),logical (0:1)) == [8;6])); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-f/m-31.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = [9,8;7,6]; +%! assert(all (all (a(logical ([1,1]),2:-1:1) == [8,9;6,7]))); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-f/m-32.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = [9,8;7,6]; +%! assert(all (a(logical ([1,1]),logical ([0,1])) == [8;6])); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-f/m-33.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = [9,8;7,6]; +%! assert(all (all (a(logical ([1,1]),[2,1]) == [8,9;6,7]))); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-f/m-34.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = [9,8;7,6]; +%! assert(all (all (a(logical ([1,1]),:) == [9,8;7,6]))); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-f/m-35.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = [9,8;7,6]; +%! assert(all (a(logical ([1,1]),1) == [9;7])); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-f/m-36.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 0; +%! a = [9,8;7,6]; +%! assert(all (all (a(logical ([1,1]),logical ([1,1])) == [9,8;7,6]))); +%! warn_fortran_indexing = wfi; +
new file mode 100644 --- /dev/null +++ b/test/test_logical-wfi-t.m @@ -0,0 +1,354 @@ +%% Automatically generated from DejaGNU files + +%% test/octave.test/logical-wfi-t/s-1.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = []; +%! fail("a(0);"); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-t/s-2.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = 2; +%! assert(a(1) == 2); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-t/s-3.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = 2; +%! assert(a(1) == 2); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-t/s-4.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = 2; +%! assert(all (a(logical ([1,1])) == [2,2])); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-t/v-1.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = [9,8,7,6]; +%! assert(isempty (a(logical ([0,0,0,0])))); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-t/v-2.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = [9,8,7,6]; +%! assert(all (a(logical ([1,1,1,1])) == [9,8,7,6])); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-t/v-3.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = [9,8,7,6]; +%! assert(all (a(logical ([0,1,1,0])) == [8,7])); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-t/v-4.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = [9,8,7,6]; +%! assert(all (a(logical ([1,1])) == [9,9])); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-t/m-1.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = [9,8;7,6]; +%! isempty (a(logical ([0,0,0,0]))); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-t/m-2.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = [9,8;7,6]; +%! all (a(logical ([1,1,1,1])) == [9;7;8;6]); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-t/m-3.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = [9,8;7,6]; +%! all (a(logical ([0,1,1,0])) == [7;8]); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-t/m-4.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = [9,8;7,6]; +%! assert(a(logical (0:1),logical (0:1)) == 6); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-t/m-5.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = [9,8;7,6]; +%! assert(all (a(logical (0:1),2:-1:1) == [6,7])); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-t/m-6.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = [9,8;7,6]; +%! assert(a(logical (0:1),logical ([0,1])) == 6); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-t/m-7.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = [9,8;7,6]; +%! assert(all (a(logical (0:1),[2,1]) == [6,7])); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-t/m-8.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = [9,8;7,6]; +%! assert(all (a(logical (0:1),:) == [7,6])); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-t/m-9.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = [9,8;7,6]; +%! assert(a(logical (0:1),1) == 7); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-t/m-10.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = [9,8;7,6]; +%! assert(all (a(logical (0:1),logical ([1,1])) == [7,6])); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-t/m-11.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = [9,8;7,6]; +%! assert(all (a(2:-1:1,logical (0:1)) == [6;8])); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-t/m-12.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = [9,8;7,6]; +%! assert(all (a(2:-1:1,logical ([0,1])) == [6;8])); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-t/m-13.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = [9,8;7,6]; +%! assert(all (all (a(2:-1:1,logical ([1,1])) == [7,6;9,8]))); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-t/m-14.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = [9,8;7,6]; +%! assert(a(logical ([0,1]),logical (0:1)) == 6); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-t/m-15.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = [9,8;7,6]; +%! assert(all (a(logical ([0,1]),2:-1:1) == [6,7])); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-t/m-16.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = [9,8;7,6]; +%! assert(a(logical ([0,1]),logical ([0,1])) == 6); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-t/m-17.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = [9,8;7,6]; +%! assert(all (a(logical ([0,1]),[2,1]) == [6,7])); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-t/m-18.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = [9,8;7,6]; +%! assert(all (a(logical ([0,1]),:) == [7,6])); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-t/m-19.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = [9,8;7,6]; +%! assert(a(logical ([0,1]),1) == 7); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-t/m-20.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = [9,8;7,6]; +%! assert(all (a(logical ([0,1]),logical ([1,1])) == [7,6])); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-t/m-21.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = [9,8;7,6]; +%! assert(all (a([2,1],logical (0:1)) == [6;8])); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-t/m-22.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = [9,8;7,6]; +%! assert(all (a([2,1],logical ([0,1])) == [6;8])); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-t/m-23.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = [9,8;7,6]; +%! assert(all (all (a([2,1],logical ([1,1])) == [7,6;9,8]))); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-t/m-24.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = [9,8;7,6]; +%! assert(all (a(:,logical (0:1)) == [8;6])); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-t/m-25.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = [9,8;7,6]; +%! assert(all (a(:,logical ([0,1])) == [8;6])); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-t/m-26.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = [9,8;7,6]; +%! assert(all (all (a(:,logical ([1,1])) == [9,8;7,6]))); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-t/m-27.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = [9,8;7,6]; +%! assert(a(1,logical (0:1)) == 8); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-t/m-28.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = [9,8;7,6]; +%! assert(a(1,logical ([0,1])) == 8); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-t/m-29.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = [9,8;7,6]; +%! assert(all (a(1,logical ([1,1])) == [9,8])); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-t/m-30.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = [9,8;7,6]; +%! assert(all (a(logical ([1,1]),logical (0:1)) == [8;6])); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-t/m-31.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = [9,8;7,6]; +%! assert(all (all (a(logical ([1,1]),2:-1:1) == [8,9;6,7]))); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-t/m-32.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = [9,8;7,6]; +%! assert(all (a(logical ([1,1]),logical ([0,1])) == [8;6])); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-t/m-33.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = [9,8;7,6]; +%! assert(all (all (a(logical ([1,1]),[2,1]) == [8,9;6,7]))); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-t/m-34.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = [9,8;7,6]; +%! assert(all (all (a(logical ([1,1]),:) == [9,8;7,6]))); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-t/m-35.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = [9,8;7,6]; +%! assert(all (a(logical ([1,1]),1) == [9;7])); +%! warn_fortran_indexing = wfi; + +%% test/octave.test/logical-wfi-t/m-36.m +%!test +%! wfi = warn_fortran_indexing; +%! warn_fortran_indexing = 1; +%! a = [9,8;7,6]; +%! assert(all (all (a(logical ([1,1]),logical ([1,1])) == [9,8;7,6]))); +%! warn_fortran_indexing = wfi; +
new file mode 100644 --- /dev/null +++ b/test/test_matrix.m @@ -0,0 +1,446 @@ +%% Automatically generated from DejaGNU files + +%% test/octave.test/matrix/all-1.m +%!test +%! x = ones (3); +%! x(1,1) = 0; +%! assert((all (all (rand (3) + 1) == [1, 1, 1]) == 1 +%! && all (all (x) == [0, 1, 1]) == 1 +%! && all (x, 1) == [0, 1, 1] +%! && all (x, 2) == [0; 1; 1])); + +%% test/octave.test/matrix/all-2.m +%!error <... all:.*> all (); + +%% test/octave.test/matrix/all-3.m +%!error <... all:.*> all (1, 2, 3); + +%% test/octave.test/matrix/any-1.m +%!test +%! x = zeros (3); +%! x(3,3) = 1; +%! assert((all (any (x) == [0, 0, 1]) == 1 +%! && all (any (ones (3)) == [1, 1, 1]) == 1 +%! && any (x, 1) == [0, 0, 1] +%! && any (x, 2) == [0; 0; 1])); + +%% test/octave.test/matrix/any-2.m +%!error <... any:.*> any (); + +%% test/octave.test/matrix/any-3.m +%!error <... any:.*> any (1, 2, 3); + +%% test/octave.test/matrix/diff-1.m +%!assert((diff ([1, 2, 3, 4]) == [1, 1, 1] +%! && diff ([1, 3, 7, 19], 2) == [2, 8] +%! && diff ([1, 2; 5, 4; 8, 7; 9, 6; 3, 1]) == [4, 2; 3, 3; 1, -1; -6, -5] +%! && diff ([1, 2; 5, 4; 8, 7; 9, 6; 3, 1], 3) == [-1, -5; -5, 0] +%! && isempty (diff (1)))); + +%% test/octave.test/matrix/diff-2.m +%!error diff ([1, 2; 3, 4], -1); + +%% test/octave.test/matrix/diff-3.m +%!error diff ("foo"); + +%% test/octave.test/matrix/diff-4.m +%!error diff (); + +%% test/octave.test/matrix/diff-5.m +%!error diff (1, 2, 3, 4); + +%% test/octave.test/matrix/find-1.m +%!assert((find ([1, 0, 1, 0, 1]) == [1, 3, 5] +%! && find ([1; 0; 3; 0; 1]) == [1; 3; 5] +%! && find ([0, 0, 2; 0, 3, 0; -1, 0, 0]) == [3; 5; 7])); + +%% test/octave.test/matrix/find-2.m +%!test +%! [i, j, v] = find ([0, 0, 2; 0, 3, 0; -1, 0, 0]); +%! +%! assert(i == [3; 2; 1] && j == [1; 2; 3] && v == [-1; 3; 2]); + +%% test/octave.test/matrix/find-3.m +%!error <... find:.*> find (); + +%% test/octave.test/matrix/find-4.m +%!error <... find:.*> find (1, 2); + +%% test/octave.test/matrix/fliplr-1.m +%!assert((fliplr ([1, 2; 3, 4]) == [2, 1; 4, 3] +%! && fliplr ([1, 2; 3, 4; 5, 6]) == [2, 1; 4, 3; 6, 5] +%! && fliplr ([1, 2, 3; 4, 5, 6]) == [3, 2, 1; 6, 5, 4])); + +%% test/octave.test/matrix/fliplr-2.m +%!error <usage.*fliplr> fliplr(); + +%% test/octave.test/matrix/fliplr-3.m +%!error fliplr (1, 2); + +%% test/octave.test/matrix/flipud-1.m +%!assert((flipud ([1, 2; 3, 4]) == [3, 4; 1, 2] +%! && flipud ([1, 2; 3, 4; 5, 6]) == [5, 6; 3, 4; 1, 2] +%! && flipud ([1, 2, 3; 4, 5, 6]) == [4, 5, 6; 1, 2, 3])); + +%% test/octave.test/matrix/flipud-2.m +%!error flipud (); + +%% test/octave.test/matrix/flipud-3.m +%!error flipud (1, 2); + +%% test/octave.test/matrix/rot90-1.m +%!test +%! x1 = [1, 2; +%! 3, 4]; +%! x2 = [2, 4; +%! 1, 3]; +%! x3 = [4, 3; +%! 2, 1]; +%! x4 = [3, 1; +%! 4, 2]; +%! +%! assert((rot90 (x1)== x2 && rot90 (x1, 2) == x3 && rot90 (x1, 3) == x4 +%! && rot90 (x1, 4) == x1 && rot90 (x1, 5) == x2 && rot90 (x1, -1) == x4)); + +%% test/octave.test/matrix/rot90-2.m +%!error rot90 (); + +%% test/octave.test/matrix/rot90-3.m +%!error rot90 (1, 2, 3); + +%% test/octave.test/matrix/reshape-1.m +%!assert((size (reshape (rand (4, 4), 2, 8)) == [2, 8] +%! && size (reshape (rand (4, 4), 8, 2)) == [8, 2] +%! && size (reshape (rand (15, 4), 1, 60)) == [1, 60] +%! && size (reshape (rand (15, 4), 60, 1)) == [60, 1])); + +%% test/octave.test/matrix/reshape-2.m +%!test +%! s.a = 1; +%! fail("reshape (s, 2, 3)"); + +%% test/octave.test/matrix/reshape-3.m +%!error <... reshape:.*> reshape (); + +%% test/octave.test/matrix/reshape-4.m +%!error reshape (1, 2, 3, 4); + +%% test/octave.test/matrix/shift-1.m +%!test +%! a = [1, 2, 3]; +%! b = [4, 5, 6]; +%! c = [7, 8, 9]; +%! +%! r = [a, b, c]; +%! m = [a; b; c]; +%! +%! assert((shift (r, 3) == [c, a, b] +%! && shift (r, -6) == [c, a, b] +%! && shift (r, -3) == [b, c, a] +%! && shift (m, 1) == [c; a; b] +%! && shift (m, -2) == [c; a; b])); + +%% test/octave.test/matrix/shift-2.m +%!error shift (); + +%% test/octave.test/matrix/shift-3.m +%!error shift (1, 2, 3, 4); + +%% test/octave.test/matrix/sort-1.m +%!test +%! a = [1, 2; 2, 3; 3, 1]; +%! s = [1, 1; 2, 2; 3, 3]; +%! i = [1, 3; 2, 1; 3, 2]; +%! [xs, xi] = sort (a); +%! assert(sort (a) == s && xs == s && xi == i); + +%% test/octave.test/matrix/sort-2.m +%!error <... sort:.*> sort (); + +%% test/octave.test/matrix/sort-3.m +%!error <... sort:.*> sort (1, 2, 3, 4); + +%% test/octave.test/matrix/tril-1.m +%!test +%! a = [1, 2, 3; 4, 5, 6; 7, 8, 9; 10, 11, 12]; +%! +%! l0 = [1, 0, 0; 4, 5, 0; 7, 8, 9; 10, 11, 12]; +%! l1 = [1, 2, 0; 4, 5, 6; 7, 8, 9; 10, 11, 12]; +%! l2 = [1, 2, 3; 4, 5, 6; 7, 8, 9; 10, 11, 12]; +%! lm1 = [0, 0, 0; 4, 0, 0; 7, 8, 0; 10, 11, 12]; +%! lm2 = [0, 0, 0; 0, 0, 0; 7, 0, 0; 10, 11, 0]; +%! lm3 = [0, 0, 0; 0, 0, 0; 0, 0, 0; 10, 0, 0]; +%! lm4 = [0, 0, 0; 0, 0, 0; 0, 0, 0; 0, 0, 0]; +%! +%! assert((tril (a, -4) == lm4 && tril (a, -3) == lm3 +%! && tril (a, -2) == lm2 && tril (a, -1) == lm1 +%! && tril (a) == l0 && tril (a, 1) == l1 && tril (a, 2) == l2)); + +%% test/octave.test/matrix/tril-2.m +%!error tril (); + +%% test/octave.test/matrix/tril-3.m +%!error tril (1, 2, 3); + +%% test/octave.test/matrix/triu-1.m +%!test +%! a = [1, 2, 3; 4, 5, 6; 7, 8, 9; 10, 11, 12]; +%! +%! u0 = [1, 2, 3; 0, 5, 6; 0, 0, 9; 0, 0, 0]; +%! u1 = [0, 2, 3; 0, 0, 6; 0, 0, 0; 0, 0, 0]; +%! u2 = [0, 0, 3; 0, 0, 0; 0, 0, 0; 0, 0, 0]; +%! u3 = [0, 0, 0; 0, 0, 0; 0, 0, 0; 0, 0, 0]; +%! um1 = [1, 2, 3; 4, 5, 6; 0, 8, 9; 0, 0, 12]; +%! um2 = [1, 2, 3; 4, 5, 6; 7, 8, 9; 0, 11, 12]; +%! um3 = [1, 2, 3; 4, 5, 6; 7, 8, 9; 10, 11, 12]; +%! +%! assert((triu (a, -3) == um3 && triu (a, -2) == um2 +%! && triu (a, -1) == um1 && triu (a) == u0 && triu (a, 1) == u1 +%! && triu (a, 2) == u2 && triu (a, 3) == u3)); + +%% test/octave.test/matrix/triu-2.m +%!error triu (); + +%% test/octave.test/matrix/triu-3.m +%!error triu (1, 2, 3); + +%% test/octave.test/matrix/vec-1.m +%!assert(vec ([1, 2; 3, 4]) == [1; 3; 2; 4] && vec ([1, 3, 2, 4]) == [1; 3; 2; 4]); + +%% test/octave.test/matrix/vec-2.m +%!error vec (); + +%% test/octave.test/matrix/vec-3.m +%!error vec (1, 2); + +%% test/octave.test/matrix/vech-1.m +%!assert(all (vech ([1, 2, 3; 4, 5, 6; 7, 8, 9]) == [1; 4; 7; 5; 8; 9])); + +%% test/octave.test/matrix/vech-2.m +%!error vech (); + +%% test/octave.test/matrix/vech-3.m +%!error vech (1, 2); + +%% test/octave.test/matrix/eye-1.m +%!test +%! i33 = [1, 0, 0; 0, 1, 0; 0, 0, 1]; +%! i23 = [1, 0, 0; 0, 1, 0]; +%! assert((eye (3) == i33 && eye (size (i33)) == i33 && eye (3, 3) == i33 +%! && eye (2, 3) == i23 && eye (3, 2) == i23')); + +%% test/octave.test/matrix/eye-2.m +%!error <... eye:.*> eye (1, 2, 3); + +%% test/octave.test/matrix/ones-1.m +%!test +%! x33 = [1, 1, 1; 1, 1, 1; 1, 1, 1]; +%! x23 = [1, 1, 1; 1, 1, 1]; +%! assert((ones (3) == x33 && ones (size (x33)) == x33 && ones (3, 3) == x33 +%! && ones (2, 3) == x23 && ones (3, 2) == x23')); + +%% test/octave.test/matrix/ones-2.m +%!assert(all (size (ones (3, 4, 5)) == [3, 4, 5])); + +%% test/octave.test/matrix/zeros-1.m +%!test +%! x33 = [0, 0, 0; 0, 0, 0; 0, 0, 0]; +%! x23 = [0, 0, 0; 0, 0, 0]; +%! assert((zeros (3) == x33 && zeros (size (x33)) == x33 && zeros (3, 3) == x33 +%! && zeros (2, 3) == x23 && zeros (3, 2) == x23')); + +%% test/octave.test/matrix/zeros-2.m +%!assert(all (size (zeros (3, 4, 5)) == [3, 4, 5])); + +%% test/octave.test/matrix/rand-1.m +%!test +%! rand ("seed", 0.5); +%! r1 = rand (100); +%! rand ("seed", 0.5); +%! r2 = rand (100); +%! assert(rand (100) < 1 && rand (100) > 0 && r1 == r2); + +%% test/octave.test/matrix/rand-2.m +%!assert(all (size (rand (1, 2, 3)) == [1, 2, 3])); + +%% test/octave.test/matrix/randn-1.m +%!test +%! randn ("seed", 0.5); +%! r1 = randn (100); +%! randn ("seed", 0.5); +%! r2 = randn (100); +%! assert(all (all (r1 == r2))); + +%% test/octave.test/matrix/randn-2.m +%!assert(all (size (randn (1, 2, 3)) == [1, 2, 3])); + +%% test/octave.test/matrix/diag-1.m +%!test +%! d = [1; 2; 3]; +%! +%! d0 = [1, 0, 0; +%! 0, 2, 0; +%! 0, 0, 3]; +%! +%! d1 = [0, 1, 0, 0; +%! 0, 0, 2, 0; +%! 0, 0, 0, 3; +%! 0, 0, 0, 0]; +%! +%! d2 = [0, 0, 1, 0, 0; +%! 0, 0, 0, 2, 0; +%! 0, 0, 0, 0, 3; +%! 0, 0, 0, 0, 0; +%! 0, 0, 0, 0, 0]; +%! +%! dm1 = [0, 0, 0, 0; +%! 1, 0, 0, 0; +%! 0, 2, 0, 0; +%! 0, 0, 3, 0]; +%! +%! dm2 = [0, 0, 0, 0, 0; +%! 0, 0, 0, 0, 0; +%! 1, 0, 0, 0, 0; +%! 0, 2, 0, 0, 0; +%! 0, 0, 3, 0, 0]; +%! +%! assert((diag (d) == d0 && diag (d, 1) == d1 && diag (d, 2) == d2 +%! && diag (d, -1) == dm1 && diag (d, -2) == dm2 +%! && diag (d0) == d && diag (d1, 1) == d && diag (dm1, -1) == d)); + +%% test/octave.test/matrix/diag-2.m +%!error <... diag:.*> diag (); + +%% test/octave.test/matrix/diag-3.m +%!error <... diag:.*> diag (1, 2, 3); + +%% test/octave.test/matrix/linspace-1.m +%!test +%! x1 = linspace (1, 2); +%! x2 = linspace (1, 2, 10); +%! x3 = linspace (1, -2, 10); +%! assert((size (x1) == [1, 100] && x1(1) == 1 && x1(100) == 2 +%! && size (x2) == [1, 10] && x2(1) == 1 && x2(10) == 2 +%! && size (x3) == [1, 10] && x3(1) == 1 && x3(10) == -2)); + +%% test/octave.test/matrix/linspace-2.m +%!test +%! warn_fortran_indexing = 0; +%! assert(all (linspace ([1, 2; 3, 4], 5, 6) == linspace (1, 5, 6))); + +%% test/octave.test/matrix/linspace-3.m +%!error <... linspace:.*> linspace (); + +%% test/octave.test/matrix/linspace-4.m +%!error <... linspace:.*> linspace (1, 2, 3, 4); + +%% test/octave.test/matrix/linspace-5.m +%!test +%! warn_fortran_indexing = 1; +%! fail("linspace ([1, 2; 3, 4], 5, 6)","warning"); + +%% test/octave.test/matrix/logspace-1.m +%!test +%! x1 = logspace (1, 2); +%! x2 = logspace (1, 2, 10); +%! x3 = logspace (1, -2, 10); +%! x4 = logspace (1, pi, 10); +%! assert((size (x1) == [1, 50] && x1(1) == 10 && x1(50) == 100 +%! && size (x2) == [1, 10] && x2(1) == 10 && x2(10) == 100 +%! && size (x3) == [1, 10] && x3(1) == 10 && x3(10) == 0.01 +%! && size (x4) == [1, 10] && x4(1) == 10 && abs (x4(10) - pi) < sqrt (eps))); + +%% test/octave.test/matrix/logspace-2.m +%!error logspace ([1, 2; 3, 4], 5, 6); + +%% test/octave.test/matrix/logspace-3.m +%!error logspace (); + +%% test/octave.test/matrix/logspace-4.m +%!error logspace (1, 2, 3, 4); + +%% test/octave.test/matrix/sylvester_matrix-1.m +%!assert((sylvester_matrix (1) == [1, 1; 1, -1] +%! && (sylvester_matrix (2) +%! == [1, 1, 1, 1; 1, -1, 1, -1; 1, 1, -1, -1; 1, -1, -1, 1]))); + +%% test/octave.test/matrix/sylvester_matrix-2.m +%!error sylvester_matrix ([1, 2; 3, 4]); + +%% test/octave.test/matrix/sylvester_matrix-3.m +%!error sylvester_matrix (); + +%% test/octave.test/matrix/sylvester_matrix-4.m +%!error sylvester_matrix (1, 2); + +%% test/octave.test/matrix/hankel-1.m +%!assert((hankel (1) == 1 && hankel ([1, 2]) == [1, 2; 2, 0] +%! && hankel ([1, 2], [2; -1; -3]) == [1, 2, -1; 2, -1, -3])); + +%% test/octave.test/matrix/hankel-2.m +%!error hankel ([1, 2; 3, 4], [1, 2; 3, 4]); + +%% test/octave.test/matrix/hankel-3.m +%!error hankel (); + +%% test/octave.test/matrix/hankel-4.m +%!error hankel (1, 2, 3); + +%% test/octave.test/matrix/hilb-1.m +%!assert((hilb (2) == [1, 1/2; 1/2, 1/3] +%! && hilb (3) == [1, 1/2, 1/3; 1/2, 1/3, 1/4; 1/3, 1/4, 1/5])); + +%% test/octave.test/matrix/hilb-2.m +%!error hilb (); + +%% test/octave.test/matrix/hilb-3.m +%!error hilb (1, 2); + +%% test/octave.test/matrix/invhilb-1.m +%!test +%! result4 = [16, -120, 240, -140; +%! -120, 1200, -2700, 1680; +%! 240, -2700, 6480, -4200; +%! -140, 1680, -4200, 2800]; +%! +%! assert((invhilb (1) == 1 && invhilb (2) == [4, -6; -6, 12] +%! && invhilb (4) == result4 +%! && abs (invhilb (7) * hilb (7) - eye (7)) < sqrt (eps))); + +%% test/octave.test/matrix/invhilb-2.m +%!error invhilb ([1, 2]); + +%% test/octave.test/matrix/invhilb-3.m +%!error invhilb (); + +%% test/octave.test/matrix/invhilb-4.m +%!error invhilb (1, 2); + +%% test/octave.test/matrix/toeplitz-1.m +%!assert((toeplitz (1) == 1 +%! && toeplitz ([1, 2, 3], [1; -3; -5]) == [1, -3, -5; 2, 1, -3; 3, 2, 1] +%! && toeplitz ([1, 2, 3], [1; -3i; -5i]) == [1, -3i, -5i; 2, 1, -3i; 3, 2, 1])); + +%% test/octave.test/matrix/toeplitz-2.m +%!error toeplitz ([1, 2; 3, 4], 1); + +%% test/octave.test/matrix/toeplitz-3.m +%!error toeplitz (); + +%% test/octave.test/matrix/toeplitz-4.m +%!error toeplitz (1, 2, 3); + +%% test/octave.test/matrix/vander-1.m +%!assert((vander (1) == 1 && vander ([1, 2, 3]) == vander ([1; 2; 3]) +%! && vander ([1, 2, 3]) == [1, 1, 1; 4, 2, 1; 9, 3, 1] +%! && vander ([1, 2, 3]*i) == [-1, i, 1; -4, 2i, 1; -9, 3i, 1])); + +%% test/octave.test/matrix/vander-2.m +%!error vander ([1, 2; 3, 4]); + +%% test/octave.test/matrix/vander-3.m +%!error vander (); + +%% test/octave.test/matrix/vander-4.m +%!error vander (1, 2); +
new file mode 100644 --- /dev/null +++ b/test/test_nonlin.m @@ -0,0 +1,88 @@ +%% Automatically generated from DejaGNU files + +%% test/octave.test/nonlin/fsolve-1.m +%!function retval = f (p) +%! x = p(1); +%! y = p(2); +%! z = p(3); +%! retval = zeros (3, 1); +%! retval(1) = sin(x) + y**2 + log(z) - 7; +%! retval(2) = 3*x + 2**y -z**3 + 1; +%! retval(3) = x + y + z - 5; +%!test +%! x_opt = [ 0.599054; +%! 2.395931; +%! 2.005014 ]; +%! tol = 1.0e-5; +%! [x, info] = fsolve ("f", [ 0.5, 2.0, 2.5 ]); +%! val = f (x); +%! info_bad = (info != 1); +%! solution_bad = sum (abs (x - x_opt) > tol); +%! value_bad = sum (abs (val) > tol); +%! if (info_bad) +%! printf_assert ("info bad\n"); +%! else +%! printf_assert ("info good\n"); +%! endif +%! if (solution_bad) +%! printf_assert ("solution bad\n"); +%! else +%! printf_assert ("solution good\n"); +%! endif +%! if (value_bad) +%! printf_assert ("value bad\n"); +%! else +%! printf_assert ("value good\n"); +%! endif +%! assert(prog_output_assert("info good\nsolution good\nvalue good")); + +%% test/octave.test/nonlin/fsolve-2.m +%!function retval = f (p) +%! x = p(1); +%! y = p(2); +%! z = p(3); +%! w = p(4); +%! retval = zeros (4, 1); +%! retval(1) = 3*x + 4*y + exp (z + w) - 1.007; +%! retval(2) = 6*x - 4*y + exp (3*z + w) - 11; +%! retval(3) = x^4 - 4*y^2 + 6*z - 8*w - 20; +%! retval(4) = x^2 + 2*y^3 + z - w - 4; +%!test +%! x_opt = [ -0.767297326653401; +%! 0.590671081117440; +%! 1.47190018629642; +%! -1.52719341133957 ]; +%! tol = 1.0e-5; +%! [x, info] = fsolve ("f", [-1, 1, 2, -1]); +%! val = f (x); +%! info_bad = (info != 1); +%! solution_bad = sum (abs (x - x_opt) > tol); +%! value_bad = sum (abs (val) > tol); +%! if (info_bad) +%! printf_assert ("info bad\n"); +%! else +%! printf_assert ("info good\n"); +%! endif +%! if (solution_bad) +%! printf_assert ("solution bad\n"); +%! else +%! printf_assert ("solution good\n"); +%! endif +%! if (value_bad) +%! printf_assert ("value bad\n"); +%! else +%! printf_assert ("value good\n"); +%! endif +%! assert(prog_output_assert("info good\nsolution good\nvalue good")); + +%% test/octave.test/nonlin/fsolve_options-1.m +%!test +%! fsolve_options ("tolerance", eps); +%! assert(fsolve_options ("tolerance") == eps); + +%% test/octave.test/nonlin/fsolve_options-2.m +%!error <... fsolve_options:.*> fsolve_options (); + +%% test/octave.test/nonlin/fsolve_options-3.m +%!error <... fsolve_options:.*> fsolve_options ("foo", 1, 2); +
new file mode 100644 --- /dev/null +++ b/test/test_number.m @@ -0,0 +1,190 @@ +%% Automatically generated from DejaGNU files + +%% test/octave.test/number/ismatrix-1.m +%!assert(ismatrix (1)); + +%% test/octave.test/number/ismatrix-2.m +%!assert(ismatrix ([1, 2, 3])); + +%% test/octave.test/number/ismatrix-3.m +%% Yes, this is right, ismatrix() checks for non-empty matrices. +%!assert( +%! ismatrix ([]) == 0); + +%% test/octave.test/number/ismatrix-4.m +%!assert(ismatrix ([1, 2; 3, 4])); + +%% test/octave.test/number/ismatrix-5.m +%!test +%! warn_str_to_num = 0; +%! assert(!(ismatrix ("t"))); + +%% test/octave.test/number/ismatrix-6.m +%!test +%! warn_str_to_num = 0; +%! assert(!(ismatrix ("test"))); + +%% test/octave.test/number/ismatrix-7.m +%!test +%! warn_str_to_num = 0; +%! assert(!(ismatrix (["test"; "ing"]))); + +%% test/octave.test/number/ismatrix-8.m +%!test +%! s.a = 1; +%! assert(!(ismatrix (s))); + +%% test/octave.test/number/ismatrix-9.m +%!error <... ismatrix:.*> ismatrix (); + +%% test/octave.test/number/ismatrix-10.m +%!error <... ismatrix:.*> ismatrix ([1, 2; 3, 4], 2); + +%% test/octave.test/number/isvector-1.m +%!assert(isvector (1)); + +%% test/octave.test/number/isvector-2.m +%!assert(isvector ([1; 2; 3])); + +%% test/octave.test/number/isvector-3.m +%!assert(!(isvector ([]))); + +%% test/octave.test/number/isvector-4.m +%!assert(!(isvector ([1, 2; 3, 4]))); + +%% test/octave.test/number/isvector-5.m +%!test +%! warn_str_to_num = 0; +%! assert(!(isvector ("t"))); + +%% test/octave.test/number/isvector-6.m +%!test +%! warn_str_to_num = 0; +%! assert(!(isvector ("test"))); + +%% test/octave.test/number/isvector-7.m +%!assert(!(isvector (["test"; "ing"]))); + +%% test/octave.test/number/isvector-8.m +%!test +%! s.a = 1; +%! assert(!(isvector (s))); + +%% test/octave.test/number/isvector-9.m +%!error isvector (); + +%% test/octave.test/number/isvector-10.m +%!error isvector ([1, 2], 2); + +%% test/octave.test/number/isscalar-1.m +%!assert(isscalar (1)); + +%% test/octave.test/number/isscalar-2.m +%!assert(!(isscalar ([1, 2]))); + +%% test/octave.test/number/isscalar-3.m +%!assert(!(isscalar ([]))); + +%% test/octave.test/number/isscalar-4.m +%!assert(!(isscalar ([1, 2; 3, 4]))); + +%% test/octave.test/number/isscalar-5.m +%!test +%! warn_str_to_num = 0; +%! assert(!(isscalar ("t"))); + +%% test/octave.test/number/isscalar-6.m +%!assert(!(isscalar ("test"))); + +%% test/octave.test/number/isscalar-7.m +%!assert(!(isscalar (["test"; "ing"]))); + +%% test/octave.test/number/isscalar-8.m +%!test +%! s.a = 1; +%! assert(!(isscalar (s))); + +%% test/octave.test/number/isscalar-9.m +%!error isscalar (); + +%% test/octave.test/number/isscalar-10.m +%!error isscalar (1, 2); + +%% test/octave.test/number/issquare-1.m +%!assert(issquare (1)); + +%% test/octave.test/number/issquare-2.m +%!assert(!(issquare ([1, 2]))); + +%% test/octave.test/number/issquare-3.m +%!assert(!(issquare ([]))); + +%% test/octave.test/number/issquare-4.m +%!assert(issquare ([1, 2; 3, 4]) == 2); + +%% test/octave.test/number/issquare-5.m +%!test +%! warn_str_to_num = 0; +%! assert(!(issquare ("t"))); + +%% test/octave.test/number/issquare-6.m +%!assert(!(issquare ("test"))); + +%% test/octave.test/number/issquare-7.m +%!test +%! warn_str_to_num = 0; +%! assert(!(issquare (["test"; "ing"; "1"; "2"]))); + +%% test/octave.test/number/issquare-8.m +%!test +%! s.a = 1; +%! assert(!(issquare (s))); + +%% test/octave.test/number/issquare-9.m +%!assert(!(issquare ([1, 2; 3, 4; 5, 6]))); + +%% test/octave.test/number/issquare-10.m +%!error issquare (); + +%% test/octave.test/number/issquare-11.m +%!error issquare ([1, 2; 3, 4], 2); + +%% test/octave.test/number/issymmetric-1.m +%!assert(issymmetric (1)); + +%% test/octave.test/number/issymmetric-2.m +%!assert(!(issymmetric ([1, 2]))); + +%% test/octave.test/number/issymmetric-3.m +%!assert(!(issymmetric ([]))); + +%% test/octave.test/number/issymmetric-4.m +%!assert(issymmetric ([1, 2; 2, 1]) == 2); + +%% test/octave.test/number/issymmetric-5.m +%!test +%! warn_str_to_num = 0; +%! assert(!(issymmetric ("t"))); + +%% test/octave.test/number/issymmetric-6.m +%!assert(!(issymmetric ("test"))); + +%% test/octave.test/number/issymmetric-7.m +%!test +%! warn_str_to_num = 0; +%! assert(!(issymmetric (["te"; "et"]))); + +%% test/octave.test/number/issymmetric-8.m +%!test +%! s.a = 1; +%! assert(!(issymmetric (s))); + +%% test/octave.test/number/issymmetric-9.m +%!assert(issymmetric ([1, 2.1; 2, 1.1], 0.2) == 2); + +%% test/octave.test/number/issymmetric-10.m +%!error issymmetric ([1, 2; 2, 1], 0, 0); + +%% test/octave.test/number/issymmetric-11.m +%!error issymmetric (); +
new file mode 100644 --- /dev/null +++ b/test/test_optim.m @@ -0,0 +1,2 @@ +%% Automatically generated from DejaGNU files +
new file mode 100644 --- /dev/null +++ b/test/test_plot.m @@ -0,0 +1,2 @@ +%% Automatically generated from DejaGNU files +
new file mode 100644 --- /dev/null +++ b/test/test_poly.m @@ -0,0 +1,176 @@ +%% Automatically generated from DejaGNU files + +%% test/octave.test/poly/compan-1.m +%!assert(all (all (compan ([1, 2, 3]) == [-2, -3; 1, 0]))); + +%% test/octave.test/poly/compan-2.m +%!assert(all (all (compan ([1; 2; 3]) == [-2, -3; 1, 0]))); + +%% test/octave.test/poly/compan-3.m +%!assert(isempty (compan (4))); + +%% test/octave.test/poly/compan-4.m +%!assert(all (all (compan ([3, 2, 1]) == [-2/3, -1/3; 1, 0]))); + +%% test/octave.test/poly/compan-5.m +%!error compan ([1,2;3,4]); + +%% test/octave.test/poly/compan-6.m +%!error compan ([]); + +%% test/octave.test/poly/conv-1.m +%!assert(all (all (conv (ones (3, 1), ones (3, 1)) == [1, 2, 3, 2, 1]))); + +%% test/octave.test/poly/conv-2.m +%!assert(all (all (conv (ones (1, 3), ones (3, 1)) == [1, 2, 3, 2, 1]))); + +%% test/octave.test/poly/conv-3.m +%!assert(all (all (conv (3, [1, 2, 3]) == [3, 6, 9]))); + +%% test/octave.test/poly/conv-4.m +%!error conv ([1, 2; 3, 4], 3); + +%% test/octave.test/poly/conv-5.m +%!assert(conv (2, 3),6); + +%% test/octave.test/poly/conv-6.m +%!error conv (2, []); + +%% test/octave.test/poly/deconv-1.m +%!test +%! [b, r] = deconv ([3, 6, 9, 9], [1, 2, 3]); +%! assert(all (all (b == [3, 0])) && all (all (r == [0, 0, 0, 9]))); + +%% test/octave.test/poly/deconv-2.m +%!test +%! [b, r] = deconv ([3, 6], [1, 2, 3]); +%! assert(b == 0 && all (all (r == [0, 3, 6]))); + +%% test/octave.test/poly/deconv-3.m +%!test +%! [b, r] = deconv ([3, 6], [1; 2; 3]); +%! assert(b == 0 && all (all (r == [0, 3, 6]))); + +%% test/octave.test/poly/deconv-4.m +%!error [b, r] = deconv ([3, 6], [1, 2; 3, 4]);; + +%% test/octave.test/poly/deconv-5.m +%!error <number of rows must match> [b, r] = deconv ([3; 6], [1, 2, 3]); + +%% test/octave.test/poly/poly-1.m +%!assert(all (all (poly ([1, 2, 3]) == [1, -6, 11, -6]))); + +%% test/octave.test/poly/poly-2.m +%!assert(all (all (abs (poly ([1, 2; 3, 4]) - [1, -5, -2]) < sqrt (eps)))); + +%% test/octave.test/poly/poly-3.m +%!error poly ([1, 2, 3; 4, 5, 6]); + +%% test/octave.test/poly/poly-4.m +%!assert(poly ([]),1); + +%% test/octave.test/poly/polyderiv-1.m +%!assert(all (all (polyderiv ([1, 2, 3]) == [2, 2]))); + +%% test/octave.test/poly/polyderiv-2.m +%!assert(polyderiv (13) == 0); + +%% test/octave.test/poly/polyderiv-3.m +%!error polyderiv ([]); + +%% test/octave.test/poly/polyderiv-4.m +%!error polyderiv ([1, 2; 3, 4]); + +%% test/octave.test/poly/polyfit-1.m +%!test +%! x = [-2, -1, 0, 1, 2]; +%! assert(all (all (abs (polyfit (x, x.^2+x+1, 2) - [1, 1, 1]) < sqrt (eps)))); + +%% test/octave.test/poly/polyfit-2.m +%!test +%! x = [-2, -1, 0, 1, 2]; +%! assert(all (all (abs (polyfit (x, x.^2+x+1, 3) - [0, 1, 1, 1]) < sqrt (eps)))); + +%% test/octave.test/poly/polyfit-3.m +%!error polyfit ([1, 2; 3, 4], [1, 2; 3, 4], 4); + +%% test/octave.test/poly/polyfit-4.m +%!test +%! x = [-2, -1, 0, 1, 2]; +%! fail("polyfit (x, x.^2+x+1)"); + +%% test/octave.test/poly/polyfit-5.m +%!test +%! x = [-2, -1, 0, 1, 2]; +%! fail("polyfit (x, x.^2+x+1, [])"); + +%% test/octave.test/poly/polyinteg-1.m +%!assert(all (all (polyinteg ([2, 2]) == [1, 2, 0]))); + +%% test/octave.test/poly/polyinteg-2.m +%!assert(isempty (polyinteg ([]))); + +%% test/octave.test/poly/polyinteg-3.m +%!assert(all (all (polyinteg (3) == [3, 0]))); + +%% test/octave.test/poly/polyinteg-4.m +%!error polyinteg ([1, 2; 3, 4]); + +%% test/octave.test/poly/polyreduce-1.m +%!assert(all (all (polyreduce ([0, 0, 1, 2, 3]) == [1, 2, 3]))); + +%% test/octave.test/poly/polyreduce-2.m +%!assert(all (all (polyreduce ([1, 2, 3, 0, 0]) == [1, 2, 3, 0, 0]))); + +%% test/octave.test/poly/polyreduce-3.m +%!assert(all (all (polyreduce ([1, 0, 3]) == [1, 0, 3]))); + +%% test/octave.test/poly/polyreduce-4.m +%!assert(isempty (polyreduce ([]))); + +%% test/octave.test/poly/polyreduce-5.m +%!error polyreduce ([1, 2; 3, 4]); + +%% test/octave.test/poly/polyval-1.m +%!assert(polyval ([1, 1, 1], 2) == 7); + +%% test/octave.test/poly/polyval-2.m +%!assert(all (all (polyval ([1, 1, 1], [0; 1; 2]) == [1; 3; 7]))); + +%% test/octave.test/poly/polyval-3.m +%!assert(isempty (polyval ([1, 1, 1], []))); + +%% test/octave.test/poly/polyval-4.m +%!assert(all (all (polyval ([1, 1, 1], [-1, 0; 1, 2]) == [1, 1; 3, 7]))); + +%% test/octave.test/poly/polyval-5.m +%!error polyval ([1, 2; 3, 4], [-1, 0; 1, 2]); + +%% test/octave.test/poly/polyval-6.m +%!assert(isempty (polyval ([], [-1, 0; 1, 2]))); + +%% test/octave.test/poly/polyvalm-1.m +%!assert(isempty (polyvalm ([], [1, 2; 3, 4]))); + +%% test/octave.test/poly/polyvalm-2.m +%!error polyvalm ([1, 1, 1], [1, 2; 3, 4; 5, 6]); + +%% test/octave.test/poly/residue-1.m +%!test +%! b = [1, 1, 1]; +%! a = [1, -5, 8, -4]; +%! [r, p, k, e] = residue (b, a); +%! assert((abs (r - [-2; 7; 3]) < 1e-6 +%! && abs (p - [2; 2; 1]) < 1e-7 +%! && isempty (k) +%! && e == [1; 2; 1])); + +%% test/octave.test/poly/roots-1.m +%!assert(all (all (abs (roots ([1, -6, 11, -6]) - [3; 2; 1]) < sqrt (eps)))); + +%% test/octave.test/poly/roots-2.m +%!assert(isempty (roots ([]))); + +%% test/octave.test/poly/roots-3.m +%!error roots ([1, 2; 3, 4]); +
new file mode 100644 --- /dev/null +++ b/test/test_prefer.m @@ -0,0 +1,235 @@ +%% Automatically generated from DejaGNU files + +%% 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-9.m +%!test +%! m = [3,2]; +%! assert(all ([m (1)] == (3:-1:1))); + +%% 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 = warn_str_to_num; +%! warn_str_to_num = 0; +%! assert("d" + 0,100); +%! warn_str_to_num = wsn; + +%% test/octave.test/prefer/prefer-13.m +%!test +%! wsn = warn_str_to_num; +%! warn_str_to_num = 1; +%! fail("'d' + 0","warning"); +%! warn_str_to_num = wsn; + +%% test/octave.test/prefer/prefer-14.m +%!test +%! wir = warn_imag_to_real; +%! warn_imag_to_real = 0; +%! assert(eye (1+i),1); +%! warn_imag_to_real = wir; + +%% test/octave.test/prefer/prefer-15.m +%!test +%! wir = warn_imag_to_real; +%! warn_imag_to_real = 1; +%! fail("eye (1+i)","warning"); +%! warn_imag_to_real = wir; + +%% test/octave.test/prefer/prefer-17.m +%!test +%! wrre = warn_resize_on_range_error; +%! warn_resize_on_range_error = 0; +%! clear a; +%! a(2) = 1; a(3) = 2; +%! assert(all (a == [0,1,2])); +%! warn_resize_on_range_error = wrre; + +%% test/octave.test/prefer/prefer-18.m +%!test +%! clear a; +%! a(1) = 1; a(2) = 2; +%! assert(all (a == [1,2])); + +%% XXX FIXME XXX How the hell do I test this one in test/assert +%% test/octave.test/prefer/prefer-19.m +%!#test +%! pid = print_answer_id_name +%! print_answer_id_name = 0; +%! a = 1 +%! print_answer_id_name = pid; + +%% XXX FIXME XXX How the hell do I test this one in test/assert +%% test/octave.test/prefer/prefer-20.m +%!#test +%! pid = print_answer_id_name +%! print_answer_id_name = 1; +%! a = 1 +%! print_answer_id_name = pid; + +%% 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,"[]"))); +%! assert(isempty(findstr(b,"[](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,"[](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))); + +%% XXX FIXME XXX return_last_computed_value no longer exists!! +%% Remove the next two tests +%% test/octave.test/prefer/prefer-25.m +%% test/octave.test/prefer/prefer-26.m + +%% 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; + +%% XXX FIXME XXX Same problem as above!!! +%% test/octave.test/prefer/prefer-29.m +%!function f () +%! 1 +%!#test +%! sf = silent_functions; +%! silent_functions = 0; +%! f +%! assert(??); +%! silent_functions = sf; + +%% XXX FIXME XXX Same problem as above!!! +%% test/octave.test/prefer/prefer-30.m +%!function f () +%! 1 +%!#test +%! sf = silent_functions; +%! silent_functions = 1; +%! f +%! assert(??); +%! silent_functions = sf; + +%% test/octave.test/prefer/prefer-32.m +%!test +%! wndz = warn_neg_dim_as_zero; +%! warn_neg_dim_as_zero = 1; +%! fail("eye (-1) == []","warning"); +%! warn_neg_dim_as_zero = wndz; + +%% test/octave.test/prefer/prefer-33.m +%!test +%! wndz = warn_neg_dim_as_zero; +%! warn_neg_dim_as_zero = 0; +%! assert(all (size (eye (-1)) == [0, 0])); +%! warn_neg_dim_as_zero = wndz; + +%% test/octave.test/prefer/prefer-34.m +%!test +%! watv = warn_assign_as_truth_value; +%! warn_assign_as_truth_value = 0; +%! if (x = 1) 1; endif +%! warn_assign_as_truth_value = watv; + +%% test/octave.test/prefer/prefer-35.m +%!test +%! watv = warn_assign_as_truth_value; +%! warn_assign_as_truth_value = 1; +%! fail("if (x = 1) 1; endif","warning"); +%! warn_assign_as_truth_value = watv; + +%% test/octave.test/prefer/prefer-38.m +%!test +%! wdbz = warn_divide_by_zero; +%! warn_divide_by_zero = 0; +%! assert(isinf (1/0)); +%! warn_divide_by_zero = wdbz; + +%% test/octave.test/prefer/prefer-39.m +%!test +%! wdbz = warn_divide_by_zero; +%! warn_divide_by_zero = 1; +%! a = 1; +%! b = 0; +%! fail("isinf (a/b);","warning") +%! warn_divide_by_zero = wdbz; +
new file mode 100644 --- /dev/null +++ b/test/test_quad.m @@ -0,0 +1,34 @@ +%% Automatically generated from DejaGNU files + +%% test/octave.test/quad/quad-1.m +%!function y = f (x) +%! y = x + 1; +%!test +%! [v, ier, nfun, err] = quad ("f", 0, 5); +%! assert(ier == 0 && abs (v - 17.5) < sqrt (eps) && nfun > 0 && +%! err < sqrt (eps)) + +%% test/octave.test/quad/quad-2.m +%!function y = f (x) +%! y = x .* sin (1 ./ x) .* sqrt (abs (1 - x)); +%!test +%! [v, ier, nfun, err] = quad ("f", 0, 3); +%! assert((ier == 0 || ier == 1) && abs (v - 1.98194122455795) < sqrt (eps) && nfun > 0); + +%% test/octave.test/quad/quad-3.m +%!error <... quad:.*> quad (); + +%% test/octave.test/quad/quad-4.m +%!error <... quad:.*> quad ("f", 1, 2, 3, 4, 5); + +%% test/octave.test/quad/quad_options-1.m +%!test +%! quad_options ("absolute tolerance", eps); +%! assert(quad_options ("absolute tolerance") == eps); + +%% test/octave.test/quad/quad_options-2.m +%!error <... quad_options:.*> quad_options (); + +%% test/octave.test/quad/quad_options-3.m +%!error <... quad_options:.*> quad_options (1, 2, 3); +
new file mode 100644 --- /dev/null +++ b/test/test_recursion.m @@ -0,0 +1,24 @@ +%% Automatically generated from DejaGNU files + +%% test/octave.test/recursion/recursion-1.m +%!function y = f (x) +%! if (x == 1) +%! y = x; +%! return; +%! else +%! y = x * f (x-1); +%! endif +%!test +%! 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 +%!test +%! assert(f (5),120); +
new file mode 100644 --- /dev/null +++ b/test/test_return.m @@ -0,0 +1,13 @@ +%% Automatically generated from DejaGNU files + +%% test/octave.test/return/return-1.m +%!function y = f () +%! y = 1; +%! return +%! y = 2; +%!assert(f(),1) + +%% test/octave.test/return/return-2.m +%!test +%! return; +
new file mode 100644 --- /dev/null +++ b/test/test_set.m @@ -0,0 +1,59 @@ +%% Automatically generated from DejaGNU files + +%% test/octave.test/set/create_set-1.m +%!assert(all (all (create_set ([1, 2; 3, 4; 2, 4]) == [1, 2, 3, 4]))); + +%% test/octave.test/set/create_set-2.m +%!assert(all (all (create_set ([1; 2; 3; 4; 2; 4]) == [1, 2, 3, 4]))); + +%% test/octave.test/set/create_set-3.m +%!assert(isempty (create_set ([]))); + +%% test/octave.test/set/create_set-4.m +%!error create_set (1, 2); + +%% test/octave.test/set/union-1.m +%!assert(all (all (union ([1, 2, 4], [2, 3, 5]) == [1, 2, 3, 4, 5]))); + +%% test/octave.test/set/union-2.m +%!assert(all (all (union ([1; 2; 4], [2, 3, 5]) == [1, 2, 3, 4, 5]))); + +%% test/octave.test/set/union-3.m +%!assert(all (all (union ([1, 2, 3], [5; 7; 9]) == [1, 2, 3, 5, 7, 9]))); + +%% test/octave.test/set/union-4.m +%!error union (1); + +%% test/octave.test/set/union-5.m +%!error union (1, 2, 3); + +%% test/octave.test/set/intersection-1.m +%!assert(all (all (intersection ([1, 2, 3], [2, 3, 5]) == [2, 3]))); + +%% test/octave.test/set/intersection-2.m +%!assert(all (all (intersection ([1; 2; 3], [2, 3, 5]) == [2, 3]))); + +%% test/octave.test/set/intersection-3.m +%!assert(isempty (intersection ([1, 2, 3], [4; 5; 6]))); + +%% test/octave.test/set/intersection-4.m +%!error intersection (1); + +%% test/octave.test/set/intersection-5.m +%!error intersection (1, 2, 5); + +%% test/octave.test/set/complement-1.m +%!assert(all (all (complement ([1, 2, 3], [3; 4; 5; 6]) == [4, 5, 6]))); + +%% test/octave.test/set/complement-2.m +%!assert(all (all (complement ([1, 2, 3], [3, 4, 5, 6]) == [4, 5, 6]))); + +%% test/octave.test/set/complement-3.m +%!assert(isempty (complement ([1, 2, 3], [3, 2, 1]))); + +%% test/octave.test/set/complement-4.m +%!error complement (1); + +%% test/octave.test/set/complement-5.m +%!error complement (1, 2, 3); +
new file mode 100644 --- /dev/null +++ b/test/test_signal.m @@ -0,0 +1,165 @@ +%% Automatically generated from DejaGNU files + +%% test/octave.test/signal/detrend-1.m +%% detrend-1.m +%% +%% Author: David Billinghurst (David.Billinghurst@riotinto.com.au) +%% Comalco Research and Technology +%% 02 May 2000 +%!test +%! N=32; +%! x = (0:1:N-1)/N + 2; +%! y = detrend(x); +%! assert(all (all (abs (y) < 10*eps))); + +%% test/octave.test/signal/detrend-2.m +%% detrend-2.m +%% +%% Author: David Billinghurst (David.Billinghurst@riotinto.com.au) +%% Comalco Research and Technology +%% 02 May 2000 +%!test +%! N=32; +%! t = (0:1:N-1)/N; +%! x = t .* t + 2; +%! y = detrend(x,2); +%! assert(all (all (abs (y) < 30*eps))); + +%% test/octave.test/signal/detrend-3.m +%% detrend-3.m +%% +%% Author: David Billinghurst (David.Billinghurst@riotinto.com.au) +%% Comalco Research and Technology +%% 02 May 2000 +%!test +%! N=32; +%! t = (0:1:N-1)/N; +%! x = [t;4*t-3]'; +%! y = detrend(x); +%! assert(all (all (abs (y) < 20*eps))); + +%% test/octave.test/signal/fft-1.m +%% fft-1.m +%% +%% Author: David Billinghurst (David.Billinghurst@riotinto.com.au) +%% Comalco Research and Technology +%% 02 May 2000 +%!test +%! N=64; +%! n=4; +%! t = 2*pi*(0:1:N-1)/N; +%! s = cos(n*t); +%! S = fft(s); +%! +%! answer = 0*t; +%! answer(n+1) = N/2; +%! answer(N-n+1) = N/2; +%! +%! assert(all( abs(S-answer) < 4*N*eps )); + +%% test/octave.test/signal/ifft-1.m +%% ifft-1.m +%% +%% Author: David Billinghurst (David.Billinghurst@riotinto.com.au) +%% Comalco Research and Technology +%% 02 May 2000 +%!test +%! N=64; +%! n=7; +%! t = 2*pi*(0:1:N-1)/N; +%! s = cos(n*t); +%! +%! S = 0*t; +%! S(n+1) = N/2; +%! S(N-n+1) = N/2; +%! +%! assert(all( abs(ifft(S)-s) < 4*N*eps )); + +%% test/octave.test/signal/fft2-1.m +%% fft2-1.m +%% +%% Author: David Billinghurst (David.Billinghurst@riotinto.com.au) +%% Comalco Research and Technology +%% 02 May 2000 +%!test +%! M=16; +%! N=8; +%! +%! m=5; +%! n=3; +%! +%! x = 2*pi*(0:1:M-1)/M; +%! y = 2*pi*(0:1:N-1)/N; +%! sx = cos(m*x); +%! sy = sin(n*y); +%! s=kron(sx',sy); +%! S = fft2(s); +%! answer = kron(fft(sx)',fft(sy)); +%! assert(all( all( abs(S-answer) < 4*M*N*eps ) )); + +%% test/octave.test/signal/ifft2-1.m +%% ifft2-1.m +%% +%% Author: David Billinghurst (David.Billinghurst@riotinto.com.au) +%% Comalco Research and Technology +%% 02 May 2000 +%!test +%! M=12; +%! N=7; +%! +%! m=3; +%! n=2; +%! +%! x = 2*pi*(0:1:M-1)/M; +%! y = 2*pi*(0:1:N-1)/N; +%! +%! sx = cos(m*x); +%! sy = cos(n*y); +%! +%! S = kron(fft(sx)',fft(sy)); +%! answer=kron(sx',sy); +%! s = ifft2(S); +%! +%! assert(all( all( abs(s-answer) < 30*eps ) )); + +%% test/octave.test/signal/unwrap-1.m +%!function t = assert(a,b,tol) +%! if (nargin == 1) +%! t = all(a(:)); +%! else +%! if (nargin == 2) +%! tol = 0; +%! endif +%! if (any (size(a) != size(b))) +%! t = 0; +%! elseif (any (abs(a(:) - b(:)) > tol)) +%! t = 0; +%! else +%! t = 1; +%! endif +%! endif +%! +%!test +%! +%! i = 0; +%! t = []; +%! +%! r = [0:100]; # original vector +%! w = r - 2*pi*floor((r+pi)/(2*pi)); # wrapped into [-pi,pi] +%! tol = 1e3*eps; # maximum expected deviation +%! +%! t(++i) = assert(r, unwrap(w), tol); #unwrap single row +%! t(++i) = assert(r', unwrap(w'), tol); #unwrap single column +%! t(++i) = assert([r',r'], unwrap([w',w']), tol); #unwrap 2 columns +%! t(++i) = assert([r;r], unwrap([w;w],[],2), tol); #verify that dim works +%! t(++i) = assert(r+10, unwrap(10+w), tol); #verify that r(1)>pi works +%! +%! t(++i) = assert(w', unwrap(w',[],2)); #unwrap col by rows should not change it +%! t(++i) = assert(w, unwrap(w,[],1)); #unwrap row by cols should not change it +%! t(++i) = assert([w;w], unwrap([w;w])); #unwrap 2 rows by cols should not change them +%! +%! ## verify that setting tolerance too low will cause bad results. +%! t(++i) = assert(any(abs(r - unwrap(w,0.8)) > 100)); +%! +%! assert(all(t)); +
new file mode 100644 --- /dev/null +++ b/test/test_stats.m @@ -0,0 +1,96 @@ +%% Automatically generated from DejaGNU files + +%% test/octave.test/stats/mean-1.m +%!test +%! x = -10:10; +%! y = x'; +%! z = [y, y+10]; +%! assert(mean (x) == 0 && mean (y) == 0 && mean (z) == [0, 10]); + +%% test/octave.test/stats/mean-2.m +%!error mean (); + +%% test/octave.test/stats/mean-3.m +%!error mean (1, 2, 3); + +%% test/octave.test/stats/median-1.m +%!test +%! x = [1, 2, 3, 4, 5, 6]; +%! x2 = x'; +%! y = [1, 2, 3, 4, 5, 6, 7]; +%! y2 = y'; +%! +%! assert((median (x) == median (x2) && median (x) == 3.5 +%! && median (y) == median (y2) && median (y) == 4 +%! && median ([x2, 2*x2]) == [3.5, 7] +%! && median ([y2, 3*y2]) == [4, 12])); + +%% test/octave.test/stats/median-2.m +%!error median (); + +%% test/octave.test/stats/median-3.m +%!error median (1, 2, 3); + +%% test/octave.test/stats/std-1.m +%!test +%! x = ones (10, 2); +%! y = [1, 3]; +%! assert(std (x) == [0, 0] && abs (std (y) - sqrt (2)) < sqrt (eps)); + +%% test/octave.test/stats/std-2.m +%!error std (); + +%% test/octave.test/stats/std-3.m +%!error std (1, 2, 3, 4); + +%% test/octave.test/stats/cov-1.m +%!test +%! x = rand (10); +%! cx1 = cov (x); +%! cx2 = cov (x, x); +%! assert(size (cx1) == [10, 10] && size (cx2) == [10, 10] && cx1 == cx2); + +%% test/octave.test/stats/cov-2.m +%!error cov (); + +%% test/octave.test/stats/cov-3.m +%!error cov (1, 2, 3); + +%% test/octave.test/stats/corrcoef-1.m +%!test +%! x = rand (10); +%! cc1 = corrcoef (x); +%! cc2 = corrcoef (x, x); +%! assert((size (cc1) == [10, 10] && size (cc2) == [10, 10] +%! && abs (cc1 - cc2) < sqrt (eps))); + +%% test/octave.test/stats/corrcoef-2.m +%!error corrcoef (); + +%% test/octave.test/stats/corrcoef-3.m +%!error corrcoef (1, 2, 3); + +%% test/octave.test/stats/kurtosis-1.m +%!test +%! x = [-1; 0; 0; 0; 1]; +%! y = [x, 2*x]; +%! assert(all (abs (kurtosis (y) - [-1.4, -1.4]) < sqrt (eps))); + +%% test/octave.test/stats/kurtosis-2.m +%!error kurtosis (); + +%% test/octave.test/stats/kurtosis-3.m +%!error kurtosis (1, 2, 3); + +%% test/octave.test/stats/mahalanobis-2.m +%!error mahalanobis (); + +%% test/octave.test/stats/mahalanobis-3.m +%!error mahalanobis (1, 2, 3); + +%% test/octave.test/stats/skewness-2.m +%!error skewness (); + +%% test/octave.test/stats/skewness-3.m +%!error skewness (1, 2, 3); +
new file mode 100644 --- /dev/null +++ b/test/test_string.m @@ -0,0 +1,597 @@ +%% Automatically generated from DejaGNU files + +%% test/octave.test/string/str-esc-1.m +%!test +%! x = 7; +%! if (strcmp ("\a", setstr (x))) +%! printf_assert ("ok\n"); +%! endif +%! assert(prog_output_assert("ok")); + +%% test/octave.test/string/str-esc-2.m +%!test +%! x = 8; +%! if (strcmp ("\b", setstr (x))) +%! printf_assert ("ok\n"); +%! endif +%! assert(prog_output_assert("ok")); + +%% test/octave.test/string/str-esc-3.m +%!test +%! x = 12; +%! if (strcmp ("\f", setstr (x))) +%! printf_assert ("ok\n"); +%! endif +%! assert(prog_output_assert("ok")); + +%% test/octave.test/string/str-esc-4.m +%!test +%! x = 10; +%! if (strcmp ("\n", setstr (x))) +%! printf_assert ("ok\n"); +%! endif +%! assert(prog_output_assert("ok")); + +%% test/octave.test/string/str-esc-5.m +%!test +%! x = 13; +%! if (strcmp ("\r", setstr (x))) +%! printf_assert ("ok\n"); +%! endif +%! assert(prog_output_assert("ok")); + +%% test/octave.test/string/str-esc-6.m +%!test +%! x = 9; +%! if (strcmp ("\t", setstr (x))) +%! printf_assert ("ok\n"); +%! endif +%! assert(prog_output_assert("ok")); + +%% test/octave.test/string/str-esc-7.m +%!test +%! x = 11; +%! if (strcmp ("\v", setstr (x))) +%! printf_assert ("ok\n"); +%! endif +%! assert(prog_output_assert("ok")); + +%% test/octave.test/string/str-esc-8.m +%!test +%! x = 92; +%! if (strcmp ("\\", setstr (x))) +%! printf_assert ("ok\n"); +%! endif +%! assert(prog_output_assert("ok")); + +%% test/octave.test/string/str-esc-9.m +%!test +%! x = 39; +%! if (strcmp ("\'", setstr (x))) +%! printf_assert ("ok\n"); +%! endif +%! assert(prog_output_assert("ok")); + +%% test/octave.test/string/str-esc-10.m +%!test +%! x = 34; +%! if (strcmp ("\"", setstr (x))) +%! printf_assert ("ok\n"); +%! endif +%! assert(prog_output_assert("ok")); + +%% test/octave.test/string/str-esc-11.m +%!test +%! x = 120; +%! fail('strcmp ("\x", setstr (x))',"warning",".*unrecognized escape sequence.*"); + +%% test/octave.test/string/str-esc-12.m +%!test +%! x = [7, 8, 12, 10, 13, 9, 11, 92, 39, 34]; +%! if (strcmp ("\a\b\f\n\r\t\v\\\'\"", setstr (x))) +%! printf_assert ("ok\n"); +%! endif +%! assert(prog_output_assert("ok")); + +%% XXX FIXME XXX +%% Why do the next two tests fail? +%% test/octave.test/string/string_fill_char-1.m +%!#test +%! sfc = string_fill_char; +%! string_fill_char = "X"; +%! str = ["these"; "are"; "strings"]; +%! assert(str,["theseXX"; "areXXXX"; "strings"]); +%! string_fill_char = sfc; + +%% test/octave.test/string/string_fill_char-2.m +%!#test +%! sfc = string_fill_char; +%! string_fill_char = " "; +%! str = ["these"; "are"; "strings"]; +%! assert(str,["these "; "are "; "strings"]); +%! string_fill_char = sfc; + +%% test/octave.test/string/ischar-1.m +%!assert(!(ischar (1))); + +%% test/octave.test/string/ischar-2.m +%!assert(!(ischar ([1, 2]))); + +%% test/octave.test/string/ischar-3.m +%!assert(!(ischar ([]))); + +%% test/octave.test/string/ischar-4.m +%!assert(!(ischar ([1, 2; 3, 4]))); + +%% test/octave.test/string/ischar-5.m +%!assert(ischar ("")); + +%% test/octave.test/string/ischar-6.m +%!assert(ischar ("t")); + +%% test/octave.test/string/ischar-7.m +%!assert(ischar ("test")); + +%% test/octave.test/string/ischar-8.m +%!assert(ischar (["test"; "ing"])); + +%% test/octave.test/string/ischar-9.m +%!test +%! s.a = "test"; +%! assert(!(ischar (s))); + +%% test/octave.test/string/ischar-10.m +%!error <... ischar:.*> ischar (); + +%% test/octave.test/string/ischar-11.m +%!error <... ischar:.*> ischar ("test", 1); + +%% test/octave.test/string/blanks-1.m +%!assert(strcmp (blanks (3), " ")); + +%% test/octave.test/string/blanks-2.m +%!error blanks (); + +%% test/octave.test/string/blanks-3.m +%!error blanks (1, 2); + +%% test/octave.test/string/char-1.m +%!assert(strcmp (char ([65, 83, 67, 73, 73]), "ASCII")); + +%% test/octave.test/string/char-2.m +%!error <... char:.*> char (); + +%% test/octave.test/string/char-3.m +%!test +%! x = char ("foo", "bar", "foobar"); +%! assert((strcmp (x(1,:), "foo ") +%! && strcmp (x(2,:), "bar ") +%! && strcmp (x(3,:), "foobar"))); + +%% test/octave.test/string/int2str-1.m +%!assert(strcmp (int2str (-123), "-123") && strcmp (int2str (1.2), "1")); + +%% test/octave.test/string/int2str-2.m +%!error int2str (); + +%% test/octave.test/string/int2str-3.m +%!error int2str (1, 2); + +%% test/octave.test/string/num2str-1.m +%!assert((strcmp (num2str (123), "123") && strcmp (num2str (1.23), "1.23"))); + +%% test/octave.test/string/num2str-2.m +%!error num2str (); + +%% test/octave.test/string/num2str-3.m +%!error num2str (1, 2, 3); + +%% test/octave.test/string/strcat-1.m +%!assert((strcmp (strcat ("foo", "bar"), "foobar") +%! && strcmp (strcat (["a"; "bb"], ["foo"; "bar"]), ["a foo"; "bbbar"]))); + +%% test/octave.test/string/strcat-2.m +%!error strcat (); + +%% test/octave.test/string/strcat-3.m +%!error strcat (1, 2); + +%% test/octave.test/string/str2mat-1.m +%!assert(strcmp (str2mat ("a", "bb", "ccc"), ["a "; "bb "; "ccc"])); + +%% test/octave.test/string/str2mat-2.m +%!error str2mat (); + +%% test/octave.test/string/str2mat-3.m +%!assert(all (str2mat (1, 2, 3) == setstr ([1; 2; 3]))); + +%% test/octave.test/string/deblank-1.m +%!assert(strcmp (deblank (" f o o "), " f o o")); + +%% test/octave.test/string/deblank-2.m +%!error deblank (); + +%% test/octave.test/string/deblank-3.m +%!error deblank ("foo", "bar"); + +%% test/octave.test/string/deblank-4.m +%!error deblank (1); + +%% test/octave.test/string/findstr-1.m +%!assert((findstr ("abababa", "a") == [1, 3, 5, 7] +%! && findstr ("abababa", "aba") == [1, 3, 5] +%! && findstr ("abababa", "aba", 0) == [1, 5])); + +%% test/octave.test/string/findstr-2.m +%!error findstr (); + +%% test/octave.test/string/findstr-3.m +%!error findstr ("foo", "bar", 3, 4); + +%% test/octave.test/string/index-1.m +%!assert(index ("foobarbaz", "b") == 4 && index ("foobarbaz", "z") == 9); + +%% test/octave.test/string/index-2.m +%!error index (); + +%% test/octave.test/string/index-3.m +%!error index ("foo", "bar", 3); + +%% test/octave.test/string/rindex-1.m +%!assert(rindex ("foobarbaz", "b") == 7 && rindex ("foobarbaz", "o") == 3); + +%% test/octave.test/string/rindex-2.m +%!error rindex (); + +%% test/octave.test/string/rindex-3.m +%!error rindex ("foo", "bar", 3); + +%% test/octave.test/string/split-1.m +%!assert(all (all (split ("Test string", "t") == ["Tes "; " s "; "ring"]))); + +%% test/octave.test/string/split-2.m +%!error split (); + +%% test/octave.test/string/split-3.m +%!assert(all (strcmp (split ("foo bar baz", " ", 2), ["foo"; "bar baz"]))); + +%% test/octave.test/string/split-4.m +%!error split ("foo", "bar", 3, 4); + +%% test/octave.test/string/strrep-1.m +%!assert(strcmp (strrep ("This is a test string", "is", "&%$"), +%! "Th&%$ &%$ a test string")); + +%% test/octave.test/string/strrep-2.m +%!error strrep (); + +%% test/octave.test/string/strrep-3.m +%!error strrep ("foo", "bar", 3, 4); + +%% test/octave.test/string/substr-1.m +%!assert(strcmp (substr ("This is a test string", 6, 9), "is a test")); + +%% test/octave.test/string/substr-2.m +%!error substr (); + +%% test/octave.test/string/substr-3.m +%!error substr ("foo", 2, 3, 4); + +%% test/octave.test/string/strcmp-1.m +%!assert(strcmp ("foobar", "foobar") && strcmp ("fooba", "foobar") == 0); + +%% test/octave.test/string/strcmp-2.m +%!error <... strcmp:.*> strcmp (); + +%% test/octave.test/string/strcmp-3.m +%!error <... strcmp:.*> strcmp ("foo", "bar", 3); + +%% test/octave.test/string/bin2dec-1.m +%!assert(bin2dec ("1110") == 14); + +%% test/octave.test/string/bin2dec-2.m +%!error bin2dec (); + +%% test/octave.test/string/bin2dec-3.m +%!error bin2dec ("str", 1); + +%% test/octave.test/string/dec2bin-1.m +%!assert(strcmp (dec2bin (14), "1110")); + +%% test/octave.test/string/dec2bin-2.m +%!error dec2bin (); + +%% test/octave.test/string/dec2bin-3.m +%!assert(strcmp (dec2bin (14, 6), "001110") +%! ); + +%% test/octave.test/string/dec2bin-4.m +%!error dec2bin (1, 2, 3); + +%% test/octave.test/string/dec2hex-1.m +%!assert(strcmp (tolower (dec2hex (2748)), "abc")); + +%% test/octave.test/string/dec2hex-2.m +%!error dec2hex (); + +%% test/octave.test/string/dec2hex-3.m +%!assert(strcmp (tolower (dec2hex (2748, 5)), "00abc")); + +%% test/octave.test/string/dec2hex-4.m +%!error dec2hex (1, 2, 3); + +%% test/octave.test/string/hex2dec-1.m +%!assert(hex2dec ("12b") == 299 && hex2dec ("12B") == 299); + +%% test/octave.test/string/hex2dec-2.m +%!error hex2dec (); + +%% test/octave.test/string/hex2dec-3.m +%!error hex2dec ("str", 1); + +%% test/octave.test/string/str2num-1.m +%!assert(str2num ("-1.3e2") == -130 && str2num ("[1, 2; 3, 4]") == [1, 2; 3, 4]); + +%% test/octave.test/string/str2num-2.m +%!error str2num (); + +%% test/octave.test/string/str2num-3.m +%!error str2num ("string", 1); + +%% test/octave.test/string/undo_string_escapes-1.m +%!assert(strcmp (undo_string_escapes ("abc\a\b\n\r\t\v\f123"), +%! "abc\\a\\b\\n\\r\\t\\v\\f123")); + +%% test/octave.test/string/undo_string_escapes-2.m +%!error <... undo_string_escapes:.*> undo_string_escapes (); + +%% test/octave.test/string/undo_string_escapes-3.m +%!error <... undo_string_escapes:.*> undo_string_escapes ("string", 2); + +%% test/octave.test/string/toascii-1.m +%!test +%! charset = setstr (0:127); +%! +%! result = 0:127; +%! +%! assert(all (toascii (charset) == result)); + +%% test/octave.test/string/toascii-3.m +%!error toascii (1, 2); + +%% test/octave.test/string/toascii-3.m +%!error toascii (1, 2); + +%% test/octave.test/string/tolower-1.m +%!test +%! charset = setstr (0:127); +%! +%! result = charset; +%! +%! result ((toascii("A"):toascii("Z"))+1) \ +%! = result ((toascii("a"):toascii("z"))+1); +%! +%! assert(all (tolower (charset) == result)); + +%% test/octave.test/string/tolower-3.m +%!error tolower (1, 2); + +%% test/octave.test/string/tolower-3.m +%!error tolower (1, 2); + +%% test/octave.test/string/toupper-1.m +%!test +%! charset = setstr (0:127); +%! +%! result = charset; +%! +%! result ((toascii("a"):toascii("z"))+1) \ +%! = result ((toascii("A"):toascii("Z"))+1); +%! +%! assert(all (toupper (charset) == result)); + +%% test/octave.test/string/toupper-3.m +%!error toupper (1, 2); + +%% test/octave.test/string/toupper-3.m +%!error toupper (1, 2); + +%% test/octave.test/string/isalnum-1.m +%!test +%! charset = setstr (0:127); +%! +%! result = zeros (1, 128); +%! +%! result ((toascii("A"):toascii("Z"))+1) = 1; +%! result ((toascii("0"):toascii("9"))+1) = 1; +%! result ((toascii("a"):toascii("z"))+1) = 1; +%! +%! assert(all (isalnum (charset) == result)); + +%% test/octave.test/string/isalnum-2.m +%!error isalnum (1, 2); + +%% test/octave.test/string/isalnum-3.m +%!error isalnum (); + +%% test/octave.test/string/isalpha-1.m +%!test +%! charset = setstr (0:127); +%! +%! result = zeros (1, 128); +%! +%! result ((toascii("A"):toascii("Z"))+1) = 1; +%! result ((toascii("a"):toascii("z"))+1) = 1; +%! +%! assert(all (isalpha (charset) == result)); + +%% test/octave.test/string/isalpha-2.m +%!error isalpha (1, 2); + +%% test/octave.test/string/isalpha-3.m +%!error isalpha (); + +%% test/octave.test/string/isascii-1.m +%!test +%! charset = setstr (0:127); +%! +%! result = ones (1, 128); +%! +%! assert(all (isascii (charset) == result)); + +%% test/octave.test/string/isascii-2.m +%!error isascii (1, 2); + +%% test/octave.test/string/isascii-3.m +%!error isascii (); + +%% test/octave.test/string/iscntrl-1.m +%!test +%! charset = setstr (0:127); +%! +%! result = zeros (1, 128); +%! +%! result (1:32) = 1; +%! result (128) = 1; +%! +%! assert(all (iscntrl (charset) == result)); + +%% test/octave.test/string/iscntrl-2.m +%!error iscntrl (1, 2); + +%% test/octave.test/string/iscntrl-3.m +%!error iscntrl (); + +%% test/octave.test/string/isdigit-1.m +%!test +%! charset = setstr (0:127); +%! +%! result = zeros (1, 128); +%! +%! result ((toascii("0"):toascii("9"))+1) = 1; +%! +%! assert(all (isdigit (charset) == result)); + +%% test/octave.test/string/isdigit-2.m +%!error isdigit (1, 2); + +%% test/octave.test/string/isdigit-3.m +%!error isdigit (); + +%% test/octave.test/string/isgraph-1.m +%!test +%! charset = setstr (0:127); +%! +%! result = zeros (1, 128); +%! +%! result (34:127) = 1; +%! +%! assert(all (isgraph (charset) == result)); + +%% test/octave.test/string/isgraph-2.m +%!error isgraph (1, 2); + +%% test/octave.test/string/isgraph-3.m +%!error isgraph (); + +%% test/octave.test/string/islower-1.m +%!test +%! charset = setstr (0:127); +%! +%! result = zeros (1, 128); +%! +%! result ((toascii("a"):toascii("z"))+1) = 1; +%! +%! assert(all (islower (charset) == result)); + +%% test/octave.test/string/islower-2.m +%!error islower (1, 2); + +%% test/octave.test/string/islower-3.m +%!error islower (); + +%% test/octave.test/string/isprint-1.m +%!test +%! charset = setstr (0:127); +%! +%! result = zeros (1, 128); +%! +%! result (33:127) = 1; +%! +%! assert(all (isprint (charset) == result)); + +%% test/octave.test/string/isprint-2.m +%!error isprint (1, 2); + +%% test/octave.test/string/isprint-3.m +%!error isprint (); + +%% test/octave.test/string/ispunct-1.m +%!test +%! charset = setstr (0:127); +%! +%! result = zeros (1, 128); +%! +%! result (34:48) = 1; +%! result (59:65) = 1; +%! result (92:97) = 1; +%! result (124:127) = 1; +%! +%! assert(all (ispunct (charset) == result)); + +%% test/octave.test/string/ispunct-2.m +%!error ispunct (1, 2); + +%% test/octave.test/string/ispunct-3.m +%!error ispunct (); + +%% test/octave.test/string/isspace-1.m +%!test +%! charset = setstr (0:127); +%! +%! result = zeros (1, 128); +%! +%! result (toascii (" \f\n\r\t\v")+1) = 1; +%! +%! assert(all (isspace (charset) == result)); + +%% test/octave.test/string/isspace-2.m +%!error isspace (1, 2); + +%% test/octave.test/string/isspace-3.m +%!error isspace (); + +%% test/octave.test/string/isupper-1.m +%!test +%! charset = setstr (0:127); +%! +%! result = zeros (1, 128); +%! +%! result ((toascii("A"):toascii("Z"))+1) = 1; +%! +%! assert(all (isupper (charset) == result)); + +%% test/octave.test/string/isupper-2.m +%!error isupper (1, 2); + +%% test/octave.test/string/isupper-3.m +%!error isupper (); + +%% test/octave.test/string/isxdigit-1.m +%!test +%! charset = setstr (0:127); +%! +%! result = zeros (1, 128); +%! +%! result ((toascii("A"):toascii("F"))+1) = 1; +%! result ((toascii("0"):toascii("9"))+1) = 1; +%! result ((toascii("a"):toascii("f"))+1) = 1; +%! +%! assert(all (isxdigit (charset) == result)); + +%% test/octave.test/string/isxdigit-2.m +%!error isxdigit (1, 2); + +%% test/octave.test/string/isxdigit-3.m +%!error isxdigit (); +
new file mode 100644 --- /dev/null +++ b/test/test_struct.m @@ -0,0 +1,93 @@ +%% Automatically generated from DejaGNU files + +%% 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:.*> fieldnames (); + +%% test/octave.test/struct/fieldnames-4.m +%!test +%! s.a = 1; +%! fail("fieldnames (s, 1)","eldnames:.*"); + +%% 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:.*> isfield (); + +%% test/octave.test/struct/isfield-4.m +%!test +%! s.aaa = 1; +%! s.a = 2; +%! fail("isfield (s, 'a', 3);","field:.*"); + +%% 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"]))); + +%% 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:.*> isstruct (); + +%% test/octave.test/struct/isstruct-11.m +%!test +%! s.a = 1; +%! fail("isstruct (s, 1)","struct:.*"); +
new file mode 100644 --- /dev/null +++ b/test/test_switch.m @@ -0,0 +1,68 @@ +%% Automatically generated from DejaGNU files + +%% 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/octave.test/switch/switch-4.m +%!error <syntax error> eval("switch endswitch"); + +%% test/octave.test/switch/switch-5.m +%!error <syntax error> eval("switch case endswitch"); + +%% test/octave.test/switch/switch-6.m +%!error <syntax error> eval("switch 1 default 1; endswitch"); +
new file mode 100644 --- /dev/null +++ b/test/test_system.m @@ -0,0 +1,592 @@ +%% Automatically generated from DejaGNU files + +%% test/octave.test/system/time-1.m +%!assert(time () > 0); + +%% test/octave.test/system/ctime-1.m +%!test +%! t = time (); +%! assert(strcmp (asctime (localtime (t)), ctime (t))); + +%% test/octave.test/system/ctime-2.m +%!error ctime (); + +%% test/octave.test/system/ctime-3.m +%!error ctime (1, 2); + +%% test/octave.test/system/gmtime-1.m +%!test +%! ts = gmtime (time ()); +%! assert((isstruct (ts) +%! && struct_contains (ts, "usec") +%! && struct_contains (ts, "year") +%! && struct_contains (ts, "mon") +%! && struct_contains (ts, "mday") +%! && struct_contains (ts, "sec") +%! && struct_contains (ts, "min") +%! && struct_contains (ts, "wday") +%! && struct_contains (ts, "hour") +%! && struct_contains (ts, "isdst") +%! && struct_contains (ts, "yday"))); + +%% test/octave.test/system/gmtime-2.m +%!error <... gmtime:.*> gmtime (); + +%% test/octave.test/system/gmtime-3.m +%!error <... gmtime:.*> gmtime (1, 2); + +%% test/octave.test/system/localtime-1.m +%!test +%! ts = localtime (time ()); +%! assert((isstruct (ts) +%! && struct_contains (ts, "usec") +%! && struct_contains (ts, "year") +%! && struct_contains (ts, "mon") +%! && struct_contains (ts, "mday") +%! && struct_contains (ts, "sec") +%! && struct_contains (ts, "min") +%! && struct_contains (ts, "wday") +%! && struct_contains (ts, "hour") +%! && struct_contains (ts, "isdst") +%! && struct_contains (ts, "yday"))); + +%% test/octave.test/system/localtime-2.m +%!error <... localtime:.*> localtime (); + +%% test/octave.test/system/localtime-3.m +%!error <... localtime:.*> localtime (1, 2); + +%% test/octave.test/system/mktime-1.m +%!test +%! t = time (); +%! assert(fix (mktime (localtime (t))) == fix (t)); + +%% test/octave.test/system/mktime-2.m +%!error <... mktime:.*> mktime (); + +%% test/octave.test/system/mktime-3.m +%!error <... mktime:.*> mktime (1, 2, 3); + +%% test/octave.test/system/asctime-1.m +%!test +%! t = time (); +%! assert(strcmp (asctime (localtime (t)), ctime (t))); + +%% test/octave.test/system/asctime-2.m +%!error asctime (); + +%% test/octave.test/system/asctime-3.m +%!error asctime (1, 2); + +%% test/octave.test/system/strftime-1.m +%!assert((isstr (strftime ("%%%n%t%H%I%k%l", localtime (time ()))) +%! && isstr (strftime ("%M%p%r%R%s%S%T", localtime (time ()))) +%! && isstr (strftime ("%X%Z%z%a%A%b%B", localtime (time ()))) +%! && isstr (strftime ("%c%C%d%e%D%h%j", localtime (time ()))) +%! && isstr (strftime ("%m%U%w%W%x%y%Y", localtime (time ()))))); + +%% test/octave.test/system/strftime-2.m +%!error <... strftime:.*> strftime (); + +%% test/octave.test/system/strftime-3.m +%!error <... strftime:.*> strftime ("foo", localtime (time ()), 1); + +%% test/octave.test/system/clock-1.m +%!test +%! t1 = clock; +%! t2 = str2num (strftime ("[%Y, %m, %d, %H, %M, %S]", localtime (time ()))); +%! assert(etime (t1, t2) < 1); + +%% test/octave.test/system/date-1.m +%!assert(strcmp (date (), strftime ("%d-%b-%Y", localtime (time ())))); + +%% test/octave.test/system/etime-1.m +%!test +%! t1 = [1993, 8, 20, 4, 56, 1]; +%! t2 = [1993, 8, 21, 4, 56, 1]; +%! t3 = [1993, 8, 20, 5, 56, 1]; +%! t4 = [1993, 8, 20, 4, 57, 1]; +%! t5 = [1993, 8, 20, 4, 56, 14]; +%! +%! assert((etime (t2, t1) == 86400 && etime (t3, t1) == 3600 +%! && etime (t4, t1) == 60 && etime (t5, t1) == 13)); + +%% test/octave.test/system/etime-2.m +%!error etime (); + +%% test/octave.test/system/etime-3.m +%!error etime (1, 2, 3); + +%% 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 && t2 == u2 + s2 && t2 >= t1 && u2 >= u2 && s2 >= s2); + +%% test/octave.test/system/is_leap_year-1.m +%!assert((is_leap_year (2000) == 1 && is_leap_year (1976) == 1 +%! && is_leap_year (1000) == 0 && is_leap_year (1800) == 0 +%! && is_leap_year (1600) == 1)); + +%% test/octave.test/system/is_leap_year-2.m +%!error is_leap_year (1, 2); + +%% 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:.*> 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:.*> sleep (); + +%% test/octave.test/system/sleep-3.m +%!error <... sleep:.*> 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:.*> usleep (); + +%% test/octave.test/system/usleep-3.m +%!error <... usleep:.*> 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:.*> rename (); + +%% test/octave.test/system/rename-3.m +%!error <... rename:.*> 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:.*> unlink (); + +%% test/octave.test/system/unlink-3.m +%!error <... unlink:.*> unlink ("foo", 1); + +%% test/octave.test/system/readdir-1.m +%!test +%! [files, status, msg] = readdir ("/"); +%! assert(iscell (files) && status == 0 && msg == ""); + +%% test/octave.test/system/readdir-2.m +%!error <... readdir:.*> readdir (); + +%% test/octave.test/system/readdir-3.m +%!error <... readdir:.*> 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:.*> mkdir (); + +%% test/octave.test/system/mkdir-2.m +%!error <... mkdir:.*> mkdir ("foo", 1); + +%% test/octave.test/system/rmdir-1.m +%!error <... rmdir:.*> rmdir (); + +%% test/octave.test/system/rmdir-2.m +%!assert(!rmdir ("foo", 1)); + +%% XXX FIXME XXX This test messes up the path it seems!! Why? +%% test/octave.test/system/umask-1.m +%!#test +%! 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(strcmp (s1.modestr, "-rw-rw-rw-") && strcmp (s2.modestr, "----------")); + +%% test/octave.test/system/umask-2.m +%!error <... umask:.*> umask (); + +%% test/octave.test/system/umask-3.m +%!error <... umask:.*> umask (1, 2); + +%% test/octave.test/system/stat-1.m +%!test +%! [s, err, msg] = stat ("/"); +%! assert((err == 0 +%! && isstruct (s) +%! && struct_contains (s, "dev") +%! && struct_contains (s, "ino") +%! && struct_contains (s, "modestr") +%! && struct_contains (s, "nlink") +%! && struct_contains (s, "uid") +%! && struct_contains (s, "gid") +%! && struct_contains (s, "size") +%! && struct_contains (s, "atime") +%! && struct_contains (s, "mtime") +%! && struct_contains (s, "ctime") +%! && isstr (msg))); + +%% test/octave.test/system/stat-2.m +%!error <... stat:.*> stat (); + +%% test/octave.test/system/stat-3.m +%!error <... stat:.*> stat ("foo", 1); + +%% test/octave.test/system/lstat-1.m +%!test +%! [s, err, msg] = lstat ("/"); +%! assert((err == 0 +%! && isstruct (s) +%! && struct_contains (s, "dev") +%! && struct_contains (s, "ino") +%! && struct_contains (s, "modestr") +%! && struct_contains (s, "nlink") +%! && struct_contains (s, "uid") +%! && struct_contains (s, "gid") +%! && struct_contains (s, "size") +%! && struct_contains (s, "atime") +%! && struct_contains (s, "mtime") +%! && struct_contains (s, "ctime") +%! && isstr (msg))); + +%% test/octave.test/system/lstat-2.m +%!error <... lstat:.*> lstat (); + +%% test/octave.test/system/lstat-3.m +%!error <... lstat:.*> lstat ("foo", 1); + +%% test/octave.test/system/glob-1.m +%!assert(iscell (glob ("/*"))); + +%% test/octave.test/system/glob-2.m +%!error <... glob:*> glob (); + +%% test/octave.test/system/glob-3.m +%!error <... glob:.*> 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:.*> fnmatch (); + +%% test/octave.test/system/fnmatch-3.m +%!error <... fnmatch:.*> fnmatch ("foo", "bar", 3); + +%% test/octave.test/system/file_in_path-1.m +%!assert(isstr (file_in_path (LOADPATH, "date.m"))); + +%% test/octave.test/system/file_in_path-2.m +%!error <invalid option> file_in_path ("foo", "bar", 1); + +%% test/octave.test/system/file_in_path-3.m +%!error <... file_in_path:.*> file_in_path (); + +%% test/octave.test/system/file_in_path-4.m +%!error <... file_in_path:.*> file_in_path ("foo", "bar", "baz", "ooka"); + +%% test/octave.test/system/tilde_expand-1.m +%!test +%! 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:.*> tilde_expand (); + +%% test/octave.test/system/tilde_expand-3.m +%!error <... tilde_expand:.*> tilde_expand ("str", 2); + +%% test/octave.test/system/getpgrp-1.m +%!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 +%!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(strcmp (getenv ("HOME"), tilde_expand ("~"))); + +%% test/octave.test/system/getenv-2.m +%!error <... getenv:.*> getenv (); + +%% test/octave.test/system/getenv-3.m +%!error <... getenv:.*> getenv ("foo", 1); + +%% test/octave.test/system/getenv-4.m +%!test +%! wns = warn_num_to_str; +%! warn_num_to_str = 1; +%! fail("getenv (1)","warning"); +%! warn_num_to_str = wns; + +%% test/octave.test/system/putenv-1.m +%!test +%! putenv ("foobar", "baz"); +%! assert(strcmp (getenv ("foobar"), "baz")); + +%% test/octave.test/system/putenv-2.m +%!error <... putenv:.*> putenv (); + +%% test/octave.test/system/putenv-3.m +%!error <... putenv:.*> putenv ("foo", "bar", 1); + +%% test/octave.test/system/putenv-4.m +%!test +%! wns = warn_num_to_str; +%! warn_num_to_str = 1; +%! fail("putenv (1, 2)","warning"); +%! warn_num_to_str = wns; + +%% test/octave.test/system/cd-1.m +%!test +%! xdir = pwd (); +%! cd / +%! d1 = pwd (); +%! cd (xdir); +%! assert("/", d1); +%! assert(pwd(), xdir); + +%% test/octave.test/system/cd-2.m +%!error cd (1); + +%% test/octave.test/system/pwd-1.m +%!assert(isstr (pwd ())); + +%% test/octave.test/system/ls-1.m +%!error ls (1); + +%% test/octave.test/system/getpwent-1.m +%!test +%! s = getpwent (); +%! assert((isstruct (s) +%! && struct_contains (s, "name") +%! && struct_contains (s, "passwd") +%! && struct_contains (s, "uid") +%! && struct_contains (s, "gid") +%! && struct_contains (s, "gecos") +%! && struct_contains (s, "dir") +%! && struct_contains (s, "shell"))); + +%% test/octave.test/system/getpwent-2.m +%!error <... getpwent:.*> getpwent (1); + +%% test/octave.test/system/getpwuid-1.m +%!test +%! x = getpwent (); +%! y = getpwuid (x.uid); +%! +%! assert(strcmp (x.name, y.name) && x.uid == y.uid && x.gid == y.gid); + +%% test/octave.test/system/getpwuid-2.m +%!error <... getpwuid:.*> getpwuid (); + +%% test/octave.test/system/getpwuid-3.m +%!error <... getpwuid:.*> getpwuid (1, 2); + +%% test/octave.test/system/getpwnam-1.m +%!test +%! x = getpwent (); +%! y = getpwnam (x.name); +%! +%! assert(strcmp (x.name, y.name) && x.uid == y.uid && x.gid == y.gid); + +%% test/octave.test/system/getpwnam-2.m +%!error <... getpwnam:.*> getpwnam (); + +%% test/octave.test/system/getpwnam-3.m +%!error <... getpwnam:.*> getpwnam ("foo", 1); + +%% test/octave.test/system/setpwent-1.m +%!test +%! x = getpwent (); +%! setpwent (); +%! y = getpwent (); +%! +%! assert(strcmp (x.name, y.name) && x.uid == y.uid && x.gid == y.gid); + +%% test/octave.test/system/setpwent-2.m +%!error <... setpwent:.*> setpwent (1); + +%% test/octave.test/system/endpwent-1.m +%!error <... endpwent:.*> endpwent (1); + +%% test/octave.test/system/getgrent-1.m +%!test +%! x = getgrent (); +%! assert((isstruct (x) +%! && struct_contains (x, "name") +%! && struct_contains (x, "passwd") +%! && struct_contains (x, "gid") +%! && struct_contains (x, "mem"))); + +%% test/octave.test/system/getgrent-2.m +%!error <... getgrent:.*> getgrent (1); + +%% test/octave.test/system/getgrgid-1.m +%!test +%! x = getgrent (); +%! y = getgrgid (x.gid); +%! +%! assert(strcmp (x.name, y.name) && x.gid == y.gid); + +%% test/octave.test/system/getgrgid-2.m +%!error <... getgrgid:.*> getgrgid (); + +%% test/octave.test/system/getgrgid-3.m +%!error <... getgrgid:.*> getgrgid (1, 2); + +%% test/octave.test/system/getgrnam-1.m +%!test +%! x = getgrent (); +%! y = getgrnam (x.name); +%! +%! assert(strcmp (x.name, y.name) && x.gid == y.gid); + +%% test/octave.test/system/getgrnam-2.m +%!error <... getgrnam:.*> getgrnam (); + +%% test/octave.test/system/getgrnam-3.m +%!error <... getgrnam:.*> getgrnam ("foo", 1); + +%% test/octave.test/system/setgrent-1.m +%!test +%! x = getgrent (); +%! setgrent (); +%! y = getgrent (); +%! +%! assert(strcmp (x.name, y.name) && x.gid == y.gid); + +%% test/octave.test/system/setgrent-2.m +%!error <... setgrent:.*> setgrent (1); + +%% test/octave.test/system/endgrent-1.m +%!error <... endgrent:.*> endgrent (1); + +%% test/octave.test/system/computer-1.m +%!assert((isstr (computer ()) +%! && computer () == octave_config_info ("canonical_host_type"))); + +%% test/octave.test/system/computer-2.m +%!warning a =computer(2); + +%% test/octave.test/system/isieee-1.m +%!assert(isieee () == 1 || isieee () == 0); + +%% test/octave.test/system/version-1.m +%!assert(isstr (version ()) && strcmp (version (), OCTAVE_VERSION)); + +%% test/octave.test/system/version-2.m +%!warning version (1); + +%% test/octave.test/system/octave_config_info-1.m +%!assert(isstruct (octave_config_info ())); + +%% test/octave.test/system/getrusage-1.m +%!assert(isstruct (getrusage ())); +
new file mode 100644 --- /dev/null +++ b/test/test_transpose.m @@ -0,0 +1,22 @@ +%% Automatically generated from DejaGNU files + +%% test/octave.test/transpose/transpose-1.m +%!test +%! scalar = 2; +%! assert(scalar',2); + +%% test/octave.test/transpose/transpose-2.m +%!test +%! range = 1:4; +%! assert(range',[1;2;3;4]); + +%% test/octave.test/transpose/transpose-3.m +%!test +%! vector = [1;2;3;4]; +%! assert(vector',[1,2,3,4]); + +%% test/octave.test/transpose/transpose-4.m +%!test +%! matrix = [1,2;3,4]; +%! assert(matrix',[1,3;2,4]); +
new file mode 100644 --- /dev/null +++ b/test/test_try.m @@ -0,0 +1,123 @@ +%% Automatically generated from DejaGNU files + +%% 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 (strcmp(lasterr()(1:20), "error: `a' undefined")) +%! end_try_catch +%! assert (strcmp(lasterr()(1:20), "error: `a' undefined")) + +%% test/octave.test/try/try-6.m +%!test +%! try +%! error ("user-defined error") +%! catch +%! assert(lasterr,"error: user-defined error\n"); +%! end_try_catch + +%% test/octave.test/try/try-7.m +%!function ms = mangle (s) +%! ## Wrap angle brackets around S. +%! ms = strcat ("<", s, ">"); +%!test +%! try +%! clear a +%! a; +%! error("Shoudn't get here"); +%! catch +%! assert(strcmp(mangle (lasterr)(1:21),"<error: `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(strcmp(lasterr()(1:20), "error: `a' undefined")) +%! end_try_catch +%! clear b +%! b; +%! error("Shoudn't get here"); +%! catch +%! assert(strcmp(lasterr()(1:20), "error: `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(strcmp(lasterr()(1:20), "error: `a' undefined")) +%! clear b +%! b; +%! error("Shoudn't get here"); +%! catch +%! assert(strcmp(lasterr()(1:20), "error: `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(strcat("rethrow: ",lasterr)); +%! end_try_catch +%! catch +%! assert(strcmp(lasterr()(1:36), "error: rethrow: error: `a' undefined")) +%! end_try_catch +
new file mode 100644 --- /dev/null +++ b/test/test_unix.m @@ -0,0 +1,2 @@ +%% Automatically generated from DejaGNU files +
new file mode 100644 --- /dev/null +++ b/test/test_unwind.m @@ -0,0 +1,40 @@ +%% Automatically generated from DejaGNU files + +%% 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 +%!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 +%!test +%! global g = -1; +%! fail("y = f (3);","number of columns must match"); +
new file mode 100644 --- /dev/null +++ b/test/test_while.m @@ -0,0 +1,54 @@ +%% Automatically generated from DejaGNU files + +%% 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")); +