tst_qsqlthread: Replace sched_yield calls with QThread::yieldCurrentThread.
Makes the test behavior identical across all platforms. Change-Id: I5e564598d8e61588af2b73f04b4ca7c9b899c02a Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
This commit is contained in:
parent
36a30d8e49
commit
2e2374a226
@ -49,10 +49,6 @@
|
||||
#include <QtSql>
|
||||
#include "qdebug.h"
|
||||
|
||||
#ifdef Q_OS_LINUX
|
||||
#include <sched.h>
|
||||
#endif
|
||||
|
||||
const QString qtest(qTableName("qtest", __FILE__, QSqlDatabase()));
|
||||
// set this define if Oracle is built with threading support
|
||||
//#define QOCI_THREADED
|
||||
@ -158,9 +154,7 @@ public:
|
||||
q.bindValue(1, "threaddy");
|
||||
q.bindValue(2, 10);
|
||||
QVERIFY_SQL(q, exec());
|
||||
#ifdef Q_OS_LINUX
|
||||
sched_yield();
|
||||
#endif
|
||||
QThread::yieldCurrentThread();
|
||||
}
|
||||
}
|
||||
|
||||
@ -196,9 +190,7 @@ public:
|
||||
q2.bindValue("id", q1.value(0));
|
||||
q1.clear();
|
||||
QVERIFY_SQL(q2, exec());
|
||||
#ifdef Q_OS_LINUX
|
||||
sched_yield();
|
||||
#endif
|
||||
QThread::yieldCurrentThread();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user