qt.cfg: Add reademptycontainer test

This commit is contained in:
Daniel Marjamäki 2017-04-18 18:47:35 +02:00
parent c229754a70
commit 01c5c2fc5b
2 changed files with 8 additions and 2 deletions

View File

@ -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);
}

View File

@ -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