diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2012-09-18 23:07:46 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-10-02 22:34:42 +0200 |
commit | 59ad0019dcbb59b25a0d252575fe831b189d16f6 (patch) | |
tree | 80e9c85e11f707b11df8477426871915507062fa /src/testlib/qtest.h | |
parent | adce435a0c6f6d515fa4dd3af86c725843158514 (diff) |
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 <faure@kde.org>
Diffstat (limited to 'src/testlib/qtest.h')
-rw-r--r-- | src/testlib/qtest.h | 2 |
1 files changed, 2 insertions, 0 deletions
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()); } |