diff options
author | Olivier Goffart <ogoffart@trolltech.com> | 2010-02-21 17:49:35 (GMT) |
---|---|---|
committer | Olivier Goffart <olivier.goffart@nokia.com> | 2011-04-01 10:59:41 (GMT) |
commit | bade388c7aae4b166ab442b1933ea59c5d4c482a (patch) | |
tree | f6afaeddaebdfb2ce5139affb289c8be8b21acf6 /tests/auto | |
parent | 7101a3fafb40cacb855ee07036ce4baacc5d202b (diff) | |
download | Qt-bade388c7aae4b166ab442b1933ea59c5d4c482a.zip Qt-bade388c7aae4b166ab442b1933ea59c5d4c482a.tar.gz Qt-bade388c7aae4b166ab442b1933ea59c5d4c482a.tar.bz2 |
Fix autotest when using QStringBuilder
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/qbytearray/tst_qbytearray.cpp | 12 | ||||
-rw-r--r-- | tests/auto/qstring/tst_qstring.cpp | 38 |
2 files changed, 25 insertions, 25 deletions
diff --git a/tests/auto/qbytearray/tst_qbytearray.cpp b/tests/auto/qbytearray/tst_qbytearray.cpp index 5fff22a..0dea9be 100644 --- a/tests/auto/qbytearray/tst_qbytearray.cpp +++ b/tests/auto/qbytearray/tst_qbytearray.cpp @@ -898,12 +898,12 @@ void tst_QByteArray::indexOf_data() QByteArray veryBigHaystack(500, 'a'); veryBigHaystack += 'B'; QTest::newRow("BoyerMooreStressTest") << veryBigHaystack << veryBigHaystack << 0 << 0; - QTest::newRow("BoyerMooreStressTest2") << veryBigHaystack + 'c' << veryBigHaystack << 0 << 0; - QTest::newRow("BoyerMooreStressTest3") << 'c' + veryBigHaystack << veryBigHaystack << 0 << 1; - QTest::newRow("BoyerMooreStressTest4") << veryBigHaystack << veryBigHaystack + 'c' << 0 << -1; - QTest::newRow("BoyerMooreStressTest5") << veryBigHaystack << 'c' + veryBigHaystack << 0 << -1; - QTest::newRow("BoyerMooreStressTest6") << 'd' + veryBigHaystack << 'c' + veryBigHaystack << 0 << -1; - QTest::newRow("BoyerMooreStressTest6") << veryBigHaystack + 'c' << 'c' + veryBigHaystack << 0 << -1; + QTest::newRow("BoyerMooreStressTest2") << QByteArray(veryBigHaystack + 'c') << QByteArray(veryBigHaystack) << 0 << 0; + QTest::newRow("BoyerMooreStressTest3") << QByteArray('c' + veryBigHaystack) << QByteArray(veryBigHaystack) << 0 << 1; + QTest::newRow("BoyerMooreStressTest4") << QByteArray(veryBigHaystack) << QByteArray(veryBigHaystack + 'c') << 0 << -1; + QTest::newRow("BoyerMooreStressTest5") << QByteArray(veryBigHaystack) << QByteArray('c' + veryBigHaystack) << 0 << -1; + QTest::newRow("BoyerMooreStressTest6") << QByteArray('d' + veryBigHaystack) << QByteArray('c' + veryBigHaystack) << 0 << -1; + QTest::newRow("BoyerMooreStressTest6") << QByteArray(veryBigHaystack + 'c') << QByteArray('c' + veryBigHaystack) << 0 << -1; } void tst_QByteArray::indexOf() diff --git a/tests/auto/qstring/tst_qstring.cpp b/tests/auto/qstring/tst_qstring.cpp index abc8d9a..25e16fe 100644 --- a/tests/auto/qstring/tst_qstring.cpp +++ b/tests/auto/qstring/tst_qstring.cpp @@ -697,11 +697,11 @@ void tst_QString::acc_01() QVERIFY(a<=c); QVERIFY(!(c<=a)); QVERIFY(!(d<=a)); - QCOMPARE(a+b,(QString)"ABCABC"); - QCOMPARE(a +"XXXX",(QString)"ABCXXXX"); - QCOMPARE(a+'X',(QString)"ABCX"); - QCOMPARE("XXXX"+a,(QString)"XXXXABC"); - QCOMPARE('X'+a,(QString)"XABC"); + QCOMPARE(QString(a+b),(QString)"ABCABC"); + QCOMPARE(QString(a+"XXXX"),(QString)"ABCXXXX"); + QCOMPARE(QString(a+'X'),(QString)"ABCX"); + QCOMPARE(QString("XXXX"+a),(QString)"XXXXABC"); + QCOMPARE(QString('X'+a),(QString)"XABC"); a = (const char*)0; QVERIFY(a.isNull()); QVERIFY(*a.toLatin1().constData() == '\0'); @@ -1060,12 +1060,12 @@ void tst_QString::indexOf_data() QString veryBigHaystack(500, 'a'); veryBigHaystack += 'B'; QTest::newRow("BoyerMooreStressTest") << veryBigHaystack << veryBigHaystack << 0 << true << 0; - QTest::newRow("BoyerMooreStressTest2") << veryBigHaystack + 'c' << veryBigHaystack << 0 << true << 0; - QTest::newRow("BoyerMooreStressTest3") << 'c' + veryBigHaystack << veryBigHaystack << 0 << true << 1; - QTest::newRow("BoyerMooreStressTest4") << veryBigHaystack << veryBigHaystack + 'c' << 0 << true << -1; - QTest::newRow("BoyerMooreStressTest5") << veryBigHaystack << 'c' + veryBigHaystack << 0 << true << -1; - QTest::newRow("BoyerMooreStressTest6") << 'd' + veryBigHaystack << 'c' + veryBigHaystack << 0 << true << -1; - QTest::newRow("BoyerMooreStressTest6") << veryBigHaystack + 'c' << 'c' + veryBigHaystack << 0 << true << -1; + QTest::newRow("BoyerMooreStressTest2") << QString(veryBigHaystack + 'c') << veryBigHaystack << 0 << true << 0; + QTest::newRow("BoyerMooreStressTest3") << QString('c' + veryBigHaystack) << veryBigHaystack << 0 << true << 1; + QTest::newRow("BoyerMooreStressTest4") << veryBigHaystack << QString(veryBigHaystack + 'c') << 0 << true << -1; + QTest::newRow("BoyerMooreStressTest5") << veryBigHaystack << QString('c' + veryBigHaystack) << 0 << true << -1; + QTest::newRow("BoyerMooreStressTest6") << QString('d' + veryBigHaystack) << QString('c' + veryBigHaystack) << 0 << true << -1; + QTest::newRow("BoyerMooreStressTest6") << QString(veryBigHaystack + 'c') << QString('c' + veryBigHaystack) << 0 << true << -1; QTest::newRow("BoyerMooreInsensitiveStressTest") << veryBigHaystack << veryBigHaystack << 0 << false << 0; @@ -1175,14 +1175,14 @@ void tst_QString::indexOf2_data() QString whale = "a5zby6cx7dw8evf9ug0th1si2rj3qkp4lomn"; QString minnow = "zby"; QTest::newRow( "data40" ) << whale << minnow << 2; - QTest::newRow( "data41" ) << (whale + whale) << minnow << 2; - QTest::newRow( "data42" ) << (minnow + whale) << minnow << 0; + QTest::newRow( "data41" ) << QString(whale + whale) << minnow << 2; + QTest::newRow( "data42" ) << QString(minnow + whale) << minnow << 0; QTest::newRow( "data43" ) << whale << whale << 0; - QTest::newRow( "data44" ) << (whale + whale) << whale << 0; - QTest::newRow( "data45" ) << whale << (whale + whale) << -1; - QTest::newRow( "data46" ) << (whale + whale) << (whale + whale) << 0; - QTest::newRow( "data47" ) << (whale + whale) << (whale + minnow) << -1; - QTest::newRow( "data48" ) << (minnow + whale) << whale << (int)minnow.length(); + QTest::newRow( "data44" ) << QString(whale + whale) << whale << 0; + QTest::newRow( "data45" ) << whale << QString(whale + whale) << -1; + QTest::newRow( "data46" ) << QString(whale + whale) << QString(whale + whale) << 0; + QTest::newRow( "data47" ) << QString(whale + whale) << QString(whale + minnow) << -1; + QTest::newRow( "data48" ) << QString(minnow + whale) << whale << (int)minnow.length(); } void tst_QString::indexOf2() @@ -1631,7 +1631,7 @@ void tst_QString::toLower() QCOMPARE( QString("`ABYZ{").toLower(), QString("`abyz{")); QCOMPARE( QString("`abyz{").toLower(), QString("`abyz{")); - QCOMPARE( QString(1, QChar(0x130)).toLower(), QString(1, QChar(0x69)) + QChar(0x307)); + QCOMPARE( QString(1, QChar(0x130)).toLower(), QString(QString(1, QChar(0x69)) + QChar(0x307))); QString lower; lower += QChar(QChar::highSurrogate(0x10428)); |