QTestlib: Add formatting for QObject * in QCOMPARE

Output object name and class in QCOMPARE(). This should help
to debug flaky QWidget tests that for example check on focusWidget().

[ChangeLog][QtTestLib] QCOMPARE() now reports QObject * values by class and objectName().

Task-number: QTBUG-64446
Change-Id: Ife04e89bba04fc78d077c8f0f07af17a17c9cf8c
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This commit is contained in:
Friedemann Kleint 2021-05-19 10:25:45 +02:00
parent 25a7034d78
commit ae02188233
16 changed files with 155 additions and 62 deletions

View File

@ -2822,6 +2822,24 @@ char *QTest::toString(const void *p)
return msg;
}
/*! \internal
*/
char *QTest::toString(const volatile QObject *vo)
{
if (vo == nullptr)
return qstrdup("<null>");
auto *o = const_cast<const QObject*>(vo);
const QString &name = o->objectName();
const char *className = o->metaObject()->className();
char *msg = new char[256];
if (name.isEmpty())
qsnprintf(msg, 256, "%s/%p", className, o);
else
qsnprintf(msg, 256, "%s/\"%s\"", className, qPrintable(name));
return msg;
}
/*! \fn char *QTest::toString(const QColor &color)
\internal
*/

View File

@ -297,6 +297,7 @@ namespace QTest
Q_TESTLIB_EXPORT char *toString(const char *);
Q_TESTLIB_EXPORT char *toString(const volatile void *);
Q_TESTLIB_EXPORT char *toString(const void *); // ### FIXME: Qt 7: Remove
Q_TESTLIB_EXPORT char *toString(const volatile QObject *);
Q_TESTLIB_EXPORT void qInit(QObject *testObject, int argc = 0, char **argv = nullptr);
Q_TESTLIB_EXPORT int qRun();
@ -421,6 +422,27 @@ namespace QTest
toString(t1), toString(t2), actual, expected, file, line);
}
inline bool compare_ptr_helper(const volatile QObject *t1, const volatile QObject *t2, const char *actual,
const char *expected, const char *file, int line)
{
return compare_helper(t1 == t2, "Compared QObject pointers are not the same",
toString(t1), toString(t2), actual, expected, file, line);
}
inline bool compare_ptr_helper(const volatile QObject *t1, std::nullptr_t, const char *actual,
const char *expected, const char *file, int line)
{
return compare_helper(t1 == nullptr, "Compared QObject pointers are not the same",
toString(t1), toString(nullptr), actual, expected, file, line);
}
inline bool compare_ptr_helper(std::nullptr_t, const volatile QObject *t2, const char *actual,
const char *expected, const char *file, int line)
{
return compare_helper(nullptr == t2, "Compared QObject pointers are not the same",
toString(nullptr), toString(t2), actual, expected, file, line);
}
inline bool compare_ptr_helper(const volatile void *t1, std::nullptr_t, const char *actual,
const char *expected, const char *file, int line)
{

View File

@ -779,8 +779,9 @@ void tst_QThread::adoptedThreadAffinity()
thread.startAndWait(adoptedThreadAffinityFunction, affinity);
thread.join();
// adopted thread should have affinity to itself
QCOMPARE(affinity[0], affinity[1]);
// adopted thread (deleted) should have affinity to itself
QCOMPARE(static_cast<const void *>(affinity[0]),
static_cast<const void *>(affinity[1]));
}
void tst_QThread::adoptedThreadSetPriority()

View File

