Skip to content

Commit e36dcbf

Browse files
author
Benjamin Moody
committed
test_infer_sig_len: test inferring length of signal file with prolog.
If the header file does not specify the signal length, rdrecord should calculate it from the size of the signal file. Test that this works correctly for a signal file with a prolog.
1 parent a95227f commit e36dcbf

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

sample-data/a103l-no-len.hea

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
a103l-no-len 3 250
2+
a103l.mat 16+24 7247/mV 16 0 -171 -27403 0 II
3+
a103l.mat 16+24 1.052e+04/mV 16 0 9127 -301 0 V
4+
a103l.mat 16+24 1.253e+04/NU 16 0 6042 -17391 0 PLETH
5+
#Asystole
6+
#False alarm

tests/test_record.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,12 @@ def test_infer_sig_len(self):
707707

708708
assert record_2.__eq__(record)
709709

710+
record = wfdb.rdrecord('sample-data/a103l')
711+
record_2 = wfdb.rdrecord('sample-data/a103l-no-len')
712+
record_2.record_name = record.record_name
713+
714+
assert record_2.__eq__(record)
715+
710716

711717
class TestDownload(unittest.TestCase):
712718
# Test that we can download records with no "dat" file

0 commit comments

Comments
 (0)