Example #1
0
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
Example #2
0
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
Example #3
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
Example #4
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