| 1 |
# Copyright (c) 2015-2026, The matio contributors |
| 2 |
# Copyright (c) 2010-2014, Christopher C. Hulbert |
| 3 |
# All rights reserved. |
| 4 |
# |
| 5 |
# Redistribution and use in source and binary forms, with or without |
| 6 |
# modification, are permitted provided that the following conditions are met: |
| 7 |
# |
| 8 |
# 1. Redistributions of source code must retain the above copyright notice, this |
| 9 |
# list of conditions and the following disclaimer. |
| 10 |
# |
| 11 |
# 2. Redistributions in binary form must reproduce the above copyright notice, |
| 12 |
# this list of conditions and the following disclaimer in the documentation |
| 13 |
# and/or other materials provided with the distribution. |
| 14 |
# |
| 15 |
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| 16 |
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 17 |
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 18 |
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
| 19 |
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 20 |
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
| 21 |
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
| 22 |
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
| 23 |
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 24 |
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 25 |
|
| 26 |
AT_SETUP([Write 2D double array]) |
| 27 |
AT_CHECK([$builddir/test_mat -v 4 -c double write_2d_numeric],[0],[],[]) |
| 28 |
AT_CHECK([cp $srcdir/results/write_2d_numeric-double.out expout |
| 29 |
$builddir/test_mat readvar test_write_2d_numeric.mat a],[0],[expout],[]) |
| 30 |
AT_SKIP_IF([test -z "$MATLABEXE"]) |
| 31 |
AT_CHECK([cp $srcdir/matlab/test_write_2d_numeric.m . |
| 32 |
$MATLABEXE -nosplash -nojvm -r "type='double';test_write_2d_numeric" | $GREP PASSED],[0],[PASSED |
| 33 |
],[]) |
| 34 |
AT_CLEANUP |
| 35 |
|
| 36 |
AT_SETUP([Write 2D single array]) |
| 37 |
AT_CHECK([$builddir/test_mat -v 4 -c single write_2d_numeric],[0],[],[]) |
| 38 |
AT_CHECK([cp $srcdir/results/write_2d_numeric-double.out expout |
| 39 |
$builddir/test_mat readvar test_write_2d_numeric.mat a],[0],[expout],[]) |
| 40 |
AT_SKIP_IF([test -z "$MATLABEXE"]) |
| 41 |
AT_CHECK([cp $srcdir/matlab/test_write_2d_numeric.m . |
| 42 |
$MATLABEXE -nosplash -nojvm -r "type='double';test_write_2d_numeric" | $GREP PASSED],[0],[PASSED |
| 43 |
],[]) |
| 44 |
AT_CLEANUP |
| 45 |
|
| 46 |
AT_SETUP([Write 2D int32 array]) |
| 47 |
AT_CHECK([$builddir/test_mat -v 4 -c int32 write_2d_numeric],[0],[],[]) |
| 48 |
AT_CHECK([cp $srcdir/results/write_2d_numeric-double.out expout |
| 49 |
$builddir/test_mat readvar test_write_2d_numeric.mat a],[0],[expout],[]) |
| 50 |
AT_SKIP_IF([test -z "$MATLABEXE"]) |
| 51 |
AT_CHECK([cp $srcdir/matlab/test_write_2d_numeric.m . |
| 52 |
$MATLABEXE -nosplash -nojvm -r "type='double';test_write_2d_numeric" | $GREP PASSED],[0],[PASSED |
| 53 |
],[]) |
| 54 |
AT_CLEANUP |
| 55 |
|
| 56 |
AT_SETUP([Write 2D int16 array]) |
| 57 |
AT_CHECK([$builddir/test_mat -v 4 -c int16 write_2d_numeric],[0],[],[]) |
| 58 |
AT_CHECK([cp $srcdir/results/write_2d_numeric-double.out expout |
| 59 |
$builddir/test_mat readvar test_write_2d_numeric.mat a],[0],[expout],[]) |
| 60 |
AT_SKIP_IF([test -z "$MATLABEXE"]) |
| 61 |
AT_CHECK([cp $srcdir/matlab/test_write_2d_numeric.m . |
| 62 |
$MATLABEXE -nosplash -nojvm -r "type='double';test_write_2d_numeric" | $GREP PASSED],[0],[PASSED |
| 63 |
],[]) |
| 64 |
AT_CLEANUP |
| 65 |
|
| 66 |
AT_SETUP([Write 2D uint16 array]) |
| 67 |
AT_CHECK([$builddir/test_mat -v 4 -c uint16 write_2d_numeric],[0],[],[]) |
| 68 |
AT_CHECK([cp $srcdir/results/write_2d_numeric-double.out expout |
| 69 |
$builddir/test_mat readvar test_write_2d_numeric.mat a],[0],[expout],[]) |
| 70 |
AT_SKIP_IF([test -z "$MATLABEXE"]) |
| 71 |
AT_CHECK([cp $srcdir/matlab/test_write_2d_numeric.m . |
| 72 |
$MATLABEXE -nosplash -nojvm -r "type='double';test_write_2d_numeric" | $GREP PASSED],[0],[PASSED |
| 73 |
],[]) |
| 74 |
AT_CLEANUP |
| 75 |
|
| 76 |
AT_SETUP([Write 2D uint8 array]) |
| 77 |
AT_CHECK([$builddir/test_mat -v 4 -c uint8 write_2d_numeric],[0],[],[]) |
| 78 |
AT_CHECK([cp $srcdir/results/write_2d_numeric-double.out expout |
| 79 |
$builddir/test_mat readvar test_write_2d_numeric.mat a],[0],[expout],[]) |
| 80 |
AT_SKIP_IF([test -z "$MATLABEXE"]) |
| 81 |
AT_CHECK([cp $srcdir/matlab/test_write_2d_numeric.m . |
| 82 |
$MATLABEXE -nosplash -nojvm -r "type='double';test_write_2d_numeric" | $GREP PASSED],[0],[PASSED |
| 83 |
],[]) |
| 84 |
AT_CLEANUP |
| 85 |
|
| 86 |
AT_SETUP([Write 2D complex double array]) |
| 87 |
AT_CHECK([$builddir/test_mat -v 4 -c double write_complex_2d_numeric],[0],[],[]) |
| 88 |
AT_CHECK([cp $srcdir/results/write_complex_2d_numeric-double.out expout |
| 89 |
$builddir/test_mat readvar test_write_complex_2d_numeric.mat a],[0],[expout],[]) |
| 90 |
AT_SKIP_IF([test -z "$MATLABEXE"]) |
| 91 |
AT_CHECK([cp $srcdir/matlab/test_write_complex_2d_numeric.m . |
| 92 |
$MATLABEXE -nosplash -nojvm -r "type='double';test_write_complex_2d_numeric" | $GREP PASSED],[0],[PASSED |
| 93 |
],[]) |
| 94 |
AT_CLEANUP |
| 95 |
|
| 96 |
AT_SETUP([Write 2D complex single array]) |
| 97 |
AT_CHECK([$builddir/test_mat -v 4 -c single write_complex_2d_numeric],[0],[],[]) |
| 98 |
AT_CHECK([cp $srcdir/results/write_complex_2d_numeric-double.out expout |
| 99 |
$builddir/test_mat readvar test_write_complex_2d_numeric.mat a],[0],[expout],[]) |
| 100 |
AT_SKIP_IF([test -z "$MATLABEXE"]) |
| 101 |
AT_CHECK([cp $srcdir/matlab/test_write_complex_2d_numeric.m . |
| 102 |
$MATLABEXE -nosplash -nojvm -r "type='double';test_write_complex_2d_numeric" | $GREP PASSED],[0],[PASSED |
| 103 |
],[]) |
| 104 |
AT_CLEANUP |
| 105 |
|
| 106 |
AT_SETUP([Write 2D complex int32 array]) |
| 107 |
AT_CHECK([$builddir/test_mat -v 4 -c int32 write_complex_2d_numeric],[0],[],[]) |
| 108 |
AT_CHECK([cp $srcdir/results/write_complex_2d_numeric-double.out expout |
| 109 |
$builddir/test_mat readvar test_write_complex_2d_numeric.mat a],[0],[expout],[]) |
| 110 |
AT_SKIP_IF([test -z "$MATLABEXE"]) |
| 111 |
AT_CHECK([cp $srcdir/matlab/test_write_complex_2d_numeric.m . |
| 112 |
$MATLABEXE -nosplash -nojvm -r "type='double';test_write_complex_2d_numeric" | $GREP PASSED],[0],[PASSED |
| 113 |
],[]) |
| 114 |
AT_CLEANUP |
| 115 |
|
| 116 |
AT_SETUP([Write 2D complex int16 array]) |
| 117 |
AT_CHECK([$builddir/test_mat -v 4 -c int16 write_complex_2d_numeric],[0],[],[]) |
| 118 |
AT_CHECK([cp $srcdir/results/write_complex_2d_numeric-double.out expout |
| 119 |
$builddir/test_mat readvar test_write_complex_2d_numeric.mat a],[0],[expout],[]) |
| 120 |
AT_SKIP_IF([test -z "$MATLABEXE"]) |
| 121 |
AT_CHECK([cp $srcdir/matlab/test_write_complex_2d_numeric.m . |
| 122 |
$MATLABEXE -nosplash -nojvm -r "type='double';test_write_complex_2d_numeric" | $GREP PASSED],[0],[PASSED |
| 123 |
],[]) |
| 124 |
AT_CLEANUP |
| 125 |
|
| 126 |
AT_SETUP([Write 2D complex uint16 array]) |
| 127 |
AT_CHECK([$builddir/test_mat -v 4 -c uint16 write_complex_2d_numeric],[0],[],[]) |
| 128 |
AT_CHECK([cp $srcdir/results/write_complex_2d_numeric-double.out expout |
| 129 |
$builddir/test_mat readvar test_write_complex_2d_numeric.mat a],[0],[expout],[]) |
| 130 |
AT_SKIP_IF([test -z "$MATLABEXE"]) |
| 131 |
AT_CHECK([cp $srcdir/matlab/test_write_complex_2d_numeric.m . |
| 132 |
$MATLABEXE -nosplash -nojvm -r "type='double';test_write_complex_2d_numeric" | $GREP PASSED],[0],[PASSED |
| 133 |
],[]) |
| 134 |
AT_CLEANUP |
| 135 |
|
| 136 |
AT_SETUP([Write 2D complex uint8 array]) |
| 137 |
AT_CHECK([$builddir/test_mat -v 4 -c uint8 write_complex_2d_numeric],[0],[],[]) |
| 138 |
AT_CHECK([cp $srcdir/results/write_complex_2d_numeric-double.out expout |
| 139 |
$builddir/test_mat readvar test_write_complex_2d_numeric.mat a],[0],[expout],[]) |
| 140 |
AT_SKIP_IF([test -z "$MATLABEXE"]) |
| 141 |
AT_CHECK([cp $srcdir/matlab/test_write_complex_2d_numeric.m . |
| 142 |
$MATLABEXE -nosplash -nojvm -r "type='double';test_write_complex_2d_numeric" | $GREP PASSED],[0],[PASSED |
| 143 |
],[]) |
| 144 |
AT_CLEANUP |
| 145 |
|
| 146 |
AT_SETUP([Write 2D sparse double array]) |
| 147 |
AT_CHECK([$builddir/test_mat -v 4 -c double write_sparse],[0],[],[]) |
| 148 |
AT_CHECK([cp $srcdir/results/readvar-write_sparse-sparse_matrix-double.out expout |
| 149 |
$builddir/test_mat readvar test_write_sparse.mat sparse_matrix],[0],[expout],[]) |
| 150 |
AT_SKIP_IF([test -z "$MATLABEXE"]) |
| 151 |
AT_CHECK([cp $srcdir/matlab/test_write_sparse.m . |
| 152 |
$MATLABEXE -nosplash -nojvm -r "test_write_sparse" | $GREP PASSED],[0],[PASSED |
| 153 |
],[]) |
| 154 |
AT_CLEANUP |
| 155 |
|
| 156 |
AT_SETUP([Write 2D sparse complex double array]) |
| 157 |
AT_CHECK([$builddir/test_mat -v 4 -c double write_complex_sparse],[0],[],[]) |
| 158 |
AT_CHECK([cp $srcdir/results/readvar-write_complex_sparse-sparse_matrix-double.out expout |
| 159 |
$builddir/test_mat readvar test_write_sparse_complex.mat sparse_matrix],[0],[expout],[]) |
| 160 |
AT_SKIP_IF([test -z "$MATLABEXE"]) |
| 161 |
AT_CHECK([cp $srcdir/matlab/test_write_sparse_complex.m . |
| 162 |
$MATLABEXE -nosplash -nojvm -r "test_write_sparse_complex" | $GREP PASSED],[0],[PASSED |
| 163 |
],[]) |
| 164 |
AT_CLEANUP |
| 165 |
|
| 166 |
AT_SETUP([Write 2D all-zero sparse double array]) |
| 167 |
AT_CHECK([$builddir/test_mat -v 4 -c double write_allzero_sparse],[0],[],[]) |
| 168 |
AT_CHECK([cp $srcdir/results/readvar-write_allzero_sparse-sparse_matrix-double.out expout |
| 169 |
$builddir/test_mat readvar test_write_allzero_sparse.mat sparse_matrix],[0],[expout],[]) |
| 170 |
AT_SKIP_IF([test -z "$MATLABEXE"]) |
| 171 |
AT_CHECK([cp $srcdir/matlab/test_write_allzero_sparse.m . |
| 172 |
$MATLABEXE -nosplash -nojvm -r "test_write_allzero_sparse" | $GREP PASSED],[0],[PASSED |
| 173 |
],[]) |
| 174 |
AT_CLEANUP |
| 175 |
|
| 176 |
AT_SETUP([Write 2D empty array]) |
| 177 |
AT_KEYWORDS([empty]) |
| 178 |
AT_CHECK([$builddir/test_mat -v 4 -c double write_empty_2d_numeric],[0],[],[]) |
| 179 |
AT_CHECK([cp $srcdir/results/readvar-write_empty_2d_numeric-empty.out expout |
| 180 |
$builddir/test_mat readvar test_write_empty_2d_numeric.mat empty],[0],[expout],[]) |
| 181 |
AT_SKIP_IF([test -z "$MATLABEXE"]) |
| 182 |
AT_CHECK([cp $srcdir/matlab/test_write_empty.m . |
| 183 |
$MATLABEXE -nosplash -nojvm -r "test_write_empty" | $GREP PASSED],[0],[PASSED |
| 184 |
],[]) |
| 185 |
AT_CLEANUP |
| 186 |
|
| 187 |
AT_SETUP([Write 2D character array]) |
| 188 |
AT_CHECK([$builddir/test_mat -v 4 write_char_2d],[0],[],[]) |
| 189 |
AT_CHECK([cp $srcdir/results/readvar-write_char_2d-a.out expout |
| 190 |
$builddir/test_mat readvar test_write_char_2d.mat a],[0],[expout],[]) |
| 191 |
AT_SKIP_IF([test -z "$MATLABEXE"]) |
| 192 |
AT_CHECK([cp $srcdir/matlab/test_write_char_2d.m . |
| 193 |
$MATLABEXE -nosplash -nojvm -r "test_write_char_2d" | $GREP PASSED],[0],[PASSED |
| 194 |
],[]) |
| 195 |
AT_CLEANUP |