private slots:
void alive();
void addMouseDClick() const;
- void compareQStringLists() const;
- void compareQStringLists_data() const;
};
void tst_Alive::alive()
QVERIFY(listener.isTested);
}
-void tst_Alive::compareQStringLists() const
-{
- QFETCH(QStringList, opA);
- QFETCH(QStringList, opB);
-
- QCOMPARE(opA, opB);
-}
-
-void tst_Alive::compareQStringLists_data() const
-{
- QTest::addColumn<QStringList>("opA");
- QTest::addColumn<QStringList>("opB");
-
- {
- QStringList opA;
- opA.append(QLatin1String("string1"));
- opA.append(QLatin1String("string2"));
-
- QStringList opB(opA);
- opA.append(QLatin1String("string3"));
- opB.append(QLatin1String("DIFFERS"));
-
- QTest::newRow("") << opA << opB;
- }
-
- {
- QStringList opA;
- opA.append(QLatin1String("string1"));
- opA.append(QLatin1String("string2"));
-
- QStringList opB(opA);
- opA.append(QLatin1String("string3"));
- opA.append(QLatin1String("string4"));
-
- opB.append(QLatin1String("DIFFERS"));
- opB.append(QLatin1String("string4"));
-
- QTest::newRow("") << opA << opB;
- }
-
- {
- QStringList opA;
- opA.append(QLatin1String("string1"));
- opA.append(QLatin1String("string2"));
-
- QStringList opB;
- opB.append(QLatin1String("string1"));
-
- QTest::newRow("") << opA << opB;
- }
-
- {
- QStringList opA;
- opA.append(QLatin1String("openInNewWindow"));
- opA.append(QLatin1String("openInNewTab"));
- opA.append(QLatin1String("separator"));
- opA.append(QLatin1String("bookmark_add"));
- opA.append(QLatin1String("savelinkas"));
- opA.append(QLatin1String("copylinklocation"));
- opA.append(QLatin1String("separator"));
- opA.append(QLatin1String("openWith_submenu"));
- opA.append(QLatin1String("preview1"));
- opA.append(QLatin1String("actions_submenu"));
- opA.append(QLatin1String("separator"));
- opA.append(QLatin1String("viewDocumentSource"));
-
- QStringList opB;
- opB.append(QLatin1String("viewDocumentSource"));
-
- QTest::newRow("") << opA << opB;
-
- QTest::newRow("") << opB << opA;
- }
-}
-
QTEST_MAIN(tst_Alive)
#include "tst_alive.moc"
void compare_pointerfuncs();
void compare_tostring();
void compare_tostring_data();
+ void compareQStringLists();
+ void compareQStringLists_data();
};
static bool boolfunc() { return true; }
QCOMPARE(actual, expected);
}
-QTEST_MAIN(tst_Cmptest)
+void tst_Cmptest::compareQStringLists_data()
+{
+ QTest::addColumn<QStringList>("opA");
+ QTest::addColumn<QStringList>("opB");
+
+ {
+ QStringList opA;
+ opA.append(QLatin1String("string1"));
+ opA.append(QLatin1String("string2"));
+
+ QStringList opB(opA);
+ opA.append(QLatin1String("string3"));
+ opB.append(QLatin1String("DIFFERS"));
+
+ QTest::newRow("") << opA << opB;
+ }
+
+ {
+ QStringList opA;
+ opA.append(QLatin1String("string1"));
+ opA.append(QLatin1String("string2"));
+
+ QStringList opB(opA);
+ opA.append(QLatin1String("string3"));
+ opA.append(QLatin1String("string4"));
+
+ opB.append(QLatin1String("DIFFERS"));
+ opB.append(QLatin1String("string4"));
+
+ QTest::newRow("") << opA << opB;
+ }
+
+ {
+ QStringList opA;
+ opA.append(QLatin1String("string1"));
+ opA.append(QLatin1String("string2"));
+
+ QStringList opB;
+ opB.append(QLatin1String("string1"));
+
+ QTest::newRow("") << opA << opB;
+ }
+
+ {
+ QStringList opA;
+ opA.append(QLatin1String("openInNewWindow"));
+ opA.append(QLatin1String("openInNewTab"));
+ opA.append(QLatin1String("separator"));
+ opA.append(QLatin1String("bookmark_add"));
+ opA.append(QLatin1String("savelinkas"));
+ opA.append(QLatin1String("copylinklocation"));
+ opA.append(QLatin1String("separator"));
+ opA.append(QLatin1String("openWith_submenu"));
+ opA.append(QLatin1String("preview1"));
+ opA.append(QLatin1String("actions_submenu"));
+ opA.append(QLatin1String("separator"));
+ opA.append(QLatin1String("viewDocumentSource"));
+
+ QStringList opB;
+ opB.append(QLatin1String("viewDocumentSource"));
+
+ QTest::newRow("") << opA << opB;
+
+ QTest::newRow("") << opB << opA;
+ }
+}
+
+void tst_Cmptest::compareQStringLists()
+{
+ QFETCH(QStringList, opA);
+ QFETCH(QStringList, opB);
+
+ QCOMPARE(opA, opB);
+}
+QTEST_MAIN(tst_Cmptest)
#include "tst_cmptest.moc"
QWARN : tst_Alive::alive() TEST LAGS 4 PINGS behind!
PASS : tst_Alive::alive()
PASS : tst_Alive::addMouseDClick()
-FAIL! : tst_Alive::compareQStringLists() Compared QStringLists differ at index 2.
- Actual (opA) : 'string3'
- Expected (opB) : 'DIFFERS'
- Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/alive/tst_alive.cpp(68)]
-FAIL! : tst_Alive::compareQStringLists() Compared QStringLists differ at index 2.
- Actual (opA) : 'string3'
- Expected (opB) : 'DIFFERS'
- Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/alive/tst_alive.cpp(68)]
-FAIL! : tst_Alive::compareQStringLists() Compared QStringLists have different sizes.
- Actual (opA) size : '2'
- Expected (opB) size: '1'
- Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/alive/tst_alive.cpp(68)]
-FAIL! : tst_Alive::compareQStringLists() Compared QStringLists have different sizes.
- Actual (opA) size : '12'
- Expected (opB) size: '1'
- Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/alive/tst_alive.cpp(68)]
-FAIL! : tst_Alive::compareQStringLists() Compared QStringLists have different sizes.
- Actual (opA) size : '1'
- Expected (opB) size: '12'
- Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/alive/tst_alive.cpp(68)]
PASS : tst_Alive::cleanupTestCase()
-Totals: 4 passed, 5 failed, 0 skipped
+Totals: 4 passed, 0 failed, 0 skipped
********* Finished testing of tst_Alive *********
Expected (expected): QVariant(PhonyClass,<value not representable as string>)]]></Description>
</Incident>
</TestFunction>
+<TestFunction name="compareQStringLists">
+<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="203">
+ <Description><![CDATA[Compared QStringLists differ at index 2.
+ Actual (opA) : 'string3'
+ Expected (opB) : 'DIFFERS']]></Description>
+</Incident>
+<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="203">
+ <Description><![CDATA[Compared QStringLists differ at index 2.
+ Actual (opA) : 'string3'
+ Expected (opB) : 'DIFFERS']]></Description>
+</Incident>
+<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="203">
+ <Description><![CDATA[Compared QStringLists have different sizes.
+ Actual (opA) size : '2'
+ Expected (opB) size: '1']]></Description>
+</Incident>
+<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="203">
+ <Description><![CDATA[Compared QStringLists have different sizes.
+ Actual (opA) size : '12'
+ Expected (opB) size: '1']]></Description>
+</Incident>
+<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="203">
+ <Description><![CDATA[Compared QStringLists have different sizes.
+ Actual (opA) size : '1'
+ Expected (opB) size: '12']]></Description>
+</Incident>
+</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />
</TestFunction>
Actual (actual): QVariant(PhonyClass,<value not representable as string>)
Expected (expected): QVariant(PhonyClass,<value not representable as string>)
Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(122)]
+FAIL! : tst_Cmptest::compareQStringLists() Compared QStringLists differ at index 2.
+ Actual (opA) : 'string3'
+ Expected (opB) : 'DIFFERS'
+ Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/alive/tst_alive.cpp(68)]
+FAIL! : tst_Cmptest::compareQStringLists() Compared QStringLists differ at index 2.
+ Actual (opA) : 'string3'
+ Expected (opB) : 'DIFFERS'
+ Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/alive/tst_alive.cpp(68)]
+FAIL! : tst_Cmptest::compareQStringLists() Compared QStringLists have different sizes.
+ Actual (opA) size : '2'
+ Expected (opB) size: '1'
+ Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/alive/tst_alive.cpp(68)]
+FAIL! : tst_Cmptest::compareQStringLists() Compared QStringLists have different sizes.
+ Actual (opA) size : '12'
+ Expected (opB) size: '1'
+ Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/alive/tst_alive.cpp(68)]
+FAIL! : tst_Cmptest::compareQStringLists() Compared QStringLists have different sizes.
+ Actual (opA) size : '1'
+ Expected (opB) size: '12'
+ Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/alive/tst_alive.cpp(68)]
PASS : tst_Cmptest::cleanupTestCase()
-Totals: 4 passed, 4 failed, 0 skipped
+Totals: 4 passed, 9 failed, 0 skipped
********* Finished testing of tst_Cmptest *********
Expected (expected): QVariant(PhonyClass,<value not representable as string>)]]></Description>
</Incident>
</TestFunction>
+<TestFunction name="compareQStringLists">
+<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="203">
+ <Description><![CDATA[Compared QStringLists differ at index 2.
+ Actual (opA) : 'string3'
+ Expected (opB) : 'DIFFERS']]></Description>
+</Incident>
+<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="203">
+ <Description><![CDATA[Compared QStringLists differ at index 2.
+ Actual (opA) : 'string3'
+ Expected (opB) : 'DIFFERS']]></Description>
+</Incident>
+<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="203">
+ <Description><![CDATA[Compared QStringLists have different sizes.
+ Actual (opA) size : '2'
+ Expected (opB) size: '1']]></Description>
+</Incident>
+<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="203">
+ <Description><![CDATA[Compared QStringLists have different sizes.
+ Actual (opA) size : '12'
+ Expected (opB) size: '1']]></Description>
+</Incident>
+<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="203">
+ <Description><![CDATA[Compared QStringLists have different sizes.
+ Actual (opA) size : '1'
+ Expected (opB) size: '12']]></Description>
+</Incident>
+</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />
</TestFunction>
<?xml version="1.0" encoding="UTF-8" ?>
-<testsuite errors="0" failures="4" tests="5" name="tst_Cmptest">
+<testsuite errors="0" failures="9" tests="6" name="tst_Cmptest">
<properties>
<property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/>
<property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/>
Actual (actual): QVariant(PhonyClass,<value not representable as string>)
Expected (expected): QVariant(PhonyClass,<value not representable as string>)" result="fail"/>
</testcase>
+ <testcase result="fail" name="compareQStringLists">
+ <failure message="Compared QStringLists differ at index 2.
+ Actual (opA) : 'string3'
+ Expected (opB) : 'DIFFERS'" result="fail"/>
+ <failure message="Compared QStringLists differ at index 2.
+ Actual (opA) : 'string3'
+ Expected (opB) : 'DIFFERS'" result="fail"/>
+ <failure message="Compared QStringLists have different sizes.
+ Actual (opA) size : '2'
+ Expected (opB) size: '1'" result="fail"/>
+ <failure message="Compared QStringLists have different sizes.
+ Actual (opA) size : '12'
+ Expected (opB) size: '1'" result="fail"/>
+ <failure message="Compared QStringLists have different sizes.
+ Actual (opA) size : '1'
+ Expected (opB) size: '12'" result="fail"/>
+ </testcase>
<testcase result="pass" name="cleanupTestCase"/>
<system-err/>
</testsuite>