annotate test/mk-conv-tst.sh @ 31191:bb9d776eafac stable

Fix wrong color in PDF printout of some latex strings (bug #62884) * octave-svgconvert (draw): For "rect" elements only set brush color if necessary and eventually restore to previous color.
author Pantxo Diribarne <pantxo.diribarne@gmail.com>
date Sun, 14 Aug 2022 18:24:07 +0200
parents 95725e6ad9c1
children 597f3ee61a48
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
22284
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
1 #!/bin/sh
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
2
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
3 ########################################################################
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
4 ##
30564
796f54d4ddbf update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents: 29982
diff changeset
5 ## Copyright (C) 2016-2022 The Octave Project Developers
27918
b442ec6dda5c use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
6 ##
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
7 ## See the file COPYRIGHT.md in the top-level directory of this
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
8 ## distribution or <https://octave.org/copyright/>.
22799
592fa741e0aa add missing copyright notices (bug #49624)
John W. Eaton <jwe@octave.org>
parents: 22324
diff changeset
9 ##
592fa741e0aa add missing copyright notices (bug #49624)
John W. Eaton <jwe@octave.org>
parents: 22324
diff changeset
10 ## This file is part of Octave.
592fa741e0aa add missing copyright notices (bug #49624)
John W. Eaton <jwe@octave.org>
parents: 22324
diff changeset
11 ##
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 23710
diff changeset
12 ## Octave is free software: you can redistribute it and/or modify it
22799
592fa741e0aa add missing copyright notices (bug #49624)
John W. Eaton <jwe@octave.org>
parents: 22324
diff changeset
13 ## under the terms of the GNU General Public License as published by
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 23710
diff changeset
14 ## the Free Software Foundation, either version 3 of the License, or
22799
592fa741e0aa add missing copyright notices (bug #49624)
John W. Eaton <jwe@octave.org>
parents: 22324
diff changeset
15 ## (at your option) any later version.
592fa741e0aa add missing copyright notices (bug #49624)
John W. Eaton <jwe@octave.org>
parents: 22324
diff changeset
16 ##
592fa741e0aa add missing copyright notices (bug #49624)
John W. Eaton <jwe@octave.org>
parents: 22324
diff changeset
17 ## Octave is distributed in the hope that it will be useful, but
592fa741e0aa add missing copyright notices (bug #49624)
John W. Eaton <jwe@octave.org>
parents: 22324
diff changeset
18 ## WITHOUT ANY WARRANTY; without even the implied warranty of
592fa741e0aa add missing copyright notices (bug #49624)
John W. Eaton <jwe@octave.org>
parents: 22324
diff changeset
19 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
592fa741e0aa add missing copyright notices (bug #49624)
John W. Eaton <jwe@octave.org>
parents: 22324
diff changeset
20 ## GNU General Public License for more details.
592fa741e0aa add missing copyright notices (bug #49624)
John W. Eaton <jwe@octave.org>
parents: 22324
diff changeset
21 ##
592fa741e0aa add missing copyright notices (bug #49624)
John W. Eaton <jwe@octave.org>
parents: 22324
diff changeset
22 ## You should have received a copy of the GNU General Public License
592fa741e0aa add missing copyright notices (bug #49624)
John W. Eaton <jwe@octave.org>
parents: 22324
diff changeset
23 ## along with Octave; see the file COPYING. If not, see
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 23710
diff changeset
24 ## <https://www.gnu.org/licenses/>.
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
25 ##
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
26 ########################################################################
22799
592fa741e0aa add missing copyright notices (bug #49624)
John W. Eaton <jwe@octave.org>
parents: 22324
diff changeset
27
22284
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
28 cat <<EOF
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
29 ## !!! DO NOT EDIT !!!
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
30 ## THIS IS AN AUTOMATICALLY GENERATED FILE
28629
af361aea02e0 allow tests to work when disable_range is true
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
31 ## modify mk-conv-tst.sh to generate the tests you need.
22284
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
32
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
33
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
34 %!shared r,dq,sq,b,bm,dm,cdm,fdm,fcdm,pm,sm,sbm,scm,s,m,cs,cm,fs,fm,fcs,fcm,i8s,i16s,i32s,i64s,i8m,i16m,i32m,i64m,ui8s,ui16s,ui32s,ui64s,ui8m,ui16m,ui32m,ui64m
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
35 %!test
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
36 %! r = 1:5;
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
37 %! dq = "foo";
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
38 %! sq = 'bar';
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
39 %! b = true;
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
40 %! bm = rand (5) > 0.5;
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
41 %! dm = eye (5);
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
42 %! cdm = eye (5) * i;
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
43 %! fdm = eye (5, "single");
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
44 %! fcdm = eye (5, "single") * single (i);
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
45 %! [~, ~, pm] = qr (rand (5));
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
46 %! sm = sprand (5, 5, 0.1);
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
47 %! sbm = sparse (rand (5) > 0.5);
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
48 %! scm = sprand (5, 5, 0.1) * i;
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
49 %! s = rand ();
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
50 %! m = rand (5);
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
51 %! cs = 13 * i;
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
52 %! cm = rand (5) * i;
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
53 %! fs = rand ("single");
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
54 %! fm = rand (5, "single");
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
55 %! fcs = rand ("single") * single (i);
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
56 %! fcm = rand (5, "single") * single (i);
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
57 %! i8s = int8 (rand () * 10);
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
58 %! i16s = int16 (rand () * 10);
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
59 %! i32s = int32 (rand () * 10);
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
60 %! i64s = int64 (rand () * 10);
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
61 %! i8m = int8 (rand (5) * 10);
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
62 %! i16m = int16 (rand (5) * 10);
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
63 %! i32m = int32 (rand (5) * 10);
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
64 %! i64m = int64 (rand (5) * 10);
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
65 %! ui8s = uint8 (rand () * 10);
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
66 %! ui16s = uint16 (rand () * 10);
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
67 %! ui32s = uint32 (rand () * 10);
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
68 %! ui64s = uint64 (rand () * 10);
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
69 %! ui8m = uint8 (rand (5) * 10);
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
70 %! ui16m = uint16 (rand (5) * 10);
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
71 %! ui32m = uint32 (rand (5) * 10);
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
72 %! ui64m = uint64 (rand (5) * 10);
22324
6d54ecbfb50a maint: Strip trailing whitespace from source files.
John W. Eaton <jwe@octave.org>
parents: 22284
diff changeset
73 %!
28629
af361aea02e0 allow tests to work when disable_range is true
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
74 %!test
29982
605275522c37 Deprecate disable_range, disable_diagonal_matrix, disable_permutation_matrix.
Rik <rik@octave.org>
parents: 29359
diff changeset
75 %! if (optimize_range ())
30852
95725e6ad9c1 restore part of the old octave_range class as octave_legacy_range
John W. Eaton <jwe@octave.org>
parents: 30564
diff changeset
76 %! assert (typeinfo (r), "double_range")
29982
605275522c37 Deprecate disable_range, disable_diagonal_matrix, disable_permutation_matrix.
Rik <rik@octave.org>
parents: 29359
diff changeset
77 %! else
28629
af361aea02e0 allow tests to work when disable_range is true
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
78 %! assert (typeinfo (r), "matrix")
af361aea02e0 allow tests to work when disable_range is true
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
79 %! endif
22284
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
80 %!assert (typeinfo (dq), "string")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
81 %!assert (typeinfo (sq), "sq_string")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
82 %!assert (typeinfo (b), "bool")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
83 %!assert (typeinfo (bm), "bool matrix")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
84 %!assert (typeinfo (dm), "diagonal matrix")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
85 %!assert (typeinfo (cdm), "complex diagonal matrix")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
86 %!assert (typeinfo (fdm), "float diagonal matrix")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
87 %!assert (typeinfo (fcdm), "float complex diagonal matrix")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
88 %!assert (typeinfo (pm), "permutation matrix")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
89 %!assert (typeinfo (sm), "sparse matrix")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
90 %!assert (typeinfo (sbm), "sparse bool matrix")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
91 %!assert (typeinfo (scm), "sparse complex matrix")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
92 %!assert (typeinfo (s), "scalar")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
93 %!assert (typeinfo (m), "matrix")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
94 %!assert (typeinfo (cs), "complex scalar")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
95 %!assert (typeinfo (cm), "complex matrix")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
96 %!assert (typeinfo (fs), "float scalar")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
97 %!assert (typeinfo (fm), "float matrix")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
98 %!assert (typeinfo (fcs), "float complex scalar")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
99 %!assert (typeinfo (fcm), "float complex matrix")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
100 %!assert (typeinfo (i8s), "int8 scalar")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
101 %!assert (typeinfo (i16s), "int16 scalar")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
102 %!assert (typeinfo (i32s), "int32 scalar")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
103 %!assert (typeinfo (i64s), "int64 scalar")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
104 %!assert (typeinfo (i8m), "int8 matrix")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
105 %!assert (typeinfo (i16m), "int16 matrix")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
106 %!assert (typeinfo (i32m), "int32 matrix")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
107 %!assert (typeinfo (i64m), "int64 matrix")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
108 %!assert (typeinfo (ui8s), "uint8 scalar")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
109 %!assert (typeinfo (ui16s), "uint16 scalar")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
110 %!assert (typeinfo (ui32s), "uint32 scalar")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
111 %!assert (typeinfo (ui64s), "uint64 scalar")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
112 %!assert (typeinfo (ui8m), "uint8 matrix")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
113 %!assert (typeinfo (ui16m), "uint16 matrix")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
114 %!assert (typeinfo (ui32m), "uint32 matrix")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
115 %!assert (typeinfo (ui64m), "uint64 matrix")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
116 %!
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
117 %!assert (class (r), "double")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
118 %!assert (class (dq), "char")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
119 %!assert (class (sq), "char")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
120 %!assert (class (b), "logical")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
121 %!assert (class (bm), "logical")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
122 %!assert (class (dm), "double")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
123 %!assert (class (cdm), "double")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
124 %!assert (class (fdm), "single")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
125 %!assert (class (fcdm), "single")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
126 %!assert (class (pm), "double")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
127 %!assert (class (sm), "double")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
128 %!assert (class (sbm), "logical")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
129 %!assert (class (scm), "double")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
130 %!assert (class (s), "double")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
131 %!assert (class (m), "double")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
132 %!assert (class (cs), "double")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
133 %!assert (class (cm), "double")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
134 %!assert (class (fs), "single")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
135 %!assert (class (fm), "single")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
136 %!assert (class (fcs), "single")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
137 %!assert (class (fcm), "single")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
138 %!assert (class (i8s), "int8")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
139 %!assert (class (i16s), "int16")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
140 %!assert (class (i32s), "int32")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
141 %!assert (class (i64s), "int64")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
142 %!assert (class (i8m), "int8")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
143 %!assert (class (i16m), "int16")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
144 %!assert (class (i32m), "int32")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
145 %!assert (class (i64m), "int64")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
146 %!assert (class (ui8s), "uint8")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
147 %!assert (class (ui16s), "uint16")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
148 %!assert (class (ui32s), "uint32")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
149 %!assert (class (ui64s), "uint64")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
150 %!assert (class (ui8m), "uint8")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
151 %!assert (class (ui16m), "uint16")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
152 %!assert (class (ui32m), "uint32")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
153 %!assert (class (ui64m), "uint64")
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
154 EOF
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
155
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
156 ## There are no single or integer sparse matrices.
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
157
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
158 sparse_vars="sm sbm scm"
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
159 sparse_conversions="double logical"
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
160
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
161 for c in $sparse_conversions; do
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
162 echo ""
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
163 for v in $sparse_vars; do
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
164 echo "%!assert (class ($c ($v)), \"$c\")"
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
165 done
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
166 done
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
167
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
168 char_vars="dq sq"
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
169 bool_vars="b bm"
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
170 real_vars="r s m fs fm dm fdm pm"
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
171 complex_vars="cs cm fcs fcm cdm fcdm"
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
172 signed_int_vars="i8s i16s i32s i64s i8m i16m i32m i64m"
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
173 unsigned_int_vars="ui8s ui16s ui32s ui64s ui8m ui16m ui32m ui64m"
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
174 int_vars="$signed_int_vars $unsigned_int_vars"
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
175
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
176 bool_conversions="logical"
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
177 float_conversions="double single"
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
178 int_conversions="int8 int16 int32 int64 uint8 uint16 uint32 uint64"
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
179 all_conversions="$bool_conversions $float_conversions $int_conversions"
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
180
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
181 ## Strings can't be converted to logical.
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
182
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
183 for v in $char_vars; do
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
184 echo ""
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
185 for c in $float_conversions $int_conversions; do
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
186 echo "%!assert (class ($c ($v)), \"$c\")"
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
187 done
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
188 done
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
189
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
190 ## Octave doesn't have complex integers.
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
191
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
192 for v in $complex_vars; do
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
193 echo ""
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
194 for c in $bool_conversions $float_conversions; do
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
195 echo "%!assert (class ($c ($v)), \"$c\")"
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
196 done
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
197 done
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
198
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
199 ## Logical and real-value numeric values should be convertible to any
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
200 ## double, single, logical or integer type.
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
201
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
202 for v in $bool_vars $real_vars $int_vars; do
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
203 echo ""
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
204 for c in $all_conversions; do
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
205 echo "%!assert (class ($c ($v)), \"$c\")"
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
206 done
a7e68243a326 new tests for type conversions
John W. Eaton <jwe@octave.org>
parents:
diff changeset
207 done