path: root/src/testlib/qtest.h
diff options
authorThiago Macieira <>2014-01-20 16:03:30 -0800
committerThiago Macieira <>2015-02-15 06:35:43 +0000
commitf5b609cac864e010085d5965b84832b2d85643e6 (patch)
treeccb339e9bb957c25591192b62590158d867f5d84 /src/testlib/qtest.h
parent8d9d2a7b8568c4c067252e6ca9eea45de7a743a5 (diff)
Make the printing of complex byte arrays prettier
Similar to what we've done to QString, only we print each byte that is not ASCII as \OOO (octal representation). [ChangeLog][QtTest] QtTest now prints an escaped version of QByteArrays that failed to compare with QCOMPARE, instead of the hex dump. Change-Id: I6a8c43f138c66c998280998a242b43cd579666a0 Reviewed-by: Richard J. Moore <>
Diffstat (limited to 'src/testlib/qtest.h')
1 files changed, 1 insertions, 1 deletions
diff --git a/src/testlib/qtest.h b/src/testlib/qtest.h
index 38c1807e08..81cc07c410 100644
--- a/src/testlib/qtest.h
+++ b/src/testlib/qtest.h
@@ -70,7 +70,7 @@ template<> inline char *toString(const QLatin1String &str)
template<> inline char *toString(const QByteArray &ba)
- return QTest::toHexRepresentation(ba.constData(), ba.length());
+ return QTest::toPrettyCString(ba.constData(), ba.length());