summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/corelib/global/qglobal/tst_qglobal.cpp15
-rw-r--r--tests/auto/dbus/dbus.pro3
-rw-r--r--tests/auto/gui.pro5
-rw-r--r--tests/auto/network.pro2
-rw-r--r--tests/auto/network/kernel/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp2
-rw-r--r--tests/auto/qstylesheetstyle/tst_qstylesheetstyle.cpp2
-rw-r--r--tests/auto/v8/tst_v8.cpp6
-rw-r--r--tests/auto/v8/v8main.cpp42
-rw-r--r--tests/auto/v8/v8test.cpp43
-rw-r--r--tests/auto/v8/v8test.h1
10 files changed, 111 insertions, 10 deletions
diff --git a/tests/auto/corelib/global/qglobal/tst_qglobal.cpp b/tests/auto/corelib/global/qglobal/tst_qglobal.cpp
index 19a13f6ad0..85aa03f642 100644
--- a/tests/auto/corelib/global/qglobal/tst_qglobal.cpp
+++ b/tests/auto/corelib/global/qglobal/tst_qglobal.cpp
@@ -213,7 +213,7 @@ void tst_QGlobal::qtry()
// check propper if/else scoping
i = 0;
- if (true)
+ if (true) {
QT_TRY {
i = 2;
QT_THROW(42);
@@ -222,12 +222,13 @@ void tst_QGlobal::qtry()
QCOMPARE(i, 2);
i = 4;
}
- else
+ } else {
QCOMPARE(i, 0);
+ }
QCOMPARE(i, 4);
i = 0;
- if (false)
+ if (false) {
QT_TRY {
i = 2;
QT_THROW(42);
@@ -236,14 +237,15 @@ void tst_QGlobal::qtry()
QCOMPARE(i, 2);
i = 2;
}
- else
+ } else {
i = 8;
+ }
QCOMPARE(i, 8);
i = 0;
- if (false)
+ if (false) {
i = 42;
- else
+ } else {
QT_TRY {
i = 2;
QT_THROW(42);
@@ -252,6 +254,7 @@ void tst_QGlobal::qtry()
QCOMPARE(i, 2);
i = 4;
}
+ }
QCOMPARE(i, 4);
}
diff --git a/tests/auto/dbus/dbus.pro b/tests/auto/dbus/dbus.pro
index 6dd8ce325c..cd845d7043 100644
--- a/tests/auto/dbus/dbus.pro
+++ b/tests/auto/dbus/dbus.pro
@@ -18,3 +18,6 @@ SUBDIRS=\
qdbusthreading \
qdbusxmlparser \
+!contains(QT_CONFIG,private_tests): SUBDIRS -= \
+ qdbusmarshall \
+
diff --git a/tests/auto/gui.pro b/tests/auto/gui.pro
index 653e19cb3d..aad48cddef 100644
--- a/tests/auto/gui.pro
+++ b/tests/auto/gui.pro
@@ -146,9 +146,12 @@ win32:SUBDIRS -= qtextpiecetable
qgraphicssceneindex \
qlistwidget \
qmainwindow \
- qnetworkreply \
+ qpathclipper \
+ qpixmapcache \
qsidebar \
qstylesheetstyle \
+ qtextlayout \
+ qtextpiecetable \
qtipc \
qtoolbar \
diff --git a/tests/auto/network.pro b/tests/auto/network.pro
index 8172ef8dbf..21388bc281 100644
--- a/tests/auto/network.pro
+++ b/tests/auto/network.pro
@@ -6,4 +6,4 @@ TEMPLATE=subdirs
SUBDIRS=\
network \
networkselftest \
- qobjectperformance \
+ qobjectperformance
diff --git a/tests/auto/network/kernel/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp b/tests/auto/network/kernel/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp
index 1df6c24c10..0540bc8408 100644
--- a/tests/auto/network/kernel/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp
+++ b/tests/auto/network/kernel/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp
@@ -118,7 +118,7 @@ void tst_QNetworkProxyFactory::systemProxyForQuery() const
QNetworkProxy proxy;
QList<QNetworkProxy> nativeProxyList;
- nativeProxyList << QNetworkProxy(QNetworkProxy::HttpProxy, QString("http://test.proxy.com"), 8080) << QNetworkProxy::NoProxy;
+ nativeProxyList << QNetworkProxy(QNetworkProxy::HttpProxy, QString("test.proxy.com"), 8080) << QNetworkProxy::NoProxy;
foreach (proxy, systemProxyList) {
if (!nativeProxyList.contains(proxy)) {
diff --git a/tests/auto/qstylesheetstyle/tst_qstylesheetstyle.cpp b/tests/auto/qstylesheetstyle/tst_qstylesheetstyle.cpp
index 92b8812733..e12b57bf72 100644
--- a/tests/auto/qstylesheetstyle/tst_qstylesheetstyle.cpp
+++ b/tests/auto/qstylesheetstyle/tst_qstylesheetstyle.cpp
@@ -1649,7 +1649,7 @@ void tst_QStyleSheetStyle::QTBUG11658_cachecrash()
void tst_QStyleSheetStyle::QTBUG15910_crashNullWidget()
{
- struct : QWidget {
+ struct Widget : QWidget {
virtual void paintEvent(QPaintEvent* ) {
QStyleOption opt;
opt.init(this);
diff --git a/tests/auto/v8/tst_v8.cpp b/tests/auto/v8/tst_v8.cpp
index 4ff80067c5..c753806518 100644
--- a/tests/auto/v8/tst_v8.cpp
+++ b/tests/auto/v8/tst_v8.cpp
@@ -55,6 +55,7 @@ private slots:
void cleanupTestCase() {}
void eval();
+ void evalwithinwith();
void userobjectcompare();
};
@@ -63,6 +64,11 @@ void tst_v8::eval()
QVERIFY(v8test_eval());
}
+void tst_v8::evalwithinwith()
+{
+ QVERIFY(v8test_evalwithinwith());
+}
+
void tst_v8::userobjectcompare()
{
QVERIFY(v8test_userobjectcompare());
diff --git a/tests/auto/v8/v8main.cpp b/tests/auto/v8/v8main.cpp
index fa0137938e..b38bbabbd5 100644
--- a/tests/auto/v8/v8main.cpp
+++ b/tests/auto/v8/v8main.cpp
@@ -1,3 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#include "v8test.h"
#include <stdio.h>
@@ -11,6 +52,7 @@ int main(int argc, char *argv[])
v8::V8::SetFlagsFromCommandLine(&argc, argv, true);
RUN_TEST(eval);
+ RUN_TEST(evalwithinwith);
RUN_TEST(userobjectcompare);
return -1;
diff --git a/tests/auto/v8/v8test.cpp b/tests/auto/v8/v8test.cpp
index a712bf12b4..0b299ed23c 100644
--- a/tests/auto/v8/v8test.cpp
+++ b/tests/auto/v8/v8test.cpp
@@ -81,6 +81,49 @@ cleanup:
ENDTEST();
}
+bool v8test_evalwithinwith()
+{
+ BEGINTEST();
+
+ HandleScope handle_scope;
+ Persistent<Context> context = Context::New();
+ Context::Scope context_scope(context);
+
+ Local<Object> qmlglobal = Object::New();
+ qmlglobal->Set(String::New("a"), Integer::New(1922));
+ // There was a bug that the "eval" lookup would incorrectly resolve
+ // to the QML global object
+ qmlglobal->Set(String::New("eval"), Integer::New(1922));
+
+#define SOURCE \
+ "(function() { " \
+ " var b = { c: 10 }; " \
+ " with (b) { " \
+ " return eval(\"a\"); " \
+ " } " \
+ "})"
+ Local<Script> script = Script::Compile(String::New(SOURCE), NULL, NULL,
+ Handle<String>(), Script::QmlMode);
+#undef SOURCE
+
+ TryCatch tc;
+ Local<Value> result = script->Run(qmlglobal);
+
+ VERIFY(!tc.HasCaught());
+ VERIFY(result->IsFunction());
+
+ {
+ Local<Value> fresult = Handle<Function>::Cast(result)->Call(context->Global(), 0, 0);
+ VERIFY(!tc.HasCaught());
+ VERIFY(fresult->Int32Value() == 1922);
+ }
+
+cleanup:
+ context.Dispose();
+
+ ENDTEST();
+}
+
static int userObjectComparisonCalled = 0;
static bool userObjectComparisonReturn = false;
static Local<Object> expectedLhs;
diff --git a/tests/auto/v8/v8test.h b/tests/auto/v8/v8test.h
index 812036dd66..fa9bbe9f02 100644
--- a/tests/auto/v8/v8test.h
+++ b/tests/auto/v8/v8test.h
@@ -49,6 +49,7 @@
#endif
bool v8test_eval();
+bool v8test_evalwithinwith();
bool v8test_userobjectcompare();
#endif // V8TEST_H