From 55ce6d2073eebb0aa70336034c0d0ba1dfe95f50 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Wed, 6 Feb 2019 13:23:05 +0100 Subject: [PATCH] qt.cfg: Add support and tests for QFile::exists function (#1645) Found by daca@home --- cfg/qt.cfg | 12 ++++++++++++ test/cfg/qt.cpp | 16 ++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/cfg/qt.cfg b/cfg/qt.cfg index 74fa18536..408ee1c30 100644 --- a/cfg/qt.cfg +++ b/cfg/qt.cfg @@ -1137,6 +1137,18 @@ + + + + false + + + + + + + + diff --git a/test/cfg/qt.cpp b/test/cfg/qt.cpp index 849c5b3f8..5b24fcdb9 100644 --- a/test/cfg/qt.cpp +++ b/test/cfg/qt.cpp @@ -10,6 +10,7 @@ #include #include #include +#include void QString1(QString s) @@ -36,3 +37,18 @@ public: explicit MacroTest1(QObject *parent = 0); ~MacroTest1(); }; + +void validCode() +{ + if (QFile::exists("test")) + {} +} + +void ignoredReturnValue() +{ + // cppcheck-suppress ignoredReturnValue + QFile::exists("test"); + QFile file1("test"); + // cppcheck-suppress ignoredReturnValue + file1.exists(); +}