()
| 63 | |
| 64 | |
| 65 | def test_segv(): |
| 66 | exitcode, stdout, stderr = __call_process('segv') |
| 67 | assert stderr == '' |
| 68 | lines = stdout.splitlines() |
| 69 | if sys.platform == "darwin": |
| 70 | if Version(platform.mac_ver()[0]) >= Version('14'): |
| 71 | assert lines[0] == 'Internal error: cppcheck received signal SIGSEGV - SEGV_ACCERR (at 0x0).' |
| 72 | else: |
| 73 | assert lines[0] == 'Internal error: cppcheck received signal SIGSEGV - SEGV_MAPERR (at 0x0).' |
| 74 | else: |
| 75 | assert lines[0] == 'Internal error: cppcheck received signal SIGSEGV - SEGV_MAPERR (reading at 0x0).' |
| 76 | # no stacktrace on macOS |
| 77 | if sys.platform != "darwin": |
| 78 | assert lines[1] == 'Callstack:' |
| 79 | assert lines[2].endswith('my_segv()'), lines[2] # TODO: wrong function |
| 80 | assert lines[len(lines)-1] == 'Please report this to the cppcheck developers!' |
| 81 | assert exitcode == -11 |
| 82 | |
| 83 | |
| 84 | @pytest.mark.skipif(sys.platform == 'darwin', reason='Cannot raise FPE on macOS') |
nothing calls this directly
no test coverage detected