2 * test3300 - 3300 series of the regress.cal test suite
4 * Copyright (C) 1999 Ernest Bowen and Landon Curt Noll
6 * Primary author: Ernest Bowen
8 * Calc is open software; you can redistribute it and/or modify it under
9 * the terms of the version 2.1 of the GNU Lesser General Public License
10 * as published by the Free Software Foundation.
12 * Calc is distributed in the hope that it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
15 * Public License for more details.
17 * A copy of version 2.1 of the GNU Lesser General Public License is
18 * distributed with calc under the filename COPYING-LGPL. You should have
19 * received a copy with calc; if not, write to Free Software Foundation, Inc.
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 * @(#) $Revision: 30.1 $
23 * @(#) $Id: test3300.cal,v 30.1 2007/03/16 11:09:54 chongo Exp $
24 * @(#) $Source: /usr/local/src/bin/calc/cal/RCS/test3300.cal,v $
26 * Under source code control: 1995/12/02 04:27:41
27 * File existed as early as: 1995
29 * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
33 defaultverbose = 1; /* default verbose value */
35 define testi(str, n, N, verbose)
37 local A, t, i, j, d1, d2;
40 if (isnull(verbose)) verbose = defaultverbose;
47 for (i = 0; i < n; i++)
48 for (j = 0; j < n; j++)
56 printf("*** Failure for n=%d, N=%d, d1=%d\n", n, N, d1);
61 printf("no errors\n");
64 printf("ok: n=%d, N=%d, d1=%d, t=%d\n", n, N, d1, t);
70 define testr(str, n, N, verbose)
72 local A, t, i, j, d1, d2;
74 if (isnull(verbose)) verbose = defaultverbose;
81 for (i = 0; i < n; i++)
82 for (j = 0; j < n; j++)
83 A[i,j] = rand(-(N^2), N^2)/rand(1, N);
90 printf("*** Failure for n=%d, N=%d, d1=%d\n", n, N, d1);
95 printf("no errors\n");
98 printf("ok: n=%d, N=%d, d1=%d, t=%d\n", n, N, d1, t);
105 * test3300 - perform all of the above tests a bunch of times
107 define test3300(verbose, tnum)
109 local N; /* test parameter */
113 * set test parameters
115 if (isnull(verbose)) {
116 verbose = defaultverbose;
122 * test a lot of stuff
124 for (i=0; i < 19; ++i) {
125 err += testi(strcat(str(tnum++), ": testi(", str(i), ")"), \
128 for (i=0; i < 9; ++i) {
129 err += testr(strcat(str(tnum++), ": testr(", str(i), ")"), \
138 print "***", err, "error(s) found in testall";
140 print "no errors in testall";