Skip to content

TEST_NUM_from_record has wrong range [4:7] in unpack, int will need 4 bytes [4:8] #76

@jaui

Description

@jaui

TEST_NUM_from_record

def TEST_NUM_from_record(record, endian):
    '''
    given a PTR, MPR or FTR record, extract the test Number.
    Note: TEST_NUM is for these records always located on offset 4..7

                REC_TYP   REC_SUB   TEST_NUM (V4)
           PTR      15       10       4:8
           MPR      15       15       4:8
           FTR      15       20       4:8

          Also note that endian is important here!
    '''
    REC_TYP, REC_SUB = TS_from_record(record)
    TEST_NUM = -1
    if REC_TYP == 15 and REC_SUB in [10, 15, 20]:
        TEST_NUM = int(struct.unpack("%sI" % endian, record[4:8])[0])
    return TEST_NUM

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions