|
7 | 7 | % LICENSE file in the root of the Project.
|
8 | 8 |
|
9 | 9 | function funcs = TestDimensions
|
10 |
| -%TestDimensions tests for Dimensions |
11 |
| -% Detailed explanation goes here |
| 10 | +% TestDimensions tests for Dimensions |
12 | 11 |
|
13 | 12 | funcs = {};
|
14 |
| - funcs{end+1} = @test_set_dimension; |
15 |
| - funcs{end+1} = @test_sample_dimension; |
16 |
| - funcs{end+1} = @test_range_dimension; |
| 13 | + funcs{end+1} = @testSetDimension; |
| 14 | + funcs{end+1} = @testSampleDimension; |
| 15 | + funcs{end+1} = @testRangeDimension; |
17 | 16 | end
|
18 | 17 |
|
19 |
| -function [] = test_set_dimension( varargin ) |
| 18 | +function [] = testSetDimension( varargin ) |
20 | 19 | %% Test: set dimension
|
21 | 20 | f = nix.File(fullfile(pwd, 'tests', 'testRW.h5'), nix.FileMode.Overwrite);
|
22 | 21 | b = f.createBlock('daTestBlock', 'test nixBlock');
|
|
50 | 49 | end;
|
51 | 50 | end
|
52 | 51 |
|
53 |
| -function [] = test_sample_dimension( varargin ) |
| 52 | +function [] = testSampleDimension( varargin ) |
54 | 53 | %% Test: sampled dimension
|
55 | 54 | f = nix.File(fullfile(pwd, 'tests', 'testRW.h5'), nix.FileMode.Overwrite);
|
56 | 55 | b = f.createBlock('daTestBlock', 'test nixBlock');
|
|
83 | 82 | assert(length(axis) == 10);
|
84 | 83 | assert(axis(end) == (length(axis) - 1) * d1.samplingInterval + d1.offset);
|
85 | 84 |
|
86 |
| - assert(d1.position_at(1) == d1.offset); |
87 |
| - assert(d1.position_at(10) == d1.offset + 9 * d1.samplingInterval); |
| 85 | + assert(d1.positionAt(1) == d1.offset); |
| 86 | + assert(d1.positionAt(10) == d1.offset + 9 * d1.samplingInterval); |
88 | 87 |
|
89 | 88 | d1.label = '';
|
90 | 89 | d1.unit = '';
|
|
99 | 98 | assert(axis(1) == 0);
|
100 | 99 | assert(axis(end) == (length(axis) - 1) * d1.samplingInterval + d1.offset);
|
101 | 100 |
|
102 |
| - assert(d1.position_at(1) == d1.offset); |
103 |
| - assert(d1.position_at(10) == d1.offset + 9 * d1.samplingInterval); |
| 101 | + assert(d1.positionAt(1) == d1.offset); |
| 102 | + assert(d1.positionAt(10) == d1.offset + 9 * d1.samplingInterval); |
104 | 103 | end
|
105 | 104 |
|
106 |
| -function [] = test_range_dimension( varargin ) |
| 105 | +function [] = testRangeDimension( varargin ) |
107 | 106 | %% Test: range dimension
|
108 | 107 | f = nix.File(fullfile(pwd, 'tests', 'testRW.h5'), nix.FileMode.Overwrite);
|
109 | 108 | b = f.createBlock('daTestBlock', 'test nixBlock');
|
|
121 | 120 | assert(length(axis) == 3);
|
122 | 121 | assert(axis(end) == ticks(length(axis)));
|
123 | 122 |
|
124 |
| - assert(d1.tick_at(1) == ticks(1)); |
125 |
| - assert(d1.tick_at(3) == ticks(3)); |
| 123 | + assert(d1.tickAt(1) == ticks(1)); |
| 124 | + assert(d1.tickAt(3) == ticks(3)); |
126 | 125 |
|
127 |
| - new_ticks = [5 6 7 8]; |
| 126 | + newTicks = [5 6 7 8]; |
128 | 127 | d1.label = 'foo';
|
129 | 128 | d1.unit = 'mV';
|
130 |
| - d1.ticks = new_ticks; |
| 129 | + d1.ticks = newTicks; |
131 | 130 |
|
132 | 131 | assert(strcmp(d1.label, 'foo'));
|
133 | 132 | assert(strcmp(d1.unit, 'mV'));
|
134 |
| - assert(isequal(d1.ticks, new_ticks)); |
| 133 | + assert(isequal(d1.ticks, newTicks)); |
135 | 134 |
|
136 | 135 | d1.label = '';
|
137 | 136 | d1.unit = '';
|
|
0 commit comments