Commit c504e832 authored by Luke Mewburn's avatar Luke Mewburn
Browse files

lint_asn1: detect missing errors

Display a "missing error" error if a lint_exception exists
in asn_config.json but isn't generated by the tool.

Remove non-existent "tag missing" errors in r18 and r19
that were fixed with CR0573.
parent 5a0eea65
Loading
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -157,7 +157,6 @@
        "Enumerations for MMStatusExtension start at 0, not 1",
        "Tags 4-5 missing in IMSMessage",
        "Tag 6 missing in StartOfInterceptionForActiveIMSSession",
        "Tag 2 missing in LALSReport",
        "Tag 6 missing in LALSReport",
        "Tag 8 missing in MMEStartOfInterceptionWithEPSAttachedUE",
        "Tag 11 missing in MMEStartOfInterceptionWithEPSAttachedUE",
@@ -203,7 +202,6 @@
        "Enumerations for MMStatusExtension start at 0, not 1",
        "Tags 4-5 missing in IMSMessage",
        "Tag 6 missing in StartOfInterceptionForActiveIMSSession",
        "Tag 2 missing in LALSReport",
        "Tag 6 missing in LALSReport",
        "Tag 8 missing in MMEStartOfInterceptionWithEPSAttachedUE",
        "Tag 11 missing in MMEStartOfInterceptionWithEPSAttachedUE",
+8 −0
Original line number Diff line number Diff line
@@ -374,7 +374,15 @@ def lintASN1File(asnFile, exceptions):
        logging.error("ParseError: {0}".format(ex))
    if len(exceptions) > 0:
        suppressed = [error for error in errors if error["message"] in exceptions]
        errorMessages = [error["message"] for error in errors]
        errors = [error for error in errors if error["message"] not in exceptions]
        errors.extend(
            [
                {"message": f"Missing error: {error}"}
                for error in exceptions
                if error not in errorMessages
            ]
        )
    return {"ok": len(errors) == 0, "message": errors, "suppressed": suppressed}