QDir d = startDir;
bool notUsed = d.exists(); // make sure we cache this before so we can see if 'cd' fails to flush this
+ Q_UNUSED(notUsed);
QCOMPARE(d.cd(cdDir), successExpected);
if (successExpected)
QCOMPARE(d.absolutePath(), newDir);
m_timer.stop();
- QTime now = QTime::currentTime();
int elapsed = m_startedTime.elapsed();
if (elapsed < m_interval / 2) {
unsigned long appTime = QX11Info::appTime();
unsigned long appUserTime = QX11Info::appUserTime();
QCOMPARE(appTime, 0ul);
- QCOMPARE(appTime, 0ul);
+ QCOMPARE(appUserTime, 0ul);
// setApp*Time do nothing without QApplication
QX11Info::setAppTime(1234);
QX11Info::setAppUserTime(5678);
appTime = QX11Info::appTime();
appUserTime = QX11Info::appUserTime();
QCOMPARE(appTime, 0ul);
- QCOMPARE(appTime, 0ul);
+ QCOMPARE(appUserTime, 0ul);
}
QTEST_APPLESS_MAIN(tst_QX11Info)
testdir.setSorting(QDir::Unsorted);
testdir.setFilter(QDir::AllEntries | QDir::System | QDir::Hidden);
QBENCHMARK {
- QStringList fileList = testdir.entryList(QDir::NoFilter, QDir::Unsorted);
- foreach (const QString &filename, fileList) {
-
- }
+ testdir.entryList(QDir::NoFilter, QDir::Unsorted);
}
}
void iDontWantAnyStatIterator() {
{
QByteArray string = QByteArray::fromHex("67C8770B44F1410AAB9AF9B5446F13EE");
QBENCHMARK {
- QUuid uuid = QUuid::fromRfc4122(string);
+ QUuid::fromRfc4122(string);
}
}
QBENCHMARK {
for (int i = 0; i < size; ++i)
val = container.value(i);
-
}
+ Q_UNUSED(val);
}
void tst_associative_containers::lookup()
QDeclarativeItem *item = new QDeclarativeItem;
for (int i = 0; i < 30; ++i) {
QDeclarativeItem *child = new QDeclarativeItem;
+ Q_UNUSED(child);
}
delete item;
}
processEvents();
QBENCHMARK {
- rect->setPos(10, 10);
+ rect->setPos(pos);
}
}
// ...then measure...
- int pass = 1;
-
// should be as small as possible, to reduce overhead of painting
QSizeF size(1, 1);
setGeometryCalls.clear();
QBENCHMARK {
item = scene.itemAt(0, 0);
}
+ Q_UNUSED(item);
//let QGraphicsScene::_q_polishItems be called so ~QGraphicsItem doesn't spend all his time cleaning the unpolished list
qApp->processEvents();
QBENCHMARK {
QQuaternion q3 = q1 * q2;
+ Q_UNUSED(q3);
}
}
void tst_QFontMetrics::testQFontMetrics( const QFontMetrics &fm )
{
- int fontHeight = fm.height();
+ QBENCHMARK {
+ int fontHeight = fm.height();
+ Q_UNUSED(fontHeight);
+ }
}
void tst_QFontMetrics::fontmetrics_create()
void tst_QText::document()
{
- QTextDocument *doc = new QTextDocument;
-
QBENCHMARK {
QTextDocument *doc = new QTextDocument;
doc->setHtml(m_shortLorem);
void tst_QText::control()
{
- QTextControl *control = new QTextControl(m_shortLorem);
-
QBENCHMARK {
QTextControl *control = new QTextControl;
QTextDocument *doc = control->document();