Commit 386ae339 authored by Kirill Smelkov's avatar Kirill Smelkov

bigarray/tests: Factor-out generic read-only BigFile_Data

We'll need this class in tests in the next patch.
parent acd73f63
......@@ -55,6 +55,12 @@ class BigFile_Data(BigFile):
memcpy(self.datab[self.blksize * blk : self.blksize * (blk+1)], buf)
# synthetic bigfile that only loads data from numpy array
class BigFile_Data_RO(BigFile_Data):
def storeblk(self, blk, buf):
raise RuntimeError('tests should not try to change test data')
PS = 2*1024*1024 # FIXME hardcoded, TODO -> ram.pagesize
......@@ -293,11 +299,6 @@ def test_bigarray_indexing_Nd():
# (else data slice will be smaller than buf)
data = arange(mul(shape) + PS, dtype=uint32)
# synthetic bigfile that only loads data from numpy array
class BigFile_Data_RO(BigFile_Data):
def storeblk(self, blk, buf):
raise RuntimeError('tests should not try to change test data')
f = BigFile_Data_RO(data, PS)
fh = f.fileh_open()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment