Does Qt testing framework support comparing list of pointers or I am doing something wrong?
My unit test source is as follows:
QList<QString *> list1;
QList<QString *> list2;
list1.append(new QString("test"));
list2.append(new QString("test"));
QCOMPARE(list1, list2);
After running this test, I was expecting passed test, but test failed with following output:
********* Start testing of ConfigurationTest *********
Config: Using QtTest library 5.5.1, Qt 5.5.1 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 5.4.0 20160609)
FAIL! : ConfigurationTest::test_sample(default) Compared lists differ at index 0.
Actual (list1): <null>
Expected (list2): <null>
Loc: [../unittest/sample_test.cpp(32)]
Totals: 0 passed, 1 failed, 0 skipped, 0 blacklisted
********* Finished testing of ConfigurationTest *********
If list contains non-pointer elements, QCOMPARE does not have any issues with it and returns "passed" output.