Commit 07a76e4d authored by Maximilien Colange's avatar Maximilien Colange

Do not warn about static_asserts.

* tests/sanity/style.test: Filter out static_assert.
parent 6c6660f4
......@@ -263,7 +263,7 @@ for dir in "$TOP/spot" "$TOP/bin" "$TOP/tests"; do
e$GREP '(->|[.])size\(\) [=!]= 0|![a-zA-Z0-9_]*(->|[.])size\(\)|(if |while |assert)\([a-zA-Z0-9_]*(->|[.])size\(\)\)' $tmp &&
diag 'Prefer empty() to check emptiness.'
e$GREP 'assert\((0|!".*")\)' $tmp &&
e$GREP 'assert\((0|!".*")\)' $tmp | $GREP -v 'static_assert' &&
  • Je ne vois pas l'intérêt du second grep ici. Qui va écrire static_assert(0) ou static_assert(!"foo") ?

Please register or sign in to reply
diag 'Prefer SPOT_UNREACHABLE or SPOT_UNIMPLEMENTED.'
e$GREP '^[^=*<]*([+][+]|--);' $tmp &&
......@@ -303,8 +303,8 @@ for dir in "$TOP/spot" "$TOP/bin" "$TOP/tests"; do
*)
$GREP '#.*include.*priv/' $tmp &&
diag 'Do not include private headers in public headers.'
$GREP -v '#' $tmp | $GREP 'assert[ ]*(.*)' &&
diag 'Use SPOT_ASSERT() instead of assert() in public headers.'
$GREP -v '#' $tmp | $GREP 'assert[ ]*(.*)' | $GREP -v 'static_assert'&&
diag 'Use SPOT_ASSERT() instead of assert() in public headers.'
;;
esac
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment