()
| 35 | |
| 36 | |
| 37 | def 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 | |
| 53 | def test_abort(): |
nothing calls this directly
no test coverage detected