Commit 1ffa30d8 authored by Vincent Michel's avatar Vincent Michel

Force uint to 32 bits

parent 1411a95b
Pipeline #907 passed with stages
in 1 minute and 16 seconds
......@@ -122,8 +122,8 @@ def get_run_data_length(channel):
def get_run_data(channel):
length = get_run_data_length(channel)
array = numpy.zeros(length, dtype='uint')
data = ffi.cast('unsigned long *', array.ctypes.data)
array = numpy.zeros(length, dtype='uint32')
data = ffi.cast('uint32_t *', array.ctypes.data)
code = handel.xiaGetRunData(channel, b'mca', data)
check_error(code)
return array
......@@ -151,8 +151,8 @@ def get_buffer(channel, buffer_id):
bid = to_buffer_id(buffer_id)
command = b'buffer_%c' % bid
length = get_buffer_length(channel)
array = numpy.zeros(length, dtype='uint')
data = ffi.cast('unsigned long *', array.ctypes.data)
array = numpy.zeros(length, dtype='uint32')
data = ffi.cast('uint32_t *', array.ctypes.data)
code = handel.xiaGetRunData(channel, command, data)
check_error(code)
return array
......
......@@ -185,7 +185,7 @@ def test_get_run_data(interface):
assert False
m.side_effect = side_effect
expected = numpy.array(range(10), dtype='uint')
expected = numpy.array(range(10), dtype='uint32')
diff = interface.get_run_data(1) == expected
assert diff.all()
m.assert_called()
......@@ -245,7 +245,7 @@ def test_get_buffer(interface):
assert False
m.side_effect = side_effect
expected = numpy.array(range(10), dtype='uint')
expected = numpy.array(range(10), dtype='uint32')
diff = interface.get_buffer(1, 'a') == expected
assert diff.all()
m.assert_called()
......@@ -496,8 +496,7 @@ def test_get_config_files(interface):
def test_get_config(interface):
filename = interface.get_config_files('.')[0]
d = interface.get_config(filename)
assert d['detector definitions']['alias'] == 'detector1'
assert 'DEFAULT' not in d
conf = interface.get_config(filename)
assert 'alias = detector1' in conf
with pytest.raises(IOError):
interface.get_config('i_dont_exist.ini')
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