From 01c5c2fc5b7d0522ed4e98046b40f6ccb44ad08f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Tue, 18 Apr 2017 18:47:35 +0200 Subject: [PATCH] qt.cfg: Add reademptycontainer test --- test/cfg/qt.cpp | 8 +++++++- test/cfg/runtests.sh | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/test/cfg/qt.cpp b/test/cfg/qt.cpp index 59b205ee5..accd84f1c 100644 --- a/test/cfg/qt.cpp +++ b/test/cfg/qt.cpp @@ -2,7 +2,7 @@ // Test library configuration for qt.cfg // // Usage: -// $ cppcheck --check-library --enable=information --error-exitcode=1 --suppress=missingIncludeSystem --inline-suppr --library=qt test/cfg/qt.cpp +// $ cppcheck --check-library --enable=information --inconclusive --error-exitcode=1 --suppress=missingIncludeSystem --inline-suppr --library=qt test/cfg/qt.cpp // => // No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0 // @@ -19,3 +19,9 @@ void QString1(QString s) { s[i] = 'x'; } } + +int QString2() { + QString s; + // cppcheck-suppress reademptycontainer + s.at(10); +} \ No newline at end of file diff --git a/test/cfg/runtests.sh b/test/cfg/runtests.sh index 094e6c909..c72e24617 100755 --- a/test/cfg/runtests.sh +++ b/test/cfg/runtests.sh @@ -29,7 +29,7 @@ ${CPPCHECK} ${CPPCHECK_OPT} --library=gnu ${DIR}gnu.c # qt.cpp ${CXX} ${CXX_OPT} ${DIR}qt.cpp -${CPPCHECK} --enable=style --enable=information --inline-suppr --error-exitcode=1 --library=qt ${DIR}qt.cpp +${CPPCHECK} --enable=style --enable=information --inconclusive --inline-suppr --error-exitcode=1 --library=qt ${DIR}qt.cpp # std.c ${CC} ${CC_OPT} ${DIR}std.c