Improve QStringList test in cmptest selftest.
authorJason McDonald <jason.mcdonald@nokia.com>
Tue, 13 Dec 2011 08:20:36 +0000 (18:20 +1000)
committerQt by Nokia <qt-info@nokia.com>
Wed, 14 Dec 2011 01:40:31 +0000 (02:40 +0100)
The old test only verified the behaviour of QCOMPARE when comparing
lists that were different.  Add data rows for comparing empty lists and
non-empty lists that are equal.

Note that testlib currently does not report passing data rows (only
failing rows and completely passing test functions), so the new data
rows do not cause any change in the expected test output.

Change-Id: I137650ce0ca6250cee36bd9cb74b01f8abd4e89c
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp

index c2e7f26..6e19d60 100644 (file)
@@ -135,6 +135,25 @@ void tst_Cmptest::compareQStringLists_data()
 
     {
         QStringList opA;
+        QStringList opB(opA);
+
+        QTest::newRow("empty lists") << opA << opB;
+    }
+
+    {
+        QStringList opA;
+        opA.append(QLatin1String("string1"));
+        opA.append(QLatin1String("string2"));
+        opA.append(QLatin1String("string3"));
+        opA.append(QLatin1String("string4"));
+
+        QStringList opB(opA);
+
+        QTest::newRow("equal lists") << opA << opB;
+    }
+
+    {
+        QStringList opA;
         opA.append(QLatin1String("string1"));
         opA.append(QLatin1String("string2"));