MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / __get_debug_section

Function __get_debug_section

test/cli/clang-import_test.py:23–43  ·  view source on GitHub ↗
(title, stdout)

Source from the content-addressed store, hash-verified

21
22
23def __get_debug_section(title, stdout):
24 s = re.sub(r'0x[0-9a-fA-F]+', '0x12345678', stdout)
25 s = re.sub(r'nestedIn: Struct', 'nestedIn: Class', s)
26 s = re.sub(r'classDef: struct', 'classDef: class', s)
27 s = re.sub(r'isInline: [a-z]+', 'isInline: ---', s)
28 s = re.sub(r'needInitialization: .*', 'needInitialization: ---', s)
29 s = re.sub(r'functionOf: .*', 'functionOf: ---', s)
30 s = re.sub(r'0x12345678 Struct', '0x12345678 Class', s)
31
32 if title == '##AST':
33 # TODO set types
34 s = re.sub(r"return '[a-zA-Z0-9: *]+'", "return", s)
35
36 pos1 = s.find(title)
37 assert pos1 > 0, 'title not found'
38 pos1 = s.find('\n', pos1) + 1
39 assert pos1 > 0
40 pos2 = s.find("\n##", pos1)
41 if pos2 < 0:
42 return s[pos1:]
43 return s[pos1:pos2-1]
44
45
46def __check_symbol_database(tmpdir, code):

Callers 2

__check_symbol_databaseFunction · 0.85
__check_astFunction · 0.85

Calls 1

findMethod · 0.45

Tested by

no test coverage detected