33import sys
44import pytest
55
6- def _lookup_cppcheck_exe (exe_name ):
6+ def __lookup_cppcheck_exe (exe_name ):
77 # path the script is located in
88 script_path = os .path .dirname (os .path .realpath (__file__ ))
99
@@ -19,8 +19,8 @@ def _lookup_cppcheck_exe(exe_name):
1919
2020 return None
2121
22- def _call_process (arg ):
23- exe = _lookup_cppcheck_exe ('test-signalhandler' )
22+ def __call_process (arg ):
23+ exe = __lookup_cppcheck_exe ('test-signalhandler' )
2424 if exe is None :
2525 raise Exception ('executable not found' )
2626 p = subprocess .Popen ([exe , arg ], stdout = subprocess .PIPE , stderr = subprocess .PIPE )
@@ -31,7 +31,7 @@ def _call_process(arg):
3131
3232
3333def test_assert ():
34- _ , stdout , stderr = _call_process ('assert' )
34+ _ , stdout , stderr = __call_process ('assert' )
3535 if sys .platform == "darwin" :
3636 assert stderr .startswith ("Assertion failed: (false), function my_assert, file test-signalhandler.cpp, line " ), stderr
3737 else :
@@ -46,7 +46,7 @@ def test_assert():
4646
4747
4848def test_abort ():
49- _ , stdout , _ = _call_process ('abort' )
49+ _ , stdout , _ = __call_process ('abort' )
5050 lines = stdout .splitlines ()
5151 assert lines [0 ] == 'Internal error: cppcheck received signal SIGABRT - abort or assertion'
5252 # no stacktrace on MaCos
@@ -57,7 +57,7 @@ def test_abort():
5757
5858
5959def test_segv ():
60- _ , stdout , stderr = _call_process ('segv' )
60+ _ , stdout , stderr = __call_process ('segv' )
6161 assert stderr == ''
6262 lines = stdout .splitlines ()
6363 if sys .platform == "darwin" :
@@ -74,7 +74,7 @@ def test_segv():
7474# TODO: make this work
7575@pytest .mark .skip
7676def test_fpe ():
77- _ , stdout , stderr = _call_process ('fpe' )
77+ _ , stdout , stderr = __call_process ('fpe' )
7878 assert stderr == ''
7979 lines = stdout .splitlines ()
8080 assert lines [0 ].startswith ('Internal error: cppcheck received signal SIGFPE - FPE_FLTDIV (at 0x7f' ), lines [0 ]
0 commit comments