Exemplo n.º 1
0
def test_data(arr, args, ret):
    from pybind11_tests.array import data, data_t
    if not all(data_t(arr, *args) == ret):
        raise AssertionError
    if not all(data(arr, *args)[::2] == ret):
        raise AssertionError
    if not all(data(arr, *args)[1::2] == 0):
        raise AssertionError
Exemplo n.º 2
0
def test_data(arr, args, ret):
    from pybind11_tests.array import data, data_t
    from sys import byteorder
    assert all(data_t(arr, *args) == ret)
    assert all(data(arr, *args)[(0 if byteorder == 'little' else 1)::2] == ret)
    assert all(data(arr, *args)[(1 if byteorder == 'little' else 0)::2] == 0)
Exemplo n.º 3
0
def test_data(arr, args, ret):
    from pybind11_tests.array import data, data_t
    from sys import byteorder
    assert all(data_t(arr, *args) == ret)
    assert all(data(arr, *args)[(0 if byteorder == 'little' else 1)::2] == ret)
    assert all(data(arr, *args)[(1 if byteorder == 'little' else 0)::2] == 0)
Exemplo n.º 4
0
def test_data(arr, args, ret):
    from pybind11_tests.array import data, data_t
    assert all(data_t(arr, *args) == ret)
    assert all(data(arr, *args)[::2] == ret)
    assert all(data(arr, *args)[1::2] == 0)