From d939dd8791134a41d36196213f463660a1c87421 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Tue, 13 Dec 2011 18:20:36 +1000 Subject: Improve QStringList test in cmptest selftest. 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 --- tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'tests/auto/testlib/selftests') diff --git a/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp b/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp index c2e7f26387..6e19d60cbb 100644 --- a/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp +++ b/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp @@ -133,6 +133,25 @@ void tst_Cmptest::compareQStringLists_data() QTest::addColumn("opA"); QTest::addColumn("opB"); + { + 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")); -- cgit v1.2.3