summaryrefslogtreecommitdiffstats
path: root/tests/auto/qscriptqobject
diff options
context:
space:
mode:
authorKent Hansen <khansen@trolltech.com>2009-06-15 15:34:33 (GMT)
committerKent Hansen <khansen@trolltech.com>2009-06-15 15:35:05 (GMT)
commit9d6069f32962128f737b83a4bf7d7e7309983023 (patch)
treed5c37af610ffceeb76ad9878a2039112be917193 /tests/auto/qscriptqobject
parentb8231cb61129964dfecaf862b6ef5fecb6753c01 (diff)
downloadQt-9d6069f32962128f737b83a4bf7d7e7309983023.zip
Qt-9d6069f32962128f737b83a4bf7d7e7309983023.tar.gz
Qt-9d6069f32962128f737b83a4bf7d7e7309983023.tar.bz2
add a bunch of qtscript autotests
Get that code coverage up.
Diffstat (limited to 'tests/auto/qscriptqobject')
-rw-r--r--tests/auto/qscriptqobject/tst_qscriptqobject.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/auto/qscriptqobject/tst_qscriptqobject.cpp b/tests/auto/qscriptqobject/tst_qscriptqobject.cpp
index 2c47c49..24c283e 100644
--- a/tests/auto/qscriptqobject/tst_qscriptqobject.cpp
+++ b/tests/auto/qscriptqobject/tst_qscriptqobject.cpp
@@ -1906,6 +1906,22 @@ void tst_QScriptExtQObject::cppConnectAndDisconnect()
QVERIFY(qScriptDisconnect(m_myObject, SIGNAL(mySignal()), QScriptValue(), fun));
QCOMPARE(m_myObject->disconnectedSignal().constData(), SIGNAL(mySignal()));
}
+
+ // bad args
+ QVERIFY(!qScriptConnect(0, SIGNAL(foo()), QScriptValue(), fun));
+ QVERIFY(!qScriptConnect(&edit, 0, QScriptValue(), fun));
+ QVERIFY(!qScriptConnect(&edit, SIGNAL(foo()), QScriptValue(), fun));
+ QVERIFY(!qScriptConnect(&edit, SIGNAL(textChanged(QString)), QScriptValue(), QScriptValue()));
+ QVERIFY(!qScriptDisconnect(0, SIGNAL(foo()), QScriptValue(), fun));
+ QVERIFY(!qScriptDisconnect(&edit, 0, QScriptValue(), fun));
+ QVERIFY(!qScriptDisconnect(&edit, SIGNAL(foo()), QScriptValue(), fun));
+ QVERIFY(!qScriptDisconnect(&edit, SIGNAL(textChanged(QString)), QScriptValue(), QScriptValue()));
+ {
+ QScriptEngine eng2;
+ QScriptValue receiverInDifferentEngine = eng2.newObject();
+ QVERIFY(!qScriptConnect(&edit, SIGNAL(textChanged(QString)), receiverInDifferentEngine, fun));
+ QVERIFY(!qScriptDisconnect(&edit, SIGNAL(textChanged(QString)), receiverInDifferentEngine, fun));
+ }
}
void tst_QScriptExtQObject::classEnums()