From f5b609cac864e010085d5965b84832b2d85643e6 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 20 Jan 2014 16:03:30 -0800 Subject: 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 --- src/testlib/qtest.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/testlib/qtest.h') 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()); } #ifndef QT_NO_DATESTRING -- cgit v1.2.3