def test_multi_bitfields_size(self):

    class X(Structure):
        _fields_ = [('a', c_short, 1), ('b', c_short, 14), ('c', c_short, 1)]
    assert (sizeof(X) == sizeof(c_short))

    class X(Structure):
        _fields_ = [('a', c_short, 1), ('a1', c_short), ('b', c_short, 14), ('c', c_short, 1)]
    assert (sizeof(X) == (sizeof(c_short) * 3))
    assert (X.a.offset == 0)
    assert (X.a1.offset == sizeof(c_short))
    assert (X.b.offset == (sizeof(c_short) * 2))
    assert (X.c.offset == (sizeof(c_short) * 2))

    class X(Structure):
        _fields_ = [('a', c_short, 3), ('b', c_short, 14), ('c', c_short, 14)]
    assert (sizeof(X) == (sizeof(c_short) * 3))
    assert (X.a.offset == (sizeof(c_short) * 0))
    assert (X.b.offset == (sizeof(c_short) * 1))
    assert (X.c.offset == (sizeof(c_short) * 2))
def test_multi_bitfields_size(self):

    class X(Structure):
        _fields_ = [('a', c_short, 1), ('b', c_short, 14), ('c', c_short, 1)]
    assert (sizeof(X) == sizeof(c_short))

    class X(Structure):
        _fields_ = [('a', c_short, 1), ('a1', c_short), ('b', c_short, 14), ('c', c_short, 1)]
    assert (sizeof(X) == (sizeof(c_short) * 3))
    assert (X.a.offset == 0)
    assert (X.a1.offset == sizeof(c_short))
    assert (X.b.offset == (sizeof(c_short) * 2))
    assert (X.c.offset == (sizeof(c_short) * 2))

    class X(Structure):
        _fields_ = [('a', c_short, 3), ('b', c_short, 14), ('c', c_short, 14)]
    assert (sizeof(X) == (sizeof(c_short) * 3))
    assert (X.a.offset == (sizeof(c_short) * 0))
    assert (X.b.offset == (sizeof(c_short) * 1))
    assert (X.c.offset == (sizeof(c_short) * 2))