summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2015-06-28 07:46:47 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2015-06-28 07:46:47 +0000
commitcb6cba2b6f11ba67a93135ac1646971e71da345b (patch)
tree441b4a02f9d03b851aa08c419c76de7c5da0b6f6 /tests
parentf1b01b7d159bcf04a2b832dba36f876479669641 (diff)
parent4dd8a63fc13cee365c58ef67fa4a4503aeceebe8 (diff)
Merge "Merge remote-tracking branch 'origin/5.5.0' into 5.5" into refs/staging/5.5
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp15
-rw-r--r--tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp18
-rw-r--r--tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp18
-rw-r--r--tests/auto/network/ssl/qsslellipticcurve/tst_qsslellipticcurve.cpp6
-rw-r--r--tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm2
5 files changed, 30 insertions, 29 deletions
diff --git a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp
index ef51422579..f215e87a48 100644
--- a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp
+++ b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp
@@ -263,21 +263,23 @@ private slots:
private:
const QString m_currentDir;
- QString m_dataPath;
QString m_sourceFile;
QString m_proFile;
QString m_resourcesDir;
QTemporaryDir m_dir;
+ QSharedPointer<QTemporaryDir> m_dataDir;
};
void tst_QFileInfo::initTestCase()
{
- m_dataPath = QEXTRACTTESTDATA("/testdata");
- QVERIFY(!m_dataPath.isEmpty());
+ m_dataDir = QEXTRACTTESTDATA("/testdata");
+ QVERIFY(m_dataDir);
+ const QString dataPath = m_dataDir->path();
+ QVERIFY(!dataPath.isEmpty());
- m_sourceFile = m_dataPath + QStringLiteral("/tst_qfileinfo.cpp");
- m_resourcesDir = m_dataPath + QStringLiteral("/resources");
- m_proFile = m_dataPath + QStringLiteral("/tst_qfileinfo.pro");
+ m_sourceFile = dataPath + QLatin1String("/tst_qfileinfo.cpp");
+ m_resourcesDir = dataPath + QLatin1String("/resources");
+ m_proFile = dataPath + QLatin1String("/tst_qfileinfo.pro");
QVERIFY(m_dir.isValid());
QVERIFY(QDir::setCurrent(m_dir.path()));
@@ -286,7 +288,6 @@ void tst_QFileInfo::initTestCase()
void tst_QFileInfo::cleanupTestCase()
{
QDir::setCurrent(m_currentDir); // Release temporary directory so that it can be deleted on Windows
- QDir(m_dataPath).removeRecursively();
}
// Testing get/set functions
diff --git a/tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp b/tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp
index 2190c32c01..a7a0cf4ddb 100644
--- a/tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp
+++ b/tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp
@@ -61,9 +61,9 @@ void tst_QStorageInfo::defaultValues()
QVERIFY(!storage.isRoot());
QVERIFY(storage.device().isEmpty());
QVERIFY(storage.fileSystemType().isEmpty());
- QVERIFY(storage.bytesTotal() == 0);
- QVERIFY(storage.bytesFree() == 0);
- QVERIFY(storage.bytesAvailable() == 0);
+ QVERIFY(storage.bytesTotal() == -1);
+ QVERIFY(storage.bytesFree() == -1);
+ QVERIFY(storage.bytesAvailable() == -1);
}
void tst_QStorageInfo::operatorEqual()
@@ -106,9 +106,9 @@ void tst_QStorageInfo::root()
QVERIFY(!storage.device().isEmpty());
QVERIFY(!storage.fileSystemType().isEmpty());
#ifndef Q_OS_HAIKU
- QVERIFY(storage.bytesTotal() > 0);
- QVERIFY(storage.bytesFree() > 0);
- QVERIFY(storage.bytesAvailable() > 0);
+ QVERIFY(storage.bytesTotal() >= 0);
+ QVERIFY(storage.bytesFree() >= 0);
+ QVERIFY(storage.bytesAvailable() >= 0);
#endif
}
@@ -121,9 +121,9 @@ void tst_QStorageInfo::currentStorage()
QVERIFY(appPath.startsWith(storage.rootPath(), Qt::CaseInsensitive));
QVERIFY(!storage.device().isEmpty());
QVERIFY(!storage.fileSystemType().isEmpty());
- QVERIFY(storage.bytesTotal() > 0);
- QVERIFY(storage.bytesFree() > 0);
- QVERIFY(storage.bytesAvailable() > 0);
+ QVERIFY(storage.bytesTotal() >= 0);
+ QVERIFY(storage.bytesFree() >= 0);
+ QVERIFY(storage.bytesAvailable() >= 0);
}
void tst_QStorageInfo::storageList()
diff --git a/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp b/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp
index aa7a3762ce..36da3b8770 100644
--- a/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp
+++ b/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp
@@ -81,7 +81,7 @@ private slots:
void readLineMaxlen_data();
void readLineMaxlen();
void readLinesFromBufferCRCR();
- void readLineOverload();
+ void readLineInto();
// all
void readAllFromDevice_data();
@@ -612,22 +612,22 @@ protected:
}
};
-void tst_QTextStream::readLineOverload()
+void tst_QTextStream::readLineInto()
{
QByteArray data = "1\n2\n3";
QTextStream ts(&data);
QString line;
- ts.readLine(&line);
+ ts.readLineInto(&line);
QCOMPARE(line, QStringLiteral("1"));
- ts.readLine(Q_NULLPTR, 0); // read the second line, but don't store it
+ ts.readLineInto(Q_NULLPTR, 0); // read the second line, but don't store it
- ts.readLine(&line);
+ ts.readLineInto(&line);
QCOMPARE(line, QStringLiteral("3"));
- QVERIFY(!ts.readLine(&line));
+ QVERIFY(!ts.readLineInto(&line));
QVERIFY(line.isEmpty());
QFile file(m_rfc3261FilePath);
@@ -637,7 +637,7 @@ void tst_QTextStream::readLineOverload()
line.reserve(1);
int maxLineCapacity = line.capacity();
- while (ts.readLine(&line)) {
+ while (ts.readLineInto(&line)) {
QVERIFY(line.capacity() >= maxLineCapacity);
maxLineCapacity = line.capacity();
}
@@ -647,7 +647,7 @@ void tst_QTextStream::readLineOverload()
QVERIFY(errorDevice.open(QIODevice::ReadOnly));
ts.setDevice(&errorDevice);
- QVERIFY(!ts.readLine(&line));
+ QVERIFY(!ts.readLineInto(&line));
QVERIFY(line.isEmpty());
}
@@ -1025,7 +1025,7 @@ void tst_QTextStream::performance()
QTextStream stream2(&file3);
QString line;
- while (stream2.readLine(&line))
+ while (stream2.readLineInto(&line))
++nlines3;
elapsed[2] = stopWatch.elapsed();
diff --git a/tests/auto/network/ssl/qsslellipticcurve/tst_qsslellipticcurve.cpp b/tests/auto/network/ssl/qsslellipticcurve/tst_qsslellipticcurve.cpp
index c97b46a512..685d354cc9 100644
--- a/tests/auto/network/ssl/qsslellipticcurve/tst_qsslellipticcurve.cpp
+++ b/tests/auto/network/ssl/qsslellipticcurve/tst_qsslellipticcurve.cpp
@@ -34,7 +34,7 @@
#include <QtTest/QtTest>
#include <QSslEllipticCurve>
-#include <QSslSocket>
+#include <QSslConfiguration>
class tst_QSslEllipticCurve : public QObject
{
@@ -84,7 +84,7 @@ void tst_QSslEllipticCurve::fromShortName_data()
QTest::newRow("QString()") << QString() << QSslEllipticCurve() << false;
QTest::newRow("\"\"") << QString("") << QSslEllipticCurve() << false;
QTest::newRow("does-not-exist") << QStringLiteral("does-not-exist") << QSslEllipticCurve() << false;
- Q_FOREACH (QSslEllipticCurve ec, QSslSocket::supportedEllipticCurves()) {
+ Q_FOREACH (QSslEllipticCurve ec, QSslConfiguration::supportedEllipticCurves()) {
const QString sN = ec.shortName();
QTest::newRow(qPrintable("supported EC \"" + sN + '"')) << sN << ec << true;
// At least in the OpenSSL impl, the short name is case-sensitive. That feels odd.
@@ -117,7 +117,7 @@ void tst_QSslEllipticCurve::fromLongName_data()
QTest::newRow("QString()") << QString() << QSslEllipticCurve() << false;
QTest::newRow("\"\"") << QString("") << QSslEllipticCurve() << false;
QTest::newRow("does-not-exist") << QStringLiteral("does-not-exist") << QSslEllipticCurve() << false;
- Q_FOREACH (QSslEllipticCurve ec, QSslSocket::supportedEllipticCurves()) {
+ Q_FOREACH (QSslEllipticCurve ec, QSslConfiguration::supportedEllipticCurves()) {
const QString lN = ec.longName();
QTest::newRow(qPrintable("supported EC \"" + lN + '"')) << lN << ec << true;
}
diff --git a/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm b/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm
index d0ff6af640..3056904dcf 100644
--- a/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm
+++ b/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm
@@ -129,7 +129,7 @@ QDebug operator<<(QDebug dbg, AXErrorTag err)
- (AXUIElementRef) ref { return reference; }
- (void) print {
- NSLog(@"Accessible Object role: '%@', title: '%@', description: '%@', value: '%@', rect: '%@'", self.role, self.title, self.description, self.value, NSStringFromRect(self.rect));
+ NSLog(@"Accessible Object role: '%@', title: '%@', description: '%@', value: '%@', rect: '%@'", self.role, self.title, self.description, self.value, NSStringFromRect(NSRectFromCGRect(self.rect)));
NSLog(@" Children: %ld", [[self childList] count]);
}