diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-01-18 15:36:32 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-01-18 15:36:32 (GMT) |
commit | c4a842563d40e8b4c3693a8acb77c9aff6f06e29 (patch) | |
tree | ceb8542f17ca2879db1831c4d018efb629234dc5 /tests/auto | |
parent | a764519a658031ce2fb375b659ff889b5241357f (diff) | |
parent | 102f415e39772086e9066f2e9954c0c22725a23e (diff) | |
download | Qt-c4a842563d40e8b4c3693a8acb77c9aff6f06e29.zip Qt-c4a842563d40e8b4c3693a8acb77c9aff6f06e29.tar.gz Qt-c4a842563d40e8b4c3693a8acb77c9aff6f06e29.tar.bz2 |
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1:
Fix QSslCertificate issues
Change the prefered content size of the anomaly browser
Avoid painting while loading in the anomaly demo browser
QFile::readData: Simplify code
If the file is open, there must be an engine.
QFile: Fix a pre-mature pessimization
don't assert when calling QtScript-wrapped method of deleted QObject
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/qscriptextqobject/tst_qscriptextqobject.cpp | 11 | ||||
-rw-r--r-- | tests/auto/qsslcertificate/tst_qsslcertificate.cpp | 13 |
2 files changed, 23 insertions, 1 deletions
diff --git a/tests/auto/qscriptextqobject/tst_qscriptextqobject.cpp b/tests/auto/qscriptextqobject/tst_qscriptextqobject.cpp index 3415163..de9d37e 100644 --- a/tests/auto/qscriptextqobject/tst_qscriptextqobject.cpp +++ b/tests/auto/qscriptextqobject/tst_qscriptextqobject.cpp @@ -2913,7 +2913,8 @@ void tst_QScriptExtQObject::objectDeleted() v.setProperty("intProperty", QScriptValue(&eng, 123)); QCOMPARE(qobj->intProperty(), 123); qobj->resetQtFunctionInvoked(); - v.property("myInvokable").call(v); + QScriptValue invokable = v.property("myInvokable"); + invokable.call(v); QCOMPARE(qobj->qtFunctionInvoked(), 0); // now delete the object @@ -2951,6 +2952,14 @@ void tst_QScriptExtQObject::objectDeleted() QCOMPARE(ret.toString(), QLatin1String("Error: cannot access member `myInvokableWithIntArg' of deleted QObject")); } + // Meta-method wrappers are still valid, but throw error when called + QVERIFY(invokable.isFunction()); + { + QScriptValue ret = invokable.call(v); + QVERIFY(ret.isError()); + QCOMPARE(ret.toString(), QString::fromLatin1("Error: cannot call function of deleted QObject")); + } + // access from script eng.globalObject().setProperty("o", v); { diff --git a/tests/auto/qsslcertificate/tst_qsslcertificate.cpp b/tests/auto/qsslcertificate/tst_qsslcertificate.cpp index 892d745..44f8522 100644 --- a/tests/auto/qsslcertificate/tst_qsslcertificate.cpp +++ b/tests/auto/qsslcertificate/tst_qsslcertificate.cpp @@ -105,6 +105,7 @@ private slots: void fromPath_data(); void fromPath(); void certInfo(); + void certInfoQByteArray(); void task256066toPem(); void nulInCN(); void nulInSan(); @@ -697,6 +698,18 @@ void tst_QSslCertificate::certInfo() QCOMPARE(cert, QSslCertificate(QByteArray::fromHex(der), QSsl::Der)); } +void tst_QSslCertificate::certInfoQByteArray() +{ + QSslCertificate cert = QSslCertificate::fromPath("certificates/cert.pem", QSsl::Pem, + QRegExp::FixedString).first(); + QVERIFY(!cert.isNull()); + + // in this test, check the bytearray variants before the enum variants to see if + // we fixed a bug we had with lazy initialization of the values. + QCOMPARE(cert.issuerInfo("CN"), QString("Test CA (1024 bit)")); + QCOMPARE(cert.subjectInfo("CN"), QString("name/with/slashes")); +} + void tst_QSslCertificate::task256066toPem() { // a certificate whose PEM encoding's length is a multiple of 64 |