@@ -36,10 +36,10 @@ def test_assert():
36
36
if sys .platform == "darwin" :
37
37
assert stderr .startswith ("Assertion failed: (false), function my_assert, file test-signalhandler.cpp, line " ), stderr
38
38
else :
39
- assert stderr .endswith ("test-signalhandler.cpp:34 : void my_assert(): Assertion `false' failed.\n " ), stderr
39
+ assert stderr .endswith ("test-signalhandler.cpp:41 : void my_assert(): Assertion `false' failed.\n " ), stderr
40
40
lines = stdout .splitlines ()
41
41
assert lines [0 ] == 'Internal error: cppcheck received signal SIGABRT - abort or assertion'
42
- # no stacktrace of MacOs
42
+ # no stacktrace of macOS
43
43
if sys .platform != "darwin" :
44
44
assert lines [1 ] == 'Callstack:'
45
45
assert lines [2 ].endswith ('my_abort()' ), lines [2 ] # TODO: wrong function
@@ -50,7 +50,7 @@ def test_abort():
50
50
_ , stdout , _ = __call_process ('abort' )
51
51
lines = stdout .splitlines ()
52
52
assert lines [0 ] == 'Internal error: cppcheck received signal SIGABRT - abort or assertion'
53
- # no stacktrace on MaCos
53
+ # no stacktrace on macOS
54
54
if sys .platform != "darwin" :
55
55
assert lines [1 ] == 'Callstack:'
56
56
assert lines [2 ].endswith ('my_segv()' ), lines [2 ] # TODO: wrong function
@@ -65,21 +65,20 @@ def test_segv():
65
65
assert lines [0 ] == 'Internal error: cppcheck received signal SIGSEGV - SEGV_MAPERR (at 0x0).'
66
66
else :
67
67
assert lines [0 ] == 'Internal error: cppcheck received signal SIGSEGV - SEGV_MAPERR (reading at 0x0).'
68
- # no stacktrace on MacOS
68
+ # no stacktrace on macOS
69
69
if sys .platform != "darwin" :
70
70
assert lines [1 ] == 'Callstack:'
71
71
assert lines [2 ].endswith ('my_segv()' ), lines [2 ] # TODO: wrong function
72
72
assert lines [len (lines )- 1 ] == 'Please report this to the cppcheck developers!'
73
73
74
74
75
- # TODO: make this work
76
- @pytest .mark .skip
75
+ @pytest .mark .skipif (sys .platform == 'darwin' , reason = 'Cannot raise FPE on macOS' )
77
76
def test_fpe ():
78
77
_ , stdout , stderr = __call_process ('fpe' )
79
78
assert stderr == ''
80
79
lines = stdout .splitlines ()
81
- assert lines [0 ].startswith ('Internal error: cppcheck received signal SIGFPE - FPE_FLTDIV (at 0x7f ' ), lines [0 ]
80
+ assert lines [0 ].startswith ('Internal error: cppcheck received signal SIGFPE - FPE_FLTINV (at 0x ' ), lines [0 ]
82
81
assert lines [0 ].endswith (').' ), lines [0 ]
83
82
assert lines [1 ] == 'Callstack:'
84
- assert lines [2 ].endswith ('my_fpe()' ), lines [2 ]
83
+ assert lines [3 ].endswith ('my_fpe()' ), lines [2 ]
85
84
assert lines [len (lines )- 1 ] == 'Please report this to the cppcheck developers!'
0 commit comments