comparison test/test_io.m @ 5948:8b4d38c76bfa

[project @ 2006-08-22 01:20:22 by jwe]
author jwe
date Tue, 22 Aug 2006 01:20:22 +0000
parents ace8d8d26933
children 2b2e5a937c59
comparison
equal deleted inserted replaced
5947:009fa69b6182 5948:8b4d38c76bfa
78 %! 78 %!
79 %! clear a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 a19 a20; 79 %! clear a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 a19 a20;
80 %! 80 %!
81 %! file = f{1}; 81 %! file = f{1};
82 %! 82 %!
83 %! eval(["load -force " file]); 83 %! load (file);
84 %! 84 %!
85 %! if (a1 != b1) 85 %! if (! isequal (a1, b1))
86 %! error(["failed: " file " scalar"]) 86 %! error ("failed: %s scalar", file)
87 %! endif 87 %! endif
88 %! if (a2 != b2) 88 %!
89 %! error(["failed: " file " matrix"]); 89 %! if (! isequal (a2, b2))
90 %! endif 90 %! error ("failed: %s matrix", file);
91 %! if (a3 != b3) 91 %! endif
92 %! error(["failed: " file " complex scalar"]); 92 %!
93 %! endif 93 %! if (! isequal (a3, b3))
94 %! if (a4 != b4) 94 %! error ("failed: %s complex scalar", file);
95 %! error(["failed: " file " complex matrix"]); 95 %! endif
96 %! endif 96 %!
97 %! if (a5 != b5) 97 %! if (! isequal (a4, b4))
98 %! error(["failed: " file " boolean"]); 98 %! error ("failed: %s complex matrix", file);
99 %! endif 99 %! endif
100 %! if (!strcmp (file,"mat5") && !strcmp(file,"mat7")) 100 %!
101 %! if (a6 != b6) 101 %! if (! isequal (a5, b5))
102 %! error(["failed: " file " boolean matrix"]); 102 %! error ("failed: %s boolean", file);
103 %! endif
104 %!
105 %! if (! strcmp (file, "mat5") && ! strcmp (file, "mat7"))
106 %! if (! isequal (a6, b6))
107 %! error ("failed: %s boolean matrix", file);
103 %! endif 108 %! endif
104 %! endif 109 %! endif
105 %! if (a7 != b7) 110 %!
106 %! error(["failed: " file " range"]); 111 %! if (! isequal (a7, b7))
107 %! endif 112 %! error ("failed: %s range", file);
108 %! 113 %! endif
109 %! ## != not implemented for structs!!!! 114 %!
110 %! if (!isstruct(a8) || (length(fieldnames(a8)) != 2) || !isfield(a8,"a") 115 %! if (! isequal (a8, b8))
111 %! || !isfield(a8,"b") || (a8.a != b8.a) || (a8.b != b8.b)) 116 %! error ("failed: %s struct", file);
112 %! error(["failed: " file " struct"]);
113 %! endif 117 %! endif
114 %! 118 %!
115 %! ## != not implemented for cell arrays!!!! 119 %! if (! isequal (a9, b9))
116 %! if (!iscell(a9) || (size(a9) != size(b9)) || (a9{1} != b9{1}) 120 %! error ("failed: %s cell", file);
117 %! || (a9{2} != b9{2}))
118 %! error(["failed: " file " cell"]);
119 %! endif 121 %! endif
120 %! 122 %!
121 %! if (a10 != b10) 123 %! if (! isequal (a10, b10))
122 %! error(["failed: " file " string"]); 124 %! error ("failed: %s string", file);
123 %! endif 125 %! endif
124 %! 126 %!
125 %! if (a11 != b11) 127 %! if (! isequal (a11, b11))
126 %! error(["failed: " file " int8"]); 128 %! error ("failed: %s int8", file);
127 %! endif 129 %! endif
128 %! 130 %!
129 %! if (a12 != b12) 131 %! if (! isequal (a12, b12))
130 %! error(["failed: " file " int16"]); 132 %! error ("failed: %s int16", file);
131 %! endif 133 %! endif
132 %! 134 %!
133 %! if (a13 != b13) 135 %! if (! isequal (a13, b13))
134 %! error(["failed: " file " int32"]); 136 %! error ("failed: %s int32", file);
135 %! endif 137 %! endif
136 %! 138 %!
137 %! if (a14 != b14) 139 %! if (! isequal (a14, b14))
138 %! error(["failed: " file " int64"]); 140 %! error ("failed: %s int64", file);
139 %! endif 141 %! endif
140 %! 142 %!
141 %! if (a15 != b15) 143 %! if (! isequal (a15, b15))
142 %! error(["failed: " file " uint8"]); 144 %! error ("failed: %s uint8", file);
143 %! endif 145 %! endif
144 %! 146 %!
145 %! if (a16 != b16) 147 %! if (! isequal (a16, b16))
146 %! error(["failed: " file " uint16"]); 148 %! error ("failed: %s uint16", file);
147 %! endif 149 %! endif
148 %! 150 %!
149 %! if (a17 != b17) 151 %! if (! isequal (a17, b17))
150 %! error(["failed: " file " uint32"]); 152 %! error ("failed: %s uint32", file);
151 %! endif 153 %! endif
152 %! 154 %!
153 %! if (a18 != b18) 155 %! if (! isequal (a18, b18))
154 %! error(["failed: " file " uint64"]); 156 %! error ("failed: %s uint64", file);
155 %! endif 157 %! endif
156 %! 158 %!
157 %! if (a19 != b19) 159 %! if (! isequal (a19, b19))
158 %! error(["failed: " file " sparse"]); 160 %! error ("failed: %s sparse", file);
159 %! endif 161 %! endif
160 %! 162 %!
161 %! if (a20 != b20) 163 %! if (! isequal (a20, b20))
162 %! error(["failed: " file " complex sparse"]); 164 %! error ("failed: %s complex sparse", file);
163 %! endif 165 %! endif
164 %! 166 %!
165 %! ## Test for global flags 167 %! ## Test for global flags
166 %! if (!isglobal("a1") || isglobal("a2") || isglobal("a3") || 168 %! if (! isglobal ("a1") || isglobal ("a2") || isglobal ("a3")
167 %! isglobal("a4") || isglobal("a5") || isglobal("a6") || 169 %! || isglobal ("a4") || isglobal ("a5") || isglobal ("a6")
168 %! isglobal("a7") || isglobal("a8") || isglobal("a9") || 170 %! || isglobal ("a7") || isglobal ("a8") || isglobal ("a9")
169 %! isglobal("a10") || isglobal("a11") || isglobal("a12") || 171 %! || isglobal ("a10") || isglobal ("a11") || isglobal ("a12")
170 %! isglobal("a13") || isglobal("a14") || isglobal("a15") || 172 %! || isglobal ("a13") || isglobal ("a14") || isglobal ("a15")
171 %! isglobal("a16") || isglobal("a17") || isglobal("a18") || 173 %! || isglobal ("a16") || isglobal ("a17") || isglobal ("a18")
172 %! isglobal("a19") || isglobal("a20")) 174 %! || isglobal ("a19") || isglobal ("a20"))
173 %! error (["failed: " file " global test"]); 175 %! error ("failed: %s global test", file);
174 %! endif 176 %! endif
175 %! endfor 177 %! endfor
176 %! endif 178 %! endif
177 %! 179 %!
178 %! ret = 1; 180 %! ret = 1;