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>
This commit is contained in:
Eirik Aavitsland 2022-01-11 11:43:31 +01:00
parent f7ac5968fc
commit 5cd35711a2
2 changed files with 2 additions and 23 deletions

View File

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

View File

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