From 7beeb932fd5cbe4e213a755001f784508a63572d Mon Sep 17 00:00:00 2001 From: Kurt Korbatits Date: Mon, 16 Jan 2012 10:52:49 +1000 Subject: Changed qsharedpointer unittest to use build qmake over system one. - If we can find the qmake belonging to the build, use that instead of qmake from the PATH for compiling subtests. Change-Id: I9445754bb02dab11c3e1bbe9dc459ecc682689a4 Reviewed-by: Rohan McGovern Reviewed-by: Kurt Korbatits Reviewed-by: Jason McDonald --- tests/auto/corelib/tools/qsharedpointer/externaltests.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'tests/auto/corelib/tools') diff --git a/tests/auto/corelib/tools/qsharedpointer/externaltests.cpp b/tests/auto/corelib/tools/qsharedpointer/externaltests.cpp index c7ffe8cb7b..2e3dd0699d 100644 --- a/tests/auto/corelib/tools/qsharedpointer/externaltests.cpp +++ b/tests/auto/corelib/tools/qsharedpointer/externaltests.cpp @@ -52,6 +52,7 @@ #include #include #include +#include #ifndef DEFAULT_MAKESPEC # error DEFAULT_MAKESPEC not defined @@ -565,7 +566,17 @@ namespace QTest { << makespec() << QLatin1String("project.pro"); qmake.setWorkingDirectory(temporaryDirPath); - qmake.start(QLatin1String("qmake"), args); + + QString cmd = QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmake"; +#ifdef Q_OS_WIN + cmd.append(".exe"); +#endif + if (!QFile::exists(cmd)) { + cmd = "qmake"; + qWarning("qmake from build not found, fallback to PATH's qmake"); + } + + qmake.start(cmd, args); std_out += "### --- stdout from qmake --- ###\n"; std_err += "### --- stderr from qmake --- ###\n"; -- cgit v1.2.3 From 642155703e9d91db6229f3863b885104e49f0b61 Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Sat, 21 Jan 2012 13:54:36 +0200 Subject: Minor style fixups. Add spaces where necessary, and pull braces back to the same line. Change-Id: If543686c9727a110f8a91f1a88e08d5d2ac12284 Reviewed-by: Richard J. Moore --- .../corelib/tools/qalgorithms/tst_qalgorithms.cpp | 29 +++++++++------------- 1 file changed, 12 insertions(+), 17 deletions(-) (limited to 'tests/auto/corelib/tools') diff --git a/tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp b/tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp index 5735c4043b..d88fb9a82f 100644 --- a/tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp +++ b/tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp @@ -105,29 +105,24 @@ QVector generateData(QString dataSetType, const int length) { QVector container; if (dataSetType == "Random") { - for(int i=0; i < length; ++i) + for (int i = 0; i < length; ++i) container.append(rand()); - } - else if (dataSetType == "Ascending") { - for (int i=0; i < length; ++i) + } else if (dataSetType == "Ascending") { + for (int i = 0; i < length; ++i) container.append(i); - } - else if (dataSetType == "Descending") { - for (int i=0; i < length; ++i) + } else if (dataSetType == "Descending") { + for (int i = 0; i < length; ++i) container.append(length - i); - } - else if (dataSetType == "Equal") { - for (int i=0; i < length; ++i) + } else if (dataSetType == "Equal") { + for (int i = 0; i < length; ++i) container.append(43); - } - else if (dataSetType == "Duplicates") { - for (int i=0; i < length; ++i) + } else if (dataSetType == "Duplicates") { + for (int i = 0; i < length; ++i) container.append(i % 10); - } - else if (dataSetType == "Almost Sorted") { - for (int i=0; i < length; ++i) + } else if (dataSetType == "Almost Sorted") { + for (int i = 0; i < length; ++i) container.append(i); - for(int i = 0; i<= length / 10; ++i) { + for (int i = 0; i <= length / 10; ++i) { const int iswap = i * 9; DataType tmp = container.at(iswap); container[iswap] = container.at(iswap + 1); -- cgit v1.2.3 From 629d6eda5cf67122776981de9073857bbc3dcba2 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Fri, 20 Jan 2012 13:06:31 +1000 Subject: Update contact information in license headers. Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern --- tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp | 2 +- tests/auto/corelib/tools/qbitarray/tst_qbitarray.cpp | 2 +- tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp | 2 +- tests/auto/corelib/tools/qbytearraymatcher/tst_qbytearraymatcher.cpp | 2 +- tests/auto/corelib/tools/qcache/tst_qcache.cpp | 2 +- tests/auto/corelib/tools/qchar/tst_qchar.cpp | 2 +- tests/auto/corelib/tools/qcontiguouscache/tst_qcontiguouscache.cpp | 2 +- tests/auto/corelib/tools/qcryptographichash/tst_qcryptographichash.cpp | 2 +- tests/auto/corelib/tools/qdate/tst_qdate.cpp | 2 +- tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp | 2 +- tests/auto/corelib/tools/qeasingcurve/tst_qeasingcurve.cpp | 2 +- tests/auto/corelib/tools/qelapsedtimer/tst_qelapsedtimer.cpp | 2 +- .../qexplicitlyshareddatapointer/tst_qexplicitlyshareddatapointer.cpp | 2 +- tests/auto/corelib/tools/qfreelist/tst_qfreelist.cpp | 2 +- tests/auto/corelib/tools/qhash/tst_qhash.cpp | 2 +- tests/auto/corelib/tools/qline/tst_qline.cpp | 2 +- tests/auto/corelib/tools/qlist/tst_qlist.cpp | 2 +- tests/auto/corelib/tools/qlocale/syslocaleapp/syslocaleapp.cpp | 2 +- tests/auto/corelib/tools/qlocale/tst_qlocale.cpp | 2 +- tests/auto/corelib/tools/qmap/tst_qmap.cpp | 2 +- tests/auto/corelib/tools/qmargins/tst_qmargins.cpp | 2 +- tests/auto/corelib/tools/qpoint/tst_qpoint.cpp | 2 +- tests/auto/corelib/tools/qqueue/tst_qqueue.cpp | 2 +- tests/auto/corelib/tools/qrect/tst_qrect.cpp | 2 +- tests/auto/corelib/tools/qregexp/tst_qregexp.cpp | 2 +- tests/auto/corelib/tools/qringbuffer/tst_qringbuffer.cpp | 2 +- tests/auto/corelib/tools/qscopedpointer/tst_qscopedpointer.cpp | 2 +- .../corelib/tools/qscopedvaluerollback/tst_qscopedvaluerollback.cpp | 2 +- tests/auto/corelib/tools/qset/tst_qset.cpp | 2 +- tests/auto/corelib/tools/qsharedpointer/externaltests.cpp | 2 +- tests/auto/corelib/tools/qsharedpointer/externaltests.h | 2 +- tests/auto/corelib/tools/qsharedpointer/forwarddeclaration.cpp | 2 +- tests/auto/corelib/tools/qsharedpointer/forwarddeclared.cpp | 2 +- tests/auto/corelib/tools/qsharedpointer/forwarddeclared.h | 2 +- tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp | 2 +- tests/auto/corelib/tools/qsharedpointer/wrapper.cpp | 2 +- tests/auto/corelib/tools/qsharedpointer/wrapper.h | 2 +- tests/auto/corelib/tools/qsize/tst_qsize.cpp | 2 +- tests/auto/corelib/tools/qsizef/tst_qsizef.cpp | 2 +- tests/auto/corelib/tools/qstl/tst_qstl.cpp | 2 +- tests/auto/corelib/tools/qstring/double_data.h | 2 +- tests/auto/corelib/tools/qstring/tst_qstring.cpp | 2 +- .../auto/corelib/tools/qstringbuilder/qstringbuilder1/stringbuilder.cpp | 2 +- .../tools/qstringbuilder/qstringbuilder1/tst_qstringbuilder1.cpp | 2 +- .../tools/qstringbuilder/qstringbuilder2/tst_qstringbuilder2.cpp | 2 +- .../tools/qstringbuilder/qstringbuilder3/tst_qstringbuilder3.cpp | 2 +- .../tools/qstringbuilder/qstringbuilder4/tst_qstringbuilder4.cpp | 2 +- tests/auto/corelib/tools/qstringlist/tst_qstringlist.cpp | 2 +- tests/auto/corelib/tools/qstringmatcher/tst_qstringmatcher.cpp | 2 +- tests/auto/corelib/tools/qstringref/tst_qstringref.cpp | 2 +- .../auto/corelib/tools/qtextboundaryfinder/tst_qtextboundaryfinder.cpp | 2 +- tests/auto/corelib/tools/qtime/tst_qtime.cpp | 2 +- tests/auto/corelib/tools/qtimeline/tst_qtimeline.cpp | 2 +- tests/auto/corelib/tools/qvarlengtharray/tst_qvarlengtharray.cpp | 2 +- tests/auto/corelib/tools/qvector/tst_qvector.cpp | 2 +- 55 files changed, 55 insertions(+), 55 deletions(-) (limited to 'tests/auto/corelib/tools') diff --git a/tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp b/tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp index d88fb9a82f..0bbd2cb61c 100644 --- a/tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp +++ b/tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/corelib/tools/qbitarray/tst_qbitarray.cpp b/tests/auto/corelib/tools/qbitarray/tst_qbitarray.cpp index 9ee006827f..263f3f6345 100644 --- a/tests/auto/corelib/tools/qbitarray/tst_qbitarray.cpp +++ b/tests/auto/corelib/tools/qbitarray/tst_qbitarray.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp b/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp index 8767571f6c..15498c3b15 100644 --- a/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp +++ b/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/corelib/tools/qbytearraymatcher/tst_qbytearraymatcher.cpp b/tests/auto/corelib/tools/qbytearraymatcher/tst_qbytearraymatcher.cpp index 8bc827ef7f..8f79e944ae 100644 --- a/tests/auto/corelib/tools/qbytearraymatcher/tst_qbytearraymatcher.cpp +++ b/tests/auto/corelib/tools/qbytearraymatcher/tst_qbytearraymatcher.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/corelib/tools/qcache/tst_qcache.cpp b/tests/auto/corelib/tools/qcache/tst_qcache.cpp index 88b56612af..99d30e442d 100644 --- a/tests/auto/corelib/tools/qcache/tst_qcache.cpp +++ b/tests/auto/corelib/tools/qcache/tst_qcache.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/corelib/tools/qchar/tst_qchar.cpp b/tests/auto/corelib/tools/qchar/tst_qchar.cpp index c5fdeeb54a..8f98e42114 100644 --- a/tests/auto/corelib/tools/qchar/tst_qchar.cpp +++ b/tests/auto/corelib/tools/qchar/tst_qchar.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/corelib/tools/qcontiguouscache/tst_qcontiguouscache.cpp b/tests/auto/corelib/tools/qcontiguouscache/tst_qcontiguouscache.cpp index ad464dc40a..58263b4798 100644 --- a/tests/auto/corelib/tools/qcontiguouscache/tst_qcontiguouscache.cpp +++ b/tests/auto/corelib/tools/qcontiguouscache/tst_qcontiguouscache.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/corelib/tools/qcryptographichash/tst_qcryptographichash.cpp b/tests/auto/corelib/tools/qcryptographichash/tst_qcryptographichash.cpp index 14b41e178d..b250c9ac2c 100644 --- a/tests/auto/corelib/tools/qcryptographichash/tst_qcryptographichash.cpp +++ b/tests/auto/corelib/tools/qcryptographichash/tst_qcryptographichash.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/corelib/tools/qdate/tst_qdate.cpp b/tests/auto/corelib/tools/qdate/tst_qdate.cpp index 7bb6de8c9f..1beeaae80c 100644 --- a/tests/auto/corelib/tools/qdate/tst_qdate.cpp +++ b/tests/auto/corelib/tools/qdate/tst_qdate.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp b/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp index 4ef508e92b..8fcff9ad44 100644 --- a/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp +++ b/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/corelib/tools/qeasingcurve/tst_qeasingcurve.cpp b/tests/auto/corelib/tools/qeasingcurve/tst_qeasingcurve.cpp index a4a96c6df7..48c1c57801 100644 --- a/tests/auto/corelib/tools/qeasingcurve/tst_qeasingcurve.cpp +++ b/tests/auto/corelib/tools/qeasingcurve/tst_qeasingcurve.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/corelib/tools/qelapsedtimer/tst_qelapsedtimer.cpp b/tests/auto/corelib/tools/qelapsedtimer/tst_qelapsedtimer.cpp index 0e2f61ab98..b817ef4218 100644 --- a/tests/auto/corelib/tools/qelapsedtimer/tst_qelapsedtimer.cpp +++ b/tests/auto/corelib/tools/qelapsedtimer/tst_qelapsedtimer.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/corelib/tools/qexplicitlyshareddatapointer/tst_qexplicitlyshareddatapointer.cpp b/tests/auto/corelib/tools/qexplicitlyshareddatapointer/tst_qexplicitlyshareddatapointer.cpp index a031bf811d..6cf8d37b85 100644 --- a/tests/auto/corelib/tools/qexplicitlyshareddatapointer/tst_qexplicitlyshareddatapointer.cpp +++ b/tests/auto/corelib/tools/qexplicitlyshareddatapointer/tst_qexplicitlyshareddatapointer.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/corelib/tools/qfreelist/tst_qfreelist.cpp b/tests/auto/corelib/tools/qfreelist/tst_qfreelist.cpp index a713fd4ca7..181eca444e 100644 --- a/tests/auto/corelib/tools/qfreelist/tst_qfreelist.cpp +++ b/tests/auto/corelib/tools/qfreelist/tst_qfreelist.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/corelib/tools/qhash/tst_qhash.cpp b/tests/auto/corelib/tools/qhash/tst_qhash.cpp index 6c941179d6..b22fe0f0d5 100644 --- a/tests/auto/corelib/tools/qhash/tst_qhash.cpp +++ b/tests/auto/corelib/tools/qhash/tst_qhash.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/corelib/tools/qline/tst_qline.cpp b/tests/auto/corelib/tools/qline/tst_qline.cpp index 0c4df63884..1a8ee00983 100644 --- a/tests/auto/corelib/tools/qline/tst_qline.cpp +++ b/tests/auto/corelib/tools/qline/tst_qline.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/corelib/tools/qlist/tst_qlist.cpp b/tests/auto/corelib/tools/qlist/tst_qlist.cpp index c1b71de2b7..58f5dcc5ee 100644 --- a/tests/auto/corelib/tools/qlist/tst_qlist.cpp +++ b/tests/auto/corelib/tools/qlist/tst_qlist.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/corelib/tools/qlocale/syslocaleapp/syslocaleapp.cpp b/tests/auto/corelib/tools/qlocale/syslocaleapp/syslocaleapp.cpp index 2b6280fd2b..66ce05b441 100644 --- a/tests/auto/corelib/tools/qlocale/syslocaleapp/syslocaleapp.cpp +++ b/tests/auto/corelib/tools/qlocale/syslocaleapp/syslocaleapp.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp index a670cac03c..7f08b74145 100644 --- a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp +++ b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/corelib/tools/qmap/tst_qmap.cpp b/tests/auto/corelib/tools/qmap/tst_qmap.cpp index c48bcfb4b3..ccf2938ec9 100644 --- a/tests/auto/corelib/tools/qmap/tst_qmap.cpp +++ b/tests/auto/corelib/tools/qmap/tst_qmap.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/corelib/tools/qmargins/tst_qmargins.cpp b/tests/auto/corelib/tools/qmargins/tst_qmargins.cpp index bdaf98cbf2..013dacc43f 100644 --- a/tests/auto/corelib/tools/qmargins/tst_qmargins.cpp +++ b/tests/auto/corelib/tools/qmargins/tst_qmargins.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/corelib/tools/qpoint/tst_qpoint.cpp b/tests/auto/corelib/tools/qpoint/tst_qpoint.cpp index acdfd20488..5284b8ad33 100644 --- a/tests/auto/corelib/tools/qpoint/tst_qpoint.cpp +++ b/tests/auto/corelib/tools/qpoint/tst_qpoint.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/corelib/tools/qqueue/tst_qqueue.cpp b/tests/auto/corelib/tools/qqueue/tst_qqueue.cpp index 5282d2964b..53f5fd5bad 100644 --- a/tests/auto/corelib/tools/qqueue/tst_qqueue.cpp +++ b/tests/auto/corelib/tools/qqueue/tst_qqueue.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/corelib/tools/qrect/tst_qrect.cpp b/tests/auto/corelib/tools/qrect/tst_qrect.cpp index c2a9d05af6..e528497cd9 100644 --- a/tests/auto/corelib/tools/qrect/tst_qrect.cpp +++ b/tests/auto/corelib/tools/qrect/tst_qrect.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/corelib/tools/qregexp/tst_qregexp.cpp b/tests/auto/corelib/tools/qregexp/tst_qregexp.cpp index 836c02dfca..239b930a42 100644 --- a/tests/auto/corelib/tools/qregexp/tst_qregexp.cpp +++ b/tests/auto/corelib/tools/qregexp/tst_qregexp.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/corelib/tools/qringbuffer/tst_qringbuffer.cpp b/tests/auto/corelib/tools/qringbuffer/tst_qringbuffer.cpp index 67de98b867..ef9d821a34 100644 --- a/tests/auto/corelib/tools/qringbuffer/tst_qringbuffer.cpp +++ b/tests/auto/corelib/tools/qringbuffer/tst_qringbuffer.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/corelib/tools/qscopedpointer/tst_qscopedpointer.cpp b/tests/auto/corelib/tools/qscopedpointer/tst_qscopedpointer.cpp index 22f6cb7d32..3d03ba9dbf 100644 --- a/tests/auto/corelib/tools/qscopedpointer/tst_qscopedpointer.cpp +++ b/tests/auto/corelib/tools/qscopedpointer/tst_qscopedpointer.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/corelib/tools/qscopedvaluerollback/tst_qscopedvaluerollback.cpp b/tests/auto/corelib/tools/qscopedvaluerollback/tst_qscopedvaluerollback.cpp index c0e036e232..3be38110de 100644 --- a/tests/auto/corelib/tools/qscopedvaluerollback/tst_qscopedvaluerollback.cpp +++ b/tests/auto/corelib/tools/qscopedvaluerollback/tst_qscopedvaluerollback.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/corelib/tools/qset/tst_qset.cpp b/tests/auto/corelib/tools/qset/tst_qset.cpp index 4c0ecce5ec..4ecdafa783 100644 --- a/tests/auto/corelib/tools/qset/tst_qset.cpp +++ b/tests/auto/corelib/tools/qset/tst_qset.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/corelib/tools/qsharedpointer/externaltests.cpp b/tests/auto/corelib/tools/qsharedpointer/externaltests.cpp index 2e3dd0699d..c351309a59 100644 --- a/tests/auto/corelib/tools/qsharedpointer/externaltests.cpp +++ b/tests/auto/corelib/tools/qsharedpointer/externaltests.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/corelib/tools/qsharedpointer/externaltests.h b/tests/auto/corelib/tools/qsharedpointer/externaltests.h index 6903433b70..c6d68d5843 100644 --- a/tests/auto/corelib/tools/qsharedpointer/externaltests.h +++ b/tests/auto/corelib/tools/qsharedpointer/externaltests.h @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/corelib/tools/qsharedpointer/forwarddeclaration.cpp b/tests/auto/corelib/tools/qsharedpointer/forwarddeclaration.cpp index b5d59de037..420a041bef 100644 --- a/tests/auto/corelib/tools/qsharedpointer/forwarddeclaration.cpp +++ b/tests/auto/corelib/tools/qsharedpointer/forwarddeclaration.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/corelib/tools/qsharedpointer/forwarddeclared.cpp b/tests/auto/corelib/tools/qsharedpointer/forwarddeclared.cpp index 17812216c0..91333368db 100644 --- a/tests/auto/corelib/tools/qsharedpointer/forwarddeclared.cpp +++ b/tests/auto/corelib/tools/qsharedpointer/forwarddeclared.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/corelib/tools/qsharedpointer/forwarddeclared.h b/tests/auto/corelib/tools/qsharedpointer/forwarddeclared.h index cebbe94ef1..accf44bcf9 100644 --- a/tests/auto/corelib/tools/qsharedpointer/forwarddeclared.h +++ b/tests/auto/corelib/tools/qsharedpointer/forwarddeclared.h @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp b/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp index 35b63deb4c..325918e2ca 100644 --- a/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp +++ b/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/corelib/tools/qsharedpointer/wrapper.cpp b/tests/auto/corelib/tools/qsharedpointer/wrapper.cpp index 889493ddb4..f3416005db 100644 --- a/tests/auto/corelib/tools/qsharedpointer/wrapper.cpp +++ b/tests/auto/corelib/tools/qsharedpointer/wrapper.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/corelib/tools/qsharedpointer/wrapper.h b/tests/auto/corelib/tools/qsharedpointer/wrapper.h index 66202a5a31..633fe4f536 100644 --- a/tests/auto/corelib/tools/qsharedpointer/wrapper.h +++ b/tests/auto/corelib/tools/qsharedpointer/wrapper.h @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/corelib/tools/qsize/tst_qsize.cpp b/tests/auto/corelib/tools/qsize/tst_qsize.cpp index bc40e2aa64..fa36cf3e83 100644 --- a/tests/auto/corelib/tools/qsize/tst_qsize.cpp +++ b/tests/auto/corelib/tools/qsize/tst_qsize.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/corelib/tools/qsizef/tst_qsizef.cpp b/tests/auto/corelib/tools/qsizef/tst_qsizef.cpp index c74f4c3754..26c1549bd2 100644 --- a/tests/auto/corelib/tools/qsizef/tst_qsizef.cpp +++ b/tests/auto/corelib/tools/qsizef/tst_qsizef.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/corelib/tools/qstl/tst_qstl.cpp b/tests/auto/corelib/tools/qstl/tst_qstl.cpp index f9e3549a4d..d8d45c76b4 100644 --- a/tests/auto/corelib/tools/qstl/tst_qstl.cpp +++ b/tests/auto/corelib/tools/qstl/tst_qstl.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/corelib/tools/qstring/double_data.h b/tests/auto/corelib/tools/qstring/double_data.h index 8ffb981675..ea5772f427 100644 --- a/tests/auto/corelib/tools/qstring/double_data.h +++ b/tests/auto/corelib/tools/qstring/double_data.h @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/corelib/tools/qstring/tst_qstring.cpp b/tests/auto/corelib/tools/qstring/tst_qstring.cpp index ed525e3429..eda34b0d99 100644 --- a/tests/auto/corelib/tools/qstring/tst_qstring.cpp +++ b/tests/auto/corelib/tools/qstring/tst_qstring.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder1/stringbuilder.cpp b/tests/auto/corelib/tools/qstringbuilder/qstringbuilder1/stringbuilder.cpp index 283e707c1b..74afecf43c 100644 --- a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder1/stringbuilder.cpp +++ b/tests/auto/corelib/tools/qstringbuilder/qstringbuilder1/stringbuilder.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder1/tst_qstringbuilder1.cpp b/tests/auto/corelib/tools/qstringbuilder/qstringbuilder1/tst_qstringbuilder1.cpp index fd92aafadd..e22b98051e 100644 --- a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder1/tst_qstringbuilder1.cpp +++ b/tests/auto/corelib/tools/qstringbuilder/qstringbuilder1/tst_qstringbuilder1.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite module of the Qt Toolkit. ** diff --git a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder2/tst_qstringbuilder2.cpp b/tests/auto/corelib/tools/qstringbuilder/qstringbuilder2/tst_qstringbuilder2.cpp index 6bdb607431..17da90a2e8 100644 --- a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder2/tst_qstringbuilder2.cpp +++ b/tests/auto/corelib/tools/qstringbuilder/qstringbuilder2/tst_qstringbuilder2.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite module of the Qt Toolkit. ** diff --git a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder3/tst_qstringbuilder3.cpp b/tests/auto/corelib/tools/qstringbuilder/qstringbuilder3/tst_qstringbuilder3.cpp index 915c0d23ad..081b039b9f 100644 --- a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder3/tst_qstringbuilder3.cpp +++ b/tests/auto/corelib/tools/qstringbuilder/qstringbuilder3/tst_qstringbuilder3.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite module of the Qt Toolkit. ** diff --git a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder4/tst_qstringbuilder4.cpp b/tests/auto/corelib/tools/qstringbuilder/qstringbuilder4/tst_qstringbuilder4.cpp index c9837a0489..819576750b 100644 --- a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder4/tst_qstringbuilder4.cpp +++ b/tests/auto/corelib/tools/qstringbuilder/qstringbuilder4/tst_qstringbuilder4.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite module of the Qt Toolkit. ** diff --git a/tests/auto/corelib/tools/qstringlist/tst_qstringlist.cpp b/tests/auto/corelib/tools/qstringlist/tst_qstringlist.cpp index 54ca9dd3a7..55e29b7d8f 100644 --- a/tests/auto/corelib/tools/qstringlist/tst_qstringlist.cpp +++ b/tests/auto/corelib/tools/qstringlist/tst_qstringlist.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/corelib/tools/qstringmatcher/tst_qstringmatcher.cpp b/tests/auto/corelib/tools/qstringmatcher/tst_qstringmatcher.cpp index 10906902ff..a985ce3e2e 100644 --- a/tests/auto/corelib/tools/qstringmatcher/tst_qstringmatcher.cpp +++ b/tests/auto/corelib/tools/qstringmatcher/tst_qstringmatcher.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/corelib/tools/qstringref/tst_qstringref.cpp b/tests/auto/corelib/tools/qstringref/tst_qstringref.cpp index c0dc253167..2b16308e85 100644 --- a/tests/auto/corelib/tools/qstringref/tst_qstringref.cpp +++ b/tests/auto/corelib/tools/qstringref/tst_qstringref.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/corelib/tools/qtextboundaryfinder/tst_qtextboundaryfinder.cpp b/tests/auto/corelib/tools/qtextboundaryfinder/tst_qtextboundaryfinder.cpp index 100ddfcb12..15f3416983 100644 --- a/tests/auto/corelib/tools/qtextboundaryfinder/tst_qtextboundaryfinder.cpp +++ b/tests/auto/corelib/tools/qtextboundaryfinder/tst_qtextboundaryfinder.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/corelib/tools/qtime/tst_qtime.cpp b/tests/auto/corelib/tools/qtime/tst_qtime.cpp index bc03e74b41..299dce6878 100644 --- a/tests/auto/corelib/tools/qtime/tst_qtime.cpp +++ b/tests/auto/corelib/tools/qtime/tst_qtime.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/corelib/tools/qtimeline/tst_qtimeline.cpp b/tests/auto/corelib/tools/qtimeline/tst_qtimeline.cpp index db08bc5724..7aed2fb3ef 100644 --- a/tests/auto/corelib/tools/qtimeline/tst_qtimeline.cpp +++ b/tests/auto/corelib/tools/qtimeline/tst_qtimeline.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/corelib/tools/qvarlengtharray/tst_qvarlengtharray.cpp b/tests/auto/corelib/tools/qvarlengtharray/tst_qvarlengtharray.cpp index cc2bbe2f1f..2c902fc8c0 100644 --- a/tests/auto/corelib/tools/qvarlengtharray/tst_qvarlengtharray.cpp +++ b/tests/auto/corelib/tools/qvarlengtharray/tst_qvarlengtharray.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/corelib/tools/qvector/tst_qvector.cpp b/tests/auto/corelib/tools/qvector/tst_qvector.cpp index 3c885f25fc..2e6e5063ee 100644 --- a/tests/auto/corelib/tools/qvector/tst_qvector.cpp +++ b/tests/auto/corelib/tools/qvector/tst_qvector.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** -- cgit v1.2.3 From 601d68584921a47d83d833228f5ec698e13b624c Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Mon, 23 Jan 2012 12:02:36 +0000 Subject: Make mid() and midRef() properly return empty, non-null objects If we request a substring starting at the very end of the string, QString::mid should return an empty string, not a null string. For instance, QString("abc").mid(3, 0) used to return a null one, while this patch makes it return an empty one. The same thing applies to QString::midRef() and QByteArray::mid(). Change-Id: Ie9efd7a0622d429efd0fb682c19856c19e9469af Reviewed-by: Lars Knoll --- tests/auto/corelib/tools/qstring/tst_qstring.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests/auto/corelib/tools') diff --git a/tests/auto/corelib/tools/qstring/tst_qstring.cpp b/tests/auto/corelib/tools/qstring/tst_qstring.cpp index eda34b0d99..b9951c1b5d 100644 --- a/tests/auto/corelib/tools/qstring/tst_qstring.cpp +++ b/tests/auto/corelib/tools/qstring/tst_qstring.cpp @@ -1417,6 +1417,10 @@ void tst_QString::mid() QCOMPARE(a.mid(3,3),(QString)"DEF"); QCOMPARE(a.mid(0,0),(QString)""); + QVERIFY(!a.mid(15,0).isNull()); + QVERIFY(a.mid(15,0).isEmpty()); + QVERIFY(!a.mid(15,1).isNull()); + QVERIFY(a.mid(15,1).isEmpty()); QVERIFY(a.mid(9999).isNull()); QVERIFY(a.mid(9999,1).isNull()); @@ -1439,6 +1443,10 @@ void tst_QString::midRef() QCOMPARE(a.midRef(3,3).toString(),(QString)"DEF"); QCOMPARE(a.midRef(0,0).toString(),(QString)""); + QVERIFY(!a.midRef(15,0).toString().isNull()); + QVERIFY(a.midRef(15,0).toString().isEmpty()); + QVERIFY(!a.midRef(15,1).toString().isNull()); + QVERIFY(a.midRef(15,1).toString().isEmpty()); QVERIFY(a.midRef(9999).toString().isEmpty()); QVERIFY(a.midRef(9999,1).toString().isEmpty()); -- cgit v1.2.3 From 8eb2546bf23419e20064f4cf5c308e77831b3ee5 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Thu, 19 Jan 2012 17:32:41 +0100 Subject: Fix a couple of edge cases for WildcardUnix matching Fix a couple of cases where WildcardUnix was not matching when the string was just [] or ended with a \. The testWildcardEscaping() test has been extended to account for these two cases too. Integrate 7ce3726aea4be2dfdb57966a4482f66fec6f8f57 from 4.8 Task-number: QTBUG-20897 Change-Id: I7a07ac008473fa7a080db752e189f6404842603f Reviewed-by: Thiago Macieira --- tests/auto/corelib/tools/qregexp/tst_qregexp.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tests/auto/corelib/tools') diff --git a/tests/auto/corelib/tools/qregexp/tst_qregexp.cpp b/tests/auto/corelib/tools/qregexp/tst_qregexp.cpp index 239b930a42..b07d435405 100644 --- a/tests/auto/corelib/tools/qregexp/tst_qregexp.cpp +++ b/tests/auto/corelib/tools/qregexp/tst_qregexp.cpp @@ -829,6 +829,8 @@ void tst_QRegExp::testEscapingWildcard_data(){ QTest::newRow("? Escaped") << "\\?O;" << "?O;" << true; QTest::newRow("[] not escaped") << "[lL]" << "l" << true; + QTest::newRow("[] escaped") << "\\[\\]" << "[]" << true; + QTest::newRow("case [[]") << "[[abc]" << "[" << true; QTest::newRow("case []abc] match ]") << "[]abc]" << "]" << true; QTest::newRow("case []abc] match a") << "[]abc]" << "a" << true; @@ -844,7 +846,7 @@ void tst_QRegExp::testEscapingWildcard_data(){ QTest::newRow("a true '\\' in input") << "\\Qt;" << "\\Qt;" << true; QTest::newRow("two true '\\' in input") << "\\\\Qt;" << "\\\\Qt;" << true; - QTest::newRow("a '\\' at the end") << "\\\\Qt;" << "\\\\Qt;" << true; + QTest::newRow("a '\\' at the end") << "\\\\Qt;\\" << "\\\\Qt;\\" << true; } void tst_QRegExp::testEscapingWildcard(){ -- cgit v1.2.3 From e62fe9ed4fd8d33f881dedeeafafc4a0c65e5278 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Thu, 26 Jan 2012 11:13:41 +0100 Subject: Fixed QString::operator<(QLatin1String) QLatin1String now has a constructor that takes explicit length, which makes it possible to create QLatin1String that do not have null-termination character. Fixed QString::operator> and < to be safe in that case. In the same patch fixed qtjson which had operator< implemented in the same way. QString::compare(QLatin1String) is still broken and will be fixed separately. Change-Id: I48ec1183a6f44034129cc17312af854795085408 Reviewed-by: Denis Dzyubenko Reviewed-by: Lars Knoll --- tests/auto/corelib/tools/qstring/tst_qstring.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tests/auto/corelib/tools') diff --git a/tests/auto/corelib/tools/qstring/tst_qstring.cpp b/tests/auto/corelib/tools/qstring/tst_qstring.cpp index b9951c1b5d..5e95f31c2a 100644 --- a/tests/auto/corelib/tools/qstring/tst_qstring.cpp +++ b/tests/auto/corelib/tools/qstring/tst_qstring.cpp @@ -220,6 +220,8 @@ private slots: void reserve(); void toHtmlEscaped_data(); void toHtmlEscaped(); + + void operatorGreaterWithQLatin1String(); }; typedef QList IntList; @@ -5175,6 +5177,16 @@ void tst_QString::toHtmlEscaped() QCOMPARE(original.toHtmlEscaped(), expected); } +void tst_QString::operatorGreaterWithQLatin1String() +{ + QLatin1String latin1foo("fooZZ", 3); + QString stringfoo = QString::fromLatin1("foo"); + QVERIFY(stringfoo >= latin1foo); + QVERIFY(!(stringfoo > latin1foo)); + QVERIFY(stringfoo <= latin1foo); + QVERIFY(!(stringfoo < latin1foo)); +} + QTEST_APPLESS_MAIN(tst_QString) #include "tst_qstring.moc" -- cgit v1.2.3 From 5635823e17db3395d9b0fa8cfcc72f82fea583f4 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Tue, 24 Jan 2012 16:17:24 +1000 Subject: Remove "All rights reserved" line from license headers. As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I311e001373776812699d6efc045b5f742890c689 Reviewed-by: Rohan McGovern --- tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp | 2 +- tests/auto/corelib/tools/qbitarray/tst_qbitarray.cpp | 2 +- tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp | 2 +- tests/auto/corelib/tools/qbytearraymatcher/tst_qbytearraymatcher.cpp | 2 +- tests/auto/corelib/tools/qcache/tst_qcache.cpp | 2 +- tests/auto/corelib/tools/qchar/tst_qchar.cpp | 2 +- tests/auto/corelib/tools/qcontiguouscache/tst_qcontiguouscache.cpp | 2 +- tests/auto/corelib/tools/qcryptographichash/tst_qcryptographichash.cpp | 2 +- tests/auto/corelib/tools/qdate/tst_qdate.cpp | 2 +- tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp | 2 +- tests/auto/corelib/tools/qeasingcurve/tst_qeasingcurve.cpp | 2 +- tests/auto/corelib/tools/qelapsedtimer/tst_qelapsedtimer.cpp | 2 +- .../qexplicitlyshareddatapointer/tst_qexplicitlyshareddatapointer.cpp | 2 +- tests/auto/corelib/tools/qfreelist/tst_qfreelist.cpp | 2 +- tests/auto/corelib/tools/qhash/tst_qhash.cpp | 2 +- tests/auto/corelib/tools/qline/tst_qline.cpp | 2 +- tests/auto/corelib/tools/qlist/tst_qlist.cpp | 2 +- tests/auto/corelib/tools/qlocale/syslocaleapp/syslocaleapp.cpp | 2 +- tests/auto/corelib/tools/qlocale/tst_qlocale.cpp | 2 +- tests/auto/corelib/tools/qmap/tst_qmap.cpp | 2 +- tests/auto/corelib/tools/qmargins/tst_qmargins.cpp | 2 +- tests/auto/corelib/tools/qpoint/tst_qpoint.cpp | 2 +- tests/auto/corelib/tools/qqueue/tst_qqueue.cpp | 2 +- tests/auto/corelib/tools/qrect/tst_qrect.cpp | 2 +- tests/auto/corelib/tools/qregexp/tst_qregexp.cpp | 2 +- tests/auto/corelib/tools/qringbuffer/tst_qringbuffer.cpp | 2 +- tests/auto/corelib/tools/qscopedpointer/tst_qscopedpointer.cpp | 2 +- .../corelib/tools/qscopedvaluerollback/tst_qscopedvaluerollback.cpp | 2 +- tests/auto/corelib/tools/qset/tst_qset.cpp | 2 +- tests/auto/corelib/tools/qsharedpointer/externaltests.cpp | 2 +- tests/auto/corelib/tools/qsharedpointer/externaltests.h | 2 +- tests/auto/corelib/tools/qsharedpointer/forwarddeclaration.cpp | 2 +- tests/auto/corelib/tools/qsharedpointer/forwarddeclared.cpp | 2 +- tests/auto/corelib/tools/qsharedpointer/forwarddeclared.h | 2 +- tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp | 2 +- tests/auto/corelib/tools/qsharedpointer/wrapper.cpp | 2 +- tests/auto/corelib/tools/qsharedpointer/wrapper.h | 2 +- tests/auto/corelib/tools/qsize/tst_qsize.cpp | 2 +- tests/auto/corelib/tools/qsizef/tst_qsizef.cpp | 2 +- tests/auto/corelib/tools/qstl/tst_qstl.cpp | 2 +- tests/auto/corelib/tools/qstring/double_data.h | 2 +- tests/auto/corelib/tools/qstring/tst_qstring.cpp | 2 +- .../auto/corelib/tools/qstringbuilder/qstringbuilder1/stringbuilder.cpp | 2 +- .../tools/qstringbuilder/qstringbuilder1/tst_qstringbuilder1.cpp | 2 +- .../tools/qstringbuilder/qstringbuilder2/tst_qstringbuilder2.cpp | 2 +- .../tools/qstringbuilder/qstringbuilder3/tst_qstringbuilder3.cpp | 2 +- .../tools/qstringbuilder/qstringbuilder4/tst_qstringbuilder4.cpp | 2 +- tests/auto/corelib/tools/qstringlist/tst_qstringlist.cpp | 2 +- tests/auto/corelib/tools/qstringmatcher/tst_qstringmatcher.cpp | 2 +- tests/auto/corelib/tools/qstringref/tst_qstringref.cpp | 2 +- .../auto/corelib/tools/qtextboundaryfinder/tst_qtextboundaryfinder.cpp | 2 +- tests/auto/corelib/tools/qtime/tst_qtime.cpp | 2 +- tests/auto/corelib/tools/qtimeline/tst_qtimeline.cpp | 2 +- tests/auto/corelib/tools/qvarlengtharray/tst_qvarlengtharray.cpp | 2 +- tests/auto/corelib/tools/qvector/tst_qvector.cpp | 2 +- 55 files changed, 55 insertions(+), 55 deletions(-) (limited to 'tests/auto/corelib/tools') diff --git a/tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp b/tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp index 0bbd2cb61c..1d7cb1e903 100644 --- a/tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp +++ b/tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp @@ -1,7 +1,6 @@ /**************************************************************************** ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. ** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -35,6 +34,7 @@ ** ** ** +** ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/auto/corelib/tools/qbitarray/tst_qbitarray.cpp b/tests/auto/corelib/tools/qbitarray/tst_qbitarray.cpp index 263f3f6345..588506534a 100644 --- a/tests/auto/corelib/tools/qbitarray/tst_qbitarray.cpp +++ b/tests/auto/corelib/tools/qbitarray/tst_qbitarray.cpp @@ -1,7 +1,6 @@ /**************************************************************************** ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. ** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -35,6 +34,7 @@ ** ** ** +** ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp b/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp index 15498c3b15..c50deb63c2 100644 --- a/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp +++ b/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp @@ -1,7 +1,6 @@ /**************************************************************************** ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. ** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -35,6 +34,7 @@ ** ** ** +** ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/auto/corelib/tools/qbytearraymatcher/tst_qbytearraymatcher.cpp b/tests/auto/corelib/tools/qbytearraymatcher/tst_qbytearraymatcher.cpp index 8f79e944ae..d0ba1fadc9 100644 --- a/tests/auto/corelib/tools/qbytearraymatcher/tst_qbytearraymatcher.cpp +++ b/tests/auto/corelib/tools/qbytearraymatcher/tst_qbytearraymatcher.cpp @@ -1,7 +1,6 @@ /**************************************************************************** ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. ** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -35,6 +34,7 @@ ** ** ** +** ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/auto/corelib/tools/qcache/tst_qcache.cpp b/tests/auto/corelib/tools/qcache/tst_qcache.cpp index 99d30e442d..8129f1510c 100644 --- a/tests/auto/corelib/tools/qcache/tst_qcache.cpp +++ b/tests/auto/corelib/tools/qcache/tst_qcache.cpp @@ -1,7 +1,6 @@ /**************************************************************************** ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. ** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -35,6 +34,7 @@ ** ** ** +** ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/auto/corelib/tools/qchar/tst_qchar.cpp b/tests/auto/corelib/tools/qchar/tst_qchar.cpp index 8f98e42114..1732f628ea 100644 --- a/tests/auto/corelib/tools/qchar/tst_qchar.cpp +++ b/tests/auto/corelib/tools/qchar/tst_qchar.cpp @@ -1,7 +1,6 @@ /**************************************************************************** ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. ** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -35,6 +34,7 @@ ** ** ** +** ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/auto/corelib/tools/qcontiguouscache/tst_qcontiguouscache.cpp b/tests/auto/corelib/tools/qcontiguouscache/tst_qcontiguouscache.cpp index 58263b4798..37fe346684 100644 --- a/tests/auto/corelib/tools/qcontiguouscache/tst_qcontiguouscache.cpp +++ b/tests/auto/corelib/tools/qcontiguouscache/tst_qcontiguouscache.cpp @@ -1,7 +1,6 @@ /**************************************************************************** ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. ** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -35,6 +34,7 @@ ** ** ** +** ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/auto/corelib/tools/qcryptographichash/tst_qcryptographichash.cpp b/tests/auto/corelib/tools/qcryptographichash/tst_qcryptographichash.cpp index b250c9ac2c..3a257c2f11 100644 --- a/tests/auto/corelib/tools/qcryptographichash/tst_qcryptographichash.cpp +++ b/tests/auto/corelib/tools/qcryptographichash/tst_qcryptographichash.cpp @@ -1,7 +1,6 @@ /**************************************************************************** ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. ** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -35,6 +34,7 @@ ** ** ** +** ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/auto/corelib/tools/qdate/tst_qdate.cpp b/tests/auto/corelib/tools/qdate/tst_qdate.cpp index 1beeaae80c..1a1c344f07 100644 --- a/tests/auto/corelib/tools/qdate/tst_qdate.cpp +++ b/tests/auto/corelib/tools/qdate/tst_qdate.cpp @@ -1,7 +1,6 @@ /**************************************************************************** ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. ** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -35,6 +34,7 @@ ** ** ** +** ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp b/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp index 8fcff9ad44..2cbac82d3b 100644 --- a/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp +++ b/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp @@ -1,7 +1,6 @@ /**************************************************************************** ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. ** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -35,6 +34,7 @@ ** ** ** +** ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/auto/corelib/tools/qeasingcurve/tst_qeasingcurve.cpp b/tests/auto/corelib/tools/qeasingcurve/tst_qeasingcurve.cpp index 48c1c57801..0a006ab5b4 100644 --- a/tests/auto/corelib/tools/qeasingcurve/tst_qeasingcurve.cpp +++ b/tests/auto/corelib/tools/qeasingcurve/tst_qeasingcurve.cpp @@ -1,7 +1,6 @@ /**************************************************************************** ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. ** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -35,6 +34,7 @@ ** ** ** +** ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/auto/corelib/tools/qelapsedtimer/tst_qelapsedtimer.cpp b/tests/auto/corelib/tools/qelapsedtimer/tst_qelapsedtimer.cpp index b817ef4218..7f28e8dc0c 100644 --- a/tests/auto/corelib/tools/qelapsedtimer/tst_qelapsedtimer.cpp +++ b/tests/auto/corelib/tools/qelapsedtimer/tst_qelapsedtimer.cpp @@ -1,7 +1,6 @@ /**************************************************************************** ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. ** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -35,6 +34,7 @@ ** ** ** +** ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/auto/corelib/tools/qexplicitlyshareddatapointer/tst_qexplicitlyshareddatapointer.cpp b/tests/auto/corelib/tools/qexplicitlyshareddatapointer/tst_qexplicitlyshareddatapointer.cpp index 6cf8d37b85..e0e74efdd0 100644 --- a/tests/auto/corelib/tools/qexplicitlyshareddatapointer/tst_qexplicitlyshareddatapointer.cpp +++ b/tests/auto/corelib/tools/qexplicitlyshareddatapointer/tst_qexplicitlyshareddatapointer.cpp @@ -1,7 +1,6 @@ /**************************************************************************** ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. ** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -35,6 +34,7 @@ ** ** ** +** ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/auto/corelib/tools/qfreelist/tst_qfreelist.cpp b/tests/auto/corelib/tools/qfreelist/tst_qfreelist.cpp index 181eca444e..86696ab0c9 100644 --- a/tests/auto/corelib/tools/qfreelist/tst_qfreelist.cpp +++ b/tests/auto/corelib/tools/qfreelist/tst_qfreelist.cpp @@ -1,7 +1,6 @@ /**************************************************************************** ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. ** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -35,6 +34,7 @@ ** ** ** +** ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/auto/corelib/tools/qhash/tst_qhash.cpp b/tests/auto/corelib/tools/qhash/tst_qhash.cpp index b22fe0f0d5..3b5d15dbfc 100644 --- a/tests/auto/corelib/tools/qhash/tst_qhash.cpp +++ b/tests/auto/corelib/tools/qhash/tst_qhash.cpp @@ -1,7 +1,6 @@ /**************************************************************************** ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. ** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -35,6 +34,7 @@ ** ** ** +** ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/auto/corelib/tools/qline/tst_qline.cpp b/tests/auto/corelib/tools/qline/tst_qline.cpp index 1a8ee00983..28ed8d3e22 100644 --- a/tests/auto/corelib/tools/qline/tst_qline.cpp +++ b/tests/auto/corelib/tools/qline/tst_qline.cpp @@ -1,7 +1,6 @@ /**************************************************************************** ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. ** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -35,6 +34,7 @@ ** ** ** +** ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/auto/corelib/tools/qlist/tst_qlist.cpp b/tests/auto/corelib/tools/qlist/tst_qlist.cpp index 58f5dcc5ee..fbb821c730 100644 --- a/tests/auto/corelib/tools/qlist/tst_qlist.cpp +++ b/tests/auto/corelib/tools/qlist/tst_qlist.cpp @@ -1,7 +1,6 @@ /**************************************************************************** ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. ** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -35,6 +34,7 @@ ** ** ** +** ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/auto/corelib/tools/qlocale/syslocaleapp/syslocaleapp.cpp b/tests/auto/corelib/tools/qlocale/syslocaleapp/syslocaleapp.cpp index 66ce05b441..508833b5d0 100644 --- a/tests/auto/corelib/tools/qlocale/syslocaleapp/syslocaleapp.cpp +++ b/tests/auto/corelib/tools/qlocale/syslocaleapp/syslocaleapp.cpp @@ -1,7 +1,6 @@ /**************************************************************************** ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. ** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -35,6 +34,7 @@ ** ** ** +** ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp index 7f08b74145..52f01e8754 100644 --- a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp +++ b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp @@ -1,7 +1,6 @@ /**************************************************************************** ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. ** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -35,6 +34,7 @@ ** ** ** +** ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/auto/corelib/tools/qmap/tst_qmap.cpp b/tests/auto/corelib/tools/qmap/tst_qmap.cpp index ccf2938ec9..79b0a931cb 100644 --- a/tests/auto/corelib/tools/qmap/tst_qmap.cpp +++ b/tests/auto/corelib/tools/qmap/tst_qmap.cpp @@ -1,7 +1,6 @@ /**************************************************************************** ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. ** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -35,6 +34,7 @@ ** ** ** +** ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/auto/corelib/tools/qmargins/tst_qmargins.cpp b/tests/auto/corelib/tools/qmargins/tst_qmargins.cpp index 013dacc43f..de3c0269e1 100644 --- a/tests/auto/corelib/tools/qmargins/tst_qmargins.cpp +++ b/tests/auto/corelib/tools/qmargins/tst_qmargins.cpp @@ -1,7 +1,6 @@ /**************************************************************************** ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. ** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -35,6 +34,7 @@ ** ** ** +** ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/auto/corelib/tools/qpoint/tst_qpoint.cpp b/tests/auto/corelib/tools/qpoint/tst_qpoint.cpp index 5284b8ad33..aaeb6bd9f5 100644 --- a/tests/auto/corelib/tools/qpoint/tst_qpoint.cpp +++ b/tests/auto/corelib/tools/qpoint/tst_qpoint.cpp @@ -1,7 +1,6 @@ /**************************************************************************** ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. ** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -35,6 +34,7 @@ ** ** ** +** ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/auto/corelib/tools/qqueue/tst_qqueue.cpp b/tests/auto/corelib/tools/qqueue/tst_qqueue.cpp index 53f5fd5bad..eb800e57bc 100644 --- a/tests/auto/corelib/tools/qqueue/tst_qqueue.cpp +++ b/tests/auto/corelib/tools/qqueue/tst_qqueue.cpp @@ -1,7 +1,6 @@ /**************************************************************************** ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. ** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -35,6 +34,7 @@ ** ** ** +** ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/auto/corelib/tools/qrect/tst_qrect.cpp b/tests/auto/corelib/tools/qrect/tst_qrect.cpp index e528497cd9..f9d0f0f291 100644 --- a/tests/auto/corelib/tools/qrect/tst_qrect.cpp +++ b/tests/auto/corelib/tools/qrect/tst_qrect.cpp @@ -1,7 +1,6 @@ /**************************************************************************** ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. ** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -35,6 +34,7 @@ ** ** ** +** ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/auto/corelib/tools/qregexp/tst_qregexp.cpp b/tests/auto/corelib/tools/qregexp/tst_qregexp.cpp index b07d435405..53e9ccc6fd 100644 --- a/tests/auto/corelib/tools/qregexp/tst_qregexp.cpp +++ b/tests/auto/corelib/tools/qregexp/tst_qregexp.cpp @@ -1,7 +1,6 @@ /**************************************************************************** ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. ** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -35,6 +34,7 @@ ** ** ** +** ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/auto/corelib/tools/qringbuffer/tst_qringbuffer.cpp b/tests/auto/corelib/tools/qringbuffer/tst_qringbuffer.cpp index ef9d821a34..d94d35afaf 100644 --- a/tests/auto/corelib/tools/qringbuffer/tst_qringbuffer.cpp +++ b/tests/auto/corelib/tools/qringbuffer/tst_qringbuffer.cpp @@ -1,7 +1,6 @@ /**************************************************************************** ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. ** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -35,6 +34,7 @@ ** ** ** +** ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/auto/corelib/tools/qscopedpointer/tst_qscopedpointer.cpp b/tests/auto/corelib/tools/qscopedpointer/tst_qscopedpointer.cpp index 3d03ba9dbf..45ccaa671d 100644 --- a/tests/auto/corelib/tools/qscopedpointer/tst_qscopedpointer.cpp +++ b/tests/auto/corelib/tools/qscopedpointer/tst_qscopedpointer.cpp @@ -1,7 +1,6 @@ /**************************************************************************** ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. ** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -35,6 +34,7 @@ ** ** ** +** ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/auto/corelib/tools/qscopedvaluerollback/tst_qscopedvaluerollback.cpp b/tests/auto/corelib/tools/qscopedvaluerollback/tst_qscopedvaluerollback.cpp index 3be38110de..b070b105da 100644 --- a/tests/auto/corelib/tools/qscopedvaluerollback/tst_qscopedvaluerollback.cpp +++ b/tests/auto/corelib/tools/qscopedvaluerollback/tst_qscopedvaluerollback.cpp @@ -1,7 +1,6 @@ /**************************************************************************** ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. ** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -35,6 +34,7 @@ ** ** ** +** ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/auto/corelib/tools/qset/tst_qset.cpp b/tests/auto/corelib/tools/qset/tst_qset.cpp index 4ecdafa783..d7d8c99071 100644 --- a/tests/auto/corelib/tools/qset/tst_qset.cpp +++ b/tests/auto/corelib/tools/qset/tst_qset.cpp @@ -1,7 +1,6 @@ /**************************************************************************** ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. ** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -35,6 +34,7 @@ ** ** ** +** ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/auto/corelib/tools/qsharedpointer/externaltests.cpp b/tests/auto/corelib/tools/qsharedpointer/externaltests.cpp index c351309a59..df8c1678bd 100644 --- a/tests/auto/corelib/tools/qsharedpointer/externaltests.cpp +++ b/tests/auto/corelib/tools/qsharedpointer/externaltests.cpp @@ -1,7 +1,6 @@ /**************************************************************************** ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. ** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -35,6 +34,7 @@ ** ** ** +** ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/auto/corelib/tools/qsharedpointer/externaltests.h b/tests/auto/corelib/tools/qsharedpointer/externaltests.h index c6d68d5843..96edbd8a2b 100644 --- a/tests/auto/corelib/tools/qsharedpointer/externaltests.h +++ b/tests/auto/corelib/tools/qsharedpointer/externaltests.h @@ -1,7 +1,6 @@ /**************************************************************************** ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. ** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -35,6 +34,7 @@ ** ** ** +** ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/auto/corelib/tools/qsharedpointer/forwarddeclaration.cpp b/tests/auto/corelib/tools/qsharedpointer/forwarddeclaration.cpp index 420a041bef..6fb01c6aa2 100644 --- a/tests/auto/corelib/tools/qsharedpointer/forwarddeclaration.cpp +++ b/tests/auto/corelib/tools/qsharedpointer/forwarddeclaration.cpp @@ -1,7 +1,6 @@ /**************************************************************************** ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. ** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -35,6 +34,7 @@ ** ** ** +** ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/auto/corelib/tools/qsharedpointer/forwarddeclared.cpp b/tests/auto/corelib/tools/qsharedpointer/forwarddeclared.cpp index 91333368db..b10b7e53ba 100644 --- a/tests/auto/corelib/tools/qsharedpointer/forwarddeclared.cpp +++ b/tests/auto/corelib/tools/qsharedpointer/forwarddeclared.cpp @@ -1,7 +1,6 @@ /**************************************************************************** ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. ** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -35,6 +34,7 @@ ** ** ** +** ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/auto/corelib/tools/qsharedpointer/forwarddeclared.h b/tests/auto/corelib/tools/qsharedpointer/forwarddeclared.h index accf44bcf9..23f6dbf24c 100644 --- a/tests/auto/corelib/tools/qsharedpointer/forwarddeclared.h +++ b/tests/auto/corelib/tools/qsharedpointer/forwarddeclared.h @@ -1,7 +1,6 @@ /**************************************************************************** ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. ** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -35,6 +34,7 @@ ** ** ** +** ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp b/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp index 325918e2ca..2bae52a622 100644 --- a/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp +++ b/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp @@ -1,7 +1,6 @@ /**************************************************************************** ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. ** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -35,6 +34,7 @@ ** ** ** +** ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/auto/corelib/tools/qsharedpointer/wrapper.cpp b/tests/auto/corelib/tools/qsharedpointer/wrapper.cpp index f3416005db..9123853696 100644 --- a/tests/auto/corelib/tools/qsharedpointer/wrapper.cpp +++ b/tests/auto/corelib/tools/qsharedpointer/wrapper.cpp @@ -1,7 +1,6 @@ /**************************************************************************** ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. ** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -35,6 +34,7 @@ ** ** ** +** ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/auto/corelib/tools/qsharedpointer/wrapper.h b/tests/auto/corelib/tools/qsharedpointer/wrapper.h index 633fe4f536..98b9a804c4 100644 --- a/tests/auto/corelib/tools/qsharedpointer/wrapper.h +++ b/tests/auto/corelib/tools/qsharedpointer/wrapper.h @@ -1,7 +1,6 @@ /**************************************************************************** ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. ** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -35,6 +34,7 @@ ** ** ** +** ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/auto/corelib/tools/qsize/tst_qsize.cpp b/tests/auto/corelib/tools/qsize/tst_qsize.cpp index fa36cf3e83..be8a374a49 100644 --- a/tests/auto/corelib/tools/qsize/tst_qsize.cpp +++ b/tests/auto/corelib/tools/qsize/tst_qsize.cpp @@ -1,7 +1,6 @@ /**************************************************************************** ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. ** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -35,6 +34,7 @@ ** ** ** +** ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/auto/corelib/tools/qsizef/tst_qsizef.cpp b/tests/auto/corelib/tools/qsizef/tst_qsizef.cpp index 26c1549bd2..a098abe5b0 100644 --- a/tests/auto/corelib/tools/qsizef/tst_qsizef.cpp +++ b/tests/auto/corelib/tools/qsizef/tst_qsizef.cpp @@ -1,7 +1,6 @@ /**************************************************************************** ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. ** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -35,6 +34,7 @@ ** ** ** +** ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/auto/corelib/tools/qstl/tst_qstl.cpp b/tests/auto/corelib/tools/qstl/tst_qstl.cpp index d8d45c76b4..6fff2b7d6b 100644 --- a/tests/auto/corelib/tools/qstl/tst_qstl.cpp +++ b/tests/auto/corelib/tools/qstl/tst_qstl.cpp @@ -1,7 +1,6 @@ /**************************************************************************** ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. ** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -35,6 +34,7 @@ ** ** ** +** ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/auto/corelib/tools/qstring/double_data.h b/tests/auto/corelib/tools/qstring/double_data.h index ea5772f427..dc392723d3 100644 --- a/tests/auto/corelib/tools/qstring/double_data.h +++ b/tests/auto/corelib/tools/qstring/double_data.h @@ -1,7 +1,6 @@ /**************************************************************************** ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. ** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -35,6 +34,7 @@ ** ** ** +** ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/auto/corelib/tools/qstring/tst_qstring.cpp b/tests/auto/corelib/tools/qstring/tst_qstring.cpp index 5e95f31c2a..44c196d719 100644 --- a/tests/auto/corelib/tools/qstring/tst_qstring.cpp +++ b/tests/auto/corelib/tools/qstring/tst_qstring.cpp @@ -1,7 +1,6 @@ /**************************************************************************** ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. ** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -35,6 +34,7 @@ ** ** ** +** ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder1/stringbuilder.cpp b/tests/auto/corelib/tools/qstringbuilder/qstringbuilder1/stringbuilder.cpp index 74afecf43c..95e24b22fb 100644 --- a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder1/stringbuilder.cpp +++ b/tests/auto/corelib/tools/qstringbuilder/qstringbuilder1/stringbuilder.cpp @@ -1,7 +1,6 @@ /**************************************************************************** ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. ** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -35,6 +34,7 @@ ** ** ** +** ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder1/tst_qstringbuilder1.cpp b/tests/auto/corelib/tools/qstringbuilder/qstringbuilder1/tst_qstringbuilder1.cpp index e22b98051e..4201fc3f5c 100644 --- a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder1/tst_qstringbuilder1.cpp +++ b/tests/auto/corelib/tools/qstringbuilder/qstringbuilder1/tst_qstringbuilder1.cpp @@ -1,7 +1,6 @@ /**************************************************************************** ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. ** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite module of the Qt Toolkit. @@ -35,6 +34,7 @@ ** ** ** +** ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder2/tst_qstringbuilder2.cpp b/tests/auto/corelib/tools/qstringbuilder/qstringbuilder2/tst_qstringbuilder2.cpp index 17da90a2e8..0e8e081c46 100644 --- a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder2/tst_qstringbuilder2.cpp +++ b/tests/auto/corelib/tools/qstringbuilder/qstringbuilder2/tst_qstringbuilder2.cpp @@ -1,7 +1,6 @@ /**************************************************************************** ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. ** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite module of the Qt Toolkit. @@ -35,6 +34,7 @@ ** ** ** +** ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder3/tst_qstringbuilder3.cpp b/tests/auto/corelib/tools/qstringbuilder/qstringbuilder3/tst_qstringbuilder3.cpp index 081b039b9f..09d7f38125 100644 --- a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder3/tst_qstringbuilder3.cpp +++ b/tests/auto/corelib/tools/qstringbuilder/qstringbuilder3/tst_qstringbuilder3.cpp @@ -1,7 +1,6 @@ /**************************************************************************** ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. ** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite module of the Qt Toolkit. @@ -35,6 +34,7 @@ ** ** ** +** ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder4/tst_qstringbuilder4.cpp b/tests/auto/corelib/tools/qstringbuilder/qstringbuilder4/tst_qstringbuilder4.cpp index 819576750b..91bb07039a 100644 --- a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder4/tst_qstringbuilder4.cpp +++ b/tests/auto/corelib/tools/qstringbuilder/qstringbuilder4/tst_qstringbuilder4.cpp @@ -1,7 +1,6 @@ /**************************************************************************** ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. ** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite module of the Qt Toolkit. @@ -35,6 +34,7 @@ ** ** ** +** ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/auto/corelib/tools/qstringlist/tst_qstringlist.cpp b/tests/auto/corelib/tools/qstringlist/tst_qstringlist.cpp index 55e29b7d8f..e3eb1a21ac 100644 --- a/tests/auto/corelib/tools/qstringlist/tst_qstringlist.cpp +++ b/tests/auto/corelib/tools/qstringlist/tst_qstringlist.cpp @@ -1,7 +1,6 @@ /**************************************************************************** ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. ** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -35,6 +34,7 @@ ** ** ** +** ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/auto/corelib/tools/qstringmatcher/tst_qstringmatcher.cpp b/tests/auto/corelib/tools/qstringmatcher/tst_qstringmatcher.cpp index a985ce3e2e..ebbad86c81 100644 --- a/tests/auto/corelib/tools/qstringmatcher/tst_qstringmatcher.cpp +++ b/tests/auto/corelib/tools/qstringmatcher/tst_qstringmatcher.cpp @@ -1,7 +1,6 @@ /**************************************************************************** ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. ** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -35,6 +34,7 @@ ** ** ** +** ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/auto/corelib/tools/qstringref/tst_qstringref.cpp b/tests/auto/corelib/tools/qstringref/tst_qstringref.cpp index 2b16308e85..77d2101320 100644 --- a/tests/auto/corelib/tools/qstringref/tst_qstringref.cpp +++ b/tests/auto/corelib/tools/qstringref/tst_qstringref.cpp @@ -1,7 +1,6 @@ /**************************************************************************** ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. ** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -35,6 +34,7 @@ ** ** ** +** ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/auto/corelib/tools/qtextboundaryfinder/tst_qtextboundaryfinder.cpp b/tests/auto/corelib/tools/qtextboundaryfinder/tst_qtextboundaryfinder.cpp index 15f3416983..89dd01ac3a 100644 --- a/tests/auto/corelib/tools/qtextboundaryfinder/tst_qtextboundaryfinder.cpp +++ b/tests/auto/corelib/tools/qtextboundaryfinder/tst_qtextboundaryfinder.cpp @@ -1,7 +1,6 @@ /**************************************************************************** ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. ** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -35,6 +34,7 @@ ** ** ** +** ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/auto/corelib/tools/qtime/tst_qtime.cpp b/tests/auto/corelib/tools/qtime/tst_qtime.cpp index 299dce6878..846ff49e2e 100644 --- a/tests/auto/corelib/tools/qtime/tst_qtime.cpp +++ b/tests/auto/corelib/tools/qtime/tst_qtime.cpp @@ -1,7 +1,6 @@ /**************************************************************************** ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. ** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -35,6 +34,7 @@ ** ** ** +** ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/auto/corelib/tools/qtimeline/tst_qtimeline.cpp b/tests/auto/corelib/tools/qtimeline/tst_qtimeline.cpp index 7aed2fb3ef..f05497d7a2 100644 --- a/tests/auto/corelib/tools/qtimeline/tst_qtimeline.cpp +++ b/tests/auto/corelib/tools/qtimeline/tst_qtimeline.cpp @@ -1,7 +1,6 @@ /**************************************************************************** ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. ** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -35,6 +34,7 @@ ** ** ** +** ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/auto/corelib/tools/qvarlengtharray/tst_qvarlengtharray.cpp b/tests/auto/corelib/tools/qvarlengtharray/tst_qvarlengtharray.cpp index 2c902fc8c0..8361150d1c 100644 --- a/tests/auto/corelib/tools/qvarlengtharray/tst_qvarlengtharray.cpp +++ b/tests/auto/corelib/tools/qvarlengtharray/tst_qvarlengtharray.cpp @@ -1,7 +1,6 @@ /**************************************************************************** ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. ** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -35,6 +34,7 @@ ** ** ** +** ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/auto/corelib/tools/qvector/tst_qvector.cpp b/tests/auto/corelib/tools/qvector/tst_qvector.cpp index 2e6e5063ee..c79aee4187 100644 --- a/tests/auto/corelib/tools/qvector/tst_qvector.cpp +++ b/tests/auto/corelib/tools/qvector/tst_qvector.cpp @@ -1,7 +1,6 @@ /**************************************************************************** ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. ** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -35,6 +34,7 @@ ** ** ** +** ** $QT_END_LICENSE$ ** ****************************************************************************/ -- cgit v1.2.3 From 21b5d0e2c3dfcafcca098d285498ffc9fbbf0498 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Sun, 29 Jan 2012 19:53:30 +0100 Subject: Fix bugs when using a non 0 terminated QLatin1String A few methods in QString still assumed that QLatin1String is always 0 terminated. Change this to rely on the size provided by QLatin1String instead. Change-Id: I9145a46e52ed8811f3b4e3d72d8a81a12588760a Reviewed-by: Kevin Simons Reviewed-by: Thiago Macieira --- tests/auto/corelib/tools/qstring/tst_qstring.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests/auto/corelib/tools') diff --git a/tests/auto/corelib/tools/qstring/tst_qstring.cpp b/tests/auto/corelib/tools/qstring/tst_qstring.cpp index 44c196d719..2a949436a0 100644 --- a/tests/auto/corelib/tools/qstring/tst_qstring.cpp +++ b/tests/auto/corelib/tools/qstring/tst_qstring.cpp @@ -4798,6 +4798,13 @@ void tst_QString::compare() QCOMPARE(sign(QString::compare(s1, QLatin1String(s2.toLatin1()), Qt::CaseInsensitive)), cir); QCOMPARE(sign(QStringRef::compare(r1, QLatin1String(s2.toLatin1()))), csr); QCOMPARE(sign(QStringRef::compare(r1, QLatin1String(s2.toLatin1()), Qt::CaseInsensitive)), cir); + QByteArray l1 = s2.toLatin1(); + l1 += "x"; + QLatin1String l1str(l1.constData(), l1.size() - 1); + QCOMPARE(sign(QString::compare(s1, l1str)), csr); + QCOMPARE(sign(QString::compare(s1, l1str, Qt::CaseInsensitive)), cir); + QCOMPARE(sign(QStringRef::compare(r1, l1str)), csr); + QCOMPARE(sign(QStringRef::compare(r1, l1str, Qt::CaseInsensitive)), cir); } if (isLatin(s1)) { -- cgit v1.2.3 From 35b96c0d3d45ac991528099f4effa708bbb170e8 Mon Sep 17 00:00:00 2001 From: John Layt Date: Mon, 16 Jan 2012 20:20:39 +0000 Subject: QDateTime: Deprecate setYMD() Change-Id: I077332df554fb750666d51486c97724411276679 Reviewed-by: Thiago Macieira Reviewed-by: Lars Knoll --- tests/auto/corelib/tools/qdate/tst_qdate.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests/auto/corelib/tools') diff --git a/tests/auto/corelib/tools/qdate/tst_qdate.cpp b/tests/auto/corelib/tools/qdate/tst_qdate.cpp index 1a1c344f07..1827b4c76f 100644 --- a/tests/auto/corelib/tools/qdate/tst_qdate.cpp +++ b/tests/auto/corelib/tools/qdate/tst_qdate.cpp @@ -703,6 +703,7 @@ void tst_QDate::yearsZeroToNinetyNine() QVERIFY(QDate::isValid(1, 2, 3)); QVERIFY(QDate::isValid(-1, 2, 3)); +#if QT_DEPRECATED_SINCE(5,0) { QDate dt; dt.setYMD(1, 2, 3); @@ -710,6 +711,7 @@ void tst_QDate::yearsZeroToNinetyNine() QCOMPARE(dt.month(), 2); QCOMPARE(dt.day(), 3); } +#endif { QDate dt; -- cgit v1.2.3 From 08b5eb579f39c38c563f5f5facbd014a930bc1c5 Mon Sep 17 00:00:00 2001 From: John Layt Date: Thu, 19 Jan 2012 00:19:45 +0000 Subject: QDateTime: Add missing QDate Unit Tests Change-Id: Idcc93cdc29739f0108b5629402b6b7a4b2c86657 Reviewed-by: Thiago Macieira --- tests/auto/corelib/tools/qdate/tst_qdate.cpp | 137 +++++++++++++++++++++++++++ 1 file changed, 137 insertions(+) (limited to 'tests/auto/corelib/tools') diff --git a/tests/auto/corelib/tools/qdate/tst_qdate.cpp b/tests/auto/corelib/tools/qdate/tst_qdate.cpp index 1827b4c76f..e1f310d4fc 100644 --- a/tests/auto/corelib/tools/qdate/tst_qdate.cpp +++ b/tests/auto/corelib/tools/qdate/tst_qdate.cpp @@ -52,6 +52,14 @@ private slots: void isValid(); void julianDay_data(); void julianDay(); + void dayOfWeek_data(); + void dayOfWeek(); + void dayOfYear_data(); + void dayOfYear(); + void daysInMonth_data(); + void daysInMonth(); + void daysInYear(); + void getDate(); void weekNumber_invalid_data(); void weekNumber_invalid(); void weekNumber_data(); @@ -62,6 +70,7 @@ private slots: void addMonths(); void addYears_data(); void addYears(); + void daysTo(); void operator_eq_eq(); void operator_not_eq(); void operator_lt(); @@ -193,6 +202,126 @@ void tst_QDate::julianDay() } } +void tst_QDate::dayOfWeek_data() +{ + QTest::addColumn("year"); + QTest::addColumn("month"); + QTest::addColumn("day"); + QTest::addColumn("dayOfWeek"); + + QTest::newRow("data1") << 2000 << 1 << 3 << 1; + QTest::newRow("data2") << 2000 << 1 << 4 << 2; + QTest::newRow("data3") << 2000 << 1 << 5 << 3; + QTest::newRow("data4") << 2000 << 1 << 6 << 4; + QTest::newRow("data5") << 2000 << 1 << 7 << 5; + QTest::newRow("data6") << 2000 << 1 << 8 << 6; + QTest::newRow("data7") << 2000 << 1 << 9 << 7; + QTest::newRow("data8") << 1815 << 6 << 15 << 4; + QTest::newRow("data9") << 1815 << 6 << 15 << 4; + QTest::newRow("data10") << 1500 << 1 << 1 << 3; + QTest::newRow("data11") << -1500 << 1 << 1 << 7; + QTest::newRow("data12") << -4713 << 1 << 2 << 2; +} + +void tst_QDate::dayOfWeek() +{ + QFETCH(int, year); + QFETCH(int, month); + QFETCH(int, day); + QFETCH(int, dayOfWeek); + + QDate dt(year, month, day); + QCOMPARE(dt.dayOfWeek(), dayOfWeek); +} + +void tst_QDate::dayOfYear_data() +{ + QTest::addColumn("year"); + QTest::addColumn("month"); + QTest::addColumn("day"); + QTest::addColumn("dayOfYear"); + + QTest::newRow("data1") << 2000 << 1 << 1 << 1; + QTest::newRow("data2") << 2000 << 1 << 2 << 2; + QTest::newRow("data3") << 2000 << 1 << 3 << 3; + QTest::newRow("data4") << 2000 << 12 << 31 << 366; + QTest::newRow("data5") << 2001 << 12 << 31 << 365; + QTest::newRow("data6") << 1815 << 1 << 1 << 1; + QTest::newRow("data7") << 1815 << 12 << 31 << 365; + QTest::newRow("data8") << 1582 << 1 << 1 << 1; + QTest::newRow("data9") << 1582 << 12 << 31 << 355; + QTest::newRow("data10") << 1500 << 1 << 1 << 1; + QTest::newRow("data11") << -1500 << 12 << 31 << 365; + QTest::newRow("data12") << -4713 << 1 << 2 << 2; + QTest::newRow("data13") << -4713 << 12 << 31 << 366; +} + +void tst_QDate::dayOfYear() +{ + QFETCH(int, year); + QFETCH(int, month); + QFETCH(int, day); + QFETCH(int, dayOfYear); + + QDate dt(year, month, day); + QCOMPARE(dt.dayOfYear(), dayOfYear); +} + +void tst_QDate::daysInMonth_data() +{ + QTest::addColumn("year"); + QTest::addColumn("month"); + QTest::addColumn("day"); + QTest::addColumn("daysInMonth"); + + QTest::newRow("data1") << 2000 << 1 << 1 << 31; + QTest::newRow("data2") << 2000 << 2 << 1 << 29; + QTest::newRow("data3") << 2000 << 3 << 1 << 31; + QTest::newRow("data4") << 2000 << 4 << 1 << 30; + QTest::newRow("data5") << 2000 << 5 << 1 << 31; + QTest::newRow("data6") << 2000 << 6 << 1 << 30; + QTest::newRow("data7") << 2000 << 7 << 1 << 31; + QTest::newRow("data8") << 2000 << 8 << 1 << 31; + QTest::newRow("data9") << 2000 << 9 << 1 << 30; + QTest::newRow("data10") << 2000 << 10 << 1 << 31; + QTest::newRow("data11") << 2000 << 11 << 1 << 30; + QTest::newRow("data12") << 2000 << 12 << 1 << 31; + QTest::newRow("data13") << 2001 << 2 << 1 << 28; +} + +void tst_QDate::daysInMonth() +{ + QFETCH(int, year); + QFETCH(int, month); + QFETCH(int, day); + QFETCH(int, daysInMonth); + + QDate dt(year, month, day); + QCOMPARE(dt.daysInMonth(), daysInMonth); +} + +void tst_QDate::daysInYear() +{ + QDate dt(2000, 1, 1); + QCOMPARE(dt.daysInYear(), 366); + dt.setDate(2001, 1, 1); + QCOMPARE(dt.daysInYear(), 365); + dt.setDate(4, 1, 1); + QCOMPARE(dt.daysInYear(), 366); + dt.setDate(5, 1, 1); + QCOMPARE(dt.daysInYear(), 365); +} + +void tst_QDate::getDate() +{ + int y, m, d; + QDate dt(2000, 1, 1); + dt.getDate(&y, &m, &d); + QCOMPARE(y, 2000); + QCOMPARE(m, 1); + QCOMPARE(d, 1); +} + void tst_QDate::weekNumber_data() { QTest::addColumn("expectedWeekNum"); @@ -402,6 +531,14 @@ void tst_QDate::addYears_data() QTest::newRow( "data19" ) << -2000 << 1 << 1 << 2001 << 2 << 1 << 1; } +void tst_QDate::daysTo() +{ + QDate dt1(2000, 1, 1); + QDate dt2(2000, 1, 5); + QCOMPARE(dt1.daysTo(dt2), 4); + QCOMPARE(dt2.daysTo(dt1), -4); +} + void tst_QDate::operator_eq_eq() { QDate d1(2000,1,2); -- cgit v1.2.3 From 0e62fc73c905d1f476f3c1493db1bde8096ac609 Mon Sep 17 00:00:00 2001 From: John Layt Date: Sun, 17 Jul 2011 19:30:12 +0100 Subject: QDateTime: Add validity checks Check the validity of date/time before attempting to perform maths. Change-Id: Ia6a2caf07c6c36f7d7fac713a77bc4eb456c6ed6 Reviewed-by: Thiago Macieira --- tests/auto/corelib/tools/qdate/tst_qdate.cpp | 45 ++++++++++++++++++++++++++-- tests/auto/corelib/tools/qtime/tst_qtime.cpp | 8 +++++ 2 files changed, 51 insertions(+), 2 deletions(-) (limited to 'tests/auto/corelib/tools') diff --git a/tests/auto/corelib/tools/qdate/tst_qdate.cpp b/tests/auto/corelib/tools/qdate/tst_qdate.cpp index e1f310d4fc..72c35354bf 100644 --- a/tests/auto/corelib/tools/qdate/tst_qdate.cpp +++ b/tests/auto/corelib/tools/qdate/tst_qdate.cpp @@ -168,12 +168,24 @@ void tst_QDate::isValid() QFETCH(int, year); QFETCH(int, month); QFETCH(int, day); + QFETCH(uint, jd); + QFETCH(bool, valid); - QTEST(QDate::isValid(year, month, day), "valid"); + QCOMPARE(QDate::isValid(year, month, day), valid); QDate d; d.setDate(year, month, day); - QTEST(d.isValid(), "valid"); + QCOMPARE(d.isValid(), valid); + + if (valid) { + QCOMPARE(d.year(), year); + QCOMPARE(d.month(), month); + QCOMPARE(d.day(), day); + } else { + QCOMPARE(d.year(), 0); + QCOMPARE(d.month(), 0); + QCOMPARE(d.day(), 0); + } } void tst_QDate::julianDay_data() @@ -209,6 +221,7 @@ void tst_QDate::dayOfWeek_data() QTest::addColumn("day"); QTest::addColumn("dayOfWeek"); + QTest::newRow("data0") << 0 << 0 << 0 << 0; QTest::newRow("data1") << 2000 << 1 << 3 << 1; QTest::newRow("data2") << 2000 << 1 << 4 << 2; QTest::newRow("data3") << 2000 << 1 << 5 << 3; @@ -241,6 +254,7 @@ void tst_QDate::dayOfYear_data() QTest::addColumn("day"); QTest::addColumn("dayOfYear"); + QTest::newRow("data0") << 0 << 0 << 0 << 0; QTest::newRow("data1") << 2000 << 1 << 1 << 1; QTest::newRow("data2") << 2000 << 1 << 2 << 2; QTest::newRow("data3") << 2000 << 1 << 3 << 3; @@ -274,6 +288,7 @@ void tst_QDate::daysInMonth_data() QTest::addColumn("day"); QTest::addColumn("daysInMonth"); + QTest::newRow("data0") << 0 << 0 << 0 << 0; QTest::newRow("data1") << 2000 << 1 << 1 << 31; QTest::newRow("data2") << 2000 << 2 << 1 << 29; QTest::newRow("data3") << 2000 << 3 << 1 << 31; @@ -320,6 +335,11 @@ void tst_QDate::getDate() QCOMPARE(y, 2000); QCOMPARE(m, 1); QCOMPARE(d, 1); + dt.setDate(0, 0, 0); + dt.getDate(&y, &m, &d); + QCOMPARE(y, 0); + QCOMPARE(m, 0); + QCOMPARE(d, 0); } void tst_QDate::weekNumber_data() @@ -537,6 +557,11 @@ void tst_QDate::daysTo() QDate dt2(2000, 1, 5); QCOMPARE(dt1.daysTo(dt2), 4); QCOMPARE(dt2.daysTo(dt1), -4); + dt1.setDate(0, 0, 0); + QCOMPARE(dt1.daysTo(dt2), 0); + dt1.setDate(2000, 1, 1); + dt2.setDate(0, 0, 0); + QCOMPARE(dt1.daysTo(dt2), 0); } void tst_QDate::operator_eq_eq() @@ -916,6 +941,8 @@ void tst_QDate::roundtripGermanLocale() const void tst_QDate::shortDayName() const { + QCOMPARE(QDate::shortDayName(0), QString()); + if (QLocale::system().language() == QLocale::C) { QCOMPARE(QDate::shortDayName(1), QLatin1String("Mon")); QCOMPARE(QDate::shortDayName(7), QLatin1String("Sun")); @@ -929,6 +956,8 @@ void tst_QDate::shortDayName() const void tst_QDate::standaloneShortDayName() const { + QCOMPARE(QDate::shortDayName(0, QDate::StandaloneFormat), QString()); + if (QLocale::system().language() == QLocale::C) { QCOMPARE(QDate::shortDayName(1, QDate::StandaloneFormat), QLatin1String("Mon")); QCOMPARE(QDate::shortDayName(7, QDate::StandaloneFormat), QLatin1String("Sun")); @@ -942,6 +971,8 @@ void tst_QDate::standaloneShortDayName() const void tst_QDate::longDayName() const { + QCOMPARE(QDate::longDayName(0), QString()); + if (QLocale::system().language() == QLocale::C) { QCOMPARE(QDate::longDayName(1), QLatin1String("Monday")); QCOMPARE(QDate::longDayName(7), QLatin1String("Sunday")); @@ -955,6 +986,8 @@ void tst_QDate::longDayName() const void tst_QDate::standaloneLongDayName() const { + QCOMPARE(QDate::longDayName(0, QDate::StandaloneFormat), QString()); + if (QLocale::system().language() == QLocale::C) { QCOMPARE(QDate::longDayName(1, QDate::StandaloneFormat), QLatin1String("Monday")); QCOMPARE(QDate::longDayName(7, QDate::StandaloneFormat), QLatin1String("Sunday")); @@ -968,6 +1001,8 @@ void tst_QDate::standaloneLongDayName() const void tst_QDate::shortMonthName() const { + QCOMPARE(QDate::shortMonthName(0), QString()); + if (QLocale::system().language() == QLocale::C) { QCOMPARE(QDate::shortMonthName(1), QLatin1String("Jan")); QCOMPARE(QDate::shortMonthName(8), QLatin1String("Aug")); @@ -981,6 +1016,8 @@ void tst_QDate::shortMonthName() const void tst_QDate::standaloneShortMonthName() const { + QCOMPARE(QDate::shortMonthName(0, QDate::StandaloneFormat), QString()); + if (QLocale::system().language() == QLocale::C) { QCOMPARE(QDate::shortMonthName(1, QDate::StandaloneFormat), QLatin1String("Jan")); QCOMPARE(QDate::shortMonthName(8, QDate::StandaloneFormat), QLatin1String("Aug")); @@ -994,6 +1031,8 @@ void tst_QDate::standaloneShortMonthName() const void tst_QDate::longMonthName() const { + QCOMPARE(QDate::longMonthName(0), QString()); + if (QLocale::system().language() == QLocale::C) { QCOMPARE(QDate::longMonthName(1), QLatin1String("January")); QCOMPARE(QDate::longMonthName(8), QLatin1String("August")); @@ -1007,6 +1046,8 @@ void tst_QDate::longMonthName() const void tst_QDate::standaloneLongMonthName() const { + QCOMPARE(QDate::longMonthName(0, QDate::StandaloneFormat), QString()); + if (QLocale::system().language() == QLocale::C) { QCOMPARE(QDate::longMonthName(1, QDate::StandaloneFormat), QLatin1String("January")); QCOMPARE(QDate::longMonthName(8, QDate::StandaloneFormat), QLatin1String("August")); diff --git a/tests/auto/corelib/tools/qtime/tst_qtime.cpp b/tests/auto/corelib/tools/qtime/tst_qtime.cpp index 846ff49e2e..d8f72dffdb 100644 --- a/tests/auto/corelib/tools/qtime/tst_qtime.cpp +++ b/tests/auto/corelib/tools/qtime/tst_qtime.cpp @@ -242,6 +242,7 @@ void tst_QTime::hour_data() QTest::newRow( "data2" ) << 1 << 2 << 3 << 4; QTest::newRow( "data3" ) << 2 << 12 << 13 << 65; QTest::newRow( "data4" ) << 23 << 59 << 59 << 999; + QTest::newRow( "data5" ) << -1 << -1 << -1 << -1; } void tst_QTime::hour() @@ -271,6 +272,7 @@ void tst_QTime::setHMS_data() QTest::newRow( "data4" ) << 23 << 0 << 0; QTest::newRow( "data5" ) << 23 << 59 << 0; QTest::newRow( "data6" ) << 23 << 59 << 59; + QTest::newRow( "data7" ) << -1 << -1 << -1; } void tst_QTime::setHMS() @@ -296,6 +298,9 @@ void tst_QTime::secsTo_data() QTest::newRow( "data1" ) << QTime(0,0,0) << QTime(0,1,0) << 60; QTest::newRow( "data2" ) << QTime(0,0,0) << QTime(0,10,0) << 600; QTest::newRow( "data3" ) << QTime(0,0,0) << QTime(23,59,59) << 86399; + QTest::newRow( "data4" ) << QTime(-1, -1, -1) << QTime(0, 0, 0) << 0; + QTest::newRow( "data5" ) << QTime(0, 0, 0) << QTime(-1, -1, -1) << 0; + QTest::newRow( "data6" ) << QTime(-1, -1, -1) << QTime(-1, -1, -1) << 0; } void tst_QTime::secsTo() @@ -317,6 +322,9 @@ void tst_QTime::msecsTo_data() QTest::newRow( "data1" ) << QTime(0,0,0,0) << QTime(0,0,1,0) << 1000; QTest::newRow( "data2" ) << QTime(0,0,0,0) << QTime(0,0,10,0) << 10000; QTest::newRow( "data3" ) << QTime(0,0,0,0) << QTime(23,59,59,0) << 86399000; + QTest::newRow( "data4" ) << QTime(-1, -1, -1, -1) << QTime(0, 0, 0, 0) << 0; + QTest::newRow( "data5" ) << QTime(0, 0, 0, 0) << QTime(-1, -1, -1, -1) << 0; + QTest::newRow( "data6" ) << QTime(-1, -1, -1, -1) << QTime(-1, -1, -1, -1) << 0; } void tst_QTime::msecsTo() -- cgit v1.2.3 From 3855233dab82946ba50ddd90ce86df035998da8e Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Tue, 24 Jan 2012 22:26:31 +0100 Subject: Remove many deprecated methods MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove methods that have been marked as deprecated before Qt 4.6. Keep others, but inline them where possible and mark them as QT_DEPRECATED_SINCE(5, 0). Change-Id: If881821ae095f054b31cc13464f19e2007c20ed7 Reviewed-by: Thiago Macieira Reviewed-by: João Abecasis --- tests/auto/corelib/tools/qregexp/tst_qregexp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/auto/corelib/tools') diff --git a/tests/auto/corelib/tools/qregexp/tst_qregexp.cpp b/tests/auto/corelib/tools/qregexp/tst_qregexp.cpp index 53e9ccc6fd..0148e933e4 100644 --- a/tests/auto/corelib/tools/qregexp/tst_qregexp.cpp +++ b/tests/auto/corelib/tools/qregexp/tst_qregexp.cpp @@ -1311,7 +1311,7 @@ void tst_QRegExp::posAndCapConsistency() QFETCH( QString, cap2 ); QRegExp re(reStr); - QCOMPARE(re.numCaptures(), 2); + QCOMPARE(re.captureCount(), 2); QCOMPARE(re.capturedTexts().size(), 3); QCOMPARE(re.indexIn(text), matchIndex); -- cgit v1.2.3 From ec9833388f514ac8050cc945e494e448dae545ea Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Wed, 1 Feb 2012 17:37:02 +0100 Subject: Fix operator==(QLatin1String, QLatin1String) and friends for substrings QLatin1String now has a constructor that takes explicit length, which makes it possible to create a QLatin1String that isn't null-terminated. Made the QLatin1String comparison operators work in that case. Change-Id: I234ba851e67a6f5cfbb46fb6f0b22623ce40be28 Reviewed-by: Lars Knoll --- tests/auto/corelib/tools/qstring/tst_qstring.cpp | 83 ++++++++++++++++++++++++ 1 file changed, 83 insertions(+) (limited to 'tests/auto/corelib/tools') diff --git a/tests/auto/corelib/tools/qstring/tst_qstring.cpp b/tests/auto/corelib/tools/qstring/tst_qstring.cpp index 2a949436a0..f3ff6e08e2 100644 --- a/tests/auto/corelib/tools/qstring/tst_qstring.cpp +++ b/tests/auto/corelib/tools/qstring/tst_qstring.cpp @@ -222,6 +222,7 @@ private slots: void toHtmlEscaped(); void operatorGreaterWithQLatin1String(); + void compareQLatin1Strings(); }; typedef QList IntList; @@ -5194,6 +5195,88 @@ void tst_QString::operatorGreaterWithQLatin1String() QVERIFY(!(stringfoo < latin1foo)); } +void tst_QString::compareQLatin1Strings() +{ + QLatin1String abc("abc"); + QLatin1String abcd("abcd"); + QLatin1String cba("cba"); + QLatin1String de("de"); + + QVERIFY(abc == abc); + QVERIFY(!(abc == cba)); + QVERIFY(!(cba == abc)); + QVERIFY(!(abc == abcd)); + QVERIFY(!(abcd == abc)); + + QVERIFY(abc != cba); + QVERIFY(!(abc != abc)); + QVERIFY(cba != abc); + QVERIFY(abc != abcd); + QVERIFY(abcd != abc); + + QVERIFY(abc < abcd); + QVERIFY(abc < cba); + QVERIFY(abc < de); + QVERIFY(abcd < cba); + QVERIFY(!(abc < abc)); + QVERIFY(!(abcd < abc)); + QVERIFY(!(de < cba)); + + QVERIFY(abcd > abc); + QVERIFY(cba > abc); + QVERIFY(de > abc); + QVERIFY(!(abc > abc)); + QVERIFY(!(abc > abcd)); + QVERIFY(!(abcd > cba)); + + QVERIFY(abc <= abc); + QVERIFY(abc <= abcd); + QVERIFY(abc <= cba); + QVERIFY(abc <= de); + QVERIFY(!(abcd <= abc)); + QVERIFY(!(cba <= abc)); + QVERIFY(!(cba <= abcd)); + QVERIFY(!(de <= abc)); + + QVERIFY(abc >= abc); + QVERIFY(abcd >= abc); + QVERIFY(!(abc >= abcd)); + QVERIFY(cba >= abc); + QVERIFY(!(abc >= cba)); + QVERIFY(de >= abc); + QVERIFY(!(abc >= de)); + + QLatin1String subfoo("fooZZ", 3); + QLatin1String foo("foo"); + QVERIFY(subfoo == foo); + QVERIFY(foo == subfoo); + QVERIFY(!(subfoo != foo)); + QVERIFY(!(foo != subfoo)); + QVERIFY(!(foo < subfoo)); + QVERIFY(!(subfoo < foo)); + QVERIFY(foo >= subfoo); + QVERIFY(subfoo >= foo); + QVERIFY(!(foo > subfoo)); + QVERIFY(!(subfoo > foo)); + QVERIFY(foo <= subfoo); + QVERIFY(subfoo <= foo); + + QLatin1String subabc("abcZZ", 3); + QLatin1String subab("abcZZ", 2); + QVERIFY(subabc != subab); + QVERIFY(subab != subabc); + QVERIFY(!(subabc == subab)); + QVERIFY(!(subab == subabc)); + QVERIFY(subab < subabc); + QVERIFY(!(subabc < subab)); + QVERIFY(subabc > subab); + QVERIFY(!(subab > subabc)); + QVERIFY(subab <= subabc); + QVERIFY(!(subabc <= subab)); + QVERIFY(subabc >= subab); + QVERIFY(!(subab >= subabc)); +} + QTEST_APPLESS_MAIN(tst_QString) #include "tst_qstring.moc" -- cgit v1.2.3 From 35b19be4784a65894ac9dfe64a6c036b95b06304 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Wed, 1 Feb 2012 20:15:24 +0100 Subject: Fix QString(QLatin1String) constructor for substrings QLatin1String now has a constructor that takes explicit length, which makes it possible to create a QLatin1String that isn't null-terminated. Made the QString(QLatin1String) constructor work in that case. Change-Id: I4f4f07a956144b7ea4aa9c58a61c755fb99ef1b3 Reviewed-by: Lars Knoll --- tests/auto/corelib/tools/qstring/tst_qstring.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests/auto/corelib/tools') diff --git a/tests/auto/corelib/tools/qstring/tst_qstring.cpp b/tests/auto/corelib/tools/qstring/tst_qstring.cpp index f3ff6e08e2..781377f574 100644 --- a/tests/auto/corelib/tools/qstring/tst_qstring.cpp +++ b/tests/auto/corelib/tools/qstring/tst_qstring.cpp @@ -223,6 +223,7 @@ private slots: void operatorGreaterWithQLatin1String(); void compareQLatin1Strings(); + void fromQLatin1StringWithLength(); }; typedef QList IntList; @@ -5277,6 +5278,14 @@ void tst_QString::compareQLatin1Strings() QVERIFY(!(subab >= subabc)); } +void tst_QString::fromQLatin1StringWithLength() +{ + QLatin1String latin1foo("foobar", 3); + QString foo(latin1foo); + QCOMPARE(foo.size(), latin1foo.size()); + QCOMPARE(foo, QString::fromLatin1("foo")); +} + QTEST_APPLESS_MAIN(tst_QString) #include "tst_qstring.moc" -- cgit v1.2.3 From 4b1ba7c7928b4b326eb83e6df6f0b8fb93f2edf0 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Wed, 1 Feb 2012 21:08:30 +0100 Subject: Fix QString::operator=(QLatin1String) for substrings QLatin1String now has a constructor that takes explicit length, which makes it possible to create a QLatin1String that isn't null-terminated. Made QString::operator=(QLatin1String) work in that case. Change-Id: Ie77eabd2f8f036531d67cd8051a7b6305b386ccf Reviewed-by: Lars Knoll --- tests/auto/corelib/tools/qstring/tst_qstring.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'tests/auto/corelib/tools') diff --git a/tests/auto/corelib/tools/qstring/tst_qstring.cpp b/tests/auto/corelib/tools/qstring/tst_qstring.cpp index 781377f574..dae1dc45ba 100644 --- a/tests/auto/corelib/tools/qstring/tst_qstring.cpp +++ b/tests/auto/corelib/tools/qstring/tst_qstring.cpp @@ -224,6 +224,7 @@ private slots: void operatorGreaterWithQLatin1String(); void compareQLatin1Strings(); void fromQLatin1StringWithLength(); + void assignQLatin1String(); }; typedef QList IntList; @@ -5286,6 +5287,28 @@ void tst_QString::fromQLatin1StringWithLength() QCOMPARE(foo, QString::fromLatin1("foo")); } +void tst_QString::assignQLatin1String() +{ + QString empty = QLatin1String(""); + QVERIFY(empty.isEmpty()); + QVERIFY(!empty.isNull()); + + QString null = QLatin1String(0); + QVERIFY(null.isEmpty()); + QVERIFY(null.isNull()); + + QLatin1String latin1foo("foo"); + QString foo = latin1foo; + QCOMPARE(foo.size(), latin1foo.size()); + QCOMPARE(foo, QString::fromLatin1("foo")); + + QLatin1String latin1subfoo("foobar", 3); + foo = latin1subfoo; + QCOMPARE(foo.size(), latin1subfoo.size()); + QCOMPARE(foo, QString::fromLatin1("foo")); + +} + QTEST_APPLESS_MAIN(tst_QString) #include "tst_qstring.moc" -- cgit v1.2.3 From e1f1d0e5a1e1ac692d3d98e72ef4a317a3e32751 Mon Sep 17 00:00:00 2001 From: Kurt Korbatits Date: Wed, 1 Feb 2012 13:33:08 +1000 Subject: Fixed qsharedpointer unittest on windows - Use source file location as working directory for externaltests Change-Id: Ic05259f48eece920b348ccbde9ba80c90dedfdd2 Reviewed-by: Rohan McGovern --- tests/auto/corelib/tools/qsharedpointer/externaltests.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tests/auto/corelib/tools') diff --git a/tests/auto/corelib/tools/qsharedpointer/externaltests.cpp b/tests/auto/corelib/tools/qsharedpointer/externaltests.cpp index df8c1678bd..fb946d9ca1 100644 --- a/tests/auto/corelib/tools/qsharedpointer/externaltests.cpp +++ b/tests/auto/corelib/tools/qsharedpointer/externaltests.cpp @@ -465,7 +465,11 @@ namespace QTest { "SOURCES += project.cpp\n" "QT -= core gui\n" "INCLUDEPATH += . "); - projectFile.write(QFile::encodeName(QDir::currentPath())); + + QString workingDir = QDir::currentPath(); + if (extraProgramSources.count() > 0) + workingDir = QFileInfo(extraProgramSources.first()).absolutePath(); + projectFile.write(QFile::encodeName(workingDir)); #ifndef QT_NO_DEBUG projectFile.write("\nCONFIG += debug\n"); -- cgit v1.2.3 From 8327fa7c11f6c84ccc66be4365ee282a76288788 Mon Sep 17 00:00:00 2001 From: John Layt Date: Thu, 25 Aug 2011 07:54:16 +0100 Subject: QDateTime: Store Julian Day as qint64 Store the QDate Julian Day number as an qint64 instead of uint32 to enable support for dates before 2 January 4713 BCE. This changes the possible date range to be approx 2.5 Quadrillion BC to 2.5 Quadrillion AD. A qint32 was not used as it only covers 5 million BCE to 5 million CE which does include Geological or Astronomical time. The effective supported date range is currently 4800 BCE to 1.4 million CE due to restrictions in existing conversion formulas. The effective range will be extended later with new formulas. Change-Id: Ib4345369455b31d4edae8c933b7721e76414e914 Reviewed-by: Thiago Macieira --- tests/auto/corelib/tools/qdate/tst_qdate.cpp | 279 ++++++++++++++++----- .../auto/corelib/tools/qdatetime/tst_qdatetime.cpp | 12 +- 2 files changed, 216 insertions(+), 75 deletions(-) (limited to 'tests/auto/corelib/tools') diff --git a/tests/auto/corelib/tools/qdate/tst_qdate.cpp b/tests/auto/corelib/tools/qdate/tst_qdate.cpp index 72c35354bf..4ce2a51902 100644 --- a/tests/auto/corelib/tools/qdate/tst_qdate.cpp +++ b/tests/auto/corelib/tools/qdate/tst_qdate.cpp @@ -48,6 +48,8 @@ class tst_QDate : public QObject Q_OBJECT private slots: void toString(); + void isNull_data(); + void isNull(); void isValid_data(); void isValid(); void julianDay_data(); @@ -64,6 +66,7 @@ private slots: void weekNumber_invalid(); void weekNumber_data(); void weekNumber(); + void julianDaysLimits(); void addDays_data(); void addDays(); void addMonths_data(); @@ -101,66 +104,92 @@ private slots: Q_DECLARE_METATYPE(QDate) +void tst_QDate::isNull_data() +{ + QTest::addColumn("jd"); + QTest::addColumn("null"); + + qint64 minJd = std::numeric_limits::min() / 2; + qint64 maxJd = std::numeric_limits::max() / 2; + + QTest::newRow("qint64 min") << std::numeric_limits::min() << true; + QTest::newRow("minJd - 1") << minJd - 1 << true; + QTest::newRow("minJd") << minJd << false; + QTest::newRow("minJd + 1") << minJd + 1 << false; + QTest::newRow("maxJd - 1") << maxJd - 1 << false; + QTest::newRow("maxJd") << maxJd << false; + QTest::newRow("maxJd + 1") << maxJd + 1 << true; + QTest::newRow("qint64 max") << std::numeric_limits::max() << true; +} + +void tst_QDate::isNull() +{ + QFETCH(qint64, jd); + + QDate d = QDate::fromJulianDay(jd); + QTEST(d.isNull(), "null"); +} + void tst_QDate::isValid_data() { + qint64 nullJd = std::numeric_limits::min(); + QTest::addColumn("year"); QTest::addColumn("month"); QTest::addColumn("day"); - QTest::addColumn("jd"); + QTest::addColumn("jd"); QTest::addColumn("valid"); - QTest::newRow("0-0-0") << 0 << 0 << 0 << 0U << false; - QTest::newRow("month 0") << 2000 << 0 << 1 << 0U << false; - QTest::newRow("day 0") << 2000 << 1 << 0 << 0U << false; + QTest::newRow("0-0-0") << 0 << 0 << 0 << nullJd << false; + QTest::newRow("month 0") << 2000 << 0 << 1 << nullJd << false; + QTest::newRow("day 0") << 2000 << 1 << 0 << nullJd << false; - QTest::newRow("month 13") << 2000 << 13 << 1 << 0U << false; + QTest::newRow("month 13") << 2000 << 13 << 1 << nullJd << false; // test leap years - QTest::newRow("non-leap") << 2006 << 2 << 29 << 0U << false; - QTest::newRow("normal leap") << 2004 << 2 << 29 << 2453065U << true; - QTest::newRow("century leap") << 1900 << 2 << 29 << 0U << false; - QTest::newRow("century leap") << 2100 << 2 << 29 << 0U << false; - QTest::newRow("400-years leap") << 2000 << 2 << 29 << 2451604U << true; - QTest::newRow("400-years leap 2") << 2400 << 2 << 29 << 2597701U << true; - QTest::newRow("400-years leap 3") << 1600 << 2 << 29 << 2305507U << true; - QTest::newRow("year 0") << 0 << 2 << 27 << 0U << false; + QTest::newRow("non-leap") << 2006 << 2 << 29 << nullJd << false; + QTest::newRow("normal leap") << 2004 << 2 << 29 << qint64(2453065) << true; + QTest::newRow("century leap") << 1900 << 2 << 29 << nullJd << false; + QTest::newRow("century leap") << 2100 << 2 << 29 << nullJd << false; + QTest::newRow("400-years leap") << 2000 << 2 << 29 << qint64(2451604) << true; + QTest::newRow("400-years leap 2") << 2400 << 2 << 29 << qint64(2597701) << true; + QTest::newRow("400-years leap 3") << 1600 << 2 << 29 << qint64(2305507) << true; + QTest::newRow("year 0") << 0 << 2 << 27 << nullJd << false; // test the number of days in months: - QTest::newRow("jan") << 2000 << 1 << 31 << 2451575U << true; - QTest::newRow("feb") << 2000 << 2 << 29 << 2451604U << true; // same data as 400-years leap - QTest::newRow("mar") << 2000 << 3 << 31 << 2451635U << true; - QTest::newRow("apr") << 2000 << 4 << 30 << 2451665U << true; - QTest::newRow("may") << 2000 << 5 << 31 << 2451696U << true; - QTest::newRow("jun") << 2000 << 6 << 30 << 2451726U << true; - QTest::newRow("jul") << 2000 << 7 << 31 << 2451757U << true; - QTest::newRow("aug") << 2000 << 8 << 31 << 2451788U << true; - QTest::newRow("sep") << 2000 << 9 << 30 << 2451818U << true; - QTest::newRow("oct") << 2000 << 10 << 31 << 2451849U << true; - QTest::newRow("nov") << 2000 << 11 << 30 << 2451879U << true; - QTest::newRow("dec") << 2000 << 12 << 31 << 2451910U << true; + QTest::newRow("jan") << 2000 << 1 << 31 << qint64(2451575) << true; + QTest::newRow("feb") << 2000 << 2 << 29 << qint64(2451604) << true; // same data as 400-years leap + QTest::newRow("mar") << 2000 << 3 << 31 << qint64(2451635) << true; + QTest::newRow("apr") << 2000 << 4 << 30 << qint64(2451665) << true; + QTest::newRow("may") << 2000 << 5 << 31 << qint64(2451696) << true; + QTest::newRow("jun") << 2000 << 6 << 30 << qint64(2451726) << true; + QTest::newRow("jul") << 2000 << 7 << 31 << qint64(2451757) << true; + QTest::newRow("aug") << 2000 << 8 << 31 << qint64(2451788) << true; + QTest::newRow("sep") << 2000 << 9 << 30 << qint64(2451818) << true; + QTest::newRow("oct") << 2000 << 10 << 31 << qint64(2451849) << true; + QTest::newRow("nov") << 2000 << 11 << 30 << qint64(2451879) << true; + QTest::newRow("dec") << 2000 << 12 << 31 << qint64(2451910) << true; // and invalid dates: - QTest::newRow("ijan") << 2000 << 1 << 32 << 0U << false; - QTest::newRow("ifeb") << 2000 << 2 << 30 << 0U << false; - QTest::newRow("imar") << 2000 << 3 << 32 << 0U << false; - QTest::newRow("iapr") << 2000 << 4 << 31 << 0U << false; - QTest::newRow("imay") << 2000 << 5 << 32 << 0U << false; - QTest::newRow("ijun") << 2000 << 6 << 31 << 0U << false; - QTest::newRow("ijul") << 2000 << 7 << 32 << 0U << false; - QTest::newRow("iaug") << 2000 << 8 << 32 << 0U << false; - QTest::newRow("isep") << 2000 << 9 << 31 << 0U << false; - QTest::newRow("ioct") << 2000 << 10 << 32 << 0U << false; - QTest::newRow("inov") << 2000 << 11 << 31 << 0U << false; - QTest::newRow("idec") << 2000 << 12 << 32 << 0U << false; + QTest::newRow("ijan") << 2000 << 1 << 32 << nullJd << false; + QTest::newRow("ifeb") << 2000 << 2 << 30 << nullJd << false; + QTest::newRow("imar") << 2000 << 3 << 32 << nullJd << false; + QTest::newRow("iapr") << 2000 << 4 << 31 << nullJd << false; + QTest::newRow("imay") << 2000 << 5 << 32 << nullJd << false; + QTest::newRow("ijun") << 2000 << 6 << 31 << nullJd << false; + QTest::newRow("ijul") << 2000 << 7 << 32 << nullJd << false; + QTest::newRow("iaug") << 2000 << 8 << 32 << nullJd << false; + QTest::newRow("isep") << 2000 << 9 << 31 << nullJd << false; + QTest::newRow("ioct") << 2000 << 10 << 32 << nullJd << false; + QTest::newRow("inov") << 2000 << 11 << 31 << nullJd << false; + QTest::newRow("idec") << 2000 << 12 << 32 << nullJd << false; // the beginning of the Julian Day calendar: - QTest::newRow("jd negative1") << -4714 << 1 << 1 << 0U << false; - QTest::newRow("jd negative2") << -4713 << 1 << 1 << 0U << false; - QTest::newRow("jd negative3") << -4713 << 1 << 2 << 1U << true; - QTest::newRow("jd negative4") << -4713 << 1 << 3 << 2U << true; - QTest::newRow("jd 0") << -4713 << 1 << 1 << 0U << false; - QTest::newRow("jd 1") << -4713 << 1 << 2 << 1U << true; - QTest::newRow("imminent overflow") << 11754508 << 12 << 13 << 4294967295U << true; + QTest::newRow("jd earliest formula") << -4800 << 1 << 1 << qint64( -31776) << true; + QTest::newRow("jd -1") << -4714 << 12 << 31 << qint64( -1) << true; + QTest::newRow("jd 0") << -4713 << 1 << 1 << qint64( 0) << true; + QTest::newRow("jd 1") << -4713 << 1 << 2 << qint64( 1) << true; + QTest::newRow("jd latest formula") << 1400000 << 12 << 31 << qint64(513060925) << true; } void tst_QDate::isValid() @@ -168,7 +197,7 @@ void tst_QDate::isValid() QFETCH(int, year); QFETCH(int, month); QFETCH(int, day); - QFETCH(uint, jd); + QFETCH(qint64, jd); QFETCH(bool, valid); QCOMPARE(QDate::isValid(year, month, day), valid); @@ -176,6 +205,7 @@ void tst_QDate::isValid() QDate d; d.setDate(year, month, day); QCOMPARE(d.isValid(), valid); + QCOMPARE(d.toJulianDay(), jd); if (valid) { QCOMPARE(d.year(), year); @@ -198,15 +228,15 @@ void tst_QDate::julianDay() QFETCH(int, year); QFETCH(int, month); QFETCH(int, day); - QFETCH(uint, jd); + QFETCH(qint64, jd); { QDate d; d.setDate(year, month, day); - QCOMPARE(uint(d.toJulianDay()), jd); + QCOMPARE(d.toJulianDay(), jd); } - if (jd) { + if (jd != std::numeric_limits::min()) { QDate d = QDate::fromJulianDay(jd); QCOMPARE(d.year(), year); QCOMPARE(d.month(), month); @@ -233,7 +263,15 @@ void tst_QDate::dayOfWeek_data() QTest::newRow("data9") << 1815 << 6 << 15 << 4; QTest::newRow("data10") << 1500 << 1 << 1 << 3; QTest::newRow("data11") << -1500 << 1 << 1 << 7; - QTest::newRow("data12") << -4713 << 1 << 2 << 2; + QTest::newRow("data12") << -4800 << 1 << 1 << 5; + QTest::newRow("data13") << -4800 << 1 << 4 << 1; + QTest::newRow("data14") << -4800 << 1 << 5 << 2; + QTest::newRow("data15") << -4800 << 1 << 6 << 3; + QTest::newRow("data16") << -4800 << 1 << 7 << 4; + QTest::newRow("data17") << -4800 << 1 << 8 << 5; + QTest::newRow("data18") << -4800 << 1 << 9 << 6; + QTest::newRow("data19") << -4800 << 1 << 10 << 7; + QTest::newRow("data20") << -4800 << 1 << 11 << 1; } void tst_QDate::dayOfWeek() @@ -266,8 +304,8 @@ void tst_QDate::dayOfYear_data() QTest::newRow("data9") << 1582 << 12 << 31 << 355; QTest::newRow("data10") << 1500 << 1 << 1 << 1; QTest::newRow("data11") << -1500 << 12 << 31 << 365; - QTest::newRow("data12") << -4713 << 1 << 2 << 2; - QTest::newRow("data13") << -4713 << 12 << 31 << 366; + QTest::newRow("data12") << -4800 << 1 << 1 << 1; + QTest::newRow("data13") << -4800 << 12 << 31 << 365; } void tst_QDate::dayOfYear() @@ -393,6 +431,68 @@ void tst_QDate::weekNumber_invalid() QCOMPARE( dt.weekNumber( &yearNumber ), 0 ); } +void tst_QDate::julianDaysLimits() +{ + qint64 min = std::numeric_limits::min(); + qint64 max = std::numeric_limits::max(); + qint64 minJd = std::numeric_limits::min() / 2; + qint64 maxJd = std::numeric_limits::max() / 2; + + QDate maxDate = QDate::fromJulianDay(maxJd); + QDate minDate = QDate::fromJulianDay(minJd); + QDate zeroDate = QDate::fromJulianDay(0); + + QDate dt = QDate::fromJulianDay(min); + QCOMPARE(dt.isValid(), false); + dt = QDate::fromJulianDay(minJd - 1); + QCOMPARE(dt.isValid(), false); + dt = QDate::fromJulianDay(minJd); + QCOMPARE(dt.isValid(), true); + dt = QDate::fromJulianDay(minJd + 1); + QCOMPARE(dt.isValid(), true); + dt = QDate::fromJulianDay(maxJd - 1); + QCOMPARE(dt.isValid(), true); + dt = QDate::fromJulianDay(maxJd); + QCOMPARE(dt.isValid(), true); + dt = QDate::fromJulianDay(maxJd + 1); + QCOMPARE(dt.isValid(), false); + dt = QDate::fromJulianDay(max); + QCOMPARE(dt.isValid(), false); + + dt = maxDate.addDays(1); + QCOMPARE(dt.isValid(), false); + dt = maxDate.addDays(0); + QCOMPARE(dt.isValid(), true); + dt = maxDate.addDays(-1); + QCOMPARE(dt.isValid(), true); + dt = maxDate.addDays(max); + QCOMPARE(dt.isValid(), false); + dt = maxDate.addDays(min); + QCOMPARE(dt.isValid(), false); + + dt = minDate.addDays(-1); + QCOMPARE(dt.isValid(), false); + dt = minDate.addDays(0); + QCOMPARE(dt.isValid(), true); + dt = minDate.addDays(1); + QCOMPARE(dt.isValid(), true); + dt = minDate.addDays(min); + QCOMPARE(dt.isValid(), false); + dt = minDate.addDays(max); + QCOMPARE(dt.isValid(), true); + + dt = zeroDate.addDays(-1); + QCOMPARE(dt.isValid(), true); + dt = zeroDate.addDays(0); + QCOMPARE(dt.isValid(), true); + dt = zeroDate.addDays(1); + QCOMPARE(dt.isValid(), true); + dt = zeroDate.addDays(min); + QCOMPARE(dt.isValid(), false); + dt = zeroDate.addDays(max); + QCOMPARE(dt.isValid(), false); +} + void tst_QDate::addDays() { QFETCH( int, year ); @@ -435,9 +535,8 @@ void tst_QDate::addDays_data() QTest::newRow( "data10" ) << 2000 << 2 << 28 << -1 << 2000 << 2 << 27; QTest::newRow( "data11" ) << 2001 << 2 << 28 << -30 << 2001 << 1 << 29; - QDate invalid; - QTest::newRow( "data12" ) << -4713 << 1 << 2 << -2 - << invalid.year() << invalid.month() << invalid.day(); + QTest::newRow( "data12" ) << -4713 << 1 << 2 << -2 << -4714 << 12 << 31; + QTest::newRow( "data13" ) << -4713 << 1 << 2 << 2 << -4713 << 1 << 4; } void tst_QDate::addMonths() @@ -553,15 +652,31 @@ void tst_QDate::addYears_data() void tst_QDate::daysTo() { + qint64 minJd = std::numeric_limits::min() / 2; + qint64 maxJd = std::numeric_limits::max() / 2; + QDate dt1(2000, 1, 1); QDate dt2(2000, 1, 5); - QCOMPARE(dt1.daysTo(dt2), 4); - QCOMPARE(dt2.daysTo(dt1), -4); + QCOMPARE(dt1.daysTo(dt2), (qint64) 4); + QCOMPARE(dt2.daysTo(dt1), (qint64) -4); + dt1.setDate(0, 0, 0); - QCOMPARE(dt1.daysTo(dt2), 0); + QCOMPARE(dt1.daysTo(dt2), (qint64) 0); dt1.setDate(2000, 1, 1); dt2.setDate(0, 0, 0); - QCOMPARE(dt1.daysTo(dt2), 0); + QCOMPARE(dt1.daysTo(dt2), (qint64) 0); + + + QDate maxDate = QDate::fromJulianDay(maxJd); + QDate minDate = QDate::fromJulianDay(minJd); + QDate zeroDate = QDate::fromJulianDay(0); + + QCOMPARE(maxDate.daysTo(minDate), minJd - maxJd); + QCOMPARE(minDate.daysTo(maxDate), maxJd - minJd); + QCOMPARE(maxDate.daysTo(zeroDate), -maxJd); + QCOMPARE(zeroDate.daysTo(maxDate), maxJd); + QCOMPARE(minDate.daysTo(zeroDate), -minJd); + QCOMPARE(zeroDate.daysTo(minDate), minJd); } void tst_QDate::operator_eq_eq() @@ -798,6 +913,8 @@ void tst_QDate::toString_format() void tst_QDate::isLeapYear() { + QVERIFY(QDate::isLeapYear(-4801)); + QVERIFY(!QDate::isLeapYear(-4800)); QVERIFY(QDate::isLeapYear(-4445)); QVERIFY(!QDate::isLeapYear(-4444)); QVERIFY(!QDate::isLeapYear(-6)); @@ -1065,28 +1182,52 @@ void tst_QDate::roundtrip() const // year(), month(), day(), julianDayFromDate(), and getDateFromJulianDay() // to ensure they are internally consistent (but doesn't guarantee correct) - // Test Julian round trip in both BC and AD + // Test Julian round trip around JD 0 and current low end of valid range QDate testDate; - QDate loopDate = QDate::fromJulianDay(1684899); // 1 Jan 100 BC - while ( loopDate.toJulianDay() <= 1757948 ) { // 31 Dec 100 AD - testDate.setDate( loopDate.year(), loopDate.month(), loopDate.day() ); - QCOMPARE( loopDate.toJulianDay(), testDate.toJulianDay() ); + QDate loopDate = QDate::fromJulianDay(-31776); // 1 Jan 4800 BC + while (loopDate.toJulianDay() <= 5113) { // 31 Dec 4700 AD + testDate.setDate(loopDate.year(), loopDate.month(), loopDate.day()); + QCOMPARE(loopDate.toJulianDay(), testDate.toJulianDay()); + loopDate = loopDate.addDays(1); + } + + // Test Julian round trip in both BC and AD + loopDate = QDate::fromJulianDay(1684899); // 1 Jan 100 BC + while (loopDate.toJulianDay() <= 1757948) { // 31 Dec 100 AD + testDate.setDate(loopDate.year(), loopDate.month(), loopDate.day()); + QCOMPARE(loopDate.toJulianDay(), testDate.toJulianDay()); loopDate = loopDate.addDays(1); } // Test Julian and Gregorian round trip during changeover period loopDate = QDate::fromJulianDay(2298153); // 1 Jan 1580 AD - while ( loopDate.toJulianDay() <= 2300334 ) { // 31 Dec 1585 AD - testDate.setDate( loopDate.year(), loopDate.month(), loopDate.day() ); - QCOMPARE( loopDate.toJulianDay(), testDate.toJulianDay() ); + while (loopDate.toJulianDay() <= 2300334) { // 31 Dec 1585 AD + testDate.setDate(loopDate.year(), loopDate.month(), loopDate.day()); + QCOMPARE(loopDate.toJulianDay(), testDate.toJulianDay()); loopDate = loopDate.addDays(1); } // Test Gregorian round trip during current useful period loopDate = QDate::fromJulianDay(2378497); // 1 Jan 1900 AD - while ( loopDate.toJulianDay() <= 2488433 ) { // 31 Dec 2100 AD - testDate.setDate( loopDate.year(), loopDate.month(), loopDate.day() ); - QCOMPARE( loopDate.toJulianDay(), testDate.toJulianDay() ); + while (loopDate.toJulianDay() <= 2488433) { // 31 Dec 2100 AD + testDate.setDate(loopDate.year(), loopDate.month(), loopDate.day()); + QCOMPARE(loopDate.toJulianDay(), testDate.toJulianDay()); + loopDate = loopDate.addDays(1); + } + + // Test Gregorian round trip at top end of widget/format range + loopDate = QDate::fromJulianDay(5336961); // 1 Jan 9900 AD + while (loopDate.toJulianDay() <= 5373484) { // 31 Dec 9999 AD + testDate.setDate(loopDate.year(), loopDate.month(), loopDate.day()); + QCOMPARE(loopDate.toJulianDay(), testDate.toJulianDay()); + loopDate = loopDate.addDays(1); + } + + // Test Gregorian round trip at top end of conversion range + loopDate = QDate::fromJulianDay(513024036); // 1 Jan 1399900 AD + while (loopDate.toJulianDay() <= 513060925) { // 31 Dec 1400000 AD + testDate.setDate(loopDate.year(), loopDate.month(), loopDate.day()); + QCOMPARE(loopDate.toJulianDay(), testDate.toJulianDay()); loopDate = loopDate.addDays(1); } } diff --git a/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp b/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp index 2cbac82d3b..2cb3db533e 100644 --- a/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp +++ b/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp @@ -883,22 +883,22 @@ void tst_QDateTime::daysTo() QDateTime dt2(QDate(1760, 2, 2), QTime()); QDateTime dt3(QDate(1760, 3, 2), QTime()); - QCOMPARE(dt1.daysTo(dt2), 31); + QCOMPARE(dt1.daysTo(dt2), (qint64) 31); QCOMPARE(dt1.addDays(31), dt2); - QCOMPARE(dt2.daysTo(dt3), 29); + QCOMPARE(dt2.daysTo(dt3), (qint64) 29); QCOMPARE(dt2.addDays(29), dt3); - QCOMPARE(dt1.daysTo(dt3), 60); + QCOMPARE(dt1.daysTo(dt3), (qint64) 60); QCOMPARE(dt1.addDays(60), dt3); - QCOMPARE(dt2.daysTo(dt1), -31); + QCOMPARE(dt2.daysTo(dt1), (qint64) -31); QCOMPARE(dt2.addDays(-31), dt1); - QCOMPARE(dt3.daysTo(dt2), -29); + QCOMPARE(dt3.daysTo(dt2), (qint64) -29); QCOMPARE(dt3.addDays(-29), dt2); - QCOMPARE(dt3.daysTo(dt1), -60); + QCOMPARE(dt3.daysTo(dt1), (qint64) -60); QCOMPARE(dt3.addDays(-60), dt1); } -- cgit v1.2.3 From fc24979e43162b27b7a482fd4963ae615f5ce54f Mon Sep 17 00:00:00 2001 From: John Layt Date: Mon, 9 Jan 2012 20:50:00 +0000 Subject: QDateTime: Remove Julian Calendar Convert QDate to only use Gregorian calendar and not Julian calendar before 1582. In future the Julian can be used via proper calendar classes. Change-Id: I547a3550332057a0ab1be616706630b6afaceffc Reviewed-by: Thiago Macieira --- tests/auto/corelib/tools/qdate/tst_qdate.cpp | 65 ++++++++-------------- .../auto/corelib/tools/qdatetime/tst_qdatetime.cpp | 8 --- 2 files changed, 22 insertions(+), 51 deletions(-) (limited to 'tests/auto/corelib/tools') diff --git a/tests/auto/corelib/tools/qdate/tst_qdate.cpp b/tests/auto/corelib/tools/qdate/tst_qdate.cpp index 4ce2a51902..4921a7e734 100644 --- a/tests/auto/corelib/tools/qdate/tst_qdate.cpp +++ b/tests/auto/corelib/tools/qdate/tst_qdate.cpp @@ -185,10 +185,10 @@ void tst_QDate::isValid_data() QTest::newRow("idec") << 2000 << 12 << 32 << nullJd << false; // the beginning of the Julian Day calendar: - QTest::newRow("jd earliest formula") << -4800 << 1 << 1 << qint64( -31776) << true; - QTest::newRow("jd -1") << -4714 << 12 << 31 << qint64( -1) << true; - QTest::newRow("jd 0") << -4713 << 1 << 1 << qint64( 0) << true; - QTest::newRow("jd 1") << -4713 << 1 << 2 << qint64( 1) << true; + QTest::newRow("jd earliest formula") << -4800 << 1 << 1 << qint64( -31738) << true; + QTest::newRow("jd -1") << -4714 << 11 << 23 << qint64( -1) << true; + QTest::newRow("jd 0") << -4714 << 11 << 24 << qint64( 0) << true; + QTest::newRow("jd 1") << -4714 << 11 << 25 << qint64( 1) << true; QTest::newRow("jd latest formula") << 1400000 << 12 << 31 << qint64(513060925) << true; } @@ -259,19 +259,14 @@ void tst_QDate::dayOfWeek_data() QTest::newRow("data5") << 2000 << 1 << 7 << 5; QTest::newRow("data6") << 2000 << 1 << 8 << 6; QTest::newRow("data7") << 2000 << 1 << 9 << 7; - QTest::newRow("data8") << 1815 << 6 << 15 << 4; - QTest::newRow("data9") << 1815 << 6 << 15 << 4; - QTest::newRow("data10") << 1500 << 1 << 1 << 3; - QTest::newRow("data11") << -1500 << 1 << 1 << 7; - QTest::newRow("data12") << -4800 << 1 << 1 << 5; - QTest::newRow("data13") << -4800 << 1 << 4 << 1; - QTest::newRow("data14") << -4800 << 1 << 5 << 2; - QTest::newRow("data15") << -4800 << 1 << 6 << 3; - QTest::newRow("data16") << -4800 << 1 << 7 << 4; - QTest::newRow("data17") << -4800 << 1 << 8 << 5; - QTest::newRow("data18") << -4800 << 1 << 9 << 6; - QTest::newRow("data19") << -4800 << 1 << 10 << 7; - QTest::newRow("data20") << -4800 << 1 << 11 << 1; + QTest::newRow("data8") << -4800 << 1 << 1 << 1; + QTest::newRow("data9") << -4800 << 1 << 2 << 2; + QTest::newRow("data10") << -4800 << 1 << 3 << 3; + QTest::newRow("data12") << -4800 << 1 << 4 << 4; + QTest::newRow("data12") << -4800 << 1 << 5 << 5; + QTest::newRow("data13") << -4800 << 1 << 6 << 6; + QTest::newRow("data14") << -4800 << 1 << 7 << 7; + QTest::newRow("data15") << -4800 << 1 << 8 << 1; } void tst_QDate::dayOfWeek() @@ -300,9 +295,9 @@ void tst_QDate::dayOfYear_data() QTest::newRow("data5") << 2001 << 12 << 31 << 365; QTest::newRow("data6") << 1815 << 1 << 1 << 1; QTest::newRow("data7") << 1815 << 12 << 31 << 365; - QTest::newRow("data8") << 1582 << 1 << 1 << 1; - QTest::newRow("data9") << 1582 << 12 << 31 << 355; - QTest::newRow("data10") << 1500 << 1 << 1 << 1; + QTest::newRow("data8") << 1500 << 1 << 1 << 1; + QTest::newRow("data9") << 1500 << 12 << 31 << 365; + QTest::newRow("data10") << -1500 << 1 << 1 << 1; QTest::newRow("data11") << -1500 << 12 << 31 << 365; QTest::newRow("data12") << -4800 << 1 << 1 << 1; QTest::newRow("data13") << -4800 << 12 << 31 << 365; @@ -589,14 +584,6 @@ void tst_QDate::addMonths_data() QTest::newRow( "data15" ) << 1 << 1 << 1 << -12 << -1 << 1 << 1; QTest::newRow( "data16" ) << -1 << 12 << 1 << 1 << 1 << 1 << 1; QTest::newRow( "data17" ) << -1 << 1 << 1 << 12 << 1 << 1 << 1; - - // Gregorian/Julian switchover - QTest::newRow( "data18" ) << 1582 << 9 << 4 << 1 << 1582 << 10 << 4; - QTest::newRow( "data19" ) << 1582 << 9 << 10 << 1 << 1582 << 10 << 15; - QTest::newRow( "data20" ) << 1582 << 9 << 20 << 1 << 1582 << 10 << 20; - QTest::newRow( "data21" ) << 1582 << 11 << 4 << -1 << 1582 << 10 << 4; - QTest::newRow( "data22" ) << 1582 << 11 << 10 << -1 << 1582 << 10 << 4; - QTest::newRow( "data23" ) << 1582 << 11 << 20 << -1 << 1582 << 10 << 20; } void tst_QDate::addYears() @@ -930,10 +917,10 @@ void tst_QDate::isLeapYear() QVERIFY(QDate::isLeapYear(4)); QVERIFY(!QDate::isLeapYear(7)); QVERIFY(QDate::isLeapYear(8)); - QVERIFY(QDate::isLeapYear(100)); + QVERIFY(!QDate::isLeapYear(100)); QVERIFY(QDate::isLeapYear(400)); - QVERIFY(QDate::isLeapYear(700)); - QVERIFY(QDate::isLeapYear(1500)); + QVERIFY(!QDate::isLeapYear(700)); + QVERIFY(!QDate::isLeapYear(1500)); QVERIFY(QDate::isLeapYear(1600)); QVERIFY(!QDate::isLeapYear(1700)); QVERIFY(!QDate::isLeapYear(1800)); @@ -1184,24 +1171,16 @@ void tst_QDate::roundtrip() const // Test Julian round trip around JD 0 and current low end of valid range QDate testDate; - QDate loopDate = QDate::fromJulianDay(-31776); // 1 Jan 4800 BC - while (loopDate.toJulianDay() <= 5113) { // 31 Dec 4700 AD + QDate loopDate = QDate::fromJulianDay(-31738); // 1 Jan 4800 BC + while (loopDate.toJulianDay() <= 5150) { // 31 Dec 4700 BC testDate.setDate(loopDate.year(), loopDate.month(), loopDate.day()); QCOMPARE(loopDate.toJulianDay(), testDate.toJulianDay()); loopDate = loopDate.addDays(1); } // Test Julian round trip in both BC and AD - loopDate = QDate::fromJulianDay(1684899); // 1 Jan 100 BC - while (loopDate.toJulianDay() <= 1757948) { // 31 Dec 100 AD - testDate.setDate(loopDate.year(), loopDate.month(), loopDate.day()); - QCOMPARE(loopDate.toJulianDay(), testDate.toJulianDay()); - loopDate = loopDate.addDays(1); - } - - // Test Julian and Gregorian round trip during changeover period - loopDate = QDate::fromJulianDay(2298153); // 1 Jan 1580 AD - while (loopDate.toJulianDay() <= 2300334) { // 31 Dec 1585 AD + loopDate = QDate::fromJulianDay(1684901); // 1 Jan 100 BC + while (loopDate.toJulianDay() <= 1757949) { // 31 Dec 100 AD testDate.setDate(loopDate.year(), loopDate.month(), loopDate.day()); QCOMPARE(loopDate.toJulianDay(), testDate.toJulianDay()); loopDate = loopDate.addDays(1); diff --git a/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp b/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp index 2cb3db533e..af8deefa4c 100644 --- a/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp +++ b/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp @@ -726,14 +726,6 @@ void tst_QDateTime::addSecs_data() QTest::newRow("toPositive") << QDateTime(QDate(-1, 12, 31), QTime(23, 59, 59), Qt::UTC) << 1 << QDateTime(QDate(1, 1, 1), QTime(0, 0, 0), Qt::UTC); - - // Gregorian/Julian switchover - QTest::newRow("toGregorian") << QDateTime(QDate(1582, 10, 4), QTime(23, 59, 59)) - << 1 - << QDateTime(QDate(1582, 10, 15), QTime(0, 0, 0)); - QTest::newRow("toJulian") << QDateTime(QDate(1582, 10, 15), QTime(0, 0, 0)) - << -1 - << QDateTime(QDate(1582, 10, 4), QTime(23, 59, 59)); } void tst_QDateTime::addSecs() -- cgit v1.2.3 From 92b112475247d42b221b03953b11b060fdf35538 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Nowacki?= Date: Tue, 31 Jan 2012 14:16:52 +0100 Subject: Add movability tests for QByteArray. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QByteArray is declared as movable but it was not tested before. Change-Id: I4fb636f8705c3fd792a768872206203ee5fd4ddb Reviewed-by: João Abecasis --- .../corelib/tools/qbytearray/tst_qbytearray.cpp | 82 +++++++++++++++++++++- 1 file changed, 81 insertions(+), 1 deletion(-) (limited to 'tests/auto/corelib/tools') diff --git a/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp b/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp index c50deb63c2..c1598c452d 100644 --- a/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp +++ b/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp @@ -130,7 +130,8 @@ private slots: void byteRefDetaching() const; void reserve(); - + void movablity_data(); + void movablity(); void literals(); }; @@ -1497,6 +1498,85 @@ void tst_QByteArray::reserve() nil2.reserve(0); } +void tst_QByteArray::movablity_data() +{ + QTest::addColumn("array"); + + QTest::newRow("0x00000000") << QByteArray("\x00\x00\x00\x00", 4); + QTest::newRow("0x000000ff") << QByteArray("\x00\x00\x00\xff", 4); + QTest::newRow("0xffffffff") << QByteArray("\xff\xff\xff\xff", 4); + QTest::newRow("empty") << QByteArray(""); + QTest::newRow("null") << QByteArray(); + QTest::newRow("sss") << QByteArray(3, 's'); +} + +void tst_QByteArray::movablity() +{ + QFETCH(QByteArray, array); + + QVERIFY(!QTypeInfo::isStatic); + + const int size = array.size(); + const bool isEmpty = array.isEmpty(); + const bool isNull = array.isNull(); + const int capacity = array.capacity(); + + QByteArray memSpace; + + // we need only memory space not the instance + memSpace.~QByteArray(); + // move array -> memSpace + memcpy(&memSpace, &array, sizeof(QByteArray)); + // reconstruct empty QByteArray + new (&array) QByteArray; + + QCOMPARE(memSpace.size(), size); + QCOMPARE(memSpace.isEmpty(), isEmpty); + QCOMPARE(memSpace.isNull(), isNull); + QCOMPARE(memSpace.capacity(), capacity); + + // try to not crash + memSpace.toLower(); + memSpace.toUpper(); + memSpace.prepend('a'); + memSpace.append("b", 1); + memSpace.squeeze(); + memSpace.reserve(array.size() + 16); + + QByteArray copy(memSpace); + + // reinitialize base values + const int newSize = size + 2; + const bool newIsEmpty = false; + const bool newIsNull = false; + const int newCapacity = 16; + + // move back memSpace -> array + array.~QByteArray(); + memcpy(&array, &memSpace, sizeof(QByteArray)); + // reconstruct empty QByteArray + new (&memSpace) QByteArray; + + QCOMPARE(array.size(), newSize); + QCOMPARE(array.isEmpty(), newIsEmpty); + QCOMPARE(array.isNull(), newIsNull); + QCOMPARE(array.capacity(), newCapacity); + QVERIFY(array.startsWith("a")); + QVERIFY(array.endsWith("b")); + + QCOMPARE(copy.size(), newSize); + QCOMPARE(copy.isEmpty(), newIsEmpty); + QCOMPARE(copy.isNull(), newIsNull); + QCOMPARE(copy.capacity(), newCapacity); + QVERIFY(copy.startsWith("a")); + QVERIFY(copy.endsWith("b")); + + // try to not crash + array.squeeze(); + array.reserve(array.size() + 3); + QVERIFY(true); +} + void tst_QByteArray::literals() { #if defined(Q_COMPILER_LAMBDA) || defined(Q_CC_GNU) -- cgit v1.2.3 From 1e3833bed8a661ee8ae284188a23bd0ffc3bed85 Mon Sep 17 00:00:00 2001 From: John Layt Date: Sun, 22 Jan 2012 21:23:50 +0000 Subject: QString: Make convert to number methods only use C locale Ensure consistent conversions by not using the system default locale. Change-Id: I60db9fc4f465c0254f3213419e57d7879aaddd65 Reviewed-by: Thiago Macieira Reviewed-by: Lars Knoll --- tests/auto/corelib/tools/qstring/tst_qstring.cpp | 237 +++++++++-------------- 1 file changed, 88 insertions(+), 149 deletions(-) (limited to 'tests/auto/corelib/tools') diff --git a/tests/auto/corelib/tools/qstring/tst_qstring.cpp b/tests/auto/corelib/tools/qstring/tst_qstring.cpp index dae1dc45ba..3be7302223 100644 --- a/tests/auto/corelib/tools/qstring/tst_qstring.cpp +++ b/tests/auto/corelib/tools/qstring/tst_qstring.cpp @@ -3989,107 +3989,83 @@ void tst_QString::operator_smaller() void tst_QString::integer_conversion_data() { - QTest::addColumn("locale_name"); QTest::addColumn("num_str"); QTest::addColumn("base"); QTest::addColumn("good"); QTest::addColumn("num"); - QTest::newRow("C empty 0") << QString("C") << QString("") << 0 << false << (qlonglong)0; - QTest::newRow("C empty 8") << QString("C") << QString("") << 8 << false << (qlonglong)0; - QTest::newRow("C empty 10") << QString("C") << QString("") << 10 << false << (qlonglong)0; - QTest::newRow("C empty 16") << QString("C") << QString("") << 16 << false << (qlonglong)0; - - QTest::newRow("C null 0") << QString("C") << QString() << 0 << false << (qlonglong)0; - QTest::newRow("C null 8") << QString("C") << QString() << 8 << false << (qlonglong)0; - QTest::newRow("C null 10") << QString("C") << QString() << 10 << false << (qlonglong)0; - QTest::newRow("C null 16") << QString("C") << QString() << 16 << false << (qlonglong)0; - - QTest::newRow("C -0xf 0") << QString("C") << QString(" -0xf") << 0 << true << (qlonglong)-15; - QTest::newRow("C -0xf 0") << QString("C") << QString("-0xf ") << 0 << true << (qlonglong)-15; - QTest::newRow("C \t0xf\t 0") << QString("C") << QString("\t0xf\t") << 0 << true << (qlonglong)15; - QTest::newRow("C -010 0") << QString("C") << QString(" -010") << 0 << true << (qlonglong)-8; - QTest::newRow("C 010 0") << QString("C") << QString("010 ") << 0 << true << (qlonglong)8; - QTest::newRow("C \t-010\t 0") << QString("C") << QString("\t-010\t") << 0 << true << (qlonglong)-8; - QTest::newRow("C 123 10") << QString("C") << QString(" 123") << 10 << true << (qlonglong)123; - QTest::newRow("C 123 10") << QString("C") << QString("123 ") << 10 << true << (qlonglong)123; - QTest::newRow("C \t123\t 10") << QString("C") << QString("\t123\t") << 10 << true << (qlonglong)123; - QTest::newRow("C -0xf 16") << QString("C") << QString(" -0xf") << 16 << true << (qlonglong)-15; - QTest::newRow("C -0xf 16") << QString("C") << QString("-0xf ") << 16 << true << (qlonglong)-15; - QTest::newRow("C \t0xf\t 16") << QString("C") << QString("\t0xf\t") << 16 << true << (qlonglong)15; - - QTest::newRow("C -0 0") << QString("C") << QString("-0") << 0 << true << (qlonglong)0; - QTest::newRow("C -0 8") << QString("C") << QString("-0") << 8 << true << (qlonglong)0; - QTest::newRow("C -0 10") << QString("C") << QString("-0") << 10 << true << (qlonglong)0; - QTest::newRow("C -0 16") << QString("C") << QString("-0") << 16 << true << (qlonglong)0; - - QTest::newRow("C 1.234 10") << QString("C") << QString("1.234") << 10 << false << (qlonglong)0; - QTest::newRow("C 1,234 10") << QString("C") << QString("1,234") << 10 << false << (qlonglong)0; - QTest::newRow("de_DE 1.234 10") << QString("de_DE") << QString("1.234") << 10 << false << (qlonglong)0; - QTest::newRow("de_DE 1,234 10") << QString("de_DE") << QString("1,234") << 10 << false << (qlonglong)0; - - QTest::newRow("C 0x 0") << QString("C") << QString("0x") << 0 << false << (qlonglong)0; - QTest::newRow("C 0x 16") << QString("C") << QString("0x") << 16 << false << (qlonglong)0; - - QTest::newRow("C 10 0") << QString("C") << QString("10") << 0 << true << (qlonglong)10; - QTest::newRow("C 010 0") << QString("C") << QString("010") << 0 << true << (qlonglong)8; - QTest::newRow("C 0x10 0") << QString("C") << QString("0x10") << 0 << true << (qlonglong)16; - QTest::newRow("C 10 8") << QString("C") << QString("10") << 8 << true << (qlonglong)8; - QTest::newRow("C 010 8") << QString("C") << QString("010") << 8 << true << (qlonglong)8; - QTest::newRow("C 0x10 8") << QString("C") << QString("0x10") << 8 << false << (qlonglong)0; - QTest::newRow("C 10 10") << QString("C") << QString("10") << 10 << true << (qlonglong)10; - QTest::newRow("C 010 10") << QString("C") << QString("010") << 10 << true << (qlonglong)10; - QTest::newRow("C 0x10 10") << QString("C") << QString("0x10") << 10 << false << (qlonglong)0; - QTest::newRow("C 10 16") << QString("C") << QString("10") << 16 << true << (qlonglong)16; - QTest::newRow("C 010 16") << QString("C") << QString("010") << 16 << true << (qlonglong)16; - QTest::newRow("C 0x10 16") << QString("C") << QString("0x10") << 16 << true << (qlonglong)16; - - QTest::newRow("de_DE 10 0") << QString("de_DE") << QString("10") << 0 << true << (qlonglong)10; - QTest::newRow("de_DE 010 0") << QString("de_DE") << QString("010") << 0 << true << (qlonglong)8; - QTest::newRow("de_DE 0x10 0") << QString("de_DE") << QString("0x10") << 0 << true << (qlonglong)16; - QTest::newRow("de_DE 10 8") << QString("de_DE") << QString("10") << 8 << true << (qlonglong)8; - QTest::newRow("de_DE 010 8") << QString("de_DE") << QString("010") << 8 << true << (qlonglong)8; - QTest::newRow("de_DE 0x10 8") << QString("de_DE") << QString("0x10") << 8 << false << (qlonglong)0; - QTest::newRow("de_DE 10 10") << QString("de_DE") << QString("10") << 10 << true << (qlonglong)10; - QTest::newRow("de_DE 010 10") << QString("de_DE") << QString("010") << 10 << true << (qlonglong)10; - QTest::newRow("de_DE 0x10 10") << QString("de_DE") << QString("0x10") << 10 << false << (qlonglong)0; - QTest::newRow("de_DE 10 16") << QString("de_DE") << QString("10") << 16 << true << (qlonglong)16; - QTest::newRow("de_DE 010 16") << QString("de_DE") << QString("010") << 16 << true << (qlonglong)16; - QTest::newRow("de_DE 0x10 16") << QString("de_DE") << QString("0x10") << 16 << true << (qlonglong)16; - - QTest::newRow("C -10 0") << QString("C") << QString("-10") << 0 << true << (qlonglong)-10; - QTest::newRow("C -010 0") << QString("C") << QString("-010") << 0 << true << (qlonglong)-8; - QTest::newRow("C -0x10 0") << QString("C") << QString("-0x10") << 0 << true << (qlonglong)-16; - QTest::newRow("C -10 8") << QString("C") << QString("-10") << 8 << true << (qlonglong)-8; - QTest::newRow("C -010 8") << QString("C") << QString("-010") << 8 << true << (qlonglong)-8; - QTest::newRow("C -0x10 8") << QString("C") << QString("-0x10") << 8 << false << (qlonglong)0; - QTest::newRow("C -10 10") << QString("C") << QString("-10") << 10 << true << (qlonglong)-10; - QTest::newRow("C -010 10") << QString("C") << QString("-010") << 10 << true << (qlonglong)-10; - QTest::newRow("C -0x10 10") << QString("C") << QString("-0x10") << 10 << false << (qlonglong)0; - QTest::newRow("C -10 16") << QString("C") << QString("-10") << 16 << true << (qlonglong)-16; - QTest::newRow("C -010 16") << QString("C") << QString("-010") << 16 << true << (qlonglong)-16; - QTest::newRow("C -0x10 16") << QString("C") << QString("-0x10") << 16 << true << (qlonglong)-16; + QTest::newRow("C empty 0") << QString("") << 0 << false << (qlonglong)0; + QTest::newRow("C empty 8") << QString("") << 8 << false << (qlonglong)0; + QTest::newRow("C empty 10") << QString("") << 10 << false << (qlonglong)0; + QTest::newRow("C empty 16") << QString("") << 16 << false << (qlonglong)0; + + QTest::newRow("C null 0") << QString() << 0 << false << (qlonglong)0; + QTest::newRow("C null 8") << QString() << 8 << false << (qlonglong)0; + QTest::newRow("C null 10") << QString() << 10 << false << (qlonglong)0; + QTest::newRow("C null 16") << QString() << 16 << false << (qlonglong)0; + + QTest::newRow("C -0xf 0") << QString(" -0xf") << 0 << true << (qlonglong)-15; + QTest::newRow("C -0xf 0") << QString("-0xf ") << 0 << true << (qlonglong)-15; + QTest::newRow("C \t0xf\t 0") << QString("\t0xf\t") << 0 << true << (qlonglong)15; + QTest::newRow("C -010 0") << QString(" -010") << 0 << true << (qlonglong)-8; + QTest::newRow("C 010 0") << QString("010 ") << 0 << true << (qlonglong)8; + QTest::newRow("C \t-010\t 0") << QString("\t-010\t") << 0 << true << (qlonglong)-8; + QTest::newRow("C 123 10") << QString(" 123") << 10 << true << (qlonglong)123; + QTest::newRow("C 123 10") << QString("123 ") << 10 << true << (qlonglong)123; + QTest::newRow("C \t123\t 10") << QString("\t123\t") << 10 << true << (qlonglong)123; + QTest::newRow("C -0xf 16") << QString(" -0xf") << 16 << true << (qlonglong)-15; + QTest::newRow("C -0xf 16") << QString("-0xf ") << 16 << true << (qlonglong)-15; + QTest::newRow("C \t0xf\t 16") << QString("\t0xf\t") << 16 << true << (qlonglong)15; + + QTest::newRow("C -0 0") << QString("-0") << 0 << true << (qlonglong)0; + QTest::newRow("C -0 8") << QString("-0") << 8 << true << (qlonglong)0; + QTest::newRow("C -0 10") << QString("-0") << 10 << true << (qlonglong)0; + QTest::newRow("C -0 16") << QString("-0") << 16 << true << (qlonglong)0; + + QTest::newRow("C 1.234 10") << QString("1.234") << 10 << false << (qlonglong)0; + QTest::newRow("C 1,234 10") << QString("1,234") << 10 << false << (qlonglong)0; + + QTest::newRow("C 0x 0") << QString("0x") << 0 << false << (qlonglong)0; + QTest::newRow("C 0x 16") << QString("0x") << 16 << false << (qlonglong)0; + + QTest::newRow("C 10 0") << QString("10") << 0 << true << (qlonglong)10; + QTest::newRow("C 010 0") << QString("010") << 0 << true << (qlonglong)8; + QTest::newRow("C 0x10 0") << QString("0x10") << 0 << true << (qlonglong)16; + QTest::newRow("C 10 8") << QString("10") << 8 << true << (qlonglong)8; + QTest::newRow("C 010 8") << QString("010") << 8 << true << (qlonglong)8; + QTest::newRow("C 0x10 8") << QString("0x10") << 8 << false << (qlonglong)0; + QTest::newRow("C 10 10") << QString("10") << 10 << true << (qlonglong)10; + QTest::newRow("C 010 10") << QString("010") << 10 << true << (qlonglong)10; + QTest::newRow("C 0x10 10") << QString("0x10") << 10 << false << (qlonglong)0; + QTest::newRow("C 10 16") << QString("10") << 16 << true << (qlonglong)16; + QTest::newRow("C 010 16") << QString("010") << 16 << true << (qlonglong)16; + QTest::newRow("C 0x10 16") << QString("0x10") << 16 << true << (qlonglong)16; + + QTest::newRow("C -10 0") << QString("-10") << 0 << true << (qlonglong)-10; + QTest::newRow("C -010 0") << QString("-010") << 0 << true << (qlonglong)-8; + QTest::newRow("C -0x10 0") << QString("-0x10") << 0 << true << (qlonglong)-16; + QTest::newRow("C -10 8") << QString("-10") << 8 << true << (qlonglong)-8; + QTest::newRow("C -010 8") << QString("-010") << 8 << true << (qlonglong)-8; + QTest::newRow("C -0x10 8") << QString("-0x10") << 8 << false << (qlonglong)0; + QTest::newRow("C -10 10") << QString("-10") << 10 << true << (qlonglong)-10; + QTest::newRow("C -010 10") << QString("-010") << 10 << true << (qlonglong)-10; + QTest::newRow("C -0x10 10") << QString("-0x10") << 10 << false << (qlonglong)0; + QTest::newRow("C -10 16") << QString("-10") << 16 << true << (qlonglong)-16; + QTest::newRow("C -010 16") << QString("-010") << 16 << true << (qlonglong)-16; + QTest::newRow("C -0x10 16") << QString("-0x10") << 16 << true << (qlonglong)-16; // Let's try some Arabic const quint16 arabic_str[] = { 0x0661, 0x0662, 0x0663, 0x0664, 0x0000 }; // "1234" - QTest::newRow("ar_SA 1234 0") << QString("ar_SA") << QString::fromUtf16(arabic_str) << 0 << true << (qlonglong)1234; - QTest::newRow("ar_SA 1234 8") << QString("ar_SA") << QString::fromUtf16(arabic_str) << 8 << true << (qlonglong)668; - QTest::newRow("ar_SA 1234 10") << QString("ar_SA") << QString::fromUtf16(arabic_str) << 10 << true << (qlonglong)1234; - QTest::newRow("ar_SA 1234 16") << QString("ar_SA") << QString::fromUtf16(arabic_str) << 16 << true << (qlonglong)4660; + QTest::newRow("ar_SA 1234 0") << QString::fromUtf16(arabic_str) << 0 << false << (qlonglong)0; } void tst_QString::integer_conversion() { - QFETCH(QString, locale_name); QFETCH(QString, num_str); QFETCH(int, base); QFETCH(bool, good); QFETCH(qlonglong, num); - - QLocale::setDefault(locale_name); - QCOMPARE(QLocale().name(), locale_name); - bool ok; qlonglong d = num_str.toLongLong(&ok, base); QCOMPARE(ok, good); @@ -4097,100 +4073,65 @@ void tst_QString::integer_conversion() if (ok) { QCOMPARE(d, num); } - - QLocale::setDefault(QLocale::C); } void tst_QString::double_conversion_data() { - QTest::addColumn("locale_name"); QTest::addColumn("num_str"); QTest::addColumn("good"); QTest::addColumn("num"); // The good... - QTest::newRow("C 1") << QString("C") << QString("1") << true << 1.0; - QTest::newRow("C 1.0") << QString("C") << QString("1.0") << true << 1.0; - QTest::newRow("C 1.234") << QString("C") << QString("1.234") << true << 1.234; - QTest::newRow("C 1.234e-10") << QString("C") << QString("1.234e-10") << true << 1.234e-10; - QTest::newRow("C 1.234E10") << QString("C") << QString("1.234E10") << true << 1.234e10; - QTest::newRow("C 1e10") << QString("C") << QString("1e10") << true << 1.0e10; + QTest::newRow("C 1") << QString("1") << true << 1.0; + QTest::newRow("C 1.0") << QString("1.0") << true << 1.0; + QTest::newRow("C 1.234") << QString("1.234") << true << 1.234; + QTest::newRow("C 1.234e-10") << QString("1.234e-10") << true << 1.234e-10; + QTest::newRow("C 1.234E10") << QString("1.234E10") << true << 1.234e10; + QTest::newRow("C 1e10") << QString("1e10") << true << 1.0e10; // The bad... - QTest::newRow("C empty") << QString("C") << QString("") << false << 0.0; - QTest::newRow("C null") << QString("C") << QString() << false << 0.0; - QTest::newRow("C .") << QString("C") << QString(".") << false << 0.0; - QTest::newRow("C 1e") << QString("C") << QString("1e") << false << 0.0; - QTest::newRow("C 1,") << QString("C") << QString("1,") << false << 0.0; - QTest::newRow("C 1,0") << QString("C") << QString("1,0") << false << 0.0; - QTest::newRow("C 1,000") << QString("C") << QString("1,000") << false << 0.0; - QTest::newRow("C 1e1.0") << QString("C") << QString("1e1.0") << false << 0.0; - QTest::newRow("C 1e+") << QString("C") << QString("1e+") << false << 0.0; - QTest::newRow("C 1e-") << QString("C") << QString("1e-") << false << 0.0; + QTest::newRow("C empty") << QString("") << false << 0.0; + QTest::newRow("C null") << QString() << false << 0.0; + QTest::newRow("C .") << QString(".") << false << 0.0; + QTest::newRow("C 1e") << QString("1e") << false << 0.0; + QTest::newRow("C 1,") << QString("1,") << false << 0.0; + QTest::newRow("C 1,0") << QString("1,0") << false << 0.0; + QTest::newRow("C 1,000") << QString("1,000") << false << 0.0; + QTest::newRow("C 1e1.0") << QString("1e1.0") << false << 0.0; + QTest::newRow("C 1e+") << QString("1e+") << false << 0.0; + QTest::newRow("C 1e-") << QString("1e-") << false << 0.0; + QTest::newRow("de_DE 1,0") << QString("1,0") << false << 0.0; + QTest::newRow("de_DE 1,234") << QString("1,234") << false << 0.0; + QTest::newRow("de_DE 1,234e-10") << QString("1,234e-10") << false << 0.0; + QTest::newRow("de_DE 1,234E10") << QString("1,234E10") << false << 0.0; // And the ugly... - QTest::newRow("C .1") << QString("C") << QString(".1") << true << 0.1; - QTest::newRow("C -.1") << QString("C") << QString("-.1") << true << -0.1; - QTest::newRow("C 1.") << QString("C") << QString("1.") << true << 1.0; - QTest::newRow("C 1.E10") << QString("C") << QString("1.E10") << true << 1.0e10; - QTest::newRow("C 1e+10") << QString("C") << QString("1e+10") << true << 1.0e+10; - - QTest::newRow("de_DE 1") << QString("de_DE") << QString("1") << true << 1.0; - QTest::newRow("de_DE 1.0") << QString("de_DE") << QString("1.0") << true << 1.0; - QTest::newRow("de_DE 1.234") << QString("de_DE") << QString("1.234") << true << 1.234; - QTest::newRow("de_DE 1.234e-10") << QString("de_DE") << QString("1.234e-10") << true << 1.234e-10; - QTest::newRow("de_DE 1.234E10") << QString("de_DE") << QString("1.234E10") << true << 1.234e10; - QTest::newRow("de_DE 1e10") << QString("de_DE") << QString("1e10") << true << 1.0e10; - QTest::newRow("de_DE .1") << QString("de_DE") << QString(".1") << true << 0.1; - QTest::newRow("de_DE -.1") << QString("de_DE") << QString("-.1") << true << -0.1; - QTest::newRow("de_DE 1.") << QString("de_DE") << QString("1.") << true << 1.0; - QTest::newRow("de_DE 1.E10") << QString("de_DE") << QString("1.E10") << true << 1.0e10; - QTest::newRow("de_DE 1e+10") << QString("de_DE") << QString("1e+10") << true << 1.0e+10; - - QTest::newRow("de_DE 1,0") << QString("de_DE") << QString("1,0") << true << 1.0; - QTest::newRow("de_DE 1,234") << QString("de_DE") << QString("1,234") << true << 1.234; - QTest::newRow("de_DE 1,234e-10") << QString("de_DE") << QString("1,234e-10") << true << 1.234e-10; - QTest::newRow("de_DE 1,234E10") << QString("de_DE") << QString("1,234E10") << true << 1.234e10; - QTest::newRow("de_DE ,1") << QString("de_DE") << QString(",1") << true << 0.1; - QTest::newRow("de_DE -,1") << QString("de_DE") << QString("-,1") << true << -0.1; - QTest::newRow("de_DE 1,") << QString("de_DE") << QString("1,") << true << 1.0; - QTest::newRow("de_DE 1,E10") << QString("de_DE") << QString("1,E10") << true << 1.0e10; - - QTest::newRow("de_DE empty") << QString("de_DE") << QString("") << false << 0.0; - QTest::newRow("de_DE null") << QString("de_DE") << QString() << false << 0.0; - QTest::newRow("de_DE .") << QString("de_DE") << QString(".") << false << 0.0; - QTest::newRow("de_DE 1e") << QString("de_DE") << QString("1e") << false << 0.0; - QTest::newRow("de_DE 1e1.0") << QString("de_DE") << QString("1e1.0") << false << 0.0; - QTest::newRow("de_DE 1e+") << QString("de_DE") << QString("1e+") << false << 0.0; - QTest::newRow("de_DE 1e-") << QString("de_DE") << QString("1e-") << false << 0.0; - - QTest::newRow("C 1") << QString("C") << QString(" 1") << true << 1.0; - QTest::newRow("C 1 ") << QString("C") << QString("1 ") << true << 1.0; - QTest::newRow("de_DE 1") << QString("de_DE") << QString(" 1") << true << 1.0; - QTest::newRow("de_DE 1 ") << QString("de_DE") << QString("1 ") << true << 1.0; + QTest::newRow("C .1") << QString(".1") << true << 0.1; + QTest::newRow("C -.1") << QString("-.1") << true << -0.1; + QTest::newRow("C 1.") << QString("1.") << true << 1.0; + QTest::newRow("C 1.E10") << QString("1.E10") << true << 1.0e10; + QTest::newRow("C 1e+10") << QString("1e+10") << true << 1.0e+10; + QTest::newRow("C 1") << QString(" 1") << true << 1.0; + QTest::newRow("C 1 ") << QString("1 ") << true << 1.0; // Let's try some Arabic const quint16 arabic_str[] = { 0x0660, 0x066B, 0x0661, 0x0662, 0x0663, 0x0664, 0x0065, 0x0662, 0x0000 }; // "0.1234e2" - QTest::newRow("ar_SA") << QString("ar_SA") << QString::fromUtf16(arabic_str) << true << 0.1234e2; + QTest::newRow("ar_SA") << QString::fromUtf16(arabic_str) << false << 0.0; } void tst_QString::double_conversion() { #define MY_DOUBLE_EPSILON (2.22045e-16) - QFETCH(QString, locale_name); QFETCH(QString, num_str); QFETCH(bool, good); QFETCH(double, num); - QLocale::setDefault(locale_name); - QCOMPARE(QLocale().name(), locale_name); - bool ok; double d = num_str.toDouble(&ok); QCOMPARE(ok, good); @@ -4201,8 +4142,6 @@ void tst_QString::double_conversion() diff = -diff; QVERIFY(diff <= MY_DOUBLE_EPSILON); } - - QLocale::setDefault(QLocale::C); } #ifndef Q_MOC_RUN -- cgit v1.2.3 From 23457bd6d9d54df2cab505e581e72f9942b0fdbb Mon Sep 17 00:00:00 2001 From: John Layt Date: Fri, 27 Jan 2012 20:21:21 +0000 Subject: SIC: QLocale: Make QSystemLocale a private class As discussed on list and approved by Lars and Thiago. Make QSystemLocale private to give us time and space to change it to a better implementation. Change-Id: Ifd806972f3996c43a876f544f78c6557ad71cd75 Reviewed-by: Lars Knoll --- tests/auto/corelib/tools/qlocale/tst_qlocale.cpp | 40 ------------------------ 1 file changed, 40 deletions(-) (limited to 'tests/auto/corelib/tools') diff --git a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp index 52f01e8754..5544c0fd71 100644 --- a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp +++ b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp @@ -123,9 +123,6 @@ private slots: void monthName(); void standaloneMonthName(); - // QSystemLocale tests - void queryDateTime(); - void ampm(); void currency(); void quoteString(); @@ -1778,43 +1775,6 @@ a(QLatin1String("0.0000000000000000000000000000000000000000000000000000000000000 QVERIFY(!ok); } -class SystemLocale : public QSystemLocale -{ -public: - virtual QVariant query(QueryType type, QVariant in) const - { - switch (type) { - case DateTimeFormatLong: return QLatin1String("dddd ddd dd d MMMM MMM MM M yyyy hh:mm:ss.zzz"); - case DateTimeFormatShort: return QLatin1String("d M yy h:m"); - case DateTimeToStringLong: - case DateTimeToStringShort: - return in.toDateTime().toString(type == DateTimeToStringShort - ? QLatin1String("dMyyhm") - : QLatin1String("ddMMyyyyhhmmsszzz")); - default: - break; - } - return QSystemLocale::query(type, in); - } -}; - - - -void tst_QLocale::queryDateTime() -{ - SystemLocale loc; - QCOMPARE(QLocale::system().dateTimeFormat(QLocale::LongFormat), - loc.query(QSystemLocale::DateTimeFormatLong, QVariant()).toString()); - QCOMPARE(QLocale::system().dateTimeFormat(QLocale::ShortFormat), - loc.query(QSystemLocale::DateTimeFormatShort, QVariant()).toString()); - QCOMPARE(QLocale::system().toString(QDateTime(QDate(1974, 12, 1), QTime(1, 2, 3, 4)), QLocale::ShortFormat), - QString("1127412")); - QCOMPARE(QLocale::system().toString(QDateTime(QDate(1974, 12, 1), QTime(1, 2, 3, 4)), QLocale::NarrowFormat), - QLocale::system().toString(QDateTime(QDate(1974, 12, 1), QTime(1, 2, 3, 4)), QLocale::ShortFormat)); - QCOMPARE(QLocale::system().toString(QDateTime(QDate(1974, 12, 1), QTime(1, 2, 3, 4)), QLocale::LongFormat), - QString("01121974010203004")); -} - void tst_QLocale::ampm() { QLocale c(QLocale::C); -- cgit v1.2.3