diff options
author | Jason McDonald <jason.mcdonald@nokia.com> | 2011-12-13 18:20:36 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-12-14 02:40:31 +0100 |
commit | d939dd8791134a41d36196213f463660a1c87421 (patch) | |
tree | 7ef5ef21b26a5b906bee49e49d336aa1ea64122e /tests/auto | |
parent | 4a233f9a9017418d0d95a94b0a1b25c8e338da91 (diff) |
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 <rohan.mcgovern@nokia.com>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
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 @@ -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")); |