def test_parse_size_ERANGE(size_t_max): input = str(size_t_max + 1).encode() arg = ffi.new('char[]', input) out = ffi.new('size_t *') assert lib.parse_size(arg, out) == -1 assert ffi.errno == errno.ERANGE assert out[0] == 0
def test_parse_size(): arg = ffi.new('char[]', b'832421') out = ffi.new('size_t *') assert lib.parse_size(arg, out) == 0 assert out[0] == 832421