Skip to content

misra-test.c: Add more tests for rule 14.2 (including FP and FN)#2399

Merged
versat merged 2 commits into
cppcheck-opensource:masterfrom
versat:misra_test_14_2_fp_fn
Nov 30, 2019
Merged

misra-test.c: Add more tests for rule 14.2 (including FP and FN)#2399
versat merged 2 commits into
cppcheck-opensource:masterfrom
versat:misra_test_14_2_fp_fn

Conversation

@versat
Copy link
Copy Markdown
Collaborator

@versat versat commented Nov 26, 2019

Adding more tests for rule 14.2 revealed a false negative when the
loop counter is changed inside the loop.
Corresponding line in the example suite:
https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/blob/master/R_14_02.c#L39
Also a false positive has been revealed when the loop counter is
initialized in a function that is called in the first for clause.
Corresponding line in the example suite:
https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/blob/master/R_14_02.c#L43

Adding more tests for rule 14.2 revealed a false negative when the
loop counter is changed inside the loop.
Corresponding line in the example suite:
https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/blob/master/R_14_02.c#L39
Also a false positive has been revealed when the loop counter is
initialized in a function that is called in the first `for` clause.
Corresponding line in the example suite:
https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/blob/master/R_14_02.c#L43
@versat
Copy link
Copy Markdown
Collaborator Author

versat commented Nov 26, 2019

Trac ticket for false negative: https://trac.cppcheck.net/ticket/9490

@versat
Copy link
Copy Markdown
Collaborator Author

versat commented Nov 26, 2019

Trac ticket for false positive: https://trac.cppcheck.net/ticket/9491

Comment thread addons/test/misra/misra-test.c
@versat versat requested a review from danmar November 29, 2019 12:06
@jubnzv
Copy link
Copy Markdown
Contributor

jubnzv commented Nov 29, 2019

Sorry, I'd create some merge conflict with my changes. Here's fix for FN: #2409.

@versat versat merged commit 8d114a4 into cppcheck-opensource:master Nov 30, 2019
@versat versat deleted the misra_test_14_2_fp_fn branch December 2, 2019 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants