cppcheck/test/cfg/qt.cpp

22 lines
499 B
C++
Raw Normal View History

2017-04-18 18:04:27 +02:00
// 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
// =>
// No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0
//
class QString {
public:
int size();
char &operator[](int pos);
};
void QString1(QString s) {
for (int i = 0; i <= s.size(); ++i) {
// cppcheck-suppress stlOutOfBounds
s[i] = 'x';
}
}