(capsys)
| 45 | |
| 46 | |
| 47 | def test_1_bad_time_bits(capsys): |
| 48 | is_safe = check_y2038_safe('./addons/test/y2038/y2038-test-1-bad-time-bits.c.dump', quiet=True) |
| 49 | assert(is_safe is False) |
| 50 | captured = capsys.readouterr() |
| 51 | captured = captured.out.splitlines() |
| 52 | json_output = convert_json_output(captured) |
| 53 | |
| 54 | # Has exactly one warnings of _TIME_BITS and _USE_TIME_BITS64 kind. |
| 55 | assert(len(json_output['type-bits-undef']) == 1) |
| 56 | assert(len(json_output['type-bits-not-64']) == 1) |
| 57 | |
| 58 | # There are 2 unsafe calls in test source and 3 in y2038-in.h |
| 59 | unsafe_calls = json_output['unsafe-call'] |
| 60 | assert(len([c for c in unsafe_calls if c['file'].endswith('h')]) == 3) |
| 61 | assert(len([c for c in unsafe_calls if c['file'].endswith('c')]) == 0) |
| 62 | |
| 63 | |
| 64 | def test_2_no_time_bits(capsys): |
nothing calls this directly
no test coverage detected