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

Function test_removedirectives

test/tools/reduce_test.py:40–64  ·  view source on GitHub ↗

do not remove any of the #if*, #el* or #endif directives on their own

()

Source from the content-addressed store, hash-verified

38
39
40def test_removedirectives():
41 """do not remove any of the #if*, #el* or #endif directives on their own"""
42
43 reduce = ReduceTest()
44
45 filedata = [
46 '#if 0\n',
47 '#else\n',
48 '#endif\n',
49 '#ifdef DEF\n',
50 '#elif 0\n'
51 '#endif\n'
52 ]
53
54 expected = [
55 '#if 0\n',
56 '#else\n',
57 '#endif\n',
58 '#ifdef DEF\n',
59 '#elif 0\n'
60 '#endif\n'
61 ]
62
63 reduce.removedirectives(filedata)
64 assert filedata == expected
65
66
67def test_combinelines_chunk():

Callers

nothing calls this directly

Calls 2

ReduceTestClass · 0.85
removedirectivesMethod · 0.80

Tested by

no test coverage detected