@ -139,6 +139,7 @@ private slots:
void compare_pointerfuncs();
void compare_tostring();
void compare_tostring_data();
void compareQObjects();
void compareQStringLists();
void compareQStringLists_data();
void compareQListInt_data();
@ -289,6 +290,17 @@ void tst_Cmptest::compare_pointerfuncs()
QCOMPARE(&i, intptr());
}
void tst_Cmptest::compareQObjects()
{
QObject object1;
object1.setObjectName(QStringLiteral("object1"));
QObject object2;
object2.setObjectName(QStringLiteral("object2"));
QCOMPARE(&object1, &object1);
QCOMPARE(&object1, &object2);
QCOMPARE(&object1, nullptr);
QCOMPARE(nullptr, &object2);
}
struct PhonyClass
{

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<testsuite name="tst_Cmptest" timestamp="@TEST_START_TIME@" tests="28" failures="45" errors="0" time="@TEST_DURATION@">
<testsuite name="tst_Cmptest" timestamp="@TEST_START_TIME@" tests="29" failures="46" errors="0" time="@TEST_DURATION@">
<properties>
<property name="QTestVersion" value="@INSERT_QT_VERSION_HERE@"/>
<property name="QtVersion" value="@INSERT_QT_VERSION_HERE@"/>
@ -54,6 +54,11 @@
Actual (actual) : QVariant(PhonyClass,&lt;value not representable as string&gt;)
Expected (expected): QVariant(PhonyClass,&lt;value not representable as string&gt;)" tag="both non&#x002D;null user type"/>
</testcase>
<testcase name="compareQObjects" result="fail" time="@TEST_DURATION@">
<failure result="fail" message="Compared QObject pointers are not the same
Actual (&amp;object1): QObject/&quot;object1&quot;
Expected (&amp;object2): QObject/&quot;object2&quot;"/>
</testcase>
<testcase name="compareQStringLists" result="fail" time="@TEST_DURATION@">
<failure result="fail" message="Compared lists differ at index 2.
Actual (opA): &quot;string3&quot;

View File

@ -109,6 +109,14 @@
</Incident>
<Duration msecs="0"/>
</TestFunction>
<TestFunction name="compareQObjects">
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
<Description><![CDATA[Compared QObject pointers are not the same
Actual (&object1): QObject/"object1"
Expected (&object2): QObject/"object2"]]></Description>
</Incident>
<Duration msecs="0"/>
</TestFunction>
<TestFunction name="compareQStringLists">
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[empty lists]]></DataTag>

View File

