Commit dae086a9 authored by Luke Mewburn's avatar Luke Mewburn Committed by Luke Mewburn
Browse files

asn_process: Remove bigInt workaround

asn1c 0.9.29 doesn't need the workaround
parent 24f98f6b
Loading
Loading
Loading
Loading
+2 −26
Changes for testing/asn/asn_process.py: 2 added lines, 26 removed lines.
Original line number Diff line number Diff line
@@ -12,22 +12,10 @@ from pathlib import Path
import pycrate_asn1c.asnproc
import pycrate_asn1c.utils

logger = logging.getLogger(__name__)


def reconstrainInteger(filename):
    Path("temp.asn").write_text(
        Path(filename).read_text().replace("18446744073709551615", "65536")
    )
    return "temp.asn"

# Note: requires python >= 3.10, pycrate >= 0.8.1, asn1c >= 0.9.29

filesWithBigInts = {
    "102232-1/LI-PS-PDU.asn",
    "102232-2/EmailPDU.asn",
    "102232-3/IPAccessPDU.asn",
    "102232-4/L2AccessPDU.asn",
}
logger = logging.getLogger(__name__)

asn1c_path = ""
change_path_to_unix = False
@@ -82,15 +70,6 @@ def syntaxCheckASN(fileList):
    results = {}
    for file in fileList:
        try:
            if file.as_posix() in filesWithBigInts:
                newFile = reconstrainInteger(str(file))
                p = subprocess.run(
                    [str(asn1c_path), "-E", fix_path(newFile)],
                    capture_output=True,
                    check=False,
                )
                Path(newFile).unlink()
            else:
            p = subprocess.run(
                [str(asn1c_path), "-E", fix_path(str(file))],
                capture_output=True,
@@ -247,9 +226,6 @@ def main():
    if processResults(compileResults, "Compiling") > 0:
        return 1

    if Path("temp.asn").exists():
        Path("temp.asn").unlink()

    return 0