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

Function test_segv

test/signal/test-signalhandler.py:65–81  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

63
64
65def 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')

Callers

nothing calls this directly

Calls 1

__call_processFunction · 0.70

Tested by

no test coverage detected