diff options
Diffstat (limited to 'tests/auto/corelib/io/qurlquery/tst_qurlquery.cpp')
-rw-r--r-- | tests/auto/corelib/io/qurlquery/tst_qurlquery.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/auto/corelib/io/qurlquery/tst_qurlquery.cpp b/tests/auto/corelib/io/qurlquery/tst_qurlquery.cpp index 8a799fbf94..8360bdbe28 100644 --- a/tests/auto/corelib/io/qurlquery/tst_qurlquery.cpp +++ b/tests/auto/corelib/io/qurlquery/tst_qurlquery.cpp @@ -73,9 +73,12 @@ static QByteArray prettyList(const QueryItems &items) static bool compare(const QueryItems &actual, const QueryItems &expected, const char *actualStr, const char *expectedStr, const char *file, int line) { + auto formatter = [](const void *val) -> const char * { + const QueryItems items = *static_cast<const QueryItems *>(val); + return qstrdup(prettyList(items).constData()); + }; return QTest::compare_helper(actual == expected, "Compared values are not the same", - [&actual] { return qstrdup(prettyList(actual).constData()); }, - [&expected] { return qstrdup(prettyList(expected).constData()); }, + &actual, &expected, formatter, formatter, actualStr, expectedStr, file, line); } |