summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/respfile/lupdatecmd2
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/respfile/project.ts.result17
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/respfile/source1.cpp49
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/respfile/source2.cpp49
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/respfile/sources.lst2
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/respfile/tsfiles.lst1
-rw-r--r--tests/auto/modeltest/dynamictreemodel.cpp3
-rw-r--r--tests/auto/modeltest/tst_modeltest.cpp30
-rw-r--r--tests/auto/networkdata/README1
-rw-r--r--tests/auto/qcombobox/tst_qcombobox.cpp30
-rw-r--r--tests/auto/qdom/tst_qdom.cpp6
-rw-r--r--tests/auto/qeasingcurve/tst_qeasingcurve.cpp139
-rw-r--r--tests/auto/qfileinfo/tst_qfileinfo.cpp15
-rw-r--r--tests/auto/qgl/tst_qgl.cpp41
-rw-r--r--tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp27
-rw-r--r--tests/auto/qhttp/tst_qhttp.cpp30
-rw-r--r--tests/auto/qintvalidator/tst_qintvalidator.cpp26
-rw-r--r--tests/auto/qkeysequence/tst_qkeysequence.cpp13
-rw-r--r--tests/auto/qmetaobject/tst_qmetaobject.cpp4
-rw-r--r--tests/auto/qobject/moc_oldnormalizeobject.cpp113
-rw-r--r--tests/auto/qobject/oldnormalizeobject.h28
-rw-r--r--tests/auto/qobject/tst_qobject.cpp172
-rw-r--r--tests/auto/qobject/tst_qobject.pro22
-rw-r--r--tests/auto/qpixmap/tst_qpixmap.cpp27
-rw-r--r--tests/auto/qsharedpointer/externaltests.cpp10
-rw-r--r--tests/auto/qtabbar/tst_qtabbar.cpp3
-rw-r--r--tests/auto/qtoolbar/tst_qtoolbar.cpp31
-rw-r--r--tests/auto/qxmlsimplereader/tst_qxmlsimplereader.cpp2
-rw-r--r--tests/auto/selftests/expected_cmptest.txt2
-rw-r--r--tests/auto/selftests/expected_crashes_3.txt2
-rw-r--r--tests/auto/selftests/expected_longstring.txt2
-rw-r--r--tests/auto/selftests/expected_maxwarnings.txt2
-rw-r--r--tests/auto/selftests/expected_skip.txt2
-rw-r--r--tests/auto/symbols/tst_symbols.cpp1
-rw-r--r--tests/auto/uiloader/baseline/css_buttons_background.ui39
35 files changed, 828 insertions, 115 deletions
diff --git a/tests/auto/linguist/lupdate/testdata/good/respfile/lupdatecmd b/tests/auto/linguist/lupdate/testdata/good/respfile/lupdatecmd
new file mode 100644
index 0000000..6f198ab
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/respfile/lupdatecmd
@@ -0,0 +1,2 @@
+# Add the command that lupdate should run here. If it can't find anything it will default to
+lupdate -silent @sources.lst -ts @tsfiles.lst
diff --git a/tests/auto/linguist/lupdate/testdata/good/respfile/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/respfile/project.ts.result
new file mode 100644
index 0000000..3a864a2
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/respfile/project.ts.result
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0">
+<context>
+ <name>Dialog2</name>
+ <message>
+ <location filename="source1.cpp" line="47"/>
+ <source>func1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="source2.cpp" line="47"/>
+ <source>func2</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+</TS>
diff --git a/tests/auto/linguist/lupdate/testdata/good/respfile/source1.cpp b/tests/auto/linguist/lupdate/testdata/good/respfile/source1.cpp
new file mode 100644
index 0000000..33642c4
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/respfile/source1.cpp
@@ -0,0 +1,49 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 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$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, 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.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// IMPORTANT!!!! If you want to add testdata to this file,
+// always add it to the end in order to not change the linenumbers of translations!!!
+
+void Dialog2::func3()
+{
+ tr("func1");
+}
+
diff --git a/tests/auto/linguist/lupdate/testdata/good/respfile/source2.cpp b/tests/auto/linguist/lupdate/testdata/good/respfile/source2.cpp
new file mode 100644
index 0000000..f284a61
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/respfile/source2.cpp
@@ -0,0 +1,49 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 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$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, 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.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// IMPORTANT!!!! If you want to add testdata to this file,
+// always add it to the end in order to not change the linenumbers of translations!!!
+
+void Dialog2::func3()
+{
+ tr("func2");
+}
+
diff --git a/tests/auto/linguist/lupdate/testdata/good/respfile/sources.lst b/tests/auto/linguist/lupdate/testdata/good/respfile/sources.lst
new file mode 100644
index 0000000..430937e
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/respfile/sources.lst
@@ -0,0 +1,2 @@
+source1.cpp
+source2.cpp
diff --git a/tests/auto/linguist/lupdate/testdata/good/respfile/tsfiles.lst b/tests/auto/linguist/lupdate/testdata/good/respfile/tsfiles.lst
new file mode 100644
index 0000000..f3eb71f
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/respfile/tsfiles.lst
@@ -0,0 +1 @@
+project.ts
diff --git a/tests/auto/modeltest/dynamictreemodel.cpp b/tests/auto/modeltest/dynamictreemodel.cpp
index 24d3ab3..b572eb1 100644
--- a/tests/auto/modeltest/dynamictreemodel.cpp
+++ b/tests/auto/modeltest/dynamictreemodel.cpp
@@ -160,10 +160,11 @@ QVariant DynamicTreeModel::data(const QModelIndex &index, int role) const
void DynamicTreeModel::clear()
{
+ beginResetModel();
m_items.clear();
m_childItems.clear();
nextId = 1;
- reset();
+ endResetModel();
}
diff --git a/tests/auto/modeltest/tst_modeltest.cpp b/tests/auto/modeltest/tst_modeltest.cpp
index 95326d4..da5cd6a 100644
--- a/tests/auto/modeltest/tst_modeltest.cpp
+++ b/tests/auto/modeltest/tst_modeltest.cpp
@@ -67,6 +67,7 @@ private slots:
void standardItemModel();
void testInsertThroughProxy();
void moveSourceItems();
+ void testResetThroughProxy();
};
@@ -225,8 +226,9 @@ public slots:
void storePersistent()
{
- m_persistentSourceIndexes.clear();
- m_persistentProxyIndexes.clear();
+ foreach(const QModelIndex &idx, m_persistentProxyIndexes)
+ Q_ASSERT(idx.isValid()); // This is called from layoutAboutToBeChanged. Persistent indexes should be valid
+
Q_ASSERT(m_proxy->persistent().isEmpty());
storePersistent(QModelIndex());
Q_ASSERT(!m_proxy->persistent().isEmpty());
@@ -243,6 +245,8 @@ public slots:
QModelIndex updatedSource = m_persistentSourceIndexes.at(row);
QCOMPARE(m_proxy->mapToSource(updatedProxy), updatedSource);
}
+ m_persistentSourceIndexes.clear();
+ m_persistentProxyIndexes.clear();
}
private:
@@ -278,6 +282,28 @@ void tst_ModelTest::moveSourceItems()
moveCommand->doCommand();
}
+void tst_ModelTest::testResetThroughProxy()
+{
+ DynamicTreeModel *model = new DynamicTreeModel(this);
+
+ ModelInsertCommand *insertCommand = new ModelInsertCommand(model, this);
+ insertCommand->setStartRow(0);
+ insertCommand->setEndRow(2);
+ insertCommand->doCommand();
+
+ QPersistentModelIndex persistent = model->index(0, 0);
+
+ AccessibleProxyModel *proxy = new AccessibleProxyModel(this);
+ proxy->setSourceModel(model);
+
+ ObservingObject observer(proxy);
+ observer.storePersistent();
+
+ ModelResetCommand *resetCommand = new ModelResetCommand(model, this);
+ resetCommand->setNumCols(0);
+ resetCommand->doCommand();
+}
+
QTEST_MAIN(tst_ModelTest)
#include "tst_modeltest.moc"
diff --git a/tests/auto/networkdata/README b/tests/auto/networkdata/README
new file mode 100644
index 0000000..e8748cc
--- /dev/null
+++ b/tests/auto/networkdata/README
@@ -0,0 +1 @@
+This directory contains network test data
diff --git a/tests/auto/qcombobox/tst_qcombobox.cpp b/tests/auto/qcombobox/tst_qcombobox.cpp
index fbaa824..1fcea9e 100644
--- a/tests/auto/qcombobox/tst_qcombobox.cpp
+++ b/tests/auto/qcombobox/tst_qcombobox.cpp
@@ -156,6 +156,7 @@ private slots:
void resetModel();
void keyBoardNavigationWithMouse();
void task_QTBUG_1071_changingFocusEmitsActivated();
+ void maxVisibleItems();
protected slots:
void onEditTextChanged( const QString &newString );
@@ -2529,5 +2530,34 @@ void tst_QComboBox::task_QTBUG_1071_changingFocusEmitsActivated()
QTRY_COMPARE(spy.count(), 1);
}
+void tst_QComboBox::maxVisibleItems()
+{
+ QComboBox comboBox;
+ QCOMPARE(comboBox.maxVisibleItems(), 10); //default value.
+
+ QStringList content;
+ for(int i = 1; i < 50; i++)
+ content += QString::number(i);
+
+ comboBox.addItems(content);
+ comboBox.show();
+ comboBox.resize(200, comboBox.height());
+ QTRY_VERIFY(comboBox.isVisible());
+
+ comboBox.setMaxVisibleItems(5);
+ QCOMPARE(comboBox.maxVisibleItems(), 5);
+
+ comboBox.showPopup();
+ QTRY_VERIFY(comboBox.view());
+ QTRY_VERIFY(comboBox.view()->isVisible());
+
+ QAbstractItemView *v = comboBox.view();
+ int itemHeight = v->visualRect(v->model()->index(0,0)).height();
+ if (v->style()->styleHint(QStyle::SH_ComboBox_Popup))
+ QCOMPARE(v->viewport()->height(), itemHeight * comboBox.maxVisibleItems());
+ // QCombobox without a popup does not work, see QTBUG-760
+}
+
+
QTEST_MAIN(tst_QComboBox)
#include "tst_qcombobox.moc"
diff --git a/tests/auto/qdom/tst_qdom.cpp b/tests/auto/qdom/tst_qdom.cpp
index d1b2ea5..76903e5 100644
--- a/tests/auto/qdom/tst_qdom.cpp
+++ b/tests/auto/qdom/tst_qdom.cpp
@@ -476,10 +476,6 @@ void tst_QDom::save()
void tst_QDom::initTestCase()
{
-#ifdef Q_CC_MINGW
- QSKIP("Our current test machine, arsia, is too slow for this auto test.", SkipAll);
-#endif
-
QFile file(SRCDIR "testdata/excludedCodecs.txt");
QVERIFY(file.open(QIODevice::ReadOnly|QIODevice::Text));
@@ -1676,7 +1672,7 @@ void tst_QDom::appendDocumentNode() const
doc.appendChild(elem);
- Q_ASSERT(!xml.isNull());
+ QVERIFY(!xml.isNull());
const QString expected(QLatin1String("<document>\n<test_elem name=\"value\"/>\n</document>\n"));
elem.appendChild(xml);
diff --git a/tests/auto/qeasingcurve/tst_qeasingcurve.cpp b/tests/auto/qeasingcurve/tst_qeasingcurve.cpp
index 0122d43..12ddff1 100644
--- a/tests/auto/qeasingcurve/tst_qeasingcurve.cpp
+++ b/tests/auto/qeasingcurve/tst_qeasingcurve.cpp
@@ -193,186 +193,208 @@ void tst_QEasingCurve::valueForProgress_data()
// integer values and avoid fp inaccuracies
QTest::newRow("Linear") << int(QEasingCurve::Linear)
<< (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (RealList() << 0 << 0.1 << 0.2 << 0.3 << 0.4 << 0.5 << 0.6 << 0.7 << 0.8 << 0.9 << 1);
+ << (RealList() << 0.0000 << 0.1000 << 0.2000 << 0.3000 << 0.4000 << 0.5000 << 0.6000 << 0.7000 << 0.8000 << 0.9000 << 1.0000);
QTest::newRow("InQuad") << int(QEasingCurve::InQuad)
<< (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (RealList() << 0 << 0.01 << 0.04 << 0.09 << 0.16 << 0.25 << 0.36 << 0.49 << 0.64 << 0.81 << 1);
+ << (RealList() << 0.0000 << 0.0100 << 0.0400 << 0.0900 << 0.1600 << 0.2500 << 0.3600 << 0.4900 << 0.6400 << 0.8100 << 1.0000);
QTest::newRow("OutQuad") << int(QEasingCurve::OutQuad)
<< (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (RealList() << 0 << 0.19 << 0.36 << 0.51 << 0.64 << 0.75 << 0.84 << 0.91 << 0.96 << 0.99 << 1);
+ << (RealList() << 0.0000 << 0.1900 << 0.3600 << 0.5100 << 0.6400 << 0.7500 << 0.8400 << 0.9100 << 0.9600 << 0.9900 << 1.0000);
QTest::newRow("InOutQuad") << int(QEasingCurve::InOutQuad)
<< (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (RealList() << 0 << 0.02 << 0.08 << 0.18 << 0.32 << 0.5 << 0.68 << 0.82 << 0.92 << 0.98 << 1);
+ << (RealList() << 0.0000 << 0.0200 << 0.0800 << 0.1800 << 0.3200 << 0.5000 << 0.6800 << 0.8200 << 0.9200 << 0.9800 << 1.0000);
QTest::newRow("OutInQuad") << int(QEasingCurve::OutInQuad)
<< (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (RealList() << 0 << 0.18 << 0.32 << 0.42 << 0.48 << 0.5 << 0.52 << 0.58 << 0.68 << 0.82 << 1);
+ << (RealList() << 0.0000 << 0.1800 << 0.3200 << 0.4200 << 0.4800 << 0.5000 << 0.5200 << 0.5800 << 0.6800 << 0.8200 << 1.0000);
QTest::newRow("InCubic") << int(QEasingCurve::InCubic)
<< (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (RealList() << 0 << 0.001 << 0.008 << 0.027 << 0.064 << 0.125 << 0.216 << 0.343 << 0.512 << 0.729 << 1);
+ << (RealList() << 0.0000 << 0.0010 << 0.0080 << 0.0270 << 0.0640 << 0.1250 << 0.2160 << 0.3430 << 0.5120 << 0.7290 << 1.0000);
QTest::newRow("OutCubic") << int(QEasingCurve::OutCubic)
<< (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (RealList() << 0 << 0.271 << 0.488 << 0.657 << 0.784 << 0.875 << 0.936 << 0.973 << 0.992 << 0.999 << 1);
+ << (RealList() << 0.0000 << 0.2710 << 0.4880 << 0.6570 << 0.7840 << 0.8750 << 0.9360 << 0.9730 << 0.9920 << 0.9990 << 1.0000);
QTest::newRow("InOutCubic") << int(QEasingCurve::InOutCubic)
<< (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (RealList() << 0 << 0.004 << 0.032 << 0.108 << 0.256 << 0.5 << 0.744 << 0.892 << 0.968 << 0.996 << 1);
+ << (RealList() << 0.0000 << 0.0040 << 0.0320 << 0.1080 << 0.2560 << 0.5000 << 0.7440 << 0.8920 << 0.9680 << 0.9960 << 1.0000);
QTest::newRow("OutInCubic") << int(QEasingCurve::OutInCubic)
<< (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (RealList() << 0 << 0.244 << 0.392 << 0.468 << 0.496 << 0.5 << 0.504 << 0.532 << 0.608 << 0.756 << 1);
+ << (RealList() << 0.0000 << 0.2440 << 0.3920 << 0.4680 << 0.4960 << 0.5000 << 0.5040 << 0.5320 << 0.6080 << 0.7560 << 1.0000);
QTest::newRow("InQuart") << int(QEasingCurve::InQuart)
<< (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (RealList() << 0 << 0.0001 << 0.0016 << 0.0081 << 0.0256 << 0.0625 << 0.1296 << 0.2401 << 0.4096 << 0.6561 << 1);
+ << (RealList() << 0.0000 << 0.0001 << 0.0016 << 0.0081 << 0.0256 << 0.0625 << 0.1296 << 0.2401 << 0.4096 << 0.6561 << 1.0000);
QTest::newRow("OutQuart") << int(QEasingCurve::OutQuart)
<< (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (RealList() << 0 << 0.3439 << 0.5904 << 0.7599 << 0.8704 << 0.9375 << 0.9744 << 0.9919 << 0.9984 << 0.9999 << 1);
+ << (RealList() << 0.0000 << 0.3439 << 0.5904 << 0.7599 << 0.8704 << 0.9375 << 0.9744 << 0.9919 << 0.9984 << 0.9999 << 1.0000);
QTest::newRow("InOutQuart") << int(QEasingCurve::InOutQuart)
<< (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (RealList() << 0 << 0.0008 << 0.0128 << 0.0648 << 0.2048 << 0.5 << 0.7952 << 0.9352 << 0.9872 << 0.9992 << 1);
+ << (RealList() << 0.0000 << 0.0008 << 0.0128 << 0.0648 << 0.2048 << 0.5000 << 0.7952 << 0.9352 << 0.9872 << 0.9992 << 1.0000);
QTest::newRow("OutInQuart") << int(QEasingCurve::OutInQuart)
<< (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (RealList() << 0 << 0.2952 << 0.4352 << 0.4872 << 0.4992 << 0.5 << 0.5008 << 0.5128 << 0.5648 << 0.7048 << 1);
+ << (RealList() << 0.0000 << 0.2952 << 0.4352 << 0.4872 << 0.4992 << 0.5000 << 0.5008 << 0.5128 << 0.5648 << 0.7048 << 1.0000);
QTest::newRow("InQuint") << int(QEasingCurve::InQuint)
<< (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (RealList() << 0 << 1e-05 << 0.00032 << 0.00243 << 0.01024 << 0.03125 << 0.07776 << 0.1681 << 0.3277 << 0.5905 << 1);
+ << (RealList() << 0.0000 << 0.0000 << 0.0003 << 0.0024 << 0.0102 << 0.0313 << 0.0778 << 0.1681 << 0.3277 << 0.5905 << 1.0000);
QTest::newRow("OutQuint") << int(QEasingCurve::OutQuint)
<< (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (RealList() << 0 << 0.4095 << 0.6723 << 0.8319 << 0.9222 << 0.9688 << 0.9898 << 0.9976 << 0.9997 << 1 << 1);
+ << (RealList() << 0.0000 << 0.4095 << 0.6723 << 0.8319 << 0.9222 << 0.9688 << 0.9898 << 0.9976 << 0.9997 << 1.0000 << 1.0000);
QTest::newRow("InOutQuint") << int(QEasingCurve::InOutQuint)
<< (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (RealList() << 0 << 0.00016 << 0.00512 << 0.03888 << 0.1638 << 0.5 << 0.8362 << 0.9611 << 0.9949 << 0.9998 << 1);
+ << (RealList() << 0.0000 << 0.0002 << 0.0051 << 0.0389 << 0.1638 << 0.5000 << 0.8362 << 0.9611 << 0.9949 << 0.9998 << 1.0000);
QTest::newRow("OutInQuint") << int(QEasingCurve::OutInQuint)
<< (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (RealList() << 0 << 0.3362 << 0.4611 << 0.4949 << 0.4998 << 0.5 << 0.5002 << 0.5051 << 0.5389 << 0.6638 << 1);
+ << (RealList() << 0.0000 << 0.3362 << 0.4611 << 0.4949 << 0.4998 << 0.5000 << 0.5002 << 0.5051 << 0.5389 << 0.6638 << 1.0000);
QTest::newRow("InSine") << int(QEasingCurve::InSine)
<< (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (RealList() << 0 << 0.01231 << 0.04894 << 0.109 << 0.191 << 0.2929 << 0.4122 << 0.546 << 0.691 << 0.8436 << 1);
+ << (RealList() << 0.0000 << 0.0123 << 0.0489 << 0.1090 << 0.1910 << 0.2929 << 0.4122 << 0.5460 << 0.6910 << 0.8436 << 1.0000);
QTest::newRow("OutSine") << int(QEasingCurve::OutSine)
<< (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (RealList() << 0 << 0.1564 << 0.309 << 0.454 << 0.5878 << 0.7071 << 0.809 << 0.891 << 0.9511 << 0.9877 << 1);
+ << (RealList() << 0.0000 << 0.1564 << 0.3090 << 0.4540 << 0.5878 << 0.7071 << 0.8090 << 0.8910 << 0.9511 << 0.9877 << 1.0000);
QTest::newRow("InOutSine") << int(QEasingCurve::InOutSine)
<< (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (RealList() << 0 << 0.02447 << 0.09549 << 0.2061 << 0.3455 << 0.5 << 0.6545 << 0.7939 << 0.9045 << 0.9755 << 1);
+ << (RealList() << 0.0000 << 0.0245 << 0.0955 << 0.2061 << 0.3455 << 0.5000 << 0.6545 << 0.7939 << 0.9045 << 0.9755 << 1.0000);
QTest::newRow("OutInSine") << int(QEasingCurve::OutInSine)
<< (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (RealList() << 0 << 0.1545 << 0.2939 << 0.4045 << 0.4755 << 0.5 << 0.5245 << 0.5955 << 0.7061 << 0.8455 << 1);
+ << (RealList() << 0.0000 << 0.1545 << 0.2939 << 0.4045 << 0.4755 << 0.5000 << 0.5245 << 0.5955 << 0.7061 << 0.8455 << 1.0000);
QTest::newRow("InExpo") << int(QEasingCurve::InExpo)
<< (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (RealList() << 0 << 0.0009531 << 0.002906 << 0.006812 << 0.01462 << 0.03025 << 0.0615 << 0.124 << 0.249 << 0.499 << 1);
+ << (RealList() << 0.0000 << 0.0010 << 0.0029 << 0.0068 << 0.0146 << 0.0303 << 0.0615 << 0.1240 << 0.2490 << 0.4990 << 1.0000);
QTest::newRow("OutExpo") << int(QEasingCurve::OutExpo)
<< (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (RealList() << 0 << 0.5005 << 0.7507 << 0.8759 << 0.9384 << 0.9697 << 0.9854 << 0.9932 << 0.9971 << 0.999 << 1);
+ << (RealList() << 0.0000 << 0.5005 << 0.7507 << 0.8759 << 0.9384 << 0.9697 << 0.9854 << 0.9932 << 0.9971 << 0.9990 << 1.0000);
QTest::newRow("InOutExpo") << int(QEasingCurve::InOutExpo)
<< (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (RealList() << 0 << 0.001453 << 0.007312 << 0.03075 << 0.1245 << 0.5002 << 0.8754 << 0.9692 << 0.9927 << 0.9985 << 1);
+ << (RealList() << 0.0000 << 0.0015 << 0.0073 << 0.0308 << 0.1245 << 0.5003 << 0.8754 << 0.9692 << 0.9927 << 0.9985 << 1.0000);
QTest::newRow("OutInExpo") << int(QEasingCurve::OutInExpo)
<< (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (RealList() << 0 << 0.3754 << 0.4692 << 0.4927 << 0.4985 << 0.5 << 0.5015 << 0.5073 << 0.5308 << 0.6245 << 1);
+ << (RealList() << 0.0000 << 0.3754 << 0.4692 << 0.4927 << 0.4985 << 0.5000 << 0.5015 << 0.5073 << 0.5308 << 0.6245 << 1.0000);
QTest::newRow("InCirc") << int(QEasingCurve::InCirc)
<< (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (RealList() << 0 << 0.005013 << 0.0202 << 0.04606 << 0.08348 << 0.134 << 0.2 << 0.2859 << 0.4 << 0.5641 << 1);
+ << (RealList() << 0.0000 << 0.0050 << 0.0202 << 0.0461 << 0.0835 << 0.1340 << 0.2000 << 0.2859 << 0.4000 << 0.5641 << 1.0000);
QTest::newRow("OutCirc") << int(QEasingCurve::OutCirc)
<< (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (RealList() << 0 << 0.4359 << 0.6 << 0.7141 << 0.8 << 0.866 << 0.9165 << 0.9539 << 0.9798 << 0.995 << 1);
+ << (RealList() << 0.0000 << 0.4359 << 0.6000 << 0.7141 << 0.8000 << 0.8660 << 0.9165 << 0.9539 << 0.9798 << 0.9950 << 1.0000);
QTest::newRow("InOutCirc") << int(QEasingCurve::InOutCirc)
<< (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (RealList() << 0 << 0.0101 << 0.04174 << 0.1 << 0.2 << 0.5 << 0.8 << 0.9 << 0.9583 << 0.9899 << 1);
+ << (RealList() << 0.0000 << 0.0101 << 0.0417 << 0.1000 << 0.2000 << 0.5000 << 0.8000 << 0.9000 << 0.9583 << 0.9899 << 1.0000);
QTest::newRow("OutInCirc") << int(QEasingCurve::OutInCirc)
<< (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (RealList() << 0 << 0.3 << 0.4 << 0.4583 << 0.4899 << 0.5 << 0.5101 << 0.5417 << 0.6 << 0.7 << 1);
+ << (RealList() << 0.0000 << 0.3000 << 0.4000 << 0.4583 << 0.4899 << 0.5000 << 0.5101 << 0.5417 << 0.6000 << 0.7000 << 1.0000);
QTest::newRow("InElastic") << int(QEasingCurve::InElastic)
<< (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (RealList() << 0 << 0.001953 << -0.001953 << -0.003906 << 0.01562 << -0.01562 << -0.03125 << 0.125 << -0.125 << -0.25 << 1);
+ << (RealList() << 0.0000 << 0.0020 << -0.0020 << -0.0039 << 0.0156 << -0.0156 << -0.0313 << 0.1250 << -0.1250 << -0.2500 << 1.0000);
QTest::newRow("OutElastic") << int(QEasingCurve::OutElastic)
<< (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (RealList() << 0 << 1.25 << 1.125 << 0.875 << 1.031 << 1.016 << 0.9844 << 1.004 << 1.002 << 0.998 << 1);
+ << (RealList() << 0.0000 << 1.2500 << 1.1250 << 0.8750 << 1.0313 << 1.0156 << 0.9844 << 1.0039 << 1.0020 << 0.9980 << 1.0000);
QTest::newRow("InOutElastic") << int(QEasingCurve::InOutElastic)
<< (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (RealList() << 0 << -0.0009766 << 0.007812 << -0.01563 << -0.0625 << 0.5 << 1.062 << 1.016 << 0.9922 << 1.001 << 1);
+ << (RealList() << 0.0000 << -0.0010 << 0.0078 << -0.0156 << -0.0625 << 0.5000 << 1.0625 << 1.0156 << 0.9922 << 1.0010 << 1.0000);
QTest::newRow("OutInElastic") << int(QEasingCurve::OutInElastic)
<< (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (RealList() << 0 << 0.375 << 0.5625 << 0.4922 << 0.498 << 0.5 << 0.4961 << 0.5078 << 0.5313 << 0.25 << 1);
+ << (RealList() << 0.0000 << 0.3750 << 0.5625 << 0.4922 << 0.4980 << 0.5000 << 0.4961 << 0.5078 << 0.5313 << 0.2500 << 1.0000);
QTest::newRow("InBack") << int(QEasingCurve::InBack)
<< (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (RealList() << 0 << -0.01431 << -0.04645 << -0.0802 << -0.09935 << -0.0877 << -0.02903 << 0.09287 << 0.2942 << 0.5912 << 1);
+ << (RealList() << 0.0000 << -0.0143 << -0.0465 << -0.0802 << -0.0994 << -0.0877 << -0.0290 << 0.0929 << 0.2942 << 0.5912 << 1.0000);
QTest::newRow("OutBack") << int(QEasingCurve::OutBack)
<< (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (RealList() << 0 << 0.4088 << 0.7058 << 0.9071 << 1.029 << 1.088 << 1.099 << 1.08 << 1.046 << 1.014 << 1);
+ << (RealList() << 0.0000 << 0.4088 << 0.7058 << 0.9071 << 1.0290 << 1.0877 << 1.0994 << 1.0802 << 1.0465 << 1.0143 << 1.0000);
QTest::newRow("InOutBack") << int(QEasingCurve::InOutBack)
<< (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (RealList() << 0 << -0.03752 << -0.09256 << -0.07883 << 0.08993 << 0.5 << 0.9101 << 1.079 << 1.093 << 1.038 << 1);
+ << (RealList() << 0.0000 << -0.0375 << -0.0926 << -0.0788 << 0.0899 << 0.5000 << 0.9101 << 1.0788 << 1.0926 << 1.0375 << 1.0000);
QTest::newRow("OutInBack") << int(QEasingCurve::OutInBack)
<< (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (RealList() << 0 << 0.3529 << 0.5145 << 0.5497 << 0.5232 << 0.5 << 0.4768 << 0.4503 << 0.4855 << 0.6471 << 1);
+ << (RealList() << 0.0000 << 0.3529 << 0.5145 << 0.5497 << 0.5232 << 0.5000 << 0.4768 << 0.4503 << 0.4855 << 0.6471 << 1.0000);
QTest::newRow("InBounce") << int(QEasingCurve::InBounce)
<< (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (RealList() << 0 << 0.01188 << 0.06 << 0.06937 << 0.2275 << 0.2344 << 0.09 << 0.3194 << 0.6975 << 0.9244 << 1);
+ << (RealList() << 0.0000 << 0.0119 << 0.0600 << 0.0694 << 0.2275 << 0.2344 << 0.0900 << 0.3194 << 0.6975 << 0.9244 << 1.0000);
QTest::newRow("OutBounce") << int(QEasingCurve::OutBounce)
<< (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (RealList() << 0 << 0.07563 << 0.3025 << 0.6806 << 0.91 << 0.7656 << 0.7725 << 0.9306 << 0.94 << 0.9881 << 1);
+ << (RealList() << 0.0000 << 0.0756 << 0.3025 << 0.6806 << 0.9100 << 0.7656 << 0.7725 << 0.9306 << 0.9400 << 0.9881 << 1.0000);
QTest::newRow("InOutBounce") << int(QEasingCurve::InOutBounce)
<< (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (RealList() << 0 << 0.03 << 0.1138 << 0.045 << 0.3488 << 0.5 << 0.6512 << 0.955 << 0.8862 << 0.97 << 1);
+ << (RealList() << 0.0000 << 0.0300 << 0.1138 << 0.0450 << 0.3488 << 0.5000 << 0.6512 << 0.9550 << 0.8863 << 0.9700 << 1.0000);
QTest::newRow("OutInBounce") << int(QEasingCurve::OutInBounce)
<< (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (RealList() << 0 << 0.1513 << 0.41 << 0.2725 << 0.44 << 0.5 << 0.56 << 0.7275 << 0.59 << 0.8488 << 1);
+ << (RealList() << 0.0000 << 0.1513 << 0.4100 << 0.2725 << 0.4400 << 0.5000 << 0.5600 << 0.7275 << 0.5900 << 0.8488 << 1.0000);
QTest::newRow("InCurve") << int(QEasingCurve::InCurve)
<< (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (RealList() << 0 << 0.02447 << 0.1059 << 0.2343 << 0.3727 << 0.5 << 0.6055 << 0.7 << 0.8 << 0.9 << 1);
+ << (RealList() << 0.0000 << 0.0245 << 0.1059 << 0.2343 << 0.3727 << 0.5000 << 0.6055 << 0.7000 << 0.8000 << 0.9000 << 1.0000);
QTest::newRow("OutCurve") << int(QEasingCurve::OutCurve)
<< (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (RealList() << 0 << 0.1 << 0.2 << 0.3 << 0.3945 << 0.5 << 0.6273 << 0.7657 << 0.8941 << 0.9755 << 1);
+ << (RealList() << 0.0000 << 0.1000 << 0.2000 << 0.3000 << 0.3945 << 0.5000 << 0.6273 << 0.7657 << 0.8941 << 0.9755 << 1.0000);
QTest::newRow("SineCurve") << int(QEasingCurve::SineCurve)
<< (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (RealList() << 0 << 0.09549 << 0.3455 << 0.6545 << 0.9045 << 1 << 0.9045 << 0.6545 << 0.3455 << 0.09549 << 0);
+ << (RealList() << 0.0000 << 0.0955 << 0.3455 << 0.6545 << 0.9045 << 1.0000 << 0.9045 << 0.6545 << 0.3455 << 0.0955 << 0.0000);
QTest::newRow("CosineCurve") << int(QEasingCurve::CosineCurve)
<< (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100)
- << (RealList() << 0.5 << 0.7939 << 0.9755 << 0.9755 << 0.7939 << 0.5 << 0.2061 << 0.02447 << 0.02447 << 0.2061 << 0.5);
+ << (RealList() << 0.5000 << 0.7939 << 0.9755 << 0.9755 << 0.7939 << 0.5000 << 0.2061 << 0.0245 << 0.0245 << 0.2061 << 0.5000);
}
+/*
+ "fixedpoint" number that is scaled up by 10000.
+ This is to work around two bugs (precision and rounding error) in QString::setNum().
+ It does not trim off trailing zeros. This is good, just to emphasize the precision.
+*/
+QString fixedToString(int value)
+{
+ QString str;
+ if (value < 0) {
+ str+= QLatin1Char('-');
+ value = -value;
+ }
+
+ QString digitArg(QLatin1String("%1."));
+ for (int i = 10000; i >= 1; i/=10) {
+ int digit = value/i;
+ value -= digit*i;
+ str.append(digitArg.arg(digit));
+ digitArg = QLatin1String("%1");
+ }
+ return str;
+}
void tst_QEasingCurve::valueForProgress()
{
@@ -390,7 +412,7 @@ void tst_QEasingCurve::valueForProgress()
for (int t = 0; t <= 100; t+= 10) {
qreal ease = curve.valueForProgress(t/qreal(100));
strInputs += QString::fromAscii(" << %1").arg(t);
- strOutputs += " << " + QString().setNum(ease, 'g', 4);
+ strOutputs += " << " + fixedToString(qRound(ease*10000));
}
QString str = QString::fromAscii(" QTest::newRow(\"%1\") << int(QEasingCurve::%2)\n"
" << (IntList() %3)\n"
@@ -409,26 +431,13 @@ void tst_QEasingCurve::valueForProgress()
QFETCH(RealList, expected);
QEasingCurve curve((QEasingCurve::Type)type);
+ // in theory the baseline should't have an error of more than 0.00005 due to how its rounded,
+ // but due to FP imprecision, we have to adjust the error a bit more.
+ const qreal errorBound = 0.00006;
for (int i = 0; i < at.count(); ++i) {
- qreal ease = curve.valueForProgress(at.at(i)/qreal(100));
- // converting ease to 4 precision qreal to match the generated samples
- qreal easeConv = qreal(QString().setNum(ease, 'g', 4).toDouble());
- qreal ex = expected.at(i);
-
- // the least significant digit it is still subject to rounding errors
- qreal error = easeConv - ex;
- qreal errorbound = 0.00001;
-#if defined( Q_OS_WINCE ) || defined( Q_OS_SYMBIAN )
- // exception values for WINCE(this test should be rewritten, as it only freezes the status quo of QEasingCurve
- // The failing (2) values are explicitly excepted here:
- // The source values for the comparison table should remain untruncated double and the
- // error bound checking function dynamic. Also the source values should come from a "trusted" source and not
- // from QEasingCurve itself.
- if ((type == int(QEasingCurve::InOutBounce) && (i == 8 || i == 6) ) || (type == int(QEasingCurve::OutExpo) && i == 2))
- errorbound = 0.0002;
-#endif
- // accept the potential rounding error in the least significant digit
- QVERIFY(error <= errorbound );
+ const qreal ex = expected.at(i);
+ const qreal error = qAbs(ex - curve.valueForProgress(at.at(i)/qreal(100)));
+ QVERIFY(error <= errorBound);
}
#endif
}
diff --git a/tests/auto/qfileinfo/tst_qfileinfo.cpp b/tests/auto/qfileinfo/tst_qfileinfo.cpp
index fdc629a..42e7250 100644
--- a/tests/auto/qfileinfo/tst_qfileinfo.cpp
+++ b/tests/auto/qfileinfo/tst_qfileinfo.cpp
@@ -828,6 +828,17 @@ void tst_QFileInfo::compare_data()
QTest::addColumn<QString>("file2");
QTest::addColumn<bool>("same");
+#if defined(Q_OS_MAC)
+ // Since 10.6 we use realpath() in qfsfileengine, and it properly handles
+ // file system case sensitivity. However here in the autotest we don't
+ // check if the file system is case sensitive, so to make it pass in the
+ // default OS X installation we assume we are running on a case insensitive
+ // file system if on 10.6 and on a case sensitive file system if on 10.5
+ bool caseSensitiveOnMac = true;
+ if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_6)
+ caseSensitiveOnMac = false;
+#endif
+
QTest::newRow("data0")
<< QString::fromLatin1(SRCDIR "tst_qfileinfo.cpp")
<< QString::fromLatin1(SRCDIR "tst_qfileinfo.cpp")
@@ -845,6 +856,8 @@ void tst_QFileInfo::compare_data()
<< QString::fromLatin1(SRCDIR "tst_qfileinfo.cpp")
#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
<< true;
+#elif defined(Q_OS_MAC)
+ << !caseSensitiveOnMac;
#else
<< false;
#endif
@@ -856,7 +869,7 @@ void tst_QFileInfo::compare()
QFETCH(QString, file2);
QFETCH(bool, same);
QFileInfo fi1(file1), fi2(file2);
- QCOMPARE(same, fi1 == fi2);
+ QCOMPARE(fi1 == fi2, same);
}
void tst_QFileInfo::consistent_data()
diff --git a/tests/auto/qgl/tst_qgl.cpp b/tests/auto/qgl/tst_qgl.cpp
index cf4616e..d0d69ae 100644
--- a/tests/auto/qgl/tst_qgl.cpp
+++ b/tests/auto/qgl/tst_qgl.cpp
@@ -425,6 +425,26 @@ void tst_QGL::getSetCheck()
obj1.setPlane(TEST_INT_MAX);
QCOMPARE(TEST_INT_MAX, obj1.plane());
+ // int QGLFormat::major/minorVersion()
+ // void QGLFormat::setVersion(int, int)
+ QCOMPARE(obj1.majorVersion(), 1);
+ QCOMPARE(obj1.minorVersion(), 0);
+ obj1.setVersion(3, 2);
+ QCOMPARE(obj1.majorVersion(), 3);
+ QCOMPARE(obj1.minorVersion(), 2);
+ QTest::ignoreMessage(QtWarningMsg, "QGLFormat::setVersion: Cannot set zero or negative version number 0.1");
+ obj1.setVersion(0, 1);
+ QCOMPARE(obj1.majorVersion(), 3);
+ QCOMPARE(obj1.minorVersion(), 2);
+ QTest::ignoreMessage(QtWarningMsg, "QGLFormat::setVersion: Cannot set zero or negative version number 3.-1");
+ obj1.setVersion(3, -1);
+ QCOMPARE(obj1.majorVersion(), 3);
+ QCOMPARE(obj1.minorVersion(), 2);
+ obj1.setVersion(TEST_INT_MAX, TEST_INT_MAX - 1);
+ QCOMPARE(obj1.majorVersion(), TEST_INT_MAX);
+ QCOMPARE(obj1.minorVersion(), TEST_INT_MAX - 1);
+
+
// operator== and operator!= for QGLFormat
QGLFormat format1;
QGLFormat format2;
@@ -508,6 +528,27 @@ void tst_QGL::getSetCheck()
QVERIFY(format1 == format2);
QVERIFY(!(format1 != format2));
+ format1.setVersion(3, 2);
+ QVERIFY(!(format1 == format2));
+ QVERIFY(format1 != format2);
+ format2.setVersion(3, 2);
+ QVERIFY(format1 == format2);
+ QVERIFY(!(format1 != format2));
+
+ format1.setProfile(QGLFormat::CoreProfile);
+ QVERIFY(!(format1 == format2));
+ QVERIFY(format1 != format2);
+ format2.setProfile(QGLFormat::CoreProfile);
+ QVERIFY(format1 == format2);
+ QVERIFY(!(format1 != format2));
+
+ format1.setOption(QGL::NoDeprecatedFunctions);
+ QVERIFY(!(format1 == format2));
+ QVERIFY(format1 != format2);
+ format2.setOption(QGL::NoDeprecatedFunctions);
+ QVERIFY(format1 == format2);
+ QVERIFY(!(format1 != format2));
+
// Copy constructor and assignment for QGLFormat.
QGLFormat format3(format1);
QGLFormat format4;
diff --git a/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp b/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp
index 909ea54..ac68224 100644
--- a/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp
+++ b/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp
@@ -163,6 +163,7 @@ private slots:
void addChildInpolishEvent();
void polishEvent();
void polishEvent2();
+ void autoFillBackground();
// Task fixes
void task236127_bspTreeIndexFails();
@@ -2856,6 +2857,32 @@ void tst_QGraphicsWidget::polishEvent2()
QVERIFY(widget->events.contains(QEvent::Polish));
}
+void tst_QGraphicsWidget::autoFillBackground()
+{
+ QGraphicsWidget *widget = new QGraphicsWidget;
+ QCOMPARE(widget->autoFillBackground(), false);
+ widget->setAutoFillBackground(true);
+ QCOMPARE(widget->autoFillBackground(), true);
+
+ const QColor color(Qt::red);
+ const QRect rect(0, 0, 1, 1);
+
+ QGraphicsScene scene;
+ scene.addItem(widget);
+ widget->setGeometry(rect);
+
+ QPalette palette = widget->palette();
+ palette.setColor(QPalette::Window, color);
+ widget->setPalette(palette);
+
+ QImage image(rect.size(), QImage::Format_RGB32);
+ QPainter painter;
+ painter.begin(&image);
+ scene.render(&painter, rect, rect);
+ painter.end();
+ QCOMPARE(image.pixel(0, 0), color.rgb());
+}
+
void tst_QGraphicsWidget::QT_BUG_6544_tabFocusFirstUnsetWhenRemovingItems()
{
QGraphicsScene scene;
diff --git a/tests/auto/qhttp/tst_qhttp.cpp b/tests/auto/qhttp/tst_qhttp.cpp
index 59bfb15..320225d 100644
--- a/tests/auto/qhttp/tst_qhttp.cpp
+++ b/tests/auto/qhttp/tst_qhttp.cpp
@@ -114,9 +114,6 @@ private slots:
void abortInReadyRead();
void abortInResponseHeaderReceived();
void nestedEventLoop();
-
-
- // manual tests
void connectionClose();
protected slots:
@@ -175,6 +172,23 @@ private:
bool proxyAuthCalled;
};
+class ClosingServer: public QTcpServer
+{
+ Q_OBJECT
+public:
+ ClosingServer()
+ {
+ connect(this, SIGNAL(newConnection()), SLOT(handleConnection()));
+ listen();
+ }
+
+public slots:
+ void handleConnection()
+ {
+ delete nextPendingConnection();
+ }
+};
+
//#define DUMP_SIGNALS
const int bytesTotal_init = -10;
@@ -1491,20 +1505,14 @@ void tst_QHttp::abortInResponseHeaderReceived()
void tst_QHttp::connectionClose()
{
- // This test tries to connect to a client's server, so it is disabled.
- // Every now and then, someone please run it to make sure it's not broken.
- // Note: the servers might change too...
- //
// This was added in response to bug 176822
-#ifndef Q_OS_SYMBIAN
- QSKIP("This test is manual - read comments in the source code", SkipAll);
-#endif
QFETCH_GLOBAL(bool, setProxy);
if (setProxy)
return;
QHttp http;
- http.setHost("www.fon.com", QHttp::ConnectionModeHttps);
+ ClosingServer server;
+ http.setHost("localhost", QHttp::ConnectionModeHttps, server.serverPort());
http.get("/login/gateway/processLogin");
// another possibility:
diff --git a/tests/auto/qintvalidator/tst_qintvalidator.cpp b/tests/auto/qintvalidator/tst_qintvalidator.cpp
index 72e7f7a..46ad0dd 100644
--- a/tests/auto/qintvalidator/tst_qintvalidator.cpp
+++ b/tests/auto/qintvalidator/tst_qintvalidator.cpp
@@ -50,6 +50,7 @@ private slots:
void validate_data();
void validate();
void validateArabic();
+ void validateFrench();
};
Q_DECLARE_METATYPE(QValidator::State);
@@ -182,6 +183,30 @@ void tst_QIntValidator::validateArabic()
}
+
+void tst_QIntValidator::validateFrench()
+{
+ QIntValidator validator(-2000, 2000, 0);
+ validator.setLocale(QLocale::French);
+ int i;
+
+ QString s = QLatin1String("1 ");
+ QCOMPARE(validator.validate(s, i), QValidator::Acceptable);
+ validator.fixup(s);
+ QCOMPARE(s, s);
+
+ s = QLatin1String("1 000");
+ QCOMPARE(validator.validate(s, i), QValidator::Acceptable);
+ validator.fixup(s);
+ QCOMPARE(s, s);
+
+
+ s = QLatin1String("1 0 00");
+ QCOMPARE(validator.validate(s, i), QValidator::Intermediate);
+ validator.fixup(s);
+ QCOMPARE(s, validator.locale().toString(1000));
+}
+
void tst_QIntValidator::validate()
{
QFETCH(int, minimum);
@@ -190,6 +215,7 @@ void tst_QIntValidator::validate()
QFETCH(QValidator::State, state);
QIntValidator iv(minimum, maximum, 0);
+ iv.setLocale(QLocale::C);
int dummy;
QCOMPARE((int)iv.validate(value, dummy), (int)state);
}
diff --git a/tests/auto/qkeysequence/tst_qkeysequence.cpp b/tests/auto/qkeysequence/tst_qkeysequence.cpp
index 3e3f202..b1ef223 100644
--- a/tests/auto/qkeysequence/tst_qkeysequence.cpp
+++ b/tests/auto/qkeysequence/tst_qkeysequence.cpp
@@ -119,6 +119,7 @@ private slots:
void symetricConstructors_data();
void symetricConstructors();
void checkMultipleNames();
+ void checkMultipleCodes();
void mnemonic_data();
void mnemonic();
void toString_data();
@@ -265,6 +266,18 @@ void tst_QKeySequence::checkMultipleNames()
QVERIFY( oldK == newK );
}
+//TODO: could test third constructor, or test fromString on all constructor-data
+void tst_QKeySequence::checkMultipleCodes()
+{
+ QKeySequence seq1("Alt+d, l");
+ QKeySequence seq2 = QKeySequence::fromString("Alt+d, l");
+ QVERIFY( seq1 == seq2 );
+
+ QKeySequence seq3("Alt+d,l");
+ QKeySequence seq4 = QKeySequence::fromString("Alt+d,l");
+ QVERIFY( seq3 == seq4 );
+}
+
/*
* We must ensure that the keyBindings data is allways sorted
* so that we can safely perform binary searches.
diff --git a/tests/auto/qmetaobject/tst_qmetaobject.cpp b/tests/auto/qmetaobject/tst_qmetaobject.cpp
index 286e793..15b6204 100644
--- a/tests/auto/qmetaobject/tst_qmetaobject.cpp
+++ b/tests/auto/qmetaobject/tst_qmetaobject.cpp
@@ -664,7 +664,7 @@ void tst_QMetaObject::normalizedSignature_data()
QTest::newRow("const rettype") << "const QString *foo()" << "const QString*foo()";
QTest::newRow("const ref") << "const QString &foo()" << "const QString&foo()";
QTest::newRow("reference") << "QString &foo()" << "QString&foo()";
- QTest::newRow("const2") << "void foo(QString const *)" << "void foo(const QString*)";
+ QTest::newRow("const1") << "void foo(QString const *)" << "void foo(const QString*)";
QTest::newRow("const2") << "void foo(QString * const)" << "void foo(QString*const)";
QTest::newRow("const3") << "void foo(QString const &)" << "void foo(QString)";
QTest::newRow("const4") << "void foo(const int)" << "void foo(int)";
@@ -672,7 +672,7 @@ void tst_QMetaObject::normalizedSignature_data()
<< "void foo(int,int,int,int)";
QTest::newRow("const6") << "void foo(QList<const int>)" << "void foo(QList<const int>)";
QTest::newRow("const7") << "void foo(QList<const int*>)" << "void foo(QList<const int*>)";
- QTest::newRow("const7") << "void foo(QList<int const*>)" << "void foo(QList<const int*>)";
+ QTest::newRow("const8") << "void foo(QList<int const*>)" << "void foo(QList<const int*>)";
}
void tst_QMetaObject::normalizedSignature()
diff --git a/tests/auto/qobject/moc_oldnormalizeobject.cpp b/tests/auto/qobject/moc_oldnormalizeobject.cpp
new file mode 100644
index 0000000..bde9c39
--- /dev/null
+++ b/tests/auto/qobject/moc_oldnormalizeobject.cpp
@@ -0,0 +1,113 @@
+/****************************************************************************
+** Meta object code from reading C++ file 'oldnormalizeobject.h'
+**
+** Created: Wed Nov 18 11:43:05 2009
+** by: The Qt Meta Object Compiler version 62 (Qt 4.6.0)
+**
+*****************************************************************************/
+
+// Yhis file was generated from moc version 4.6 to test binary compatibility
+// It should *not* be generated by the current moc
+
+#include "oldnormalizeobject.h"
+
+QT_BEGIN_MOC_NAMESPACE
+static const uint qt_meta_data_OldNormalizeObject[] = {
+
+ // content:
+ 4, // revision
+ 0, // classname
+ 0, 0, // classinfo
+ 6, 14, // methods
+ 0, 0, // properties
+ 0, 0, // enums/sets
+ 0, 0, // constructors
+ 0, // flags
+ 3, // signalCount
+
+ // signals: signature, parameters, type, tag, flags
+ 24, 20, 19, 19, 0x05,
+ 57, 20, 19, 19, 0x05,
+ 100, 20, 19, 19, 0x05,
+
+ // slots: signature, parameters, type, tag, flags
+ 149, 20, 19, 19, 0x0a,
+ 180, 20, 19, 19, 0x0a,
+ 221, 20, 19, 19, 0x0a,
+
+ 0 // eod
+};
+
+static const char qt_meta_stringdata_OldNormalizeObject[] = {
+ "OldNormalizeObject\0\0ref\0"
+ "typeRefSignal(Template<Class&>&)\0"
+ "constTypeRefSignal(Template<const Class&>)\0"
+ "typeConstRefSignal(Template<const Class&>const&)\0"
+ "typeRefSlot(Template<Class&>&)\0"
+ "constTypeRefSlot(Template<const Class&>)\0"
+ "typeConstRefSlot(Template<const Class&>const&)\0"
+};
+
+const QMetaObject OldNormalizeObject::staticMetaObject = {
+ { &QObject::staticMetaObject, qt_meta_stringdata_OldNormalizeObject,
+ qt_meta_data_OldNormalizeObject, 0 }
+};
+
+#ifdef Q_NO_DATA_RELOCATION
+const QMetaObject &OldNormalizeObject::getStaticMetaObject() { return staticMetaObject; }
+#endif //Q_NO_DATA_RELOCATION
+
+const QMetaObject *OldNormalizeObject::metaObject() const
+{
+ return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject;
+}
+
+void *OldNormalizeObject::qt_metacast(const char *_clname)
+{
+ if (!_clname) return 0;
+ if (!strcmp(_clname, qt_meta_stringdata_OldNormalizeObject))
+ return static_cast<void*>(const_cast< OldNormalizeObject*>(this));
+ return QObject::qt_metacast(_clname);
+}
+
+int OldNormalizeObject::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
+{
+ _id = QObject::qt_metacall(_c, _id, _a);
+ if (_id < 0)
+ return _id;
+ if (_c == QMetaObject::InvokeMetaMethod) {
+ switch (_id) {
+ case 0: typeRefSignal((*reinterpret_cast< Template<Class&>(*)>(_a[1]))); break;
+ case 1: constTypeRefSignal((*reinterpret_cast< const Template<const Class&>(*)>(_a[1]))); break;
+ case 2: typeConstRefSignal((*reinterpret_cast< Template<const Class&>const(*)>(_a[1]))); break;
+ case 3: typeRefSlot((*reinterpret_cast< Template<Class&>(*)>(_a[1]))); break;
+ case 4: constTypeRefSlot((*reinterpret_cast< const Template<const Class&>(*)>(_a[1]))); break;
+ case 5: typeConstRefSlot((*reinterpret_cast< Template<const Class&>const(*)>(_a[1]))); break;
+ default: ;
+ }
+ _id -= 6;
+ }
+ return _id;
+}
+
+// SIGNAL 0
+void OldNormalizeObject::typeRefSignal(Template<Class&> & _t1)
+{
+ void *_a[] = { 0, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
+ QMetaObject::activate(this, &staticMetaObject, 0, _a);
+}
+
+// SIGNAL 1
+void OldNormalizeObject::constTypeRefSignal(const Template<const Class&> & _t1)
+{
+ void *_a[] = { 0, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
+ QMetaObject::activate(this, &staticMetaObject, 1, _a);
+}
+
+// SIGNAL 2
+void OldNormalizeObject::typeConstRefSignal(Template<Class const&> const & _t1)
+{
+ void *_a[] = { 0, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
+ QMetaObject::activate(this, &staticMetaObject, 2, _a);
+}
+QT_END_MOC_NAMESPACE
diff --git a/tests/auto/qobject/oldnormalizeobject.h b/tests/auto/qobject/oldnormalizeobject.h
new file mode 100644
index 0000000..8420a3a
--- /dev/null
+++ b/tests/auto/qobject/oldnormalizeobject.h
@@ -0,0 +1,28 @@
+#ifndef OLDNORMALIZEOBJECT_H
+#define OLDNORMALIZEOBJECT_H
+
+#include <QObject>
+
+struct Struct;
+class Class;
+template <typename T> class Template;
+
+// An object with old moc output that incorrectly normalizes 'T<C> const &' in the function
+// signatures
+class OldNormalizeObject : public QObject
+{
+ /* tmake ignore Q_OBJECT */
+ Q_OBJECT
+
+signals:
+ void typeRefSignal(Template<Class &> &ref);
+ void constTypeRefSignal(const Template<const Class &> &ref);
+ void typeConstRefSignal(Template<Class const &> const &ref);
+
+public slots:
+ void typeRefSlot(Template<Class &> &) {}
+ void constTypeRefSlot(const Template<const Class &> &) {}
+ void typeConstRefSlot(Template<Class const &> const &) {}
+};
+
+#endif // OLDNORMALIZEOBJECT_H
diff --git a/tests/auto/qobject/tst_qobject.cpp b/tests/auto/qobject/tst_qobject.cpp
index d342581..7c172ef 100644
--- a/tests/auto/qobject/tst_qobject.cpp
+++ b/tests/auto/qobject/tst_qobject.cpp
@@ -2023,6 +2023,7 @@ enum Enum { };
struct Struct { };
class Class { };
+template <typename T> class Template { };
class NormalizeObject : public QObject
{
@@ -2060,6 +2061,12 @@ signals:
void unsignedshortSignal(unsigned short);
void unsignedcharSignal(unsigned char);
+ void typeRefSignal(Template<Class &> &ref);
+ void constTypeRefSignal(const Template<Class const &> &ref);
+ void typeConstRefSignal(Template<Class const &> const &ref);
+
+ void typePointerConstRefSignal(Class * const &);
+
public slots:
void uintPointerSlot(uint *) { }
void ulongPointerSlot(ulong *) { }
@@ -2091,8 +2098,15 @@ public slots:
void unsignedshortSlot(unsigned short) {};
void unsignedcharSlot(unsigned char) {};
+ void typeRefSlot(Template<Class &> &) {}
+ void constTypeRefSlot(const Template<const Class &> &) {}
+ void typeConstRefSlot(Template<Class const &> const &) {}
+
+ void typePointerConstRefSlot(Class * const &) {}
};
+#include "oldnormalizeobject.h"
+
void tst_QObject::normalize()
{
NormalizeObject object;
@@ -2332,7 +2346,165 @@ void tst_QObject::normalize()
SIGNAL(unsignedcharSignal(unsigned char)),
SLOT(unsignedcharSlot(unsigned char))));
+ // connect when original template signature and mixed usage of 'T<C const &> const &',
+ // 'const T<const C &> &', and 'T<const C &>'
+
+ QVERIFY(object.connect(&object,
+ SIGNAL(typeRefSignal(Template<Class &> &)),
+ SLOT(typeRefSlot(Template<Class &> &))));
+
+ QVERIFY(object.connect(&object,
+ SIGNAL(constTypeRefSignal(const Template<const Class &> &)),
+ SLOT(constTypeRefSlot(const Template<const Class &> &))));
+ QVERIFY(object.connect(&object,
+ SIGNAL(constTypeRefSignal(const Template<const Class &> &)),
+ SLOT(constTypeRefSlot(const Template<Class const &> &))));
+ QVERIFY(object.connect(&object,
+ SIGNAL(constTypeRefSignal(const Template<const Class &> &)),
+ SLOT(constTypeRefSlot(Template<Class const &> const &))));
+ QVERIFY(object.connect(&object,
+ SIGNAL(constTypeRefSignal(Template<const Class &> const &)),
+ SLOT(constTypeRefSlot(Template<Class const &> const &))));
+ QVERIFY(object.connect(&object,
+ SIGNAL(constTypeRefSignal(Template<Class const &> const &)),
+ SLOT(constTypeRefSlot(Template<Class const &> const &))));
+ QVERIFY(object.connect(&object,
+ SIGNAL(constTypeRefSignal(const Template<const Class &> &)),
+ SLOT(typeConstRefSlot(const Template<const Class &> &))));
+ QVERIFY(object.connect(&object,
+ SIGNAL(constTypeRefSignal(const Template<const Class &> &)),
+ SLOT(typeConstRefSlot(const Template<Class const &> &))));
+ QVERIFY(object.connect(&object,
+ SIGNAL(constTypeRefSignal(const Template<const Class &> &)),
+ SLOT(typeConstRefSlot(Template<Class const &> const &))));
+ QVERIFY(object.connect(&object,
+ SIGNAL(constTypeRefSignal(Template<const Class &> const &)),
+ SLOT(typeConstRefSlot(Template<Class const &> const &))));
+ QVERIFY(object.connect(&object,
+ SIGNAL(constTypeRefSignal(Template<Class const &> const &)),
+ SLOT(typeConstRefSlot(Template<Class const &> const &))));
+
+ QVERIFY(object.connect(&object,
+ SIGNAL(typeConstRefSignal(const Template<const Class &> &)),
+ SLOT(constTypeRefSlot(const Template<const Class &> &))));
+ QVERIFY(object.connect(&object,
+ SIGNAL(typeConstRefSignal(const Template<const Class &> &)),
+ SLOT(constTypeRefSlot(const Template<Class const &> &))));
+ QVERIFY(object.connect(&object,
+ SIGNAL(typeConstRefSignal(const Template<const Class &> &)),
+ SLOT(constTypeRefSlot(Template<Class const &> const &))));
+ QVERIFY(object.connect(&object,
+ SIGNAL(typeConstRefSignal(Template<const Class &> const &)),
+ SLOT(constTypeRefSlot(Template<Class const &> const &))));
+ QVERIFY(object.connect(&object,
+ SIGNAL(typeConstRefSignal(Template<Class const &> const &)),
+ SLOT(constTypeRefSlot(Template<Class const &> const &))));
+
+ QVERIFY(object.connect(&object,
+ SIGNAL(typeConstRefSignal(const Template<const Class &> &)),
+ SLOT(typeConstRefSlot(const Template<const Class &> &))));
+ QVERIFY(object.connect(&object,
+ SIGNAL(typeConstRefSignal(const Template<const Class &> &)),
+ SLOT(typeConstRefSlot(const Template<Class const &> &))));
+ QVERIFY(object.connect(&object,
+ SIGNAL(typeConstRefSignal(const Template<const Class &> &)),
+ SLOT(typeConstRefSlot(Template<Class const &> const &))));
+ QVERIFY(object.connect(&object,
+ SIGNAL(typeConstRefSignal(Template<const Class &> const &)),
+ SLOT(typeConstRefSlot(Template<Class const &> const &))));
+ QVERIFY(object.connect(&object,
+ SIGNAL(typeConstRefSignal(Template<Class const &> const &)),
+ SLOT(typeConstRefSlot(Template<Class const &> const &))));
+
+ // same test again, this time with an object compiled with old moc output... we know that
+ // it is not possible to connect everything, whic is the purpose for this test
+ OldNormalizeObject oldobject;
+
+ QVERIFY(oldobject.connect(&oldobject,
+ SIGNAL(constTypeRefSignal(const Template<const Class &> &)),
+ SLOT(constTypeRefSlot(const Template<const Class &> &))));
+ QVERIFY(oldobject.connect(&oldobject,
+ SIGNAL(constTypeRefSignal(const Template<const Class &> &)),
+ SLOT(constTypeRefSlot(const Template<Class const &> &))));
+ // this fails in older versions, but passes now due to proper normalizing
+ QVERIFY(oldobject.connect(&oldobject,
+ SIGNAL(constTypeRefSignal(const Template<const Class &> &)),
+ SLOT(constTypeRefSlot(Template<Class const &> const &))));
+ // this fails in older versions, but passes now due to proper normalizing
+ QVERIFY(oldobject.connect(&oldobject,
+ SIGNAL(constTypeRefSignal(Template<const Class &> const &)),
+ SLOT(constTypeRefSlot(Template<Class const &> const &))));
+ // this fails in older versions, but passes now due to proper normalizing
+ QVERIFY(oldobject.connect(&oldobject,
+ SIGNAL(constTypeRefSignal(Template<Class const &> const &)),
+ SLOT(constTypeRefSlot(Template<Class const &> const &))));
+
+ // these fail in older Qt versions, but pass now due to proper normalizing
+ QVERIFY(oldobject.connect(&oldobject,
+ SIGNAL(constTypeRefSignal(const Template<const Class &> &)),
+ SLOT(typeConstRefSlot(const Template<const Class &> &))));
+ QVERIFY(oldobject.connect(&oldobject,
+ SIGNAL(constTypeRefSignal(const Template<const Class &> &)),
+ SLOT(typeConstRefSlot(const Template<Class const &> &))));
+ QVERIFY(oldobject.connect(&oldobject,
+ SIGNAL(constTypeRefSignal(const Template<const Class &> &)),
+ SLOT(typeConstRefSlot(Template<Class const &> const &))));
+ QVERIFY(oldobject.connect(&oldobject,
+ SIGNAL(constTypeRefSignal(Template<const Class &> const &)),
+ SLOT(typeConstRefSlot(Template<Class const &> const &))));
+ QVERIFY(oldobject.connect(&oldobject,
+ SIGNAL(constTypeRefSignal(Template<Class const &> const &)),
+ SLOT(typeConstRefSlot(Template<Class const &> const &))));
+
+ // these also fail in older Qt versions, but pass now due to proper normalizing
+ QVERIFY(oldobject.connect(&oldobject,
+ SIGNAL(typeConstRefSignal(const Template<const Class &> &)),
+ SLOT(constTypeRefSlot(const Template<const Class &> &))));
+ QVERIFY(oldobject.connect(&oldobject,
+ SIGNAL(typeConstRefSignal(const Template<const Class &> &)),
+ SLOT(constTypeRefSlot(const Template<Class const &> &))));
+ QVERIFY(oldobject.connect(&oldobject,
+ SIGNAL(typeConstRefSignal(const Template<const Class &> &)),
+ SLOT(constTypeRefSlot(Template<Class const &> const &))));
+ QVERIFY(oldobject.connect(&oldobject,
+ SIGNAL(typeConstRefSignal(Template<const Class &> const &)),
+ SLOT(constTypeRefSlot(Template<Class const &> const &))));
+ QVERIFY(oldobject.connect(&oldobject,
+ SIGNAL(typeConstRefSignal(Template<Class const &> const &)),
+ SLOT(constTypeRefSlot(Template<Class const &> const &))));
+
+ // this fails in older versions, but passes now due to proper normalizing
+ QVERIFY(oldobject.connect(&oldobject,
+ SIGNAL(typeConstRefSignal(const Template<const Class &> &)),
+ SLOT(typeConstRefSlot(const Template<const Class &> &))));
+ // this fails in older versions, but passes now due to proper normalizing
+ QVERIFY(oldobject.connect(&oldobject,
+ SIGNAL(typeConstRefSignal(const Template<const Class &> &)),
+ SLOT(typeConstRefSlot(const Template<Class const &> &))));
+ // this fails in older versions, but passes now due to proper normalizing
+ QVERIFY(oldobject.connect(&oldobject,
+ SIGNAL(typeConstRefSignal(const Template<const Class &> &)),
+ SLOT(typeConstRefSlot(Template<Class const &> const &))));
+ QVERIFY(oldobject.connect(&oldobject,
+ SIGNAL(typeConstRefSignal(Template<const Class &> const &)),
+ SLOT(typeConstRefSlot(Template<Class const &> const &))));
+ QVERIFY(oldobject.connect(&oldobject,
+ SIGNAL(typeConstRefSignal(Template<Class const &> const &)),
+ SLOT(typeConstRefSlot(Template<Class const &> const &))));
+
+ QVERIFY(object.connect(&object,
+ SIGNAL(typePointerConstRefSignal(Class*const&)),
+ SLOT(typePointerConstRefSlot(Class*const&))));
+ QVERIFY(object.connect(&object,
+ SIGNAL(typePointerConstRefSignal(Class*const&)),
+ SLOT(typePointerConstRefSlot(Class*))));
+ QVERIFY(object.connect(&object,
+ SIGNAL(typePointerConstRefSignal(Class*)),
+ SLOT(typePointerConstRefSlot(Class*const&))));
+ QVERIFY(object.connect(&object,
+ SIGNAL(typePointerConstRefSignal(Class*)),
+ SLOT(typePointerConstRefSlot(Class*))));
}
class SiblingDeleter : public QObject
diff --git a/tests/auto/qobject/tst_qobject.pro b/tests/auto/qobject/tst_qobject.pro
index 003ee98..0200f3e 100644
--- a/tests/auto/qobject/tst_qobject.pro
+++ b/tests/auto/qobject/tst_qobject.pro
@@ -1,16 +1,20 @@
load(qttest_p4)
-SOURCES += tst_qobject.cpp
+SOURCES += tst_qobject.cpp
-QT = core network gui
-contains(QT_CONFIG, qt3support):DEFINES+=QT_HAS_QT3SUPPORT
+# this is here for a reason, moc_oldnormalizedobject.cpp is not auto-generated, it was generated by
+# moc from Qt 4.6, and should *not* be generated by the current moc
+SOURCES += moc_oldnormalizeobject.cpp
-wince*: {
- addFiles.sources = signalbug.exe
- addFiles.path = .
- DEPLOYMENT += addFiles
+QT = core \
+ network \
+ gui
+contains(QT_CONFIG, qt3support):DEFINES += QT_HAS_QT3SUPPORT
+wince*: {
+ addFiles.sources = signalbug.exe
+ addFiles.path = .
+ DEPLOYMENT += addFiles
}
-
-symbian: {
+symbian: {
addFiles.sources = signalbug.exe
addFiles.path = \sys\bin
DEPLOYMENT += addFiles
diff --git a/tests/auto/qpixmap/tst_qpixmap.cpp b/tests/auto/qpixmap/tst_qpixmap.cpp
index 2340ef5..a1f20ca 100644
--- a/tests/auto/qpixmap/tst_qpixmap.cpp
+++ b/tests/auto/qpixmap/tst_qpixmap.cpp
@@ -47,6 +47,7 @@
#include <qmatrix.h>
#include <qdesktopwidget.h>
#include <qpaintengine.h>
+#include <qtreewidget.h>
#include <qsplashscreen.h>
#include <private/qpixmapdata_p.h>
@@ -793,14 +794,32 @@ void tst_QPixmap::drawBitmap()
void tst_QPixmap::grabWidget()
{
QWidget widget;
- widget.setPalette(Qt::green);
- widget.resize(128, 128);
+ QImage image(128, 128, QImage::Format_ARGB32_Premultiplied);
+ for (int row = 0; row < image.height(); ++row) {
+ QRgb *line = reinterpret_cast<QRgb *>(image.scanLine(row));
+ for (int col = 0; col < image.width(); ++col)
+ line[col] = qRgb(rand() & 255, row, col);
+ }
- QPixmap expected(64, 64);
- expected.fill(Qt::green);
+ QPalette pal = widget.palette();
+ pal.setBrush(QPalette::Window, QBrush(image));
+ widget.setPalette(pal);
+ widget.resize(128, 128);
+ QPixmap expected = QPixmap::fromImage(QImage(image.scanLine(64) + 64 * 4, 64, 64, image.bytesPerLine(), image.format()));
QPixmap actual = QPixmap::grabWidget(&widget, QRect(64, 64, 64, 64));
QVERIFY(lenientCompare(actual, expected));
+
+ actual = QPixmap::grabWidget(&widget, 64, 64);
+ QVERIFY(lenientCompare(actual, expected));
+
+ // Make sure a widget that is not yet shown is grabbed correctly.
+ QTreeWidget widget2;
+ actual = QPixmap::grabWidget(&widget2);
+ widget2.show();
+ expected = QPixmap::grabWidget(&widget2);
+
+ QVERIFY(lenientCompare(actual, expected));
}
void tst_QPixmap::grabWindow()
diff --git a/tests/auto/qsharedpointer/externaltests.cpp b/tests/auto/qsharedpointer/externaltests.cpp
index eb2f27d..7eae3c1 100644
--- a/tests/auto/qsharedpointer/externaltests.cpp
+++ b/tests/auto/qsharedpointer/externaltests.cpp
@@ -671,14 +671,9 @@ namespace QTest {
make.setProcessChannelMode(channelMode);
-#if defined(Q_OS_WIN) && !defined(Q_CC_MINGW)
- make.start(QLatin1String("nmake.exe"), args);
- make.waitForStarted();
-#else
static const char makes[] =
-# ifdef Q_CC_MINGW
- "mingw32-make.exe\0"
-# endif
+ "nmake.exe\0" //for visual c++
+ "mingw32-make.exe\0" //for mingw
"gmake\0"
"make\0";
for (const char *p = makes; *p; p += strlen(p) + 1) {
@@ -686,7 +681,6 @@ namespace QTest {
if (make.waitForStarted())
break;
}
-#endif
if (make.state() != QProcess::Running) {
exitCode = 255;
diff --git a/tests/auto/qtabbar/tst_qtabbar.cpp b/tests/auto/qtabbar/tst_qtabbar.cpp
index d980efa..72f9dd3 100644
--- a/tests/auto/qtabbar/tst_qtabbar.cpp
+++ b/tests/auto/qtabbar/tst_qtabbar.cpp
@@ -273,6 +273,9 @@ void tst_QTabBar::setElideMode()
if (tabElideMode != -128)
tabBar.setElideMode(Qt::TextElideMode(tabElideMode));
QTEST(int(tabBar.elideMode()), "expectedMode");
+ // Make sure style sheet does not override user set mode
+ tabBar.setStyleSheet("QWidget { background-color: #ABA8A6;}");
+ QTEST(int(tabBar.elideMode()), "expectedMode");
}
void tst_QTabBar::setUsesScrollButtons_data()
diff --git a/tests/auto/qtoolbar/tst_qtoolbar.cpp b/tests/auto/qtoolbar/tst_qtoolbar.cpp
index e00597d..07e81c1 100644
--- a/tests/auto/qtoolbar/tst_qtoolbar.cpp
+++ b/tests/auto/qtoolbar/tst_qtoolbar.cpp
@@ -102,6 +102,7 @@ private slots:
void orientationChanged();
void iconSizeChanged();
void toolButtonStyleChanged();
+ void visibilityChanged();
void actionOwnership();
void widgetAction();
void accel();
@@ -998,6 +999,36 @@ void tst_QToolBar::iconSizeChanged()
void tst_QToolBar::toolButtonStyleChanged()
{ DEPENDS_ON("toolButtonStyle()"); }
+void tst_QToolBar::visibilityChanged()
+{
+ QMainWindow mw;
+ QToolBar tb;
+ QSignalSpy spy(&tb, SIGNAL(visibilityChanged(bool)));
+
+ mw.addToolBar(&tb);
+ mw.show();
+
+ QCOMPARE(spy.count(), 1);
+ QCOMPARE(spy.at(0).at(0).toBool(), true);
+ spy.clear();
+
+ tb.hide();
+ QCOMPARE(spy.count(), 1);
+ QCOMPARE(spy.at(0).at(0).toBool(), false);
+ spy.clear();
+
+ tb.hide();
+ QCOMPARE(spy.count(), 0);
+
+ tb.show();
+ QCOMPARE(spy.count(), 1);
+ QCOMPARE(spy.at(0).at(0).toBool(), true);
+ spy.clear();
+
+ tb.show();
+ QCOMPARE(spy.count(), 0);
+}
+
void tst_QToolBar::actionOwnership()
{
{
diff --git a/tests/auto/qxmlsimplereader/tst_qxmlsimplereader.cpp b/tests/auto/qxmlsimplereader/tst_qxmlsimplereader.cpp
index e38a2bc..0e57306 100644
--- a/tests/auto/qxmlsimplereader/tst_qxmlsimplereader.cpp
+++ b/tests/auto/qxmlsimplereader/tst_qxmlsimplereader.cpp
@@ -580,7 +580,7 @@ void tst_QXmlSimpleReader::inputFromSocket()
QSKIP("Symbian: Skipped due to problems in Open C and QtNetwork", SkipAll);
#endif
-#if defined(Q_OS_WIN32) && (defined(Q_CC_INTEL) || defined(Q_CC_MINGW) || defined(Q_CC_MSVC_NET))
+#if defined(Q_OS_WIN32) && (defined(Q_CC_INTEL) || defined(Q_CC_MSVC_NET))
QSKIP("Regression caused by QHOstInfo change 294548, see task 202231.", SkipAll);
#endif
QTcpSocket sock;
diff --git a/tests/auto/selftests/expected_cmptest.txt b/tests/auto/selftests/expected_cmptest.txt
index a941f21..e9f94c9 100644
--- a/tests/auto/selftests/expected_cmptest.txt
+++ b/tests/auto/selftests/expected_cmptest.txt
@@ -1,5 +1,5 @@
********* Start testing of tst_Cmptest *********
-Config: Using QTest library 4.6.1, Qt 4.6.1
+Config: Using QTest library 4.7.0, Qt 4.7.0
PASS : tst_Cmptest::initTestCase()
PASS : tst_Cmptest::compare_boolfuncs()
PASS : tst_Cmptest::compare_pointerfuncs()
diff --git a/tests/auto/selftests/expected_crashes_3.txt b/tests/auto/selftests/expected_crashes_3.txt
index 692fddb..3aced25 100644
--- a/tests/auto/selftests/expected_crashes_3.txt
+++ b/tests/auto/selftests/expected_crashes_3.txt
@@ -1,5 +1,5 @@
********* Start testing of tst_Crashes *********
-Config: Using QTest library 4.6.1, Qt 4.6.1
+Config: Using QTest library 4.7.0, Qt 4.7.0
PASS : tst_Crashes::initTestCase()
QFATAL : tst_Crashes::crash() Received signal 11
FAIL! : tst_Crashes::crash() Received a fatal error.
diff --git a/tests/auto/selftests/expected_longstring.txt b/tests/auto/selftests/expected_longstring.txt
index 5755c97..a6ad5d0 100644
--- a/tests/auto/selftests/expected_longstring.txt
+++ b/tests/auto/selftests/expected_longstring.txt
@@ -1,5 +1,5 @@
********* Start testing of tst_LongString *********
-Config: Using QTest library 4.6.1, Qt 4.6.1
+Config: Using QTest library 4.7.0, Qt 4.7.0
PASS : tst_LongString::initTestCase()
FAIL! : tst_LongString::failWithLongString() Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet. Quisque rutrum. Aenean imperdiet. Etiam ultricies nisi vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui.
diff --git a/tests/auto/selftests/expected_maxwarnings.txt b/tests/auto/selftests/expected_maxwarnings.txt
index 032a3e8..908bd5d 100644
--- a/tests/auto/selftests/expected_maxwarnings.txt
+++ b/tests/auto/selftests/expected_maxwarnings.txt
@@ -1,5 +1,5 @@
********* Start testing of MaxWarnings *********
-Config: Using QTest library 4.6.1, Qt 4.6.1
+Config: Using QTest library 4.7.0, Qt 4.7.0
PASS : MaxWarnings::initTestCase()
QWARN : MaxWarnings::warn() 0
QWARN : MaxWarnings::warn() 1
diff --git a/tests/auto/selftests/expected_skip.txt b/tests/auto/selftests/expected_skip.txt
index e687759..4345a6c 100644
--- a/tests/auto/selftests/expected_skip.txt
+++ b/tests/auto/selftests/expected_skip.txt
@@ -1,5 +1,5 @@
********* Start testing of tst_Skip *********
-Config: Using QTest library 4.6.1, Qt 4.6.1
+Config: Using QTest library 4.7.0, Qt 4.7.0
PASS : tst_Skip::initTestCase()
SKIP : tst_Skip::test() skipping all
Loc: [/home/rmcgover/depot/qt-git/mainline/tests/auto/selftests/skip/tst_skip.cpp(68)]
diff --git a/tests/auto/symbols/tst_symbols.cpp b/tests/auto/symbols/tst_symbols.cpp
index e30481a..70abc43 100644
--- a/tests/auto/symbols/tst_symbols.cpp
+++ b/tests/auto/symbols/tst_symbols.cpp
@@ -100,7 +100,6 @@ void tst_Symbols::globalObjects()
#ifndef Q_OS_LINUX
QSKIP("Linux-specific test", SkipAll);
#endif
- QSKIP("Test disabled, we're not fixing these issues in this Qt version", SkipAll);
// these are regexps for global objects that are allowed in Qt
QStringList whitelist = QStringList()
diff --git a/tests/auto/uiloader/baseline/css_buttons_background.ui b/tests/auto/uiloader/baseline/css_buttons_background.ui
index f1fa0bc..3d80aeb 100644
--- a/tests/auto/uiloader/baseline/css_buttons_background.ui
+++ b/tests/auto/uiloader/baseline/css_buttons_background.ui
@@ -89,6 +89,19 @@ color: yellow;
</property>
</widget>
</item>
+ <item row="5" column="0">
+ <widget class="QPushButton" name="pushButton_4">
+ <property name="text">
+ <string>Checked</string>
+ </property>
+ <property name="checkable">
+ <bool>true</bool>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
</item>
@@ -149,6 +162,19 @@ color: yellow;
</property>
</widget>
</item>
+ <item row="5" column="0">
+ <widget class="QPushButton" name="pushButton_5">
+ <property name="text">
+ <string>Checked</string>
+ </property>
+ <property name="checkable">
+ <bool>true</bool>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
</item>
@@ -209,6 +235,19 @@ color: yellow;
</property>
</widget>
</item>
+ <item row="5" column="0">
+ <widget class="QPushButton" name="pushButton_6">
+ <property name="text">
+ <string>Checked</string>
+ </property>
+ <property name="checkable">
+ <bool>true</bool>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
</item>