Suppress a broken benchmark comparing QVector to std::vector
The test constructs an ersatz object with which to overwrite a QVector's internals, but based it on Qt 5's memory layout. Since Qt 6 completely rearranged that memory layout, the test now crashes (or, in a debug build, trips over an out-of-bounds assertion). So suppress the test until those who perpetrated it and/or the reworking of QVector's internals can work out how to fix it. That way, QA can at least run the benchmark without crashing. Task-number: QTBUG-95061 Pick-to: 6.2 Change-Id: I0e8c8d58f2002497f6e29d0ad25f840e207704a4 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
parent
1969a25cee
commit
406bb11a4e
@ -1,6 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2016 The Qt Company Ltd.
|
** Copyright (C) 2021 The Qt Company Ltd.
|
||||||
** Contact: https://www.qt.io/licensing/
|
** Contact: https://www.qt.io/licensing/
|
||||||
**
|
**
|
||||||
** This file is part of the test suite of the Qt Toolkit.
|
** This file is part of the test suite of the Qt Toolkit.
|
||||||
@ -175,6 +175,16 @@ sys 0m0.008s
|
|||||||
|
|
||||||
|
|
||||||
#define TEST_RETURN 1
|
#define TEST_RETURN 1
|
||||||
|
#if TEST_RETURN
|
||||||
|
/* QRawVector::mutateToVector() hacks a semblance of a Qt 5 QVector.
|
||||||
|
|
||||||
|
However, Qt 6's QVector is Qt 6's QList and completely different in internal
|
||||||
|
layout. The QTypedArrayData inside it is also completely rearranged. Until
|
||||||
|
QRawVector can be rewritten to do whatever it's supposed to do in a
|
||||||
|
Qt6-compatible way, this test is suppressed, see QTBUG-95061.
|
||||||
|
*/
|
||||||
|
#define TEST_RAW 0
|
||||||
|
#endif
|
||||||
|
|
||||||
// For some reason, both 'plain' and '-callgrind' create strange results
|
// For some reason, both 'plain' and '-callgrind' create strange results
|
||||||
// (like varying instruction count for the same assembly code)
|
// (like varying instruction count for the same assembly code)
|
||||||
@ -218,9 +228,9 @@ private slots:
|
|||||||
void qrawvector_separator() { qWarning() << "QRawVector results: "; }
|
void qrawvector_separator() { qWarning() << "QRawVector results: "; }
|
||||||
void qrawvector_const_read_access();
|
void qrawvector_const_read_access();
|
||||||
void qrawvector_mutable_read_access();
|
void qrawvector_mutable_read_access();
|
||||||
#ifdef TEST_RETURN
|
#if TEST_RAW
|
||||||
void qrawvector_fill_and_return();
|
void qrawvector_fill_and_return();
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
const int N = 1000000;
|
const int N = 1000000;
|
||||||
@ -321,9 +331,7 @@ void tst_QVector::qvector_pop_back()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if TEST_RAW
|
||||||
|
|
||||||
#ifdef TEST_RETURN
|
|
||||||
extern QVector<double> qrawvector_fill_and_return_helper();
|
extern QVector<double> qrawvector_fill_and_return_helper();
|
||||||
|
|
||||||
void tst_QVector::qrawvector_fill_and_return()
|
void tst_QVector::qrawvector_fill_and_return()
|
||||||
|
@ -217,6 +217,7 @@ private:
|
|||||||
public:
|
public:
|
||||||
QVector<T> mutateToVector()
|
QVector<T> mutateToVector()
|
||||||
{
|
{
|
||||||
|
Q_ASSERT(!"Fix QTBUG-95061 before calling this; it is broken beyond repair");
|
||||||
Data *d = toBase(m_begin);
|
Data *d = toBase(m_begin);
|
||||||
d->ref.initializeOwned();
|
d->ref.initializeOwned();
|
||||||
d->alloc = m_alloc;
|
d->alloc = m_alloc;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user