File tree Expand file tree Collapse file tree 3 files changed +11
-9
lines changed Expand file tree Collapse file tree 3 files changed +11
-9
lines changed Original file line number Diff line number Diff line change 52
52
dimensions{i } = nix .Utils .createEntity(currList(i ).dimension, ...
53
53
@nix .RangeDimension );
54
54
otherwise
55
- disp(' some dimension type is unknown! skip' )
55
+ disp(' some dimension type is unknown! skip' );
56
56
end
57
57
end
58
58
end
Original file line number Diff line number Diff line change 65
65
r = nix .Utils .open_entity(obj , ' openBlock' , id_or_name , @nix .Block );
66
66
end
67
67
68
- function r = open_block_idx(obj , idx )
68
+ function r = open_block_idx(obj , index )
69
+ idx = nix .Utils .handle_index(index );
69
70
r = nix .Utils .open_entity(obj , ' openBlockIdx' , idx , @nix .Block );
70
71
end
71
72
99
100
r = nix .Utils .open_entity(obj , ' openSection' , id_or_name , @nix .Section );
100
101
end
101
102
102
- function r = open_section_idx(obj , idx )
103
+ function r = open_section_idx(obj , index )
104
+ idx = nix .Utils .handle_index(index );
103
105
r = nix .Utils .open_entity(obj , ' openSectionIdx' , idx , @nix .Section );
104
106
end
105
107
Original file line number Diff line number Diff line change 236
236
s2 = f .create_section(' testSection2' , ' nixSection' );
237
237
s3 = f .create_section(' testSection3' , ' nixSection' );
238
238
239
- assert(strcmp(f .open_section_idx(0 ).name, s1 .name ));
240
- assert(strcmp(f .open_section_idx(1 ).name, s2 .name ));
241
- assert(strcmp(f .open_section_idx(2 ).name, s3 .name ));
239
+ assert(strcmp(f .open_section_idx(1 ).name, s1 .name ));
240
+ assert(strcmp(f .open_section_idx(2 ).name, s2 .name ));
241
+ assert(strcmp(f .open_section_idx(3 ).name, s3 .name ));
242
242
end
243
243
244
244
function [] = test_open_block( varargin )
263
263
b2 = f .create_block(' testBlock2' , ' nixBlock' );
264
264
b3 = f .create_block(' testBlock3' , ' nixBlock' );
265
265
266
- assert(strcmp(f .open_block_idx(0 ).name, b1 .name ));
267
- assert(strcmp(f .open_block_idx(1 ).name, b2 .name ));
268
- assert(strcmp(f .open_block_idx(2 ).name, b3 .name ));
266
+ assert(strcmp(f .open_block_idx(1 ).name, b1 .name ));
267
+ assert(strcmp(f .open_block_idx(2 ).name, b2 .name ));
268
+ assert(strcmp(f .open_block_idx(3 ).name, b3 .name ));
269
269
end
270
270
271
271
%% Test: nix.File has nix.Block by ID or name
You can’t perform that action at this time.
0 commit comments