|
49 | 49 | function [] = test_attrs( varargin )
|
50 | 50 | %% Test: Access Attributes
|
51 | 51 | f = nix.File(fullfile(pwd, 'tests', 'testRW.h5'), nix.FileMode.Overwrite);
|
52 |
| - b = f.createBlock('tagtest', 'test nixBlock'); |
| 52 | + b = f.create_block('tagtest', 'test nixBlock'); |
53 | 53 |
|
54 | 54 | assert(~isempty(b.id));
|
55 | 55 | assert(strcmp(b.name, 'tagtest'));
|
|
70 | 70 | function [] = test_create_data_array( varargin )
|
71 | 71 | fileName = fullfile(pwd, 'tests', 'testRW.h5');
|
72 | 72 | f = nix.File(fileName, nix.FileMode.Overwrite);
|
73 |
| - b = f.createBlock('arraytest', 'nixblock'); |
| 73 | + b = f.create_block('arraytest', 'nixblock'); |
74 | 74 |
|
75 | 75 | assert(isempty(b.dataArrays));
|
76 | 76 |
|
|
115 | 115 | fileName = fullfile(pwd, 'tests', 'testRW.h5');
|
116 | 116 | daType = 'nix.DataArray';
|
117 | 117 | f = nix.File(fileName, nix.FileMode.Overwrite);
|
118 |
| - b = f.createBlock('arraytest', 'nixblock'); |
| 118 | + b = f.create_block('arraytest', 'nixblock'); |
119 | 119 |
|
120 | 120 | assert(isempty(b.dataArrays));
|
121 | 121 |
|
|
155 | 155 | %% Test: delete dataArray by entity and id
|
156 | 156 | function [] = test_delete_data_array( varargin )
|
157 | 157 | f = nix.File(fullfile(pwd, 'tests', 'testRW.h5'), nix.FileMode.Overwrite);
|
158 |
| - b = f.createBlock('arraytest', 'nixBlock'); |
| 158 | + b = f.create_block('arraytest', 'nixBlock'); |
159 | 159 | tmp = b.create_data_array('dataArrayTest1', 'nixDataArray', nix.DataType.Double, [1 2]);
|
160 | 160 | tmp = b.create_data_array('dataArrayTest2', 'nixDataArray', nix.DataType.Double, [3 4]);
|
161 | 161 |
|
|
170 | 170 | function [] = test_create_tag( varargin )
|
171 | 171 | %% Test: Create Tag
|
172 | 172 | f = nix.File(fullfile(pwd, 'tests', 'testRW.h5'), nix.FileMode.Overwrite);
|
173 |
| - b = f.createBlock('tagtest', 'nixblock'); |
| 173 | + b = f.create_block('tagtest', 'nixblock'); |
174 | 174 |
|
175 | 175 | assert(isempty(b.tags));
|
176 | 176 |
|
|
186 | 186 | %% Test: delete tag by entity and id
|
187 | 187 | function [] = test_delete_tag( varargin )
|
188 | 188 | f = nix.File(fullfile(pwd, 'tests', 'testRW.h5'), nix.FileMode.Overwrite);
|
189 |
| - b = f.createBlock('tagtest', 'nixBlock'); |
| 189 | + b = f.create_block('tagtest', 'nixBlock'); |
190 | 190 | position = [1.0 1.2 1.3 15.9];
|
191 | 191 | tmp = b.create_tag('tagtest1', 'nixTag', position);
|
192 | 192 | tmp = b.create_tag('tagtest2', 'nixTag', position);
|
|
203 | 203 | function [] = test_create_multi_tag( varargin )
|
204 | 204 | %% Test: Create multitag by data_array entity and data_array id
|
205 | 205 | f = nix.File(fullfile(pwd, 'tests', 'testRW.h5'), nix.FileMode.Overwrite);
|
206 |
| - b = f.createBlock('mTagTestBlock', 'nixBlock'); |
| 206 | + b = f.create_block('mTagTestBlock', 'nixBlock'); |
207 | 207 | tmp = b.create_data_array('mTagTestDataArray1', 'nixDataArray', nix.DataType.Double, [1 2]);
|
208 | 208 | tmp = b.create_data_array('mTagTestDataArray2', 'nixDataArray', nix.DataType.Double, [3 4]);
|
209 | 209 | assert(isempty(b.multiTags));
|
|
222 | 222 | %% Test: delete multitag by entity and id
|
223 | 223 | function [] = test_delete_multi_tag( varargin )
|
224 | 224 | f = nix.File(fullfile(pwd, 'tests', 'testRW.h5'), nix.FileMode.Overwrite);
|
225 |
| - b = f.createBlock('mTagTestBlock', 'nixBlock'); |
| 225 | + b = f.create_block('mTagTestBlock', 'nixBlock'); |
226 | 226 | tmp = b.create_data_array('mTagTestDataArray1', 'nixDataArray', nix.DataType.Double, [1 2]);
|
227 | 227 | tmp = b.create_multi_tag('mTagTest1', 'nixMultiTag1', b.dataArrays{1});
|
228 | 228 | tmp = b.create_multi_tag('mTagTest2', 'nixMultiTag2', b.dataArrays{1});
|
|
240 | 240 | %% Test: create source
|
241 | 241 | function [] = test_create_source ( varargin )
|
242 | 242 | test_file = nix.File(fullfile(pwd, 'tests', 'testRW.h5'), nix.FileMode.Overwrite);
|
243 |
| - getBlock = test_file.createBlock('sourcetest', 'nixblock'); |
| 243 | + getBlock = test_file.create_block('sourcetest', 'nixblock'); |
244 | 244 | assert(isempty(getBlock.sources));
|
245 | 245 |
|
246 | 246 | createSource = getBlock.create_source('sourcetest','nixsource');
|
|
252 | 252 | %% Test: delete source by entity and id
|
253 | 253 | function [] = test_delete_source( varargin )
|
254 | 254 | test_file = nix.File(fullfile(pwd, 'tests', 'testRW.h5'), nix.FileMode.Overwrite);
|
255 |
| - getBlock = test_file.createBlock('sourcetest', 'nixblock'); |
| 255 | + getBlock = test_file.create_block('sourcetest', 'nixblock'); |
256 | 256 | tmp = getBlock.create_source('sourcetest1','nixsource');
|
257 | 257 | tmp = getBlock.create_source('sourcetest2','nixsource');
|
258 | 258 | tmp = getBlock.create_source('sourcetest3','nixsource');
|
|
269 | 269 | function [] = test_list_arrays( varargin )
|
270 | 270 | fileName = fullfile(pwd, 'tests', 'testRW.h5');
|
271 | 271 | f = nix.File(fileName, nix.FileMode.Overwrite);
|
272 |
| - b = f.createBlock('arraytest', 'nixBlock'); |
| 272 | + b = f.create_block('arraytest', 'nixBlock'); |
273 | 273 |
|
274 | 274 | assert(isempty(b.dataArrays));
|
275 | 275 | tmp = b.create_data_array('arrayTest1', 'nixDataArray', nix.DataType.Double, [1 2]);
|
|
286 | 286 | function [] = test_list_sources( varargin )
|
287 | 287 | fileName = fullfile(pwd, 'tests', 'testRW.h5');
|
288 | 288 | f = nix.File(fileName, nix.FileMode.Overwrite);
|
289 |
| - b = f.createBlock('sourcetest', 'nixBlock'); |
| 289 | + b = f.create_block('sourcetest', 'nixBlock'); |
290 | 290 |
|
291 | 291 | assert(isempty(b.sources));
|
292 | 292 | tmp = b.create_source('sourcetest1','nixSource');
|
|
305 | 305 | function [] = test_list_tags( varargin )
|
306 | 306 | fileName = fullfile(pwd, 'tests', 'testRW.h5');
|
307 | 307 | f = nix.File(fileName, nix.FileMode.Overwrite);
|
308 |
| - b = f.createBlock('tagtest', 'nixBlock'); |
| 308 | + b = f.create_block('tagtest', 'nixBlock'); |
309 | 309 | position = [1.0 1.2 1.3 15.9];
|
310 | 310 |
|
311 | 311 | assert(isempty(b.tags));
|
|
325 | 325 | function [] = test_list_multitags( varargin )
|
326 | 326 | fileName = fullfile(pwd, 'tests', 'testRW.h5');
|
327 | 327 | f = nix.File(fileName, nix.FileMode.Overwrite);
|
328 |
| - b = f.createBlock('mTagTestBlock', 'nixBlock'); |
| 328 | + b = f.create_block('mTagTestBlock', 'nixBlock'); |
329 | 329 | tmp = b.create_data_array('mTagTestDataArray', 'nixDataArray', nix.DataType.Double, [1 2]);
|
330 | 330 |
|
331 | 331 | assert(isempty(b.multiTags));
|
|
344 | 344 | function [] = test_open_array( varargin )
|
345 | 345 | %% Test: Open data array by ID or name
|
346 | 346 | f = nix.File(fullfile(pwd, 'tests', 'testRW.h5'), nix.FileMode.Overwrite);
|
347 |
| - b = f.createBlock('arraytest', 'nixBlock'); |
| 347 | + b = f.create_block('arraytest', 'nixBlock'); |
348 | 348 | daName = 'arrayTest1';
|
349 | 349 |
|
350 | 350 | assert(isempty(b.dataArrays));
|
|
364 | 364 | function [] = test_open_tag( varargin )
|
365 | 365 | %% Test: Open tag by ID or name
|
366 | 366 | f = nix.File(fullfile(pwd, 'tests', 'testRW.h5'), nix.FileMode.Overwrite);
|
367 |
| - b = f.createBlock('tagtest', 'nixBlock'); |
| 367 | + b = f.create_block('tagtest', 'nixBlock'); |
368 | 368 | position = [1.0 1.2 1.3 15.9];
|
369 | 369 | tagName = 'tagtest1';
|
370 | 370 | tmp = b.create_tag(tagName, 'nixTag', position);
|
|
383 | 383 | function [] = test_open_multitag( varargin )
|
384 | 384 | %% Test: Open multi tag by ID or name
|
385 | 385 | f = nix.File(fullfile(pwd, 'tests', 'testRW.h5'), nix.FileMode.Overwrite);
|
386 |
| - b = f.createBlock('mTagTestBlock', 'nixBlock'); |
| 386 | + b = f.create_block('mTagTestBlock', 'nixBlock'); |
387 | 387 | tmp = b.create_data_array('mTagTestDataArray', 'nixDataArray', nix.DataType.Double, [1 2]);
|
388 | 388 | mTagName = 'mTagTest1';
|
389 | 389 | tmp = b.create_multi_tag(mTagName, 'nixMultiTag', b.dataArrays{1});
|
|
402 | 402 | function [] = test_open_source( varargin )
|
403 | 403 | %% Test: Open source by ID or name
|
404 | 404 | f = nix.File(fullfile(pwd, 'tests', 'testRW.h5'), nix.FileMode.Overwrite);
|
405 |
| - b = f.createBlock('sourcetest', 'nixBlock'); |
| 405 | + b = f.create_block('sourcetest', 'nixBlock'); |
406 | 406 | sName = 'sourcetest1';
|
407 | 407 | tmp = b.create_source(sName, 'nixSource');
|
408 | 408 |
|
|
420 | 420 | function [] = test_has_multitag( varargin )
|
421 | 421 | %% Test: Block has multi tag by ID or name
|
422 | 422 | f = nix.File(fullfile(pwd, 'tests', 'testRW.h5'), nix.FileMode.Overwrite);
|
423 |
| - b = f.createBlock('mTagTestBlock', 'nixBlock'); |
| 423 | + b = f.create_block('mTagTestBlock', 'nixBlock'); |
424 | 424 | tmp = b.create_data_array('mTagTestDataArray', 'nixDataArray', nix.DataType.Double, [1 2]);
|
425 | 425 | tmp = b.create_multi_tag('mTagTest1', 'nixMultiTag', b.dataArrays{1});
|
426 | 426 |
|
|
433 | 433 | function [] = test_has_tag( varargin )
|
434 | 434 | %% Test: Block has tag by ID or name
|
435 | 435 | f = nix.File(fullfile(pwd, 'tests', 'testRW.h5'), nix.FileMode.Overwrite);
|
436 |
| - b = f.createBlock('tagtest', 'nixBlock'); |
| 436 | + b = f.create_block('tagtest', 'nixBlock'); |
437 | 437 | tmp = b.create_tag('tagtest1', 'nixTag', [1.0 1.2 1.3 15.9]);
|
438 | 438 |
|
439 | 439 | assert(b.has_tag(b.tags{1,1}.id));
|
|
448 | 448 | secName1 = 'testSection1';
|
449 | 449 | secName2 = 'testSection2';
|
450 | 450 | f = nix.File(fileName, nix.FileMode.Overwrite);
|
451 |
| - tmp = f.createSection(secName1, 'nixSection'); |
452 |
| - tmp = f.createSection(secName2, 'nixSection'); |
453 |
| - b = f.createBlock('testBlock', 'nixBlock'); |
| 451 | + tmp = f.create_section(secName1, 'nixSection'); |
| 452 | + tmp = f.create_section(secName2, 'nixSection'); |
| 453 | + b = f.create_block('testBlock', 'nixBlock'); |
454 | 454 |
|
455 | 455 | assert(isempty(b.open_metadata));
|
456 | 456 | assert(isempty(f.blocks{1}.open_metadata));
|
|
475 | 475 | function [] = test_open_metadata( varargin )
|
476 | 476 | %% Test: Open metadata
|
477 | 477 | f = nix.File(fullfile(pwd, 'tests', 'testRW.h5'), nix.FileMode.Overwrite);
|
478 |
| - tmp = f.createSection('testSection', 'nixSection'); |
479 |
| - b = f.createBlock('testBlock', 'nixBlock'); |
| 478 | + tmp = f.create_section('testSection', 'nixSection'); |
| 479 | + b = f.create_block('testBlock', 'nixBlock'); |
480 | 480 | b.set_metadata(f.sections{1});
|
481 | 481 |
|
482 | 482 | assert(strcmp(b.open_metadata.name, 'testSection'));
|
|
487 | 487 | fileName = 'testRW.h5';
|
488 | 488 | daName = 'hasDataArrayTest';
|
489 | 489 | f = nix.File(fullfile(pwd, 'tests', fileName), nix.FileMode.Overwrite);
|
490 |
| - b = f.createBlock('testblock', 'nixBlock'); |
| 490 | + b = f.create_block('testblock', 'nixBlock'); |
491 | 491 | da = b.create_data_array(daName, 'nixDataArray', nix.DataType.Double, [1 2]);
|
492 | 492 | daID = da.id;
|
493 | 493 |
|
|
504 | 504 | fileName = 'testRW.h5';
|
505 | 505 | sName = 'sourcetest1';
|
506 | 506 | f = nix.File(fullfile(pwd, 'tests', fileName), nix.FileMode.Overwrite);
|
507 |
| - b = f.createBlock('testblock', 'nixBlock'); |
| 507 | + b = f.create_block('testblock', 'nixBlock'); |
508 | 508 | s = b.create_source(sName, 'nixSource');
|
509 | 509 | sID = s.id;
|
510 | 510 |
|
|
523 | 523 | groupType = 'nixGroup';
|
524 | 524 |
|
525 | 525 | f = nix.File(fullfile(pwd, 'tests', fileName), nix.FileMode.Overwrite);
|
526 |
| - b = f.createBlock('grouptest', 'nixBlock'); |
| 526 | + b = f.create_block('grouptest', 'nixBlock'); |
527 | 527 |
|
528 | 528 | assert(isempty(b.groups));
|
529 | 529 |
|
|
542 | 542 | function [] = test_has_group( varargin )
|
543 | 543 | groupName = 'testGroup';
|
544 | 544 | f = nix.File(fullfile(pwd, 'tests', 'testRW.h5'), nix.FileMode.Overwrite);
|
545 |
| - b = f.createBlock('grouptest', 'nixBlock'); |
| 545 | + b = f.create_block('grouptest', 'nixBlock'); |
546 | 546 |
|
547 | 547 | assert(~b.has_group('I do not exist'));
|
548 | 548 |
|
|
558 | 558 | function [] = test_get_group( varargin )
|
559 | 559 | groupName = 'testGroup';
|
560 | 560 | f = nix.File(fullfile(pwd, 'tests', 'testRW.h5'), nix.FileMode.Overwrite);
|
561 |
| - b = f.createBlock('grouptest', 'nixBlock'); |
| 561 | + b = f.create_block('grouptest', 'nixBlock'); |
562 | 562 | g = b.create_group(groupName, 'nixGroup');
|
563 | 563 | gID = g.id;
|
564 | 564 |
|
|
574 | 574 | groupType = 'nixGroup';
|
575 | 575 |
|
576 | 576 | f = nix.File(fullfile(pwd, 'tests', fileName), nix.FileMode.Overwrite);
|
577 |
| - b = f.createBlock('grouptest', 'nixBlock'); |
| 577 | + b = f.create_block('grouptest', 'nixBlock'); |
578 | 578 | g1 = b.create_group('testGroup1', groupType);
|
579 | 579 | g2 = b.create_group('testGroup2', groupType);
|
580 | 580 |
|
|
595 | 595 | function [] = test_group_count( varargin )
|
596 | 596 | testFile = fullfile(pwd, 'tests', 'testRW.h5');
|
597 | 597 | f = nix.File(testFile, nix.FileMode.Overwrite);
|
598 |
| - b = f.createBlock('testBlock', 'nixBlock'); |
| 598 | + b = f.create_block('testBlock', 'nixBlock'); |
599 | 599 | assert(b.group_count() == 0);
|
600 | 600 | g = b.create_group('testGroup', 'nixGroup');
|
601 | 601 | assert(b.group_count() == 1);
|
|
610 | 610 | function [] = test_data_array_count( varargin )
|
611 | 611 | testFile = fullfile(pwd, 'tests', 'testRW.h5');
|
612 | 612 | f = nix.File(testFile, nix.FileMode.Overwrite);
|
613 |
| - b = f.createBlock('testBlock', 'nixBlock'); |
| 613 | + b = f.create_block('testBlock', 'nixBlock'); |
614 | 614 |
|
615 | 615 | assert(b.data_array_count() == 0);
|
616 | 616 | d = b.create_data_array('testDataArray', 'nixDataArray', nix.DataType.Double, [1 2]);
|
|
626 | 626 | function [] = test_tag_count( varargin )
|
627 | 627 | testFile = fullfile(pwd, 'tests', 'testRW.h5');
|
628 | 628 | f = nix.File(testFile, nix.FileMode.Overwrite);
|
629 |
| - b = f.createBlock('testBlock', 'nixBlock'); |
| 629 | + b = f.create_block('testBlock', 'nixBlock'); |
630 | 630 |
|
631 | 631 | assert(b.tag_count() == 0);
|
632 | 632 | t = b.create_tag('testTag1', 'nixTag', [1.0 1.2 1.3 15.9]);
|
|
642 | 642 | function [] = test_multi_tag_count( varargin )
|
643 | 643 | testFile = fullfile(pwd, 'tests', 'testRW.h5');
|
644 | 644 | f = nix.File(testFile, nix.FileMode.Overwrite);
|
645 |
| - b = f.createBlock('testBlock', 'nixBlock'); |
| 645 | + b = f.create_block('testBlock', 'nixBlock'); |
646 | 646 | d = b.create_data_array('mTagTestDataArray', 'nixDataArray', nix.DataType.Double, [1 2]);
|
647 | 647 |
|
648 | 648 | assert(b.multi_tag_count() == 0);
|
|
659 | 659 | function [] = test_source_count( varargin )
|
660 | 660 | testFile = fullfile(pwd, 'tests', 'testRW.h5');
|
661 | 661 | f = nix.File(testFile, nix.FileMode.Overwrite);
|
662 |
| - b = f.createBlock('testBlock', 'nixBlock'); |
| 662 | + b = f.create_block('testBlock', 'nixBlock'); |
663 | 663 |
|
664 | 664 | assert(b.source_count() == 0);
|
665 | 665 | s = b.create_source('testSource1', 'nixSource');
|
|
0 commit comments