summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorEirik Aavitsland <eirik.aavitsland@qt.io>2022-01-11 11:43:31 +0100
committerEirik Aavitsland <eirik.aavitsland@qt.io>2022-01-19 12:58:22 +0000
commit5cd35711a28d6d8579ab2eacc066570591e5ff5b (patch)
tree4d6b4b1d6532118b4cbf88cc0319e9537205ffb8 /tests
parentf7ac5968fc92d9c656b4c2f742ee8245a9692bb4 (diff)
Baseline test framework: fix bug in internal data structure
The 'misc' data field was not copied in the assignment operator. That field is normally not used, so this bug went undiscovered for a long time. But in certain cases, the bug would cause an image size mismatch to be reported as just a normal mismatch. Fix the source of the problem by following the rule of zero - the compiler generated special functions are just fine for this value type. Done-With: Volker Hilsheimer <volker.hilsheimer@qt.io> Pick-to: 6.3 6.2 Change-Id: I8fc8d32d1b83b78cd4ef3f4ec9a8f22661b0e025 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/baseline/shared/baselineprotocol.cpp11
-rw-r--r--tests/baseline/shared/baselineprotocol.h14
2 files changed, 2 insertions, 23 deletions
diff --git a/tests/baseline/shared/baselineprotocol.cpp b/tests/baseline/shared/baselineprotocol.cpp
index 297574744d..9f4c3721fc 100644
--- a/tests/baseline/shared/baselineprotocol.cpp
+++ b/tests/baseline/shared/baselineprotocol.cpp
@@ -163,17 +163,6 @@ QDataStream & operator>> (QDataStream &stream, PlatformInfo &pi)
}
-ImageItem &ImageItem::operator=(const ImageItem &other)
-{
- testFunction = other.testFunction;
- itemName = other.itemName;
- itemChecksum = other.itemChecksum;
- status = other.status;
- image = other.image;
- imageChecksums = other.imageChecksums;
- return *this;
-}
-
// Defined in lookup3.c:
void hashword2 (
const quint32 *k, /* the key, an array of quint32 values */
diff --git a/tests/baseline/shared/baselineprotocol.h b/tests/baseline/shared/baselineprotocol.h
index 3786c3390a..e03fdb7e04 100644
--- a/tests/baseline/shared/baselineprotocol.h
+++ b/tests/baseline/shared/baselineprotocol.h
@@ -82,16 +82,6 @@ QDataStream & operator>> (QDataStream &stream, PlatformInfo& pi);
struct ImageItem
{
-public:
- ImageItem()
- : status(Ok), itemChecksum(0)
- {}
- ImageItem(const ImageItem &other)
- { *this = other; }
- ~ImageItem()
- {}
- ImageItem &operator=(const ImageItem &other);
-
static quint64 computeChecksum(const QImage& image);
enum ItemStatus {
@@ -105,10 +95,10 @@ public:
QString testFunction;
QString itemName;
- ItemStatus status;
+ ItemStatus status = Ok;
QImage image;
QList<quint64> imageChecksums;
- quint16 itemChecksum;
+ quint16 itemChecksum = 0;
QByteArray misc;
void writeImageToStream(QDataStream &stream) const;