From 459933708a2ead6bedb0e2a47fcea474edfa07b8 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 24 May 2016 15:53:04 +0200 Subject: Do an actual toString conversion for QVariant test failures A cast is not a conversion. If the value is not already a string type we are just getting an empty string for all metatypes that can be converted to string. Change-Id: I4643cc9fd509c21568fdc2133403c3ed8cb38a10 Reviewed-by: Simon Hausmann --- 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 c35b767875..6ab8d3d96b 100644 --- a/src/testlib/qtest.h +++ b/src/testlib/qtest.h @@ -160,7 +160,7 @@ template<> inline char *toString(const QVariant &v) if (!v.isNull()) { vstring.append(','); if (v.canConvert(QVariant::String)) { - vstring.append(qvariant_cast(v).toLocal8Bit()); + vstring.append(v.toString().toLocal8Bit()); } else { vstring.append(""); -- cgit v1.2.3