diff options
author | Alon Zakai <alonzakai@gmail.com> | 2014-03-01 11:51:05 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2014-03-01 13:31:43 -0800 |
commit | 0f23cac48fe4e5278e5b35f6a40e6f8a214d5e7c (patch) | |
tree | f040a29744747b63ec7a1dda13ceaebe74ea50b3 /tests | |
parent | cde8796577b2d1959b5322172bec85ba6b10647c (diff) |
improve assertions message on function pointer errors
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_other.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/test_other.py b/tests/test_other.py index 8b507306..678fa90d 100644 --- a/tests/test_other.py +++ b/tests/test_other.py @@ -556,10 +556,10 @@ f.close() else: # fastcomp. all asm, so it can't just work with wrong sigs. but, ASSERTIONS=2 gives much better info to debug test(['-O1'], 'abort') # no useful info - test(['-O1', '-s', 'ASSERTIONS=1'], '''Invalid function pointer called with signature 'v'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an different type, which will fail? + test(['-O1', '-s', 'ASSERTIONS=1'], '''Invalid function pointer called with signature 'v'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this) Build with ASSERTIONS=2 for more info. ''') # some useful text - test(['-O1', '-s', 'ASSERTIONS=2'], '''Invalid function pointer '1' called with signature 'v'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an different type, which will fail? + test(['-O1', '-s', 'ASSERTIONS=2'], '''Invalid function pointer '1' called with signature 'v'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this) This pointer might make sense in another type signature: i: _my_func ''') # actually useful identity of the bad pointer, with comparisons to what it would be in other types/tables |