summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/tools
diff options
context:
space:
mode:
authorJason McDonald <jason.mcdonald@nokia.com>2011-11-24 17:34:51 +1000
committerQt by Nokia <qt-info@nokia.com>2011-11-25 07:56:16 +0100
commite08410ab8db3d7cabf4ef2fc4de40bb6da6d6fef (patch)
tree9d6e154364039ab6cbc7a789ef33b7e0ce038e51 /tests/auto/corelib/tools
parent489a39aacc102e46a5b3fffd5839ed694bb7214f (diff)
Cleanup corelib autotests
Bug trackers come and go, so using bug identifiers in function and test case names will ensure that those names eventually become meaningless. It is better to choose a meaningful name and provide explanatory comments where appropriate. Change-Id: I67c27782ef21b5d4eaab4854079a043c8ef6957b Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Diffstat (limited to 'tests/auto/corelib/tools')
-rw-r--r--tests/auto/corelib/tools/qregexp/tst_qregexp.cpp10
-rw-r--r--tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp15
-rw-r--r--tests/auto/corelib/tools/qstring/tst_qstring.cpp8
-rw-r--r--tests/auto/corelib/tools/qvarlengtharray/tst_qvarlengtharray.cpp32
-rw-r--r--tests/auto/corelib/tools/qvector/tst_qvector.cpp16
5 files changed, 41 insertions, 40 deletions
diff --git a/tests/auto/corelib/tools/qregexp/tst_qregexp.cpp b/tests/auto/corelib/tools/qregexp/tst_qregexp.cpp
index 2f1ac10694..21bf9d1539 100644
--- a/tests/auto/corelib/tools/qregexp/tst_qregexp.cpp
+++ b/tests/auto/corelib/tools/qregexp/tst_qregexp.cpp
@@ -79,8 +79,8 @@ private slots:
void reentrancy();
void threadsafeEngineCache();
- void QTBUG_7049_data();
- void QTBUG_7049();
+ void posAndCapConsistency_data();
+ void posAndCapConsistency();
void interval();
};
@@ -1237,7 +1237,9 @@ void tst_QRegExp::operator_eq()
}
}
-void tst_QRegExp::QTBUG_7049_data()
+// This test aims to ensure that the values returned by pos() and cap()
+// are consistent.
+void tst_QRegExp::posAndCapConsistency_data()
{
QTest::addColumn<QString>("reStr");
QTest::addColumn<QString>("text");
@@ -1297,7 +1299,7 @@ void tst_QRegExp::QTBUG_7049_data()
}
-void tst_QRegExp::QTBUG_7049()
+void tst_QRegExp::posAndCapConsistency()
{
QFETCH( QString, reStr );
QFETCH( QString, text );
diff --git a/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp b/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp
index 94f6fc1c12..c4acf5be76 100644
--- a/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp
+++ b/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp
@@ -1838,7 +1838,7 @@ void tst_QSharedPointer::invalidConstructs()
}
}
-namespace QTBUG11730 {
+namespace ReentrancyWhileDestructing {
struct IB
{
virtual ~IB() {}
@@ -1881,17 +1881,14 @@ namespace QTBUG11730 {
};
}
+// This is a regression test for QTBUG-11730, where there would be a crash if
+// the destructor of a QSharedPointer object being deleted recursed back into
+// the same QSharedPointer object. There are no explicit verification steps
+// in this test -- it is sufficient that the code does not crash.
void tst_QSharedPointer::reentrancyWhileDestructing()
{
- // this bug is about recursing back into QSharedPointer::clear()
- // from inside it
- // that is, the destructor of the object being deleted recurses
- // into the same QSharedPointer object.
- // First reported as QTBUG-11730
- QTBUG11730::A obj;
+ ReentrancyWhileDestructing::A obj;
}
-
QTEST_MAIN(tst_QSharedPointer)
-
#include "tst_qsharedpointer.moc"
diff --git a/tests/auto/corelib/tools/qstring/tst_qstring.cpp b/tests/auto/corelib/tools/qstring/tst_qstring.cpp
index 45df14b560..cb61dea924 100644
--- a/tests/auto/corelib/tools/qstring/tst_qstring.cpp
+++ b/tests/auto/corelib/tools/qstring/tst_qstring.cpp
@@ -214,8 +214,8 @@ private slots:
void repeated() const;
void repeated_data() const;
void task262677remove();
- void QTBUG10404_compareRef();
- void QTBUG9281_arg_locale();
+ void compareRef();
+ void arg_locale();
void toUpperLower_icu();
void literals();
@@ -4962,7 +4962,7 @@ void tst_QString::task262677remove()
QVERIFY(driveName == QLatin1String("V:"));
}
-void tst_QString::QTBUG10404_compareRef()
+void tst_QString::compareRef()
{
QString a = "ABCDEFGH";
@@ -4993,7 +4993,7 @@ void tst_QString::QTBUG10404_compareRef()
QVERIFY(QStringRef(&a2, 1, 2).compare(QStringRef(&a, 1, 3), Qt::CaseInsensitive) < 0);
}
-void tst_QString::QTBUG9281_arg_locale()
+void tst_QString::arg_locale()
{
QLocale l(QLocale::English, QLocale::UnitedKingdom);
l.setNumberOptions(QLocale::OmitGroupSeparator);
diff --git a/tests/auto/corelib/tools/qvarlengtharray/tst_qvarlengtharray.cpp b/tests/auto/corelib/tools/qvarlengtharray/tst_qvarlengtharray.cpp
index b6bdd9d1cf..c36f293745 100644
--- a/tests/auto/corelib/tools/qvarlengtharray/tst_qvarlengtharray.cpp
+++ b/tests/auto/corelib/tools/qvarlengtharray/tst_qvarlengtharray.cpp
@@ -56,8 +56,8 @@ private slots:
void removeLast();
void oldTests();
void task214223();
- void QTBUG6718_resize();
- void QTBUG10978_realloc();
+ void resize();
+ void realloc();
};
int fooCtor = 0;
@@ -258,7 +258,7 @@ void tst_QVarLengthArray::task214223()
d.append(i);
}
-void tst_QVarLengthArray::QTBUG6718_resize()
+void tst_QVarLengthArray::resize()
{
//MOVABLE
{
@@ -400,7 +400,7 @@ Q_DECLARE_TYPEINFO(MyComplex, Q_COMPLEX_TYPE);
QT_END_NAMESPACE
-bool QTBUG10978_proceed = true;
+bool reallocTestProceed = true;
template <class T, int PreAlloc>
int countMoved(QVarLengthArray<T, PreAlloc> const &c)
@@ -414,9 +414,9 @@ int countMoved(QVarLengthArray<T, PreAlloc> const &c)
}
template <class T>
-void QTBUG10978_test()
+void reallocTest()
{
- QTBUG10978_proceed = false;
+ reallocTestProceed = false;
typedef QVarLengthArray<T, 16> Container;
enum {
@@ -578,22 +578,22 @@ void QTBUG10978_test()
QCOMPARE(MyBase::liveCount, 0);
// All done
- QTBUG10978_proceed = true;
+ reallocTestProceed = true;
}
-void tst_QVarLengthArray::QTBUG10978_realloc()
+void tst_QVarLengthArray::realloc()
{
- QTBUG10978_test<MyBase>();
- QVERIFY(QTBUG10978_proceed);
+ reallocTest<MyBase>();
+ QVERIFY(reallocTestProceed);
- QTBUG10978_test<MyPrimitive>();
- QVERIFY(QTBUG10978_proceed);
+ reallocTest<MyPrimitive>();
+ QVERIFY(reallocTestProceed);
- QTBUG10978_test<MyMovable>();
- QVERIFY(QTBUG10978_proceed);
+ reallocTest<MyMovable>();
+ QVERIFY(reallocTestProceed);
- QTBUG10978_test<MyComplex>();
- QVERIFY(QTBUG10978_proceed);
+ reallocTest<MyComplex>();
+ QVERIFY(reallocTestProceed);
}
QTEST_APPLESS_MAIN(tst_QVarLengthArray)
diff --git a/tests/auto/corelib/tools/qvector/tst_qvector.cpp b/tests/auto/corelib/tools/qvector/tst_qvector.cpp
index 2c1a17108b..77e70bd1fd 100644
--- a/tests/auto/corelib/tools/qvector/tst_qvector.cpp
+++ b/tests/auto/corelib/tools/qvector/tst_qvector.cpp
@@ -82,9 +82,9 @@ private slots:
void testOperators() const;
void outOfMemory();
- void QTBUG6416_reserve();
- void QTBUG11763_data();
- void QTBUG11763();
+ void reserve();
+ void reallocAfterCopy_data();
+ void reallocAfterCopy();
void initializeList();
void const_shared_null();
@@ -832,7 +832,7 @@ void tst_QVector::outOfMemory()
}
}
-void tst_QVector::QTBUG6416_reserve()
+void tst_QVector::reserve()
{
fooCtor = 0;
fooDtor = 0;
@@ -845,7 +845,9 @@ void tst_QVector::QTBUG6416_reserve()
QCOMPARE(fooCtor, fooDtor);
}
-void tst_QVector::QTBUG11763_data()
+// This is a regression test for QTBUG-11763, where memory would be reallocated
+// soon after copying a QVector.
+void tst_QVector::reallocAfterCopy_data()
{
QTest::addColumn<int>("capacity");
QTest::addColumn<int>("fill_size");
@@ -881,12 +883,12 @@ void tst_QVector::QTBUG11763_data()
result3 = i - 10;
result4 = i - 20;
}
- QTest::newRow(qPrintable(QString("QTBUG11763:%1,%2").arg(i).arg(j))) << i << fill_size << j << result1 << result2 << result3 << result4;
+ QTest::newRow(qPrintable(QString("reallocAfterCopy:%1,%2").arg(i).arg(j))) << i << fill_size << j << result1 << result2 << result3 << result4;
}
}
}
-void tst_QVector::QTBUG11763()
+void tst_QVector::reallocAfterCopy()
{
QFETCH(int, capacity);
QFETCH(int, fill_size);