Skip to content

Commit 781ad94

Browse files
committed
made all suppressions in cfg tests inline / added TODOs [skip ci]
1 parent e2081e8 commit 781ad94

File tree

15 files changed

+69
-48
lines changed

15 files changed

+69
-48
lines changed

test/CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ if (BUILD_TESTS)
115115
else()
116116
# TODO: remove missingInclude disabling when it no longer is implied by --enable=information
117117
# TODO: add syntax check
118-
# need to suppress unmatchedSuppression in case valueFlowBailout is not reported
119118
add_test(NAME cfg-${TEST_NAME}
120119
COMMAND $<TARGET_FILE:cppcheck>
121120
--library=${LIBRARY}
@@ -129,9 +128,6 @@ if (BUILD_TESTS)
129128
--disable=missingInclude
130129
--inline-suppr
131130
--debug-warnings
132-
--suppress=valueFlowBailout
133-
--suppress=purgedConfiguration
134-
--suppress=unmatchedSuppression
135131
${CMAKE_CURRENT_SOURCE_DIR}/cfg/${CFG_TEST}
136132
)
137133
endif()

test/cfg/boost.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
// No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0
88
//
99

10+
// cppcheck-suppress-file valueFlowBailout
11+
1012
#include <boost/config.hpp>
1113
#include <boost/math/special_functions/round.hpp>
1214
#include <boost/endian/conversion.hpp>

test/cfg/bsd.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
// No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0
77
//
88

9+
// cppcheck-suppress-file valueFlowBailout
10+
911
#include <string.h>
1012
#include <stdlib.h>
1113
#include <stdint.h>

test/cfg/cppunit.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
// No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0
77
//
88

9+
// cppcheck-suppress-file valueFlowBailout
10+
911
#include <cppunit/TestAssert.h>
1012

1113
void cppunit_assert_equal(int x, double y)

test/cfg/gnu.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
// No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0
88
//
99

10+
// cppcheck-suppress-file valueFlowBailout
11+
1012
#include <string.h>
1113
#include <stdlib.h>
1214
#include <stdint.h>

test/cfg/googletest.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
// No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0
88
//
99

10+
// cppcheck-suppress-file valueFlowBailout
11+
1012
#include <gmock/gmock-generated-matchers.h>
1113
#include <gtest/gtest.h>
1214

test/cfg/libcurl.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
// No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0
88
//
99

10+
// cppcheck-suppress-file valueFlowBailout
11+
1012
#include <curl/curl.h>
1113
#include <stdio.h>
1214

test/cfg/opencv2.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
// No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0
88
//
99

10+
// cppcheck-suppress-file valueFlowBailout
11+
1012
#include <iostream>
1113
#include <opencv2/opencv.hpp>
1214

test/cfg/posix.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
// No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0
88
//
99

10+
// cppcheck-suppress-file [valueFlowBailout,purgedConfiguration]
11+
1012
#define _BSD_SOURCE
1113

1214
#include <aio.h>

test/cfg/qt.cpp

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
// No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0
88
//
99

10+
// cppcheck-suppress-file [valueFlowBailout,unmatchedSuppression] - TODO: remove unmatchedSuppression
11+
1012
#include <QObject>
1113
#include <QString>
1214
#include <QVector>
@@ -35,9 +37,9 @@
3537