@ -139,9 +139,21 @@ not ok 18 - compare_tostring(both non-null user type)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
line: 0
...
ok 19 - compareQStringLists(empty lists)
ok 20 - compareQStringLists(equal lists)
not ok 21 - compareQStringLists(last item different)
not ok 19 - compareQObjects()
---
type: QCOMPARE
message: Compared QObject pointers are not the same
wanted: QObject/"object2" (&object2)
found: QObject/"object1" (&object1)
expected: QObject/"object2" (&object2)
actual: QObject/"object1" (&object1)
at: tst_Cmptest::compareQObjects() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:0)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
line: 0
...
ok 20 - compareQStringLists(empty lists)
ok 21 - compareQStringLists(equal lists)
not ok 22 - compareQStringLists(last item different)
---
type: QCOMPARE
message: Compared lists differ at index 2.
@ -153,7 +165,7 @@ not ok 21 - compareQStringLists(last item different)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
line: 0
...
not ok 22 - compareQStringLists(second-last item different)
not ok 23 - compareQStringLists(second-last item different)
---
type: QCOMPARE
message: Compared lists differ at index 2.
@ -165,7 +177,7 @@ not ok 22 - compareQStringLists(second-last item different)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
line: 0
...
not ok 23 - compareQStringLists(prefix)
not ok 24 - compareQStringLists(prefix)
---
# Compared lists have different sizes.
Actual (opA) size: 2
@ -174,7 +186,7 @@ not ok 23 - compareQStringLists(prefix)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
line: 0
...
not ok 24 - compareQStringLists(short list second)
not ok 25 - compareQStringLists(short list second)
---
# Compared lists have different sizes.
Actual (opA) size: 12
@ -183,7 +195,7 @@ not ok 24 - compareQStringLists(short list second)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
line: 0
...
not ok 25 - compareQStringLists(short list first)
not ok 26 - compareQStringLists(short list first)
---
# Compared lists have different sizes.
Actual (opA) size: 1
@ -192,8 +204,8 @@ not ok 25 - compareQStringLists(short list first)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
line: 0
...
ok 26 - compareQListInt(match)
not ok 27 - compareQListInt(size mismatch)
ok 27 - compareQListInt(match)
not ok 28 - compareQListInt(size mismatch)
---
# Compared lists have different sizes.
Actual (actual) size: 2
@ -202,7 +214,7 @@ not ok 27 - compareQListInt(size mismatch)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
line: 0
...
not ok 28 - compareQListInt(value mismatch)
not ok 29 - compareQListInt(value mismatch)
---
type: QCOMPARE
message: Compared lists differ at index 2.
@ -214,8 +226,8 @@ not ok 28 - compareQListInt(value mismatch)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
line: 0
...
ok 29 - compareQListIntToArray(match)
not ok 30 - compareQListIntToArray(size mismatch)
ok 30 - compareQListIntToArray(match)
not ok 31 - compareQListIntToArray(size mismatch)
---
# Compared lists have different sizes.
Actual (actual) size: 2
@ -224,7 +236,7 @@ not ok 30 - compareQListIntToArray(size mismatch)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
line: 0
...
not ok 31 - compareQListIntToArray(value mismatch)
not ok 32 - compareQListIntToArray(value mismatch)
---
type: QCOMPARE
message: Compared lists differ at index 2.
@ -236,8 +248,8 @@ not ok 31 - compareQListIntToArray(value mismatch)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
line: 0
...
ok 32 - compareQListIntToInitializerList(match)
not ok 33 - compareQListIntToInitializerList(size mismatch)
ok 33 - compareQListIntToInitializerList(match)
not ok 34 - compareQListIntToInitializerList(size mismatch)
---
# Compared lists have different sizes.
Actual (actual) size: 2
@ -246,7 +258,7 @@ not ok 33 - compareQListIntToInitializerList(size mismatch)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
line: 0
...
not ok 34 - compareQListIntToInitializerList(value mismatch)
not ok 35 - compareQListIntToInitializerList(value mismatch)
---
type: QCOMPARE
message: Compared lists differ at index 2.
@ -258,7 +270,7 @@ not ok 34 - compareQListIntToInitializerList(value mismatch)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
line: 0
...
not ok 35 - compareQListDouble()
not ok 36 - compareQListDouble()
---
type: QCOMPARE
message: Compared lists differ at index 0.
@ -270,8 +282,8 @@ not ok 35 - compareQListDouble()
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
line: 0
...
ok 36 - compareQColor(Qt::yellow vs "yellow")
not ok 37 - compareQColor(Qt::yellow vs Qt::green)
ok 37 - compareQColor(Qt::yellow vs "yellow")
not ok 38 - compareQColor(Qt::yellow vs Qt::green)
---
type: QCOMPARE
message: Compared values are not the same
@ -283,7 +295,7 @@ not ok 37 - compareQColor(Qt::yellow vs Qt::green)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
line: 0
...
not ok 38 - compareQColor(0x88ff0000 vs 0xffff0000)
not ok 39 - compareQColor(0x88ff0000 vs 0xffff0000)
---
type: QCOMPARE
message: Compared values are not the same
@ -295,8 +307,8 @@ not ok 38 - compareQColor(0x88ff0000 vs 0xffff0000)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
line: 0
...
ok 39 - compareQPixmaps(both null)
not ok 40 - compareQPixmaps(one null)
ok 40 - compareQPixmaps(both null)
not ok 41 - compareQPixmaps(one null)
---
type: QCOMPARE
message: Compared QPixmaps differ.
@ -308,7 +320,7 @@ not ok 40 - compareQPixmaps(one null)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
line: 0
...
not ok 41 - compareQPixmaps(other null)
not ok 42 - compareQPixmaps(other null)
---
type: QCOMPARE
message: Compared QPixmaps differ.
@ -320,8 +332,8 @@ not ok 41 - compareQPixmaps(other null)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
line: 0
...
ok 42 - compareQPixmaps(equal)
not ok 43 - compareQPixmaps(different size)
ok 43 - compareQPixmaps(equal)
not ok 44 - compareQPixmaps(different size)
---
type: QCOMPARE
message: Compared QPixmaps differ in size.
@ -333,14 +345,14 @@ not ok 43 - compareQPixmaps(different size)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
line: 0
...
not ok 44 - compareQPixmaps(different pixels)
not ok 45 - compareQPixmaps(different pixels)
---
# Compared values are not the same
at: tst_Cmptest::compareQPixmaps() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:0)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
line: 0
...
not ok 45 - compareQPixmaps(different dpr)
not ok 46 - compareQPixmaps(different dpr)
---
type: QCOMPARE
message: Compared QPixmaps differ in device pixel ratio.
@ -352,8 +364,8 @@ not ok 45 - compareQPixmaps(different dpr)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
line: 0
...
ok 46 - compareQImages(both null)
not ok 47 - compareQImages(one null)
ok 47 - compareQImages(both null)
not ok 48 - compareQImages(one null)
---
type: QCOMPARE
message: Compared QImages differ.
@ -365,7 +377,7 @@ not ok 47 - compareQImages(one null)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
line: 0
...
not ok 48 - compareQImages(other null)
not ok 49 - compareQImages(other null)
---
type: QCOMPARE
message: Compared QImages differ.
@ -377,8 +389,8 @@ not ok 48 - compareQImages(other null)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
line: 0
...
ok 49 - compareQImages(equal)
not ok 50 - compareQImages(different size)
ok 50 - compareQImages(equal)
not ok 51 - compareQImages(different size)
---
type: QCOMPARE
message: Compared QImages differ in size.
@ -390,7 +402,7 @@ not ok 50 - compareQImages(different size)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
line: 0
...
not ok 51 - compareQImages(different format)
not ok 52 - compareQImages(different format)
---
type: QCOMPARE
message: Compared QImages differ in format.
@ -402,14 +414,14 @@ not ok 51 - compareQImages(different format)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
line: 0
...
not ok 52 - compareQImages(different pixels)
not ok 53 - compareQImages(different pixels)
---
# Compared values are not the same
at: tst_Cmptest::compareQImages() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:0)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
line: 0
...
not ok 53 - compareQImages(different dpr)
not ok 54 - compareQImages(different dpr)
---
type: QCOMPARE
message: Compared QImages differ in device pixel ratio.
@ -421,8 +433,8 @@ not ok 53 - compareQImages(different dpr)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
line: 0
...
ok 54 - compareQRegion(equal-empty)
not ok 55 - compareQRegion(1-empty)
ok 55 - compareQRegion(equal-empty)
not ok 56 - compareQRegion(1-empty)
---
type: QCOMPARE
message: Compared values are not the same
@ -434,8 +446,8 @@ not ok 55 - compareQRegion(1-empty)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
line: 0
...
ok 56 - compareQRegion(equal)
not ok 57 - compareQRegion(different lists)
ok 57 - compareQRegion(equal)
not ok 58 - compareQRegion(different lists)
---
type: QCOMPARE
message: Compared values are not the same
@ -447,7 +459,7 @@ not ok 57 - compareQRegion(different lists)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
line: 0
...
not ok 58 - compareQVector2D()
not ok 59 - compareQVector2D()
---
type: QCOMPARE
message: Compared values are not the same
@ -459,7 +471,7 @@ not ok 58 - compareQVector2D()
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
line: 0
...
not ok 59 - compareQVector3D()
not ok 60 - compareQVector3D()
---
type: QCOMPARE
message: Compared values are not the same
@ -471,7 +483,7 @@ not ok 59 - compareQVector3D()
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
line: 0
...
not ok 60 - compareQVector4D()
not ok 61 - compareQVector4D()
---
type: QCOMPARE
message: Compared values are not the same
@ -483,7 +495,7 @@ not ok 60 - compareQVector4D()
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
line: 0
...
not ok 61 - verify()
not ok 62 - verify()
---
type: QVERIFY
message: Verification failed
@ -495,7 +507,7 @@ not ok 61 - verify()
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
line: 0
...
not ok 62 - verify2()
not ok 63 - verify2()
---
type: QVERIFY
message: 42
@ -507,7 +519,7 @@ not ok 62 - verify2()
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
line: 0
...
not ok 63 - tryVerify()
not ok 64 - tryVerify()
---
type: QVERIFY
message: Verification failed
@ -519,7 +531,7 @@ not ok 63 - tryVerify()
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
line: 0
...
not ok 64 - tryVerify2()
not ok 65 - tryVerify2()
---
type: QVERIFY
message: 42
@ -531,9 +543,9 @@ not ok 64 - tryVerify2()
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
line: 0
...
ok 65 - verifyExplicitOperatorBool()
ok 66 - cleanupTestCase()
1..66
# tests 66
ok 66 - verifyExplicitOperatorBool()
ok 67 - cleanupTestCase()
1..67
# tests 67
# pass 21
# fail 45
# fail 46

