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

Function test_2_no_time_bits

addons/test/y2038_test.py:64–78  ·  view source on GitHub ↗
(capsys)

Source from the content-addressed store, hash-verified

62
63
64def test_2_no_time_bits(capsys):
65 is_safe = check_y2038_safe('./addons/test/y2038/y2038-test-2-no-time-bits.c.dump', quiet=True)
66 assert(is_safe is False)
67 captured = capsys.readouterr()
68 captured = captured.out.splitlines()
69 json_output = convert_json_output(captured)
70
71 # _USE_TIME_BITS64 defined in y2038-inc.h header, but there is not
72 # _TIME_BITS definition. Here must be appropriate warning.
73 assert(len(json_output['type-bits-undef']) == 1)
74 assert(json_output.get('type-bits-not-64') is None)
75
76 # y2038-in.h still has y2038-unsafe calls.
77 unsafe_calls = json_output['unsafe-call']
78 assert(len([c for c in unsafe_calls if c['file'].endswith('h')]) == 3)
79
80
81def test_3_no_use_time_bits(capsys):

Callers

nothing calls this directly

Calls 3

check_y2038_safeFunction · 0.90
convert_json_outputFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected