Parse error codes from include/openssl/err.h.in. Detected lines match (up to spaces) "#define ERR_LIB_ ", e.g., "# define ERR_LIB_NONE 1".
(args)
| 104 | |
| 105 | |
| 106 | def parse_err_h(args): |
| 107 | """Parse error codes from include/openssl/err.h.in. |
| 108 | |
| 109 | Detected lines match (up to spaces) "#define ERR_LIB_<LIBNAME> <ERRCODE>", |
| 110 | e.g., "# define ERR_LIB_NONE 1". |
| 111 | """ |
| 112 | pat = re.compile(r"#\s*define\W+(ERR_LIB_(\w+))\s+(\d+)") |
| 113 | lib2errnum = {} |
| 114 | for match in _file_search(args.err_h, pat): |
| 115 | macroname, libname, num = match.groups() |
| 116 | if macroname in ['ERR_LIB_OFFSET', 'ERR_LIB_MASK']: |
| 117 | # ignore: "# define ERR_LIB_OFFSET 23L" |
| 118 | # ignore: "# define ERR_LIB_MASK 0xFF" |
| 119 | continue |
| 120 | actual = int(num) |
| 121 | expect = lib2errnum.setdefault(libname, actual) |
| 122 | if actual != expect: |
| 123 | logger.warning("OpenSSL inconsistency for ERR_LIB_%s (%d != %d)", |
| 124 | libname, actual, expect) |
| 125 | return lib2errnum |
| 126 | |
| 127 | |
| 128 | def parse_openssl_error_text(args): |
no test coverage detected
searching dependent graphs…