View File

@ -2,7 +2,7 @@
##teamcity[testStarted name='initTestCase()' flowId='tst_Cmptest']
##teamcity[testFinished name='initTestCase()' flowId='tst_Cmptest']
##teamcity[testStarted name='compare_unregistered_enums()' flowId='tst_Cmptest']
##teamcity[testFailed name='compare_unregistered_enums()' message='Failure! |[Loc: _FILE_(_LINE_)|]' details='Compared values are not the same|n Actual (MyUnregisteredEnumValue1): 0|n Expected (MyUnregisteredEnumValue2): 1' flowId='tst_Cmptest']
##teamcity[testFailed name='compare_unregistered_enums()' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)|]' details='Compared values are not the same|n Actual (MyUnregisteredEnumValue1): 0|n Expected (MyUnregisteredEnumValue2): 1' flowId='tst_Cmptest']
##teamcity[testFinished name='compare_unregistered_enums()' flowId='tst_Cmptest']
##teamcity[testStarted name='compare_registered_enums()' flowId='tst_Cmptest']
##teamcity[testFailed name='compare_registered_enums()' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)|]' details='Compared values are not the same|n Actual (Qt::Monday): Monday|n Expected (Qt::Sunday): Sunday' flowId='tst_Cmptest']
@ -46,6 +46,9 @@
##teamcity[testStarted name='compare_tostring(both non-null user type)' flowId='tst_Cmptest']
##teamcity[testFailed name='compare_tostring(both non-null user type)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)|]' details='Compared values are not the same|n Actual (actual) : QVariant(PhonyClass,<value not representable as string>)|n Expected (expected): QVariant(PhonyClass,<value not representable as string>)' flowId='tst_Cmptest']
##teamcity[testFinished name='compare_tostring(both non-null user type)' flowId='tst_Cmptest']
##teamcity[testStarted name='compareQObjects()' flowId='tst_Cmptest']
##teamcity[testFailed name='compareQObjects()' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)|]' details='Compared QObject pointers are not the same|n Actual (&object1): QObject/"object1"|n Expected (&object2): QObject/"object2"' flowId='tst_Cmptest']
##teamcity[testFinished name='compareQObjects()' flowId='tst_Cmptest']
##teamcity[testStarted name='compareQStringLists(empty lists)' flowId='tst_Cmptest']
##teamcity[testFinished name='compareQStringLists(empty lists)' flowId='tst_Cmptest']
##teamcity[testStarted name='compareQStringLists(equal lists)' flowId='tst_Cmptest']

