File: test_write_empty_struct.m

package info (click to toggle)
libmatio 1.5.29-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 34,648 kB
  • sloc: sh: 126,066; ansic: 22,606; makefile: 646; python: 215
file content (23 lines) | stat: -rw-r--r-- 687 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
try
    load test_write_empty_struct.mat
    expdata1 = repmat(struct,0,1);
    expdata2 = repmat(struct('field1',zeros(0,0),'field2',zeros(0,0)),0,1);
    expdata3 = struct('field1',zeros(0,1),'field2',zeros(0,1));
    expdata4(1).field1 = zeros(0,1);
    expdata4(1).field2 = repmat(' ',0,1);
    expdata4(2).field1 = repmat(struct,0,1);
    expdata4(2).field2 = repmat({zeros(0,0)},0,1);
    pass = true;
    pass = pass && isequal(var1,expdata1);
    pass = pass && isequal(var2,expdata2);
    pass = pass && isequal(var3,expdata3);
    pass = pass && isequal(var4,expdata4(:));
catch me
    pass = false;
end
if pass
    fprintf('PASSED\n');
else
    fprintf('FAILED\n');
end
exit;