From 59ad0019dcbb59b25a0d252575fe831b189d16f6 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 18 Sep 2012 23:07:46 +0200 Subject: Make QUrl::errorString() usable for QtTest output in invalid URLs If an URL is invalid, let's indicate that in the test output. To be helpful, let's make QUrl::errorString() include the component form of the URL. Change-Id: Iaafe16973ded79c7ea688fbb23808d91253e8c14 Reviewed-by: David Faure --- src/testlib/qtest.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/testlib') diff --git a/src/testlib/qtest.h b/src/testlib/qtest.h index beb4ad59f6..a38b65671b 100644 --- a/src/testlib/qtest.h +++ b/src/testlib/qtest.h @@ -144,6 +144,8 @@ template<> inline char *toString(const QRectF &s) template<> inline char *toString(const QUrl &uri) { + if (!uri.isValid()) + return qstrdup(QByteArray("Invalid URL: " + uri.errorString().toLatin1()).constData()); return qstrdup(uri.toEncoded().constData()); } -- cgit v1.2.3