View File

@ -51,6 +51,10 @@ FAIL! : tst_Cmptest::compare_tostring(both non-null user type) Compared values
Actual (actual) : QVariant(PhonyClass,<value not representable as string>)
Expected (expected): QVariant(PhonyClass,<value not representable as string>)
Loc: [qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)]
FAIL! : tst_Cmptest::compareQObjects() Compared QObject pointers are not the same
Actual (&object1): QObject/"object1"
Expected (&object2): QObject/"object2"
Loc: [qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)]
PASS : tst_Cmptest::compareQStringLists(empty lists)
PASS : tst_Cmptest::compareQStringLists(equal lists)
FAIL! : tst_Cmptest::compareQStringLists(last item different) Compared lists differ at index 2.
@ -189,5 +193,5 @@ FAIL! : tst_Cmptest::tryVerify2() 'opaqueFunc() < 2' returned FALSE. (42)
Loc: [qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)]
PASS : tst_Cmptest::verifyExplicitOperatorBool()
PASS : tst_Cmptest::cleanupTestCase()
Totals: 21 passed, 45 failed, 0 skipped, 0 blacklisted, 0ms
Totals: 21 passed, 46 failed, 0 skipped, 0 blacklisted, 0ms
********* Finished testing of tst_Cmptest *********

View File

