summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikhail Svetkin <mikhail.svetkin@gmail.com>2020-04-28 21:47:07 +0200
committerMikhail Svetkin <mikhail.svetkin@gmail.com>2020-05-14 19:52:34 +0200
commitf28694ea2c6ef25c2803df0916891dd0f33a3e4e (patch)
tree89ce4985ea7e865c976ee0bff8cbadbed767255d
parent1c254ef8d470caa5f9a18ff0a6297bbf935f9c0d (diff)
tst_qhttpserver: Add expected warning messages
Change-Id: Iffbde346b6e8454dc9e8b19d96e8a4a4e860f1e2 Reviewed-by: Mikhail Svetkin <mikhail.svetkin@gmail.com>
-rw-r--r--src/httpserver/qhttpserverrouterrule.cpp2
-rw-r--r--tests/auto/qhttpserver/tst_qhttpserver.cpp6
2 files changed, 7 insertions, 1 deletions
diff --git a/src/httpserver/qhttpserverrouterrule.cpp b/src/httpserver/qhttpserverrouterrule.cpp
index b9758c8..e09bedd 100644
--- a/src/httpserver/qhttpserverrouterrule.cpp
+++ b/src/httpserver/qhttpserverrouterrule.cpp
@@ -237,7 +237,7 @@ bool QHttpServerRouterRule::createPathRegexp(const std::initializer_list<int> &m
auto it = converters.constFind(type);
if (it == converters.end()) {
- qCWarning(lcRouterRule) << "can not find converter for type:"
+ qCWarning(lcRouterRule) << "Can not find converter for type:"
<< QMetaType::typeName(type);
return false;
}
diff --git a/tests/auto/qhttpserver/tst_qhttpserver.cpp b/tests/auto/qhttpserver/tst_qhttpserver.cpp
index 83824e1..4c50463 100644
--- a/tests/auto/qhttpserver/tst_qhttpserver.cpp
+++ b/tests/auto/qhttpserver/tst_qhttpserver.cpp
@@ -808,18 +808,21 @@ struct CustomType {
void tst_QHttpServer::invalidRouterArguments()
{
+ QTest::ignoreMessage(QtWarningMsg, "Can not find converter for type: QDateTime");
QCOMPARE(
httpserver.route("/datetime/", [] (const QDateTime &datetime) {
return QString("datetime: %1").arg(datetime.toString());
}),
false);
+ QTest::ignoreMessage(QtWarningMsg, "Can not convert GeT to QHttpServerRequest::Method");
QCOMPARE(
httpserver.route("/invalid-rule-method", "GeT", [] () {
return "";
}),
false);
+ QTest::ignoreMessage(QtWarningMsg, "Can not convert Garbage to QHttpServerRequest::Method");
QCOMPARE(
httpserver.route("/invalid-rule-method", "Garbage", [] () {
return "";
@@ -832,6 +835,9 @@ void tst_QHttpServer::invalidRouterArguments()
}),
false);
+ QTest::ignoreMessage(QtWarningMsg,
+ "CustomType has not registered a converter to QString. "
+ "Use QHttpServerRouter::addConveter<Type>(converter).");
QCOMPARE(
httpserver.route("/implicit-conversion-to-qstring-has-no-registered/",
[] (const CustomType &) {