mirror of
https://github.com/crystalidea/qt6windows7.git
synced 2025-07-06 09:15:23 +08:00
qt 6.6.0 clean
This commit is contained in:
@ -31,6 +31,7 @@ class tst_QSortFilterProxyModel : public QObject
|
||||
private slots:
|
||||
void clearFilter_data();
|
||||
void clearFilter();
|
||||
void setSourceModel();
|
||||
|
||||
private:
|
||||
QStringList m_numberList; ///< Cache the strings for efficiency.
|
||||
@ -93,6 +94,19 @@ void tst_QSortFilterProxyModel::clearFilter()
|
||||
QCOMPARE(proxy.rowCount(), itemCount);
|
||||
}
|
||||
|
||||
void tst_QSortFilterProxyModel::setSourceModel()
|
||||
{
|
||||
QStringListModel model1;
|
||||
QStringListModel model2;
|
||||
|
||||
QSortFilterProxyModel proxy;
|
||||
|
||||
QBENCHMARK {
|
||||
proxy.setSourceModel(&model1);
|
||||
proxy.setSourceModel(&model2);
|
||||
}
|
||||
}
|
||||
|
||||
QTEST_MAIN(tst_QSortFilterProxyModel)
|
||||
|
||||
#include "tst_bench_qsortfilterproxymodel.moc"
|
||||
|
@ -455,10 +455,6 @@ void tst_QLocale::toLongLong()
|
||||
QBENCHMARK {
|
||||
actual = loc.toLongLong(text, &ok);
|
||||
}
|
||||
QEXPECT_FAIL("ar_EG: +403", "Code wrongly assumes single character, QTBUG-107801", Abort);
|
||||
QEXPECT_FAIL("ar_EG: -403", "Code wrongly assumes single character, QTBUG-107801", Abort);
|
||||
QEXPECT_FAIL("fa_IR: +403", "Code wrongly assumes single character, QTBUG-107801", Abort);
|
||||
QEXPECT_FAIL("fa_IR: -403", "Code wrongly assumes single character, QTBUG-107801", Abort);
|
||||
QCOMPARE(ok, good);
|
||||
QCOMPARE(actual, expected);
|
||||
}
|
||||
@ -488,8 +484,6 @@ void tst_QLocale::toULongLong()
|
||||
QBENCHMARK {
|
||||
actual = loc.toULongLong(text, &ok);
|
||||
}
|
||||
QEXPECT_FAIL("ar_EG: +403", "Code wrongly assumes single character, QTBUG-107801", Abort);
|
||||
QEXPECT_FAIL("fa_IR: +403", "Code wrongly assumes single character, QTBUG-107801", Abort);
|
||||
QCOMPARE(ok, good);
|
||||
QCOMPARE(actual, expected);
|
||||
}
|
||||
@ -588,9 +582,6 @@ void tst_QLocale::toDouble()
|
||||
QBENCHMARK {
|
||||
actual = loc.toDouble(text, &ok);
|
||||
}
|
||||
QEXPECT_FAIL("sv_SE: 4e-3", "Code wrongly assumes single character, QTBUG-107801", Abort);
|
||||
QEXPECT_FAIL("se_NO: 4e-3", "Code wrongly assumes single character, QTBUG-107801", Abort);
|
||||
QEXPECT_FAIL("ar_EG: 4e-3", "Code wrongly assumes single character, QTBUG-107801", Abort);
|
||||
QEXPECT_FAIL("en: ∞", "Localized infinity support missing: QTBUG-95460", Abort);
|
||||
QEXPECT_FAIL("ga: Nuimh", "Localized NaN support missing: QTBUG-95460", Abort);
|
||||
QCOMPARE(ok, good);
|
||||
|
@ -13,7 +13,7 @@ class tst_QFuture : public QObject
|
||||
Q_OBJECT
|
||||
|
||||
private slots:
|
||||
void makeReadyfuture();
|
||||
void makeReadyValueFuture();
|
||||
#ifndef QT_NO_EXCEPTIONS
|
||||
void makeExceptionalFuture();
|
||||
#endif
|
||||
@ -43,10 +43,10 @@ private slots:
|
||||
void progressText();
|
||||
};
|
||||
|
||||
void tst_QFuture::makeReadyfuture()
|
||||
void tst_QFuture::makeReadyValueFuture()
|
||||
{
|
||||
QBENCHMARK {
|
||||
auto future = QtFuture::makeReadyFuture(42);
|
||||
auto future = QtFuture::makeReadyValueFuture(42);
|
||||
Q_UNUSED(future);
|
||||
}
|
||||
}
|
||||
@ -64,7 +64,7 @@ void tst_QFuture::makeExceptionalFuture()
|
||||
|
||||
void tst_QFuture::result()
|
||||
{
|
||||
auto future = QtFuture::makeReadyFuture(42);
|
||||
auto future = QtFuture::makeReadyValueFuture(42);
|
||||
|
||||
QBENCHMARK {
|
||||
auto value = future.result();
|
||||
@ -92,7 +92,7 @@ void tst_QFuture::results()
|
||||
void tst_QFuture::takeResult()
|
||||
{
|
||||
QBENCHMARK {
|
||||
auto future = QtFuture::makeReadyFuture(42);
|
||||
auto future = QtFuture::makeReadyValueFuture(42);
|
||||
auto value = future.takeResult();
|
||||
Q_UNUSED(value);
|
||||
}
|
||||
@ -140,7 +140,7 @@ void tst_QFuture::reportException()
|
||||
|
||||
void tst_QFuture::then()
|
||||
{
|
||||
auto f = QtFuture::makeReadyFuture(42);
|
||||
auto f = QtFuture::makeReadyValueFuture(42);
|
||||
QBENCHMARK {
|
||||
auto future = f.then([](int value) { return value; });
|
||||
Q_UNUSED(future);
|
||||
@ -149,7 +149,7 @@ void tst_QFuture::then()
|
||||
|
||||
void tst_QFuture::thenVoid()
|
||||
{
|
||||
auto f = QtFuture::makeReadyFuture();
|
||||
auto f = QtFuture::makeReadyVoidFuture();
|
||||
QBENCHMARK {
|
||||
auto future = f.then([] {});
|
||||
Q_UNUSED(future);
|
||||
@ -205,7 +205,7 @@ void tst_QFuture::onFailedVoid()
|
||||
|
||||
void tst_QFuture::thenOnFailed()
|
||||
{
|
||||
auto f = QtFuture::makeReadyFuture(42);
|
||||
auto f = QtFuture::makeReadyValueFuture(42);
|
||||
QBENCHMARK {
|
||||
auto future =
|
||||
f.then([](int) { throw std::runtime_error("error"); }).onFailed([] { return 0; });
|
||||
@ -215,7 +215,7 @@ void tst_QFuture::thenOnFailed()
|
||||
|
||||
void tst_QFuture::thenOnFailedVoid()
|
||||
{
|
||||
auto f = QtFuture::makeReadyFuture();
|
||||
auto f = QtFuture::makeReadyVoidFuture();
|
||||
QBENCHMARK {
|
||||
auto future = f.then([] { throw std::runtime_error("error"); }).onFailed([] {});
|
||||
Q_UNUSED(future);
|
||||
|
@ -9,6 +9,8 @@
|
||||
|
||||
//#define USE_SEM_T
|
||||
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
#if defined(Q_OS_UNIX)
|
||||
#if !defined(USE_SEM_T)
|
||||
# include <pthread.h>
|
||||
@ -228,7 +230,8 @@ void tst_QMutex::contendedNative_data()
|
||||
class NativeMutexThread : public QThread
|
||||
{
|
||||
NativeMutexType *mutex1, *mutex2;
|
||||
int iterations, msleepDuration;
|
||||
int iterations;
|
||||
std::chrono::milliseconds msleepDuration;
|
||||
bool use2mutexes;
|
||||
public:
|
||||
bool done;
|
||||
@ -246,8 +249,8 @@ public:
|
||||
NativeMutexLock(mutex1);
|
||||
if (use2mutexes)
|
||||
NativeMutexLock(mutex2);
|
||||
if (msleepDuration >= 0)
|
||||
msleep(msleepDuration);
|
||||
if (msleepDuration >= 0ms)
|
||||
sleep(msleepDuration);
|
||||
if (use2mutexes)
|
||||
NativeMutexUnlock(mutex2);
|
||||
NativeMutexUnlock(mutex1);
|
||||
@ -298,7 +301,8 @@ void tst_QMutex::contendedNative()
|
||||
class QMutexThread : public QThread
|
||||
{
|
||||
QMutex *mutex1, *mutex2;
|
||||
int iterations, msleepDuration;
|
||||
int iterations;
|
||||
std::chrono::milliseconds msleepDuration;
|
||||
bool use2mutexes;
|
||||
public:
|
||||
bool done;
|
||||
@ -316,8 +320,8 @@ public:
|
||||
mutex1->lock();
|
||||
if (use2mutexes)
|
||||
mutex2->lock();
|
||||
if (msleepDuration >= 0)
|
||||
msleep(msleepDuration);
|
||||
if (msleepDuration >= 0ms)
|
||||
sleep(msleepDuration);
|
||||
if (use2mutexes)
|
||||
mutex2->unlock();
|
||||
mutex1->unlock();
|
||||
@ -363,7 +367,8 @@ void tst_QMutex::contendedQMutex()
|
||||
class QMutexLockerThread : public QThread
|
||||
{
|
||||
QMutex *mutex1, *mutex2;
|
||||
int iterations, msleepDuration;
|
||||
int iterations;
|
||||
std::chrono::milliseconds msleepDuration;
|
||||
bool use2mutexes;
|
||||
public:
|
||||
bool done;
|
||||
@ -381,8 +386,8 @@ public:
|
||||
{
|
||||
QMutexLocker locker1(mutex1);
|
||||
QMutexLocker locker2(use2mutexes ? mutex2 : 0);
|
||||
if (msleepDuration >= 0)
|
||||
msleep(msleepDuration);
|
||||
if (msleepDuration >= 0ms)
|
||||
sleep(msleepDuration);
|
||||
}
|
||||
|
||||
QThread::yieldCurrentThread();
|
||||
|
@ -178,7 +178,7 @@ void tst_QCryptographicHash::hmac_addData()
|
||||
mac.reset();
|
||||
mac.addData(data);
|
||||
[[maybe_unused]]
|
||||
auto r = mac.result();
|
||||
auto r = mac.resultView();
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user