Merge branch 'master' into refactor
This commit is contained in:
commit
df0ff8fd4e
@ -1,7 +1,7 @@
|
|||||||
HEADERS = shapeitem.h \
|
HEADERS = shapeitem.h \
|
||||||
sortingbox.h
|
sortingbox.h
|
||||||
SOURCES = main.cpp \
|
SOURCES = main.cpp \
|
||||||
shapeItem.cpp \
|
shapeitem.cpp \
|
||||||
sortingbox.cpp
|
sortingbox.cpp
|
||||||
RESOURCES = tooltips.qrc
|
RESOURCES = tooltips.qrc
|
||||||
|
|
||||||
|
@ -189,28 +189,35 @@ bool QHttpNetworkConnectionPrivate::shouldEmitChannelError(QAbstractSocket *sock
|
|||||||
int i = indexOf(socket);
|
int i = indexOf(socket);
|
||||||
int otherSocket = (i == 0 ? 1 : 0);
|
int otherSocket = (i == 0 ? 1 : 0);
|
||||||
|
|
||||||
if (networkLayerState == QHttpNetworkConnectionPrivate::InProgress) {
|
if (channelCount == 1) {
|
||||||
if (channels[otherSocket].isSocketBusy() && (channels[otherSocket].state != QHttpNetworkConnectionChannel::ClosingState)) {
|
if (networkLayerState == QHttpNetworkConnectionPrivate::InProgress)
|
||||||
// this was the first socket to fail.
|
|
||||||
channels[i].close();
|
|
||||||
emitError = false;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// Both connection attempts has failed.
|
|
||||||
networkLayerState = QHttpNetworkConnectionPrivate::Unknown;
|
networkLayerState = QHttpNetworkConnectionPrivate::Unknown;
|
||||||
channels[i].close();
|
channels[0].close();
|
||||||
emitError = true;
|
emitError = true;
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if ((networkLayerState == QHttpNetworkConnectionPrivate::IPv4) && (channels[i].networkLayerPreference != QAbstractSocket::IPv4Protocol)
|
if (networkLayerState == QHttpNetworkConnectionPrivate::InProgress) {
|
||||||
|| (networkLayerState == QHttpNetworkConnectionPrivate::IPv6) && (channels[i].networkLayerPreference != QAbstractSocket::IPv6Protocol)) {
|
if (channels[otherSocket].isSocketBusy() && (channels[otherSocket].state != QHttpNetworkConnectionChannel::ClosingState)) {
|
||||||
// First connection worked so this is the second one to complete and it failed.
|
// this was the first socket to fail.
|
||||||
channels[i].close();
|
channels[i].close();
|
||||||
QMetaObject::invokeMethod(q, "_q_startNextRequest", Qt::QueuedConnection);
|
emitError = false;
|
||||||
emitError = false;
|
}
|
||||||
|
else {
|
||||||
|
// Both connection attempts has failed.
|
||||||
|
networkLayerState = QHttpNetworkConnectionPrivate::Unknown;
|
||||||
|
channels[i].close();
|
||||||
|
emitError = true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if ((networkLayerState == QHttpNetworkConnectionPrivate::IPv4) && (channels[i].networkLayerPreference != QAbstractSocket::IPv4Protocol)
|
||||||
|
|| (networkLayerState == QHttpNetworkConnectionPrivate::IPv6) && (channels[i].networkLayerPreference != QAbstractSocket::IPv6Protocol)) {
|
||||||
|
// First connection worked so this is the second one to complete and it failed.
|
||||||
|
channels[i].close();
|
||||||
|
QMetaObject::invokeMethod(q, "_q_startNextRequest", Qt::QueuedConnection);
|
||||||
|
emitError = false;
|
||||||
|
}
|
||||||
|
if (networkLayerState == QHttpNetworkConnectionPrivate::Unknown)
|
||||||
|
qWarning() << "We got a connection error when networkLayerState is Unknown";
|
||||||
}
|
}
|
||||||
if (networkLayerState == QHttpNetworkConnectionPrivate::Unknown)
|
|
||||||
qWarning() << "We got a connection error when networkLayerState is Unknown";
|
|
||||||
}
|
}
|
||||||
return emitError;
|
return emitError;
|
||||||
}
|
}
|
||||||
@ -917,10 +924,6 @@ void QHttpNetworkConnectionPrivate::readMoreLater(QHttpNetworkReply *reply)
|
|||||||
// lookup as then the hostinfo will already be in the cache.
|
// lookup as then the hostinfo will already be in the cache.
|
||||||
void QHttpNetworkConnectionPrivate::startHostInfoLookup()
|
void QHttpNetworkConnectionPrivate::startHostInfoLookup()
|
||||||
{
|
{
|
||||||
// At this time all channels should be unconnected.
|
|
||||||
Q_ASSERT(!channels[0].isSocketBusy());
|
|
||||||
Q_ASSERT(!channels[1].isSocketBusy());
|
|
||||||
|
|
||||||
networkLayerState = InProgress;
|
networkLayerState = InProgress;
|
||||||
|
|
||||||
// check if we already now can descide if this is IPv4 or IPv6
|
// check if we already now can descide if this is IPv4 or IPv6
|
||||||
@ -989,17 +992,23 @@ void QHttpNetworkConnectionPrivate::_q_hostLookupFinished(QHostInfo info)
|
|||||||
// connection will then be disconnected.
|
// connection will then be disconnected.
|
||||||
void QHttpNetworkConnectionPrivate::startNetworkLayerStateLookup()
|
void QHttpNetworkConnectionPrivate::startNetworkLayerStateLookup()
|
||||||
{
|
{
|
||||||
// At this time all channels should be unconnected.
|
if (channelCount > 1) {
|
||||||
Q_ASSERT(!channels[0].isSocketBusy());
|
// At this time all channels should be unconnected.
|
||||||
Q_ASSERT(!channels[1].isSocketBusy());
|
Q_ASSERT(!channels[0].isSocketBusy());
|
||||||
|
Q_ASSERT(!channels[1].isSocketBusy());
|
||||||
|
|
||||||
networkLayerState = InProgress;
|
networkLayerState = InProgress;
|
||||||
|
|
||||||
channels[0].networkLayerPreference = QAbstractSocket::IPv4Protocol;
|
channels[0].networkLayerPreference = QAbstractSocket::IPv4Protocol;
|
||||||
channels[1].networkLayerPreference = QAbstractSocket::IPv6Protocol;
|
channels[1].networkLayerPreference = QAbstractSocket::IPv6Protocol;
|
||||||
|
|
||||||
channels[0].ensureConnection(); // Possibly delay this one..
|
channels[0].ensureConnection(); // Possibly delay this one..
|
||||||
channels[1].ensureConnection();
|
channels[1].ensureConnection();
|
||||||
|
} else {
|
||||||
|
networkLayerState = InProgress;
|
||||||
|
channels[0].networkLayerPreference = QAbstractSocket::AnyIPProtocol;
|
||||||
|
channels[0].ensureConnection();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -955,6 +955,12 @@ void QHttpNetworkConnectionChannel::_q_connected()
|
|||||||
connection->d_func()->networkLayerState = QHttpNetworkConnectionPrivate::IPv4;
|
connection->d_func()->networkLayerState = QHttpNetworkConnectionPrivate::IPv4;
|
||||||
else if (networkLayerPreference == QAbstractSocket::IPv6Protocol)
|
else if (networkLayerPreference == QAbstractSocket::IPv6Protocol)
|
||||||
connection->d_func()->networkLayerState = QHttpNetworkConnectionPrivate::IPv6;
|
connection->d_func()->networkLayerState = QHttpNetworkConnectionPrivate::IPv6;
|
||||||
|
else {
|
||||||
|
if (socket->peerAddress().protocol() == QAbstractSocket::IPv4Protocol)
|
||||||
|
connection->d_func()->networkLayerState = QHttpNetworkConnectionPrivate::IPv4;
|
||||||
|
else
|
||||||
|
connection->d_func()->networkLayerState = QHttpNetworkConnectionPrivate::IPv6;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (((connection->d_func()->networkLayerState == QHttpNetworkConnectionPrivate::IPv4) && (networkLayerPreference != QAbstractSocket::IPv4Protocol))
|
if (((connection->d_func()->networkLayerState == QHttpNetworkConnectionPrivate::IPv4) && (networkLayerPreference != QAbstractSocket::IPv4Protocol))
|
||||||
|| ((connection->d_func()->networkLayerState == QHttpNetworkConnectionPrivate::IPv6) && (networkLayerPreference != QAbstractSocket::IPv6Protocol))) {
|
|| ((connection->d_func()->networkLayerState == QHttpNetworkConnectionPrivate::IPv6) && (networkLayerPreference != QAbstractSocket::IPv6Protocol))) {
|
||||||
|
@ -147,8 +147,7 @@ Q_SIGNALS:
|
|||||||
void finished();
|
void finished();
|
||||||
void finishedWithError(QNetworkReply::NetworkError errorCode, const QString &detail = QString());
|
void finishedWithError(QNetworkReply::NetworkError errorCode, const QString &detail = QString());
|
||||||
void headerChanged();
|
void headerChanged();
|
||||||
// FIXME we need to change this to qint64!
|
void dataReadProgress(qint64 done, qint64 total);
|
||||||
void dataReadProgress(int done, int total);
|
|
||||||
void dataSendProgress(qint64 done, qint64 total);
|
void dataSendProgress(qint64 done, qint64 total);
|
||||||
void cacheCredentials(const QHttpNetworkRequest &request, QAuthenticator *authenticator);
|
void cacheCredentials(const QHttpNetworkRequest &request, QAuthenticator *authenticator);
|
||||||
#ifndef QT_NO_NETWORKPROXY
|
#ifndef QT_NO_NETWORKPROXY
|
||||||
|
@ -310,7 +310,7 @@ void QHttpThreadDelegate::startRequest()
|
|||||||
this, SLOT(finishedWithErrorSlot(QNetworkReply::NetworkError,QString)));
|
this, SLOT(finishedWithErrorSlot(QNetworkReply::NetworkError,QString)));
|
||||||
// some signals are only interesting when normal asynchronous style is used
|
// some signals are only interesting when normal asynchronous style is used
|
||||||
connect(httpReply,SIGNAL(readyRead()), this, SLOT(readyReadSlot()));
|
connect(httpReply,SIGNAL(readyRead()), this, SLOT(readyReadSlot()));
|
||||||
connect(httpReply,SIGNAL(dataReadProgress(int, int)), this, SLOT(dataReadProgressSlot(int,int)));
|
connect(httpReply,SIGNAL(dataReadProgress(qint64, qint64)), this, SLOT(dataReadProgressSlot(qint64,qint64)));
|
||||||
connect(httpReply, SIGNAL(cacheCredentials(QHttpNetworkRequest,QAuthenticator*)),
|
connect(httpReply, SIGNAL(cacheCredentials(QHttpNetworkRequest,QAuthenticator*)),
|
||||||
this, SLOT(cacheCredentialsSlot(QHttpNetworkRequest,QAuthenticator*)));
|
this, SLOT(cacheCredentialsSlot(QHttpNetworkRequest,QAuthenticator*)));
|
||||||
#ifndef QT_NO_OPENSSL
|
#ifndef QT_NO_OPENSSL
|
||||||
@ -507,7 +507,7 @@ void QHttpThreadDelegate::synchronousHeaderChangedSlot()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void QHttpThreadDelegate::dataReadProgressSlot(int done, int total)
|
void QHttpThreadDelegate::dataReadProgressSlot(qint64 done, qint64 total)
|
||||||
{
|
{
|
||||||
// If we don't have a download buffer don't attempt to go this codepath
|
// If we don't have a download buffer don't attempt to go this codepath
|
||||||
// It is not used by QNetworkAccessHttpBackend
|
// It is not used by QNetworkAccessHttpBackend
|
||||||
|
@ -154,7 +154,7 @@ protected slots:
|
|||||||
void synchronousFinishedWithErrorSlot(QNetworkReply::NetworkError errorCode, const QString &detail = QString());
|
void synchronousFinishedWithErrorSlot(QNetworkReply::NetworkError errorCode, const QString &detail = QString());
|
||||||
void headerChangedSlot();
|
void headerChangedSlot();
|
||||||
void synchronousHeaderChangedSlot();
|
void synchronousHeaderChangedSlot();
|
||||||
void dataReadProgressSlot(int done, int total);
|
void dataReadProgressSlot(qint64 done, qint64 total);
|
||||||
void cacheCredentialsSlot(const QHttpNetworkRequest &request, QAuthenticator *authenticator);
|
void cacheCredentialsSlot(const QHttpNetworkRequest &request, QAuthenticator *authenticator);
|
||||||
#ifndef QT_NO_OPENSSL
|
#ifndef QT_NO_OPENSSL
|
||||||
void sslErrorsSlot(const QList<QSslError> &errors);
|
void sslErrorsSlot(const QList<QSslError> &errors);
|
||||||
|
@ -901,6 +901,7 @@ static const char *certificate_blacklist[] = {
|
|||||||
"92:39:d5:34:8f:40:d1:69:5a:74:54:70:e1:f2:3f:43",
|
"92:39:d5:34:8f:40:d1:69:5a:74:54:70:e1:f2:3f:43",
|
||||||
"b0:b7:13:3e:d0:96:f9:b5:6f:ae:91:c8:74:bd:3a:c0",
|
"b0:b7:13:3e:d0:96:f9:b5:6f:ae:91:c8:74:bd:3a:c0",
|
||||||
"d8:f3:5f:4e:b7:87:2b:2d:ab:06:92:e3:15:38:2f:b0",
|
"d8:f3:5f:4e:b7:87:2b:2d:ab:06:92:e3:15:38:2f:b0",
|
||||||
|
"05:e2:e6:a4:cd:09:ea:54:d6:65:b0:75:fe:22:a2:56",
|
||||||
0
|
0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -96,8 +96,6 @@ public:
|
|||||||
virtual void addMessage(MessageTypes type, const char *message,
|
virtual void addMessage(MessageTypes type, const char *message,
|
||||||
const char *file = 0, int line = 0) = 0;
|
const char *file = 0, int line = 0) = 0;
|
||||||
|
|
||||||
virtual void registerRandomSeed(unsigned int seed) = 0;
|
|
||||||
|
|
||||||
void outputString(const char *msg);
|
void outputString(const char *msg);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -345,7 +345,6 @@ void QPlainTestLogger::printBenchmarkResult(const QBenchmarkResult &result)
|
|||||||
}
|
}
|
||||||
|
|
||||||
QPlainTestLogger::QPlainTestLogger()
|
QPlainTestLogger::QPlainTestLogger()
|
||||||
: randomSeed(9), hasRandomSeed(false)
|
|
||||||
{
|
{
|
||||||
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
|
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
|
||||||
InitializeCriticalSection(&QTest::outputCriticalSection);
|
InitializeCriticalSection(&QTest::outputCriticalSection);
|
||||||
@ -368,17 +367,10 @@ void QPlainTestLogger::startLogging(const char *filename)
|
|||||||
QTest::qt_snprintf(buf, sizeof(buf), "Testing %s\n",
|
QTest::qt_snprintf(buf, sizeof(buf), "Testing %s\n",
|
||||||
QTestResult::currentTestObjectName());
|
QTestResult::currentTestObjectName());
|
||||||
} else {
|
} else {
|
||||||
if (hasRandomSeed) {
|
QTest::qt_snprintf(buf, sizeof(buf),
|
||||||
QTest::qt_snprintf(buf, sizeof(buf),
|
"********* Start testing of %s *********\n"
|
||||||
"********* Start testing of %s *********\n"
|
"Config: Using QTest library " QTEST_VERSION_STR
|
||||||
"Config: Using QTest library " QTEST_VERSION_STR
|
", Qt %s\n", QTestResult::currentTestObjectName(), qVersion());
|
||||||
", Qt %s, Random seed %d\n", QTestResult::currentTestObjectName(), qVersion(), randomSeed);
|
|
||||||
} else {
|
|
||||||
QTest::qt_snprintf(buf, sizeof(buf),
|
|
||||||
"********* Start testing of %s *********\n"
|
|
||||||
"Config: Using QTest library " QTEST_VERSION_STR
|
|
||||||
", Qt %s\n", QTestResult::currentTestObjectName(), qVersion());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
outputMessage(buf);
|
outputMessage(buf);
|
||||||
}
|
}
|
||||||
@ -440,10 +432,4 @@ void QPlainTestLogger::addMessage(MessageTypes type, const char *message,
|
|||||||
printMessage(QTest::messageType2String(type), message, file, line);
|
printMessage(QTest::messageType2String(type), message, file, line);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QPlainTestLogger::registerRandomSeed(unsigned int seed)
|
|
||||||
{
|
|
||||||
randomSeed = seed;
|
|
||||||
hasRandomSeed = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
@ -75,11 +75,8 @@ public:
|
|||||||
|
|
||||||
void addMessage(MessageTypes type, const char *message,
|
void addMessage(MessageTypes type, const char *message,
|
||||||
const char *file = 0, int line = 0);
|
const char *file = 0, int line = 0);
|
||||||
void registerRandomSeed(unsigned int seed);
|
|
||||||
private:
|
|
||||||
unsigned int randomSeed;
|
|
||||||
bool hasRandomSeed;
|
|
||||||
|
|
||||||
|
private:
|
||||||
void printMessage(const char *type, const char *msg, const char *file = 0, int line = 0);
|
void printMessage(const char *type, const char *msg, const char *file = 0, int line = 0);
|
||||||
void outputMessage(const char *str);
|
void outputMessage(const char *str);
|
||||||
void printBenchmarkResult(const QBenchmarkResult &result);
|
void printBenchmarkResult(const QBenchmarkResult &result);
|
||||||
|
@ -869,10 +869,7 @@ namespace QTest
|
|||||||
static int keyDelay = -1;
|
static int keyDelay = -1;
|
||||||
static int mouseDelay = -1;
|
static int mouseDelay = -1;
|
||||||
static int eventDelay = -1;
|
static int eventDelay = -1;
|
||||||
static bool randomOrder = false;
|
|
||||||
static int keyVerbose = -1;
|
static int keyVerbose = -1;
|
||||||
static unsigned int seed = 0;
|
|
||||||
static bool seedSet = false;
|
|
||||||
#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN)
|
#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN)
|
||||||
static bool noCrashHandler = false;
|
static bool noCrashHandler = false;
|
||||||
#endif
|
#endif
|
||||||
@ -958,37 +955,6 @@ int Q_TESTLIB_EXPORT defaultKeyDelay()
|
|||||||
return keyDelay;
|
return keyDelay;
|
||||||
}
|
}
|
||||||
|
|
||||||
void seedRandom()
|
|
||||||
{
|
|
||||||
static bool randomSeeded = false;
|
|
||||||
if (!randomSeeded) {
|
|
||||||
if (!QTest::seedSet) {
|
|
||||||
QElapsedTimer timer;
|
|
||||||
timer.start();
|
|
||||||
QTest::seed = timer.msecsSinceReference();
|
|
||||||
}
|
|
||||||
qsrand(QTest::seed);
|
|
||||||
randomSeeded = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
void swap(T * array, int pos, int otherPos)
|
|
||||||
{
|
|
||||||
T tmp = array[pos];
|
|
||||||
array[pos] = array[otherPos];
|
|
||||||
array[otherPos] = tmp;
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
static void randomizeList(T * array, int size)
|
|
||||||
{
|
|
||||||
for (int i = 0; i != size; i++) {
|
|
||||||
int pos = qrand() % size;
|
|
||||||
swap(array, pos, i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool isValidSlot(const QMetaMethod &sl)
|
static bool isValidSlot(const QMetaMethod &sl)
|
||||||
{
|
{
|
||||||
if (sl.access() != QMetaMethod::Private || !sl.parameterTypes().isEmpty()
|
if (sl.access() != QMetaMethod::Private || !sl.parameterTypes().isEmpty()
|
||||||
@ -1046,9 +1012,6 @@ Q_TESTLIB_EXPORT void qtest_qParseArgs(int argc, char *argv[], bool qml)
|
|||||||
" -v1 : Print enter messages for each testfunction\n"
|
" -v1 : Print enter messages for each testfunction\n"
|
||||||
" -v2 : Also print out each QVERIFY/QCOMPARE/QTEST\n"
|
" -v2 : Also print out each QVERIFY/QCOMPARE/QTEST\n"
|
||||||
" -vs : Print every signal emitted\n"
|
" -vs : Print every signal emitted\n"
|
||||||
" -random : Run testcases within each test in random order\n"
|
|
||||||
" -seed n : Positive integer to be used as seed for -random. If not specified,\n"
|
|
||||||
" the current time will be used as seed.\n"
|
|
||||||
" -eventdelay ms : Set default delay for mouse and keyboard simulation to ms milliseconds\n"
|
" -eventdelay ms : Set default delay for mouse and keyboard simulation to ms milliseconds\n"
|
||||||
" -keydelay ms : Set default delay for keyboard simulation to ms milliseconds\n"
|
" -keydelay ms : Set default delay for keyboard simulation to ms milliseconds\n"
|
||||||
" -mousedelay ms : Set default delay for mouse simulation to ms milliseconds\n"
|
" -mousedelay ms : Set default delay for mouse simulation to ms milliseconds\n"
|
||||||
@ -1177,22 +1140,6 @@ Q_TESTLIB_EXPORT void qtest_qParseArgs(int argc, char *argv[], bool qml)
|
|||||||
#endif
|
#endif
|
||||||
} else if (strcmp(argv[i], "-eventcounter") == 0) {
|
} else if (strcmp(argv[i], "-eventcounter") == 0) {
|
||||||
QBenchmarkGlobalData::current->setMode(QBenchmarkGlobalData::EventCounter);
|
QBenchmarkGlobalData::current->setMode(QBenchmarkGlobalData::EventCounter);
|
||||||
} else if (strcmp(argv[i], "-random") == 0) {
|
|
||||||
QTest::randomOrder = true;
|
|
||||||
} else if (strcmp(argv[i], "-seed") == 0) {
|
|
||||||
bool argumentOk = false;
|
|
||||||
if (i + 1 < argc) {
|
|
||||||
char * endpt = 0;
|
|
||||||
long longSeed = strtol(argv[++i], &endpt, 10);
|
|
||||||
argumentOk = (*endpt == '\0' && longSeed >= 0);
|
|
||||||
QTest::seed = longSeed;
|
|
||||||
}
|
|
||||||
if (!argumentOk) {
|
|
||||||
fprintf(stderr, "-seed needs an extra positive integer parameter to specify the seed\n");
|
|
||||||
exit(1);
|
|
||||||
} else {
|
|
||||||
QTest::seedSet = true;
|
|
||||||
}
|
|
||||||
} else if (strcmp(argv[i], "-minimumvalue") == 0) {
|
} else if (strcmp(argv[i], "-minimumvalue") == 0) {
|
||||||
if (i + 1 >= argc) {
|
if (i + 1 >= argc) {
|
||||||
fprintf(stderr, "-minimumvalue needs an extra parameter to indicate the minimum time(ms)\n");
|
fprintf(stderr, "-minimumvalue needs an extra parameter to indicate the minimum time(ms)\n");
|
||||||
@ -1297,11 +1244,6 @@ Q_TESTLIB_EXPORT void qtest_qParseArgs(int argc, char *argv[], bool qml)
|
|||||||
QTEST_ASSERT(QTest::testFuncCount < 512);
|
QTEST_ASSERT(QTest::testFuncCount < 512);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (QTest::seedSet && !QTest::randomOrder) {
|
|
||||||
fprintf(stderr, "-seed requires -random\n");
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QBenchmarkResult qMedian(const QList<QBenchmarkResult> &container)
|
QBenchmarkResult qMedian(const QList<QBenchmarkResult> &container)
|
||||||
@ -1596,11 +1538,7 @@ static void qInvokeTestMethods(QObject *testObject)
|
|||||||
{
|
{
|
||||||
const QMetaObject *metaObject = testObject->metaObject();
|
const QMetaObject *metaObject = testObject->metaObject();
|
||||||
QTEST_ASSERT(metaObject);
|
QTEST_ASSERT(metaObject);
|
||||||
if (QTest::randomOrder) {
|
QTestLog::startLogging();
|
||||||
QTestLog::startLogging(QTest::seed);
|
|
||||||
} else {
|
|
||||||
QTestLog::startLogging();
|
|
||||||
}
|
|
||||||
QTestResult::setCurrentTestFunction("initTestCase");
|
QTestResult::setCurrentTestFunction("initTestCase");
|
||||||
QTestResult::setCurrentTestLocation(QTestResult::DataFunc);
|
QTestResult::setCurrentTestLocation(QTestResult::DataFunc);
|
||||||
QTestTable::globalTestTable();
|
QTestTable::globalTestTable();
|
||||||
@ -1617,8 +1555,6 @@ static void qInvokeTestMethods(QObject *testObject)
|
|||||||
if(!QTestResult::skipCurrentTest() && !previousFailed) {
|
if(!QTestResult::skipCurrentTest() && !previousFailed) {
|
||||||
|
|
||||||
if (QTest::testFuncs) {
|
if (QTest::testFuncs) {
|
||||||
if (QTest::randomOrder)
|
|
||||||
randomizeList(QTest::testFuncs, QTest::testFuncCount);
|
|
||||||
for (int i = 0; i != QTest::testFuncCount; i++) {
|
for (int i = 0; i != QTest::testFuncCount; i++) {
|
||||||
if (!qInvokeTestMethod(metaObject->method(QTest::testFuncs[i].function()).signature(),
|
if (!qInvokeTestMethod(metaObject->method(QTest::testFuncs[i].function()).signature(),
|
||||||
QTest::testFuncs[i].data())) {
|
QTest::testFuncs[i].data())) {
|
||||||
@ -1631,8 +1567,6 @@ static void qInvokeTestMethods(QObject *testObject)
|
|||||||
QMetaMethod *testMethods = new QMetaMethod[methodCount];
|
QMetaMethod *testMethods = new QMetaMethod[methodCount];
|
||||||
for (int i = 0; i != methodCount; i++)
|
for (int i = 0; i != methodCount; i++)
|
||||||
testMethods[i] = metaObject->method(i);
|
testMethods[i] = metaObject->method(i);
|
||||||
if (QTest::randomOrder)
|
|
||||||
randomizeList(testMethods, methodCount);
|
|
||||||
for (int i = 0; i != methodCount; i++) {
|
for (int i = 0; i != methodCount; i++) {
|
||||||
if (!isValidSlot(testMethods[i]))
|
if (!isValidSlot(testMethods[i]))
|
||||||
continue;
|
continue;
|
||||||
@ -1840,9 +1774,6 @@ int QTest::qExec(QObject *testObject, int argc, char **argv)
|
|||||||
|
|
||||||
QTestResult::setCurrentTestObject(metaObject->className());
|
QTestResult::setCurrentTestObject(metaObject->className());
|
||||||
qtest_qParseArgs(argc, argv, false);
|
qtest_qParseArgs(argc, argv, false);
|
||||||
if (QTest::randomOrder) {
|
|
||||||
seedRandom();
|
|
||||||
}
|
|
||||||
#ifdef QTESTLIB_USE_VALGRIND
|
#ifdef QTESTLIB_USE_VALGRIND
|
||||||
if (QBenchmarkGlobalData::current->mode() == QBenchmarkGlobalData::CallgrindParentProcess) {
|
if (QBenchmarkGlobalData::current->mode() == QBenchmarkGlobalData::CallgrindParentProcess) {
|
||||||
const QStringList origAppArgs(QCoreApplication::arguments());
|
const QStringList origAppArgs(QCoreApplication::arguments());
|
||||||
|
@ -165,13 +165,8 @@ void QTestLightXmlStreamer::formatBeforeAttributes(const QTestElement *element,
|
|||||||
void QTestLightXmlStreamer::output(QTestElement *element) const
|
void QTestLightXmlStreamer::output(QTestElement *element) const
|
||||||
{
|
{
|
||||||
QTestCharBuffer buf;
|
QTestCharBuffer buf;
|
||||||
if (logger()->hasRandomSeed()) {
|
QTest::qt_asprintf(&buf, "<Environment>\n <QtVersion>%s</QtVersion>\n <QTestVersion>%s</QTestVersion>\n",
|
||||||
QTest::qt_asprintf(&buf, "<Environment>\n <QtVersion>%s</QtVersion>\n <QTestVersion>%s</QTestVersion>\n <RandomSeed>%d</RandomSeed>\n",
|
|
||||||
qVersion(), QTEST_VERSION_STR, logger()->randomSeed() );
|
|
||||||
} else {
|
|
||||||
QTest::qt_asprintf(&buf, "<Environment>\n <QtVersion>%s</QtVersion>\n <QTestVersion>%s</QTestVersion>\n",
|
|
||||||
qVersion(), QTEST_VERSION_STR );
|
qVersion(), QTEST_VERSION_STR );
|
||||||
}
|
|
||||||
outputString(buf.constData());
|
outputString(buf.constData());
|
||||||
|
|
||||||
QTest::qt_asprintf(&buf, "</Environment>\n");
|
QTest::qt_asprintf(&buf, "</Environment>\n");
|
||||||
|
@ -281,15 +281,6 @@ void QTestLog::addBenchmarkResult(const QBenchmarkResult &result)
|
|||||||
QTest::testLogger->addBenchmarkResult(result);
|
QTest::testLogger->addBenchmarkResult(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QTestLog::startLogging(unsigned int randomSeed)
|
|
||||||
{
|
|
||||||
QTEST_ASSERT(!QTest::testLogger);
|
|
||||||
QTest::initLogger();
|
|
||||||
QTest::testLogger->registerRandomSeed(randomSeed);
|
|
||||||
QTest::testLogger->startLogging(QTest::outFile);
|
|
||||||
QTest::oldMessageHandler = qInstallMsgHandler(QTest::messageHandler);
|
|
||||||
}
|
|
||||||
|
|
||||||
void QTestLog::startLogging()
|
void QTestLog::startLogging()
|
||||||
{
|
{
|
||||||
QTEST_ASSERT(!QTest::testLogger);
|
QTEST_ASSERT(!QTest::testLogger);
|
||||||
|
@ -82,7 +82,6 @@ public:
|
|||||||
static void info(const char *msg, const char *file, int line);
|
static void info(const char *msg, const char *file, int line);
|
||||||
|
|
||||||
static void startLogging();
|
static void startLogging();
|
||||||
static void startLogging(unsigned int randomSeed);
|
|
||||||
static void stopLogging();
|
static void stopLogging();
|
||||||
|
|
||||||
static void setLogMode(LogMode mode);
|
static void setLogMode(LogMode mode);
|
||||||
|
@ -62,8 +62,6 @@ QTestLogger::QTestLogger(int fm)
|
|||||||
, testCounter(0)
|
, testCounter(0)
|
||||||
, failureCounter(0)
|
, failureCounter(0)
|
||||||
, errorCounter(0)
|
, errorCounter(0)
|
||||||
, randomSeed_(0)
|
|
||||||
, hasRandomSeed_(false)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -128,14 +126,6 @@ void QTestLogger::stopLogging()
|
|||||||
property->addAttribute(QTest::AI_PropertyValue, qVersion());
|
property->addAttribute(QTest::AI_PropertyValue, qVersion());
|
||||||
properties->addLogElement(property);
|
properties->addLogElement(property);
|
||||||
|
|
||||||
if (hasRandomSeed()) {
|
|
||||||
property = new QTestElement(QTest::LET_Property);
|
|
||||||
property->addAttribute(QTest::AI_Name, "RandomSeed");
|
|
||||||
QTest::qt_snprintf(buf, sizeof(buf), "%i", randomSeed());
|
|
||||||
property->addAttribute(QTest::AI_PropertyValue, buf);
|
|
||||||
properties->addLogElement(property);
|
|
||||||
}
|
|
||||||
|
|
||||||
currentLogElement->addLogElement(properties);
|
currentLogElement->addLogElement(properties);
|
||||||
|
|
||||||
currentLogElement->addLogElement(iterator);
|
currentLogElement->addLogElement(iterator);
|
||||||
@ -349,21 +339,5 @@ void QTestLogger::addMessage(MessageTypes type, const char *message, const char
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QTestLogger::registerRandomSeed(unsigned int seed)
|
|
||||||
{
|
|
||||||
randomSeed_ = seed;
|
|
||||||
hasRandomSeed_ = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned int QTestLogger::randomSeed() const
|
|
||||||
{
|
|
||||||
return randomSeed_;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool QTestLogger::hasRandomSeed() const
|
|
||||||
{
|
|
||||||
return hasRandomSeed_;
|
|
||||||
}
|
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
|
@ -87,10 +87,6 @@ class QTestLogger : public QAbstractTestLogger
|
|||||||
void addMessage(MessageTypes type, const char *message,
|
void addMessage(MessageTypes type, const char *message,
|
||||||
const char *file = 0, int line = 0);
|
const char *file = 0, int line = 0);
|
||||||
|
|
||||||
void registerRandomSeed(unsigned int seed);
|
|
||||||
unsigned int randomSeed() const;
|
|
||||||
bool hasRandomSeed() const;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QTestElement *listOfTestcases;
|
QTestElement *listOfTestcases;
|
||||||
QTestElement *currentLogElement;
|
QTestElement *currentLogElement;
|
||||||
@ -101,8 +97,6 @@ class QTestLogger : public QAbstractTestLogger
|
|||||||
int testCounter;
|
int testCounter;
|
||||||
int failureCounter;
|
int failureCounter;
|
||||||
int errorCounter;
|
int errorCounter;
|
||||||
unsigned int randomSeed_;
|
|
||||||
bool hasRandomSeed_;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
@ -205,13 +205,8 @@ void QTestXmlStreamer::output(QTestElement *element) const
|
|||||||
quotedTc.constData());
|
quotedTc.constData());
|
||||||
outputString(buf.constData());
|
outputString(buf.constData());
|
||||||
|
|
||||||
if (logger()->hasRandomSeed()) {
|
QTest::qt_asprintf(&buf, "<Environment>\n <QtVersion>%s</QtVersion>\n <QTestVersion>%s</QTestVersion>\n",
|
||||||
QTest::qt_asprintf(&buf, "<Environment>\n <QtVersion>%s</QtVersion>\n <QTestVersion>%s</QTestVersion>\n <RandomSeed>%d</RandomSeed>\n",
|
qVersion(), QTEST_VERSION_STR );
|
||||||
qVersion(), QTEST_VERSION_STR, logger()->randomSeed() );
|
|
||||||
} else {
|
|
||||||
QTest::qt_asprintf(&buf, "<Environment>\n <QtVersion>%s</QtVersion>\n <QTestVersion>%s</QTestVersion>\n",
|
|
||||||
qVersion(), QTEST_VERSION_STR );
|
|
||||||
}
|
|
||||||
outputString(buf.constData());
|
outputString(buf.constData());
|
||||||
|
|
||||||
QTest::qt_asprintf(&buf, "</Environment>\n");
|
QTest::qt_asprintf(&buf, "</Environment>\n");
|
||||||
|
@ -93,9 +93,8 @@ namespace QTest {
|
|||||||
|
|
||||||
|
|
||||||
QXmlTestLogger::QXmlTestLogger(XmlMode mode )
|
QXmlTestLogger::QXmlTestLogger(XmlMode mode )
|
||||||
:xmlmode(mode), randomSeed(0), hasRandomSeed(false)
|
: xmlmode(mode)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QXmlTestLogger::~QXmlTestLogger()
|
QXmlTestLogger::~QXmlTestLogger()
|
||||||
@ -116,20 +115,11 @@ void QXmlTestLogger::startLogging(const char *filename)
|
|||||||
outputString(buf.constData());
|
outputString(buf.constData());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hasRandomSeed) {
|
QTest::qt_asprintf(&buf,
|
||||||
QTest::qt_asprintf(&buf,
|
|
||||||
"<Environment>\n"
|
|
||||||
" <QtVersion>%s</QtVersion>\n"
|
|
||||||
" <QTestVersion>"QTEST_VERSION_STR"</QTestVersion>\n"
|
|
||||||
" <RandomSeed>%d</RandomSeed>\n"
|
|
||||||
"</Environment>\n", qVersion(), randomSeed);
|
|
||||||
} else {
|
|
||||||
QTest::qt_asprintf(&buf,
|
|
||||||
"<Environment>\n"
|
"<Environment>\n"
|
||||||
" <QtVersion>%s</QtVersion>\n"
|
" <QtVersion>%s</QtVersion>\n"
|
||||||
" <QTestVersion>"QTEST_VERSION_STR"</QTestVersion>\n"
|
" <QTestVersion>"QTEST_VERSION_STR"</QTestVersion>\n"
|
||||||
"</Environment>\n", qVersion());
|
"</Environment>\n", qVersion());
|
||||||
}
|
|
||||||
outputString(buf.constData());
|
outputString(buf.constData());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -450,10 +440,4 @@ int QXmlTestLogger::xmlCdata(QTestCharBuffer* str, char const* src)
|
|||||||
return allocateStringFn(str, src, QXmlTestLogger::xmlCdata);
|
return allocateStringFn(str, src, QXmlTestLogger::xmlCdata);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QXmlTestLogger::registerRandomSeed(unsigned int seed)
|
|
||||||
{
|
|
||||||
randomSeed = seed;
|
|
||||||
hasRandomSeed = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
@ -79,8 +79,6 @@ public:
|
|||||||
void addMessage(MessageTypes type, const char *message,
|
void addMessage(MessageTypes type, const char *message,
|
||||||
const char *file = 0, int line = 0);
|
const char *file = 0, int line = 0);
|
||||||
|
|
||||||
void registerRandomSeed(unsigned int seed);
|
|
||||||
|
|
||||||
static int xmlCdata(QTestCharBuffer *dest, char const* src);
|
static int xmlCdata(QTestCharBuffer *dest, char const* src);
|
||||||
static int xmlQuote(QTestCharBuffer *dest, char const* src);
|
static int xmlQuote(QTestCharBuffer *dest, char const* src);
|
||||||
static int xmlCdata(QTestCharBuffer *dest, char const* src, size_t n);
|
static int xmlCdata(QTestCharBuffer *dest, char const* src, size_t n);
|
||||||
@ -88,8 +86,6 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
XmlMode xmlmode;
|
XmlMode xmlmode;
|
||||||
unsigned int randomSeed;
|
|
||||||
bool hasRandomSeed;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
@ -0,0 +1,30 @@
|
|||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIIFKDCCBBCgAwIBAgIQBeLmpM0J6lTWZbB1/iKiVjANBgkqhkiG9w0BAQUFADBm
|
||||||
|
MQswCQYDVQQGEwJOTDESMBAGA1UEChMJRGlnaU5vdGFyMSEwHwYDVQQDExhEaWdp
|
||||||
|
Tm90YXIgUHVibGljIENBIDIwMjUxIDAeBgkqhkiG9w0BCQEWEWluZm9AZGlnaW5v
|
||||||
|
dGFyLm5sMB4XDTExMDcxMDE5MDYzMFoXDTEzMDcwOTE5MDYzMFowajELMAkGA1UE
|
||||||
|
BhMCVVMxEzARBgNVBAoTCkdvb2dsZSBJbmMxFjAUBgNVBAcTDU1vdW50YWluIFZp
|
||||||
|
ZXcxFzAVBgNVBAUTDlBLMDAwMjI5MjAwMDAyMRUwEwYDVQQDEwwqLmdvb2dsZS5j
|
||||||
|
b20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDNbeKubCV0aCxhOiOS
|
||||||
|
CSQ/w9HXTYuD5BLKuiqXNw3setdTymeJz2L8aWOHo3nicFNDVwWTgwWomGNr2J6Q
|
||||||
|
7g1iINNSW0rR4E1l2szRkcnAY6c6i/Eke93nF4i2hDsnIBveolF5yjpuRm73uQQD
|
||||||
|
ulHjA3BFRF/PTi0fw2/Yt+8ieoMuNcMWN6Eou5Gqt5YZkWv176ofeCbsBmMrP87x
|
||||||
|
OhhtTDckCapk4VQZG2XrfzZcV6tdzCp5TI8uHdu17cdzXm1imZ8tyvzFeiCEOQN8
|
||||||
|
vPNzB/fIr3CJQ5q4uM5aKT3DD5PeVzf4rfJKQNgCTWiIBc9XcWEUuszwAsnmg7e2
|
||||||
|
EJRdAgMBAAGjggHMMIIByDA6BggrBgEFBQcBAQQuMCwwKgYIKwYBBQUHMAGGHmh0
|
||||||
|
dHA6Ly92YWxpZGF0aW9uLmRpZ2lub3Rhci5ubDAfBgNVHSMEGDAWgBTfM8Cvkv43
|
||||||
|
/LbYFhbQ2bGR1fpupTAJBgNVHRMEAjAAMIHGBgNVHSAEgb4wgbswgbgGDmCEEAGH
|
||||||
|
aQEBAQIEAQICMIGlMCcGCCsGAQUFBwIBFhtodHRwOi8vd3d3LmRpZ2lub3Rhci5u
|
||||||
|
bC9jcHMwegYIKwYBBQUHAgIwbhpsQ29uZGl0aW9ucywgYXMgbWVudGlvbmVkIG9u
|
||||||
|
IG91ciB3ZWJzaXRlICh3d3cuZGlnaW5vdGFyLm5sKSwgYXJlIGFwcGxpY2FibGUg
|
||||||
|
dG8gYWxsIG91ciBwcm9kdWN0cyBhbmQgc2VydmljZXMuMEkGA1UdHwRCMEAwPqA8
|
||||||
|
oDqGOGh0dHA6Ly9zZXJ2aWNlLmRpZ2lub3Rhci5ubC9jcmwvcHVibGljMjAyNS9s
|
||||||
|
YXRlc3RDUkwuY3JsMA4GA1UdDwEB/wQEAwIEsDAbBgNVHREEFDASgRBhZG1pbkBn
|
||||||
|
b29nbGUuY29tMB0GA1UdDgQWBBQHSn0WJzIo0eMBMQUNsMqN6eF/7TANBgkqhkiG
|
||||||
|
9w0BAQUFAAOCAQEAAs5dL7N9wzRJkI4Aq4lC5t8j5ZadqnqUcgYLADzSv4ExytNH
|
||||||
|
UY2nH6iVTihC0UPSsILWraoeApdT7Rphz/8DLQEBRGdeKWAptNM3EbiXtQaZT2uB
|
||||||
|
pidL8UoafX0kch3f71Y1scpBEjvu5ZZLnjg0A8AL0tnsereOVdDpU98bKqdbbrnM
|
||||||
|
FRmBlSf7xdaNca6JJHeEpga4E9Ty683CmccrSGXdU2tTCuHEJww+iOAUtPIZcsum
|
||||||
|
U7/eYeY1pMyGLyIjbNgRY7nDzRwvM/BsbL9eh4/mSQj/4nncqJd22sVQpCggQiVK
|
||||||
|
baB2sVGcVNBkK55bT8gPqnx8JypubyUvayzZGg==
|
||||||
|
-----END CERTIFICATE-----
|
@ -1,3 +1,3 @@
|
|||||||
TEMPLATE = subdirs
|
TEMPLATE=subdirs
|
||||||
SUBDIRS = \
|
SUBDIRS=\
|
||||||
v8
|
v8
|
||||||
|
Loading…
x
Reference in New Issue
Block a user