3638
void unreadVariable_QRegion(const int x, const QRegion::RegionType type, const QPolygon &polygon, const QBitmap &bm, const QRegion &region, const Qt::FillRule fillRule)
3739
{
38-
// cppcheck-suppress unreadVariable
40+
// TODO cppcheck-suppress unreadVariable
3941
QRegion a;
40-
// cppcheck-suppress unreadVariable
42+
// TODO cppcheck-suppress unreadVariable
4143
QRegion b{};
4244
// cppcheck-suppress unreadVariable
4345
QRegion c{x,x,x,x};
@@ -53,9 +55,9 @@ void unreadVariable_QRegion(const int x, const QRegion::RegionType type, const Q
5355

5456
void unreadVariable_QPoint(const QPoint &s)
5557
{
56-
// cppcheck-suppress unreadVariable
58+
// TODO cppcheck-suppress unreadVariable
5759
QPoint a;
58-
// cppcheck-suppress unreadVariable
60+
// TODO cppcheck-suppress unreadVariable
5961
QPoint b{};
6062
// cppcheck-suppress unreadVariable
6163
QPoint c{4, 2};
@@ -67,9 +69,9 @@ void unreadVariable_QPoint(const QPoint &s)
6769

6870
void unreadVariable_QPointF(const QPointF &s)
6971
{
70-
// cppcheck-suppress unreadVariable
72+
// TODO cppcheck-suppress unreadVariable
7173
QPointF a;
72-
// cppcheck-suppress unreadVariable
74+
// TODO cppcheck-suppress unreadVariable
7375
QPointF b{};
7476
// cppcheck-suppress unreadVariable
7577
QPointF c{4.2, 4.2};
@@ -81,9 +83,9 @@ void unreadVariable_QPointF(const QPointF &s)
8183

8284
void unreadVariable_QSizeF(const QSize &s)
8385
{
84-
// cppcheck-suppress unreadVariable
86+
// TODO cppcheck-suppress unreadVariable
8587
QSizeF a;
86-
// cppcheck-suppress unreadVariable
88+
// TODO cppcheck-suppress unreadVariable
8789
QSizeF b{};
8890
// cppcheck-suppress unreadVariable
8991
QSizeF c{4.2, 4.2};
@@ -95,9 +97,9 @@ void unreadVariable_QSizeF(const QSize &s)
9597

9698
void unreadVariable_QSize(const QSize &s)
9799
{
98-
// cppcheck-suppress unreadVariable
100+
// TODO cppcheck-suppress unreadVariable
99101
QSize a;
100-
// cppcheck-suppress unreadVariable
102+
// TODO cppcheck-suppress unreadVariable
101103
QSize b{};
102104
// cppcheck-suppress unreadVariable
103105
QSize c{4, 2};
@@ -108,9 +110,9 @@ void unreadVariable_QSize(const QSize &s)
108110
}
109111

110112
void unreadVariable_QRect(const QPoint &topLeft, const QSize &size, const QPoint &bottomRight, const int x) {
111-
// cppcheck-suppress unreadVariable
113+
// TODO cppcheck-suppress unreadVariable
112114
QRect a;
113-
// cppcheck-suppress unreadVariable
115+
// TODO cppcheck-suppress unreadVariable
114116
QRect b{};
115117
// cppcheck-suppress unreadVariable
116118
QRect c(0, 0, 100, 50);
@@ -123,9 +125,9 @@ void unreadVariable_QRect(const QPoint &topLeft, const QSize &size, const QPoint
123125
}
124126

125127
void unreadVariable_QRectF(const QPointF &topLeft, const QSizeF &size, const QPointF &bottomRight, const QRectF &rect, const qreal x) {
126-
// cppcheck-suppress unreadVariable
128+
// TODO cppcheck-suppress unreadVariable
127129
QRectF a;
128-
// cppcheck-suppress unreadVariable
130+
// TODO cppcheck-suppress unreadVariable
129131
QRectF b{};
130132
// cppcheck-suppress unreadVariable
131133
QRectF c(0.0, 0.0, 100.0, 50.0);
@@ -576,7 +578,6 @@ void validCode(int * pIntPtr, QString & qstrArg, double d)
576578

577579
printf(QT_TR_NOOP("Hi"));
578580

579-
// cppcheck-suppress checkLibraryFunction
580581
Q_DECLARE_LOGGING_CATEGORY(logging_category_test);
581582
QT_FORWARD_DECLARE_CLASS(forwardDeclaredClass);
582583
QT_FORWARD_DECLARE_STRUCT(forwardDeclaredStruct);

0 commit comments

Comments
 (0)