MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / test_isKeyword

Function test_isKeyword

addons/test/misra_test.py:222–244  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

220 assert isStdLibId("sprintf_s") is False
221
222def test_isKeyword():
223 # Check that Keywords from C90 are correctly classified
224 assert isKeyword("if", 'c89') is True
225 assert isKeyword("if", 'c99') is True
226 assert isKeyword("if", 'c11') is True
227 assert isKeyword("if", 'c23') is True
228
229 # Check that Keywords from C99 are correctly classified
230 assert isKeyword("inline", 'c89') is False
231 assert isKeyword("inline", 'c99') is True
232 assert isKeyword("inline", 'c11') is True
233 assert isKeyword("inline", 'c23') is True
234
235 # Check that Keywords from C11 are correctly classified
236 assert isKeyword("static_assert", 'c89') is False
237 assert isKeyword("static_assert", 'c99') is False
238 assert isKeyword("static_assert", 'c11') is True
239 assert isKeyword("static_assert", 'c23') is True
240
241 # Function Defaulting to C99
242 assert isKeyword("if") is True
243 assert isKeyword("inline") is True
244 assert isKeyword("static_assert") is False

Callers

nothing calls this directly

Calls 1

isKeywordFunction · 0.90

Tested by

no test coverage detected