Skip to content

Commit aad7b14

Browse files
author
Benjamin Moody
committed
Add test cases for reading/writing huge skips.
Check that we can both read and write an annotation file containing a relative offset of more than 2**31 - 1 ticks, which necessitates the use of multiple SKIP pseudo-annotations.
1 parent 0dab235 commit aad7b14

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

sample-data/huge.qrs

34 Bytes
Binary file not shown.

tests/test_annotation.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,12 +187,28 @@ def test_3(self):
187187
assert annotation.__eq__(pn_annotation)
188188
assert annotation.__eq__(write_annotation)
189189

190+
def test_4(self):
191+
"""
192+
Read and write annotations with large time skips
193+
194+
Annotation file created by:
195+
echo "xxxxxxxxx 10000000000 N 0 0 0" | wrann -r huge -a qrs
196+
"""
197+
annotation = wfdb.rdann('sample-data/huge', 'qrs')
198+
self.assertEqual(annotation.sample[0], 10000000000)
199+
annotation.wrann()
200+
201+
annotation1 = wfdb.rdann('sample-data/huge', 'qrs')
202+
annotation2 = wfdb.rdann('huge', 'qrs')
203+
self.assertEqual(annotation1, annotation2)
204+
190205
@classmethod
191206
def tearDownClass(cls):
192207
writefiles = [
193208
'100.atr',
194209
'1003.atr',
195210
'12726.anI',
211+
'huge.qrs',
196212
]
197213
for file in writefiles:
198214
if os.path.isfile(file):

0 commit comments

Comments
 (0)