import ctypes

from target_simulator.core.sfp_structures import SFPHeader


def test_sfp_header_size_and_fields():
    # Ensure SFPHeader is a ctypes Structure and has expected size
    hdr = SFPHeader()
    size = ctypes.sizeof(hdr)
    assert size >= 16  # at least some reasonable size
    # Test get_field_offset for a known field
    off = SFPHeader.get_field_offset('SFP_FLOW')
    assert isinstance(off, int)
    # Setting and reading field
    hdr.SFP_FLOW = 77
    assert hdr.SFP_FLOW == 77
