Skip to content

Commit 5ed37ef

Browse files
committed
increase test coverage of sampledDimensions
1 parent 6019ac5 commit 5ed37ef

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

tests/TestDimensions.m

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,12 @@
4141
assert(isempty(d1.unit));
4242
assert(d1.samplingInterval == 200);
4343
assert(isempty(d1.offset));
44-
44+
45+
axis = d1.axis(10, 0);
46+
assert(axis(1) == 0);
47+
assert(length(axis) == 10);
48+
assert(axis(end) == (length(axis) - 1) * d1.samplingInterval);
49+
4550
d1.label = 'foo';
4651
d1.unit = 'mV';
4752
d1.samplingInterval = 325;
@@ -52,6 +57,14 @@
5257
assert(d1.samplingInterval == 325);
5358
assert(d1.offset == 500);
5459

60+
axis = d1.axis(10, 0);
61+
assert(axis(1) == d1.offset);
62+
assert(length(axis) == 10);
63+
assert(axis(end) == (length(axis) - 1) * d1.samplingInterval + d1.offset);
64+
65+
assert(d1.position_at(0) == d1.offset);
66+
assert(d1.position_at(9) == d1.offset + 9 * d1.samplingInterval);
67+
5568
d1.label = '';
5669
d1.unit = '';
5770
d1.offset = 0;
@@ -60,6 +73,13 @@
6073
assert(isempty(d1.unit));
6174
assert(d1.samplingInterval == 325);
6275
assert(d1.offset == 0);
76+
77+
axis = d1.axis(10, 0);
78+
assert(axis(1) == 0);
79+
assert(axis(end) == (length(axis) - 1) * d1.samplingInterval + d1.offset);
80+
81+
assert(d1.position_at(0) == d1.offset);
82+
assert(d1.position_at(9) == d1.offset + 9 * d1.samplingInterval);
6383
end
6484

6585
function [] = test_range_dimension( varargin )

0 commit comments

Comments
 (0)