QTestlib: Fix formatting of pointers in QCOMPARE
After 1ed8a7bff5
,
volatile needs to be specified for toString(), else it is not
used by compare_ptr_helper(). Add an overload.
Pick-to: 6.1 5.15
Change-Id: I3c335f324df346233623272d1014c8360ca33160
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
895edcd7cd
commit
6fff7bb269
@ -2810,6 +2810,11 @@ char *QTest::toString(const char *str)
|
||||
|
||||
/*! \internal
|
||||
*/
|
||||
char *QTest::toString(const volatile void *p) // Use volatile to match compare_ptr_helper()
|
||||
{
|
||||
return QTest::toString(const_cast<const void *>(p));
|
||||
}
|
||||
|
||||
char *QTest::toString(const void *p)
|
||||
{
|
||||
char *msg = new char[128];
|
||||
|
@ -295,7 +295,8 @@ namespace QTest
|
||||
Q_TESTLIB_EXPORT char *toPrettyCString(const char *unicode, int length);
|
||||
Q_TESTLIB_EXPORT char *toPrettyUnicode(QStringView string);
|
||||
Q_TESTLIB_EXPORT char *toString(const char *);
|
||||
Q_TESTLIB_EXPORT char *toString(const void *);
|
||||
Q_TESTLIB_EXPORT char *toString(const volatile void *);
|
||||
Q_TESTLIB_EXPORT char *toString(const void *); // ### FIXME: Qt 7: Remove
|
||||
|
||||
Q_TESTLIB_EXPORT void qInit(QObject *testObject, int argc = 0, char **argv = nullptr);
|
||||
Q_TESTLIB_EXPORT int qRun();
|
||||
|
Loading…
Reference in New Issue
Block a user