def _testTableDirectoryPositions(data, reporter):
    directory = unpackDirectory(data)
    tablesWithProblems = set()
    # test for overlapping tables
    locations = []
    for table in directory:
        offset = table["offset"]
        length = table["compLength"]
        length = length + calcPaddingLength(length)
        locations.append((offset, offset + length, table["tag"]))
    for start, end, tag in locations:
        for otherStart, otherEnd, otherTag in locations:
            if tag == otherTag:
                continue
            if start >= otherStart and start < otherEnd:
                reporter.logError(message="The \"%s\" table overlaps the \"%s\" table." % (tag, otherTag))
                tablesWithProblems.add(tag)
                tablesWithProblems.add(otherTag)
    # test for invalid offset, length and combo
    header = unpackHeader(data)
    if header["metaOffset"] != 0:
        tableDataEnd = header["metaOffset"]
    elif header["privOffset"] != 0:
        tableDataEnd = header["privOffset"]
    else:
        tableDataEnd = header["length"]
    numTables = header["numTables"]
    minOffset = headerSize + (directorySize * numTables)
    maxLength = tableDataEnd - minOffset
    for table in directory:
        tag = table["tag"]
        offset = table["offset"]
        length = table["compLength"]
        # offset is before the beginning of the table data block
        if offset < minOffset:
            tablesWithProblems.add(tag)
            message = "The \"%s\" table directory entry offset (%d) is before the start of the table data block (%d)." % (tag, offset, minOffset)
            reporter.logError(message=message)
        # offset is after the end of the table data block
        elif offset > tableDataEnd:
            tablesWithProblems.add(tag)
            message = "The \"%s\" table directory entry offset (%d) is past the end of the table data block (%d)." % (tag, offset, tableDataEnd)
            reporter.logError(message=message)
        # offset + length is after the end of the table tada block
        elif (offset + length) > tableDataEnd:
            tablesWithProblems.add(tag)
            message = "The \"%s\" table directory entry offset (%d) + length (%d) is past the end of the table data block (%d)." % (tag, offset, length, tableDataEnd)
            reporter.logError(message=message)
    # test for gaps
    tables = []
    for table in directory:
        tag = table["tag"]
        offset = table["offset"]
        length = table["compLength"]
        length += calcPaddingLength(length)
        tables.append((offset, offset + length, tag))
    tables.sort()
    for index, (start, end, tag) in enumerate(tables):
        if index == 0:
            continue
        prevStart, prevEnd, prevTag = tables[index - 1]
        if prevEnd < start:
            tablesWithProblems.add(prevTag)
            tablesWithProblems.add(tag)
            reporter.logError(message="Extraneous data between the \"%s\" and \"%s\" tables." % (prevTag, tag))
    # log passes
    for entry in directory:
        tag = entry["tag"]
        if tag in tablesWithProblems:
            continue
        reporter.logPass(message="The \"%s\" table directory entry has a valid offset and length." % tag)
Create a summary table for a list containing FaceDetectionTest objects.
dataset/ETHPy150Open typesupply/woffTools/Lib/woffTools/tools/validate.py/_testTableDirectoryPositions--crossover with--dataset/ETHPy150Open bolme/pyvision/src/pyvision/analysis/FaceAnalysis/EyeDetectionTest.py/summarizeEyeDetectionTests