@ -111,6 +111,14 @@
</Incident>
<Duration msecs="0"/>
</TestFunction>
<TestFunction name="compareQObjects">
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
<Description><![CDATA[Compared QObject pointers are not the same
Actual (&object1): QObject/"object1"
Expected (&object2): QObject/"object2"]]></Description>
</Incident>
<Duration msecs="0"/>
</TestFunction>
<TestFunction name="compareQStringLists">
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[empty lists]]></DataTag>

View File

@ -7,7 +7,7 @@
</properties>
<testcase name="initTestCase" result="pass" time="@TEST_DURATION@"/>
<testcase name="basics" result="fail" time="@TEST_DURATION@">
<failure result="fail" message="Compared pointers are not the same"/>
<failure result="fail" message="Compared QObject pointers are not the same"/>
</testcase>
<testcase name="delays" result="pass" time="@TEST_DURATION@"/>
<testcase name="reals" result="pass" time="@TEST_DURATION@"/>

View File

@ -9,7 +9,7 @@
</TestFunction>
<TestFunction name="basics">
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/testlib/tst_testlib.cpp" line="0">
<Description><![CDATA[Compared pointers are not the same]]></Description>
<Description><![CDATA[Compared QObject pointers are not the same]]></Description>
</Incident>
<Duration msecs="0"/>
</TestFunction>

View File

@ -3,7 +3,7 @@ TAP version 13
ok 1 - initTestCase()
not ok 2 - basics()
---
# Compared pointers are not the same
# Compared QObject pointers are not the same
at: tst_TestLib::basics() (qtbase/tests/auto/testlib/selftests/testlib/tst_testlib.cpp:0)
file: qtbase/tests/auto/testlib/selftests/testlib/tst_testlib.cpp
line: 0

View File

@ -2,7 +2,7 @@
##teamcity[testStarted name='initTestCase()' flowId='tst_TestLib']
##teamcity[testFinished name='initTestCase()' flowId='tst_TestLib']
##teamcity[testStarted name='basics()' flowId='tst_TestLib']
##teamcity[testFailed name='basics()' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/testlib/tst_testlib.cpp(0)|]' details='Compared pointers are not the same' flowId='tst_TestLib']
##teamcity[testFailed name='basics()' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/testlib/tst_testlib.cpp(0)|]' details='Compared QObject pointers are not the same' flowId='tst_TestLib']
##teamcity[testFinished name='basics()' flowId='tst_TestLib']
##teamcity[testStarted name='delays()' flowId='tst_TestLib']
##teamcity[testFinished name='delays()' flowId='tst_TestLib']

View File

@ -1,7 +1,7 @@
********* Start testing of tst_TestLib *********
Config: Using QtTest library
PASS : tst_TestLib::initTestCase()
FAIL! : tst_TestLib::basics() Compared pointers are not the same
FAIL! : tst_TestLib::basics() Compared QObject pointers are not the same
Loc: [qtbase/tests/auto/testlib/selftests/testlib/tst_testlib.cpp(0)]
PASS : tst_TestLib::delays()
PASS : tst_TestLib::reals(zero)

View File

@ -11,7 +11,7 @@
</TestFunction>
<TestFunction name="basics">
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/testlib/tst_testlib.cpp" line="0">
<Description><![CDATA[Compared pointers are not the same]]></Description>
<Description><![CDATA[Compared QObject pointers are not the same]]></Description>
</Incident>
<Duration msecs="0"/>
</TestFunction>