From 4730742f69123fb814a780f2434fa9b5b39acede Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Thu, 24 Jan 2013 13:49:28 +0100 Subject: Stabilize tst_qabstractslider MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When simulating hight load, this test failed 4 times out of 80 runs on my machine. With this patch I could no longer reproduce the failure. Change-Id: I42748de0200b9094c8facf0e33f3794002ec1d01 Reviewed-by: Gabriel de Dietrich Reviewed-by: Jędrzej Nowacki --- tests/auto/widgets/widgets/qabstractslider/tst_qabstractslider.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/auto/widgets/widgets/qabstractslider/tst_qabstractslider.cpp b/tests/auto/widgets/widgets/qabstractslider/tst_qabstractslider.cpp index fee06f2477..adb3c26dce 100644 --- a/tests/auto/widgets/widgets/qabstractslider/tst_qabstractslider.cpp +++ b/tests/auto/widgets/widgets/qabstractslider/tst_qabstractslider.cpp @@ -1244,17 +1244,17 @@ void tst_QAbstractSlider::setRepeatAction() QCOMPARE(slider->value(), 55); waitUntilTimeElapsed(t, 550); - QCOMPARE(spy.count(), 1); + QTRY_COMPARE(spy.count(), 1); QCOMPARE(slider->value(), 65); QCOMPARE(spy.at(0).at(0).toUInt(), (uint)QAbstractSlider::SliderPageStepAdd); waitUntilTimeElapsed(t, 790); - QCOMPARE(spy.count(), 2); + QTRY_COMPARE(spy.count(), 2); QCOMPARE(slider->value(), 75); QCOMPARE(spy.at(1).at(0).toUInt(), (uint)QAbstractSlider::SliderPageStepAdd); waitUntilTimeElapsed(t, 1790); - QCOMPARE(spy.count(), 6); + QTRY_COMPARE(spy.count(), 6); QCOMPARE(slider->value(), 115); QCOMPARE(spy.at(4).at(0).toUInt(), (uint)QAbstractSlider::SliderPageStepAdd); QCOMPARE(spy.at(5).at(0).toUInt(), (uint)QAbstractSlider::SliderPageStepAdd); -- cgit v1.2.3 From 05b4000e01ff5785739617c3069fbe0b0d36a606 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pasi=20Pet=C3=A4j=C3=A4j=C3=A4rvi?= Date: Wed, 2 Jan 2013 17:43:39 +0200 Subject: Fixed checking HOME variable return value using isEmpty() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Return value of the QFile::decodeName(qgetenv("HOME")); is never null if HOME environment variable is not set. So need to check the return value using isEmpty() instead. Task-number: QTBUG-28912 Change-Id: Ic57b1978d63e99b056cde35ca8cb9d2a07ff8ce8 Reviewed-by: Oswald Buddenhagen Reviewed-by: Samuel Rødal --- tests/auto/corelib/io/qdir/tst_qdir.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests') diff --git a/tests/auto/corelib/io/qdir/tst_qdir.cpp b/tests/auto/corelib/io/qdir/tst_qdir.cpp index 7799d40de7..d44ef167b5 100644 --- a/tests/auto/corelib/io/qdir/tst_qdir.cpp +++ b/tests/auto/corelib/io/qdir/tst_qdir.cpp @@ -1344,6 +1344,14 @@ void tst_QDir::homePath() #ifdef Q_OS_UNIX if (strHome.length() > 1) // root dir = "/" QVERIFY(!strHome.endsWith('/')); + + QByteArray envHome = qgetenv("HOME"); +#if !defined(_WRS_KERNEL) // unsetenv is not available on VxWorks DKM mode + unsetenv("HOME"); +#endif + QCOMPARE(QDir::homePath(), QDir::rootPath()); + qputenv("HOME", envHome); + #elif defined(Q_OS_WIN) if (strHome.length() > 3) // root dir = "c:/"; "//" is not really valid... QVERIFY(!strHome.endsWith('/')); -- cgit v1.2.3 From 63569a68d2fd5ca90c4660e632fba2f3f3b37d73 Mon Sep 17 00:00:00 2001 From: Sze Howe Koh Date: Sat, 29 Dec 2012 02:09:39 +0800 Subject: Doc: Fix module name format Follow the conventions at http://qt-project.org/wiki/Spelling_Module_Names_in_Qt_Documentation QtCore -> Qt Core QtDBus -> Qt D-Bus QtDesigner -> Qt Designer QtGui -> Qt GUI QtImageFormats -> Qt Image Formats QtNetwork -> Qt Network QtPrintSupport -> Qt Print Support QtScript -> Qt Script QtSql -> Qt SQL QtSvg -> Qt SVG QtTest -> Qt Test QtWebKit -> Qt WebKit QtWidgets -> Qt Widgets QtXml -> Qt XML QtConcurrent -> Qt Concurrent (partial) QtQuick -> Qt Quick (partial) Also, distinguish between "module" and "library" Change-Id: Icb8aa695ae60b0e45920b0c8fce4dc763a12b0cd Reviewed-by: Jerome Pasion --- tests/auto/cmake/CMakeLists.txt | 2 +- tests/auto/cmake/test_testlib_no_link_gui/CMakeLists.txt | 4 ++-- .../cmake/test_testlib_no_link_widgets/CMakeLists.txt | 4 ++-- tests/auto/corelib/tools/qstring/tst_qstring.cpp | 16 ++++++++-------- tests/auto/dbus/qdbusconnection/tst_qdbusconnection.cpp | 4 ++-- tests/auto/gui/text/qfontmetrics/tst_qfontmetrics.cpp | 2 +- tests/auto/opengl/qgl/tst_qgl.cpp | 4 ++-- tests/auto/testlib/selftests/tst_selftests.cpp | 2 +- 8 files changed, 19 insertions(+), 19 deletions(-) (limited to 'tests') diff --git a/tests/auto/cmake/CMakeLists.txt b/tests/auto/cmake/CMakeLists.txt index 46dcdcca2b..6da0c9bfa6 100644 --- a/tests/auto/cmake/CMakeLists.txt +++ b/tests/auto/cmake/CMakeLists.txt @@ -62,7 +62,7 @@ expect_pass("test(needsquoting)dirname") expect_pass(test_platform_defs_include) expect_pass(test_qtmainwin_library) -# If QtDBus has been installed then run the tests for its macros. +# If Qt D-Bus has been installed then run the tests for its macros. find_package(Qt5DBus QUIET) if (Qt5DBus_FOUND AND NOT APPLE) expect_pass(test_dbus_module) diff --git a/tests/auto/cmake/test_testlib_no_link_gui/CMakeLists.txt b/tests/auto/cmake/test_testlib_no_link_gui/CMakeLists.txt index aa93d73fec..571fadcfb6 100644 --- a/tests/auto/cmake/test_testlib_no_link_gui/CMakeLists.txt +++ b/tests/auto/cmake/test_testlib_no_link_gui/CMakeLists.txt @@ -31,10 +31,10 @@ qt5_generate_moc("${main_file}" "${moc_file}") # The core_test is expected to fail to build because # QT_GUI_LIB is defined, which affects the contents of -# QtTest and the definition of QTEST_MAIN. +# Qt Test and the definition of QTEST_MAIN. # If running this test manually (ctest -V -R no_link_gui from # the tests/auto/cmake/build directory), the core_test is -# expected to fail to link because of missing symbols from QtGui. +# expected to fail to link because of missing symbols from Qt GUI. # The gui_test is expected to build successfully (though it may # be necessary to comment out the core_test and re-run cmake) add_executable(core_test "${main_file}" "${moc_file}") diff --git a/tests/auto/cmake/test_testlib_no_link_widgets/CMakeLists.txt b/tests/auto/cmake/test_testlib_no_link_widgets/CMakeLists.txt index 9b120ecba0..8c025d65cd 100644 --- a/tests/auto/cmake/test_testlib_no_link_widgets/CMakeLists.txt +++ b/tests/auto/cmake/test_testlib_no_link_widgets/CMakeLists.txt @@ -34,8 +34,8 @@ qt5_generate_moc("${main_file}" "${moc_file}") # QtTest and the definition of QTEST_MAIN. # If running this test manually (ctest -V -R no_link_widgets from # the tests/auto/cmake/build directory), the core_test is -# expected to fail to link because of missing symbols from QtGui -# and QtWidgets. +# expected to fail to link because of missing symbols from Qt GUI +# and Qt Widgets. # The widgets_test is expected to build successfully (though it may # be necessary to comment out the core_test and re-run cmake) add_executable(core_test "${main_file}" "${moc_file}") diff --git a/tests/auto/corelib/tools/qstring/tst_qstring.cpp b/tests/auto/corelib/tools/qstring/tst_qstring.cpp index f75d74c4b0..8e30a66d6f 100644 --- a/tests/auto/corelib/tools/qstring/tst_qstring.cpp +++ b/tests/auto/corelib/tools/qstring/tst_qstring.cpp @@ -2358,7 +2358,7 @@ void tst_QString::remove_uint_uint() s1.remove( (uint) index, (uint) len ); QTEST( s1, "result" ); } else - QCOMPARE( 0, 0 ); // shut QtTest + QCOMPARE( 0, 0 ); // shut Qt Test } void tst_QString::remove_string() @@ -2397,7 +2397,7 @@ void tst_QString::remove_string() s5.replace( QRegExp(before, cs, QRegExp::FixedString), after ); QTEST( s5, "result" ); } else { - QCOMPARE( 0, 0 ); // shut QtTest + QCOMPARE( 0, 0 ); // shut Qt Test } } @@ -2416,7 +2416,7 @@ void tst_QString::remove_regexp() s2.remove( QRegularExpression(regexp) ); QTEST( s2, "result" ); } else { - QCOMPARE( 0, 0 ); // shut QtTest + QCOMPARE( 0, 0 ); // shut Qt Test } } @@ -3727,7 +3727,7 @@ void tst_QString::fromLatin1Roundtrip() QFETCH(QByteArray, latin1); QFETCH(QString, unicode); - // QtTest safety check: + // Qt Test safety check: QCOMPARE(latin1.isNull(), unicode.isNull()); QCOMPARE(latin1.isEmpty(), unicode.isEmpty()); QCOMPARE(latin1.length(), unicode.length()); @@ -3782,7 +3782,7 @@ void tst_QString::toLatin1Roundtrip() QFETCH(QString, unicodesrc); QFETCH(QString, unicodedst); - // QtTest safety check: + // Qt Test safety check: QCOMPARE(latin1.isNull(), unicodesrc.isNull()); QCOMPARE(latin1.isEmpty(), unicodesrc.isEmpty()); QCOMPARE(latin1.length(), unicodesrc.length()); @@ -3817,7 +3817,7 @@ void tst_QString::stringRef_toLatin1Roundtrip() QFETCH(QString, unicodesrc); QFETCH(QString, unicodedst); - // QtTest safety check: + // Qt Test safety check: QCOMPARE(latin1.isNull(), unicodesrc.isNull()); QCOMPARE(latin1.isEmpty(), unicodesrc.isEmpty()); QCOMPARE(latin1.length(), unicodesrc.length()); @@ -3883,8 +3883,8 @@ void tst_QString::fromAscii() void tst_QString::arg() { /* - Warning: If any of these test fails, the warning given by QtTest - is all messed up, because QtTest itself uses QString::arg(). + Warning: If any of these test fails, the warning given by Qt Test + is all messed up, because Qt Test itself uses QString::arg(). */ QLocale::setDefault(QString("de_DE")); diff --git a/tests/auto/dbus/qdbusconnection/tst_qdbusconnection.cpp b/tests/auto/dbus/qdbusconnection/tst_qdbusconnection.cpp index ea5c4e7b2b..c56a47bbc6 100644 --- a/tests/auto/dbus/qdbusconnection/tst_qdbusconnection.cpp +++ b/tests/auto/dbus/qdbusconnection/tst_qdbusconnection.cpp @@ -1055,11 +1055,11 @@ signals: void tst_QDBusConnection::serviceRegistrationRaceCondition() { // There was a race condition in the updating of list of name owners in - // QtDBus. When the user connects to a signal coming from a given + // Qt D-Bus. When the user connects to a signal coming from a given // service, we must listen for NameOwnerChanged signals relevant to that // name and update when the owner changes. However, it's possible that we // receive in one chunk from the server both the NameOwnerChanged signal - // about the service and the signal we're interested in. Since QtDBus + // about the service and the signal we're interested in. Since Qt D-Bus // posts events in order to handle the incoming signals, the update // happens too late. diff --git a/tests/auto/gui/text/qfontmetrics/tst_qfontmetrics.cpp b/tests/auto/gui/text/qfontmetrics/tst_qfontmetrics.cpp index 8113e1d5f4..15e8c2ee90 100644 --- a/tests/auto/gui/text/qfontmetrics/tst_qfontmetrics.cpp +++ b/tests/auto/gui/text/qfontmetrics/tst_qfontmetrics.cpp @@ -228,7 +228,7 @@ void tst_QFontMetrics::bypassShaping() int charsWidth = 0; for (int i = 0; i < text.size(); ++i) charsWidth += fm.width(text[i]); - // This assertion is needed in QtWebKit's WebCore::Font::offsetForPositionForSimpleText + // This assertion is needed in Qt WebKit's WebCore::Font::offsetForPositionForSimpleText QCOMPARE(textWidth, charsWidth); } diff --git a/tests/auto/opengl/qgl/tst_qgl.cpp b/tests/auto/opengl/qgl/tst_qgl.cpp index 0e6dba2132..6c5c90d737 100644 --- a/tests/auto/opengl/qgl/tst_qgl.cpp +++ b/tests/auto/opengl/qgl/tst_qgl.cpp @@ -1597,8 +1597,8 @@ void tst_QGL::fboFormat() void tst_QGL::testDontCrashOnDanglingResources() { - // We have a number of Q_GLOBAL_STATICS inside the QtOpenGL - // library. This test is verify that we don't crash as a result of + // We have a number of Q_GLOBAL_STATICS inside the Qt OpenGL + // module. This test is verify that we don't crash as a result of // them calling into libgl on application shutdown. QWidget *widget = new UnclippedWidget(); widget->show(); diff --git a/tests/auto/testlib/selftests/tst_selftests.cpp b/tests/auto/testlib/selftests/tst_selftests.cpp index ea4feae9db..4b19ee57ea 100644 --- a/tests/auto/testlib/selftests/tst_selftests.cpp +++ b/tests/auto/testlib/selftests/tst_selftests.cpp @@ -501,7 +501,7 @@ static inline QProcessEnvironment processEnvironment() { QProcessEnvironment result; insertEnvironmentVariable(QStringLiteral("PATH"), result); - // Preserve DISPLAY for X11 as some tests use QtGui. + // Preserve DISPLAY for X11 as some tests use Qt GUI. #if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) insertEnvironmentVariable(QStringLiteral("DISPLAY"), result); #endif -- cgit v1.2.3