summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authortsjordan-eng <55999897+tsjordan-eng@users.noreply.github.com>2021-09-03 07:31:17 -0600
committerGitHub <noreply@github.com>2021-09-03 22:31:17 +0900
commitb9fdb91e9294b091a56a9da0b8ae705490cd95c6 (patch)
tree9775fa05ebbeaa5352aefe4691162381e8d93740 /test
parentd53a085096306c890897385692693ee653aaddce (diff)
downloadale-b9fdb91e9294b091a56a9da0b8ae705490cd95c6.zip
Cppcheck backwards compat 1.34 (#3887)
* Add support for cppcheck 1.34 * Add cppcheck 1.34 tests, correct pattern Co-authored-by: Tyler S. Jordan <tsjorda@sandia.gov>
Diffstat (limited to 'test')
-rw-r--r--test/handler/test_cppcheck_handler.vader28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/handler/test_cppcheck_handler.vader b/test/handler/test_cppcheck_handler.vader
index 55a5d29b..2a740722 100644
--- a/test/handler/test_cppcheck_handler.vader
+++ b/test/handler/test_cppcheck_handler.vader
@@ -35,6 +35,34 @@ Execute(Basic errors should be handled by cppcheck):
\ ' ^',
\ ])
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 974,
+ \ 'col' : 1,
+ \ 'type': 'E',
+ \ 'sub_type': '',
+ \ 'text': 'inconclusive Array ''n[3]'' accessed at index 3, which is out of bounds.',
+ \ 'code': 'arrayIndexOutOfBounds'
+ \ },
+ \ {
+ \ 'lnum': 1185,
+ \ 'col' : 1,
+ \ 'type': 'W',
+ \ 'sub_type': 'style',
+ \ 'text': 'The scope of the variable ''indxStr'' can be reduced.',
+ \ 'code': 'variableScope'
+ \ },
+ \ ],
+ \ ale#handlers#cppcheck#HandleCppCheckFormat(bufnr(''), [
+ \ 'test.cpp:974:{column}: error:inconclusive Array ''n[3]'' accessed at index 3, which is out of bounds. [arrayIndexOutOfBounds]\',
+ \ ' n[3]=3;',
+ \ ' ^',
+ \ 'test.cpp:1185:{column}: style:{inconclusive:inconclusive} The scope of the variable ''indxStr'' can be reduced. [variableScope]\',
+ \ ' char indxStr[16];',
+ \ ' ^',
+ \ ])
+
Execute(Problems from other files should be ignored by cppcheck):
call ale#test#SetFilename('test.cpp')