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

Function test_assert

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

Source from the content-addressed store, hash-verified

35
36
37def test_assert():
38 exitcode, stdout, stderr = __call_process('assert')
39 if sys.platform == "darwin":
40 assert stderr.startswith("Assertion failed: (false), function my_assert, file test-signalhandler.cpp, line "), stderr
41 else:
42 assert stderr.endswith("test-signalhandler.cpp:43: void my_assert(): Assertion `false' failed.\n"), stderr
43 lines = stdout.splitlines()
44 assert lines[0] == 'Internal error: cppcheck received signal SIGABRT - abort or assertion'
45 # no stacktrace of macOS
46 if sys.platform != "darwin":
47 assert lines[1] == 'Callstack:'
48 assert lines[2].endswith('my_abort()'), lines[2] # TODO: wrong function
49 assert lines[len(lines)-1] == 'Please report this to the cppcheck developers!'
50 assert exitcode == -6
51
52
53def test_abort():

Callers

nothing calls this directly

Calls 1

__call_processFunction · 0.70

Tested by

no test coverage detected