| 1 |
try |
| 2 |
load test_write_empty_struct.mat |
| 3 |
expdata1 = repmat(struct,0,1); |
| 4 |
expdata2 = repmat(struct('field1',zeros(0,0),'field2',zeros(0,0)),0,1); |
| 5 |
expdata3 = struct('field1',zeros(0,1),'field2',zeros(0,1)); |
| 6 |
expdata4(1).field1 = zeros(0,1); |
| 7 |
expdata4(1).field2 = repmat(' ',0,1); |
| 8 |
expdata4(2).field1 = repmat(struct,0,1); |
| 9 |
expdata4(2).field2 = repmat({zeros(0,0)},0,1); |
| 10 |
pass = true; |
| 11 |
pass = pass && isequal(var1,expdata1); |
| 12 |
pass = pass && isequal(var2,expdata2); |
| 13 |
pass = pass && isequal(var3,expdata3); |
| 14 |
pass = pass && isequal(var4,expdata4(:)); |
| 15 |
catch me |
| 16 |
pass = false; |
| 17 |
end |
| 18 |
if pass |
| 19 |
fprintf('PASSED\n'); |
| 20 |
else |
| 21 |
fprintf('FAILED\n'); |
| 22 |
end |
| 23 |
exit; |