uonedb-qt team mailing list archive
-
uonedb-qt team
-
Mailing list archive
-
Message #00154
[Merge] lp:~kalikiana/u1db-qt/wrongquery into lp:u1db-qt
Christian Dywan has proposed merging lp:~kalikiana/u1db-qt/wrongquery into lp:u1db-qt.
Commit message:
Warn only once on wrong query type and test cases
Requested reviews:
U1DB Qt developers (uonedb-qt)
For more details, see:
https://code.launchpad.net/~kalikiana/u1db-qt/wrongquery/+merge/161983
Warn only once on wrong query type and test cases
--
https://code.launchpad.net/~kalikiana/u1db-qt/wrongquery/+merge/161983
Your team U1DB Qt developers is requested to review the proposed merge of lp:~kalikiana/u1db-qt/wrongquery into lp:u1db-qt.
=== modified file 'src/query.cpp'
--- src/query.cpp 2013-04-30 00:53:19 +0000
+++ src/query.cpp 2013-05-01 23:13:26 +0000
@@ -184,7 +184,10 @@
match = iterateQueryList(query, field, value_string);
}
else
- qWarning("u1db: Unexpected type %s", qPrintable(typeName));
+ {
+ m_query = "";
+ qWarning("u1db: Unexpected type %s for query", qPrintable(typeName));
+ }
return match;
@@ -227,7 +230,10 @@
}
else
- qWarning("u1db: Unexpected type %s", qPrintable(typeName));
+ {
+ m_query = "";
+ qWarning("u1db: Unexpected type %s for query", qPrintable(typeName));
+ }
}
=== modified file 'tests/tst_query.qml'
--- tests/tst_query.qml 2013-04-30 00:49:25 +0000
+++ tests/tst_query.qml 2013-05-01 23:13:26 +0000
@@ -113,6 +113,11 @@
query: [ { 'name': 'Ivanka', 'phone': '*' } ]
}
+ U1db.Query {
+ id: wrongQuery
+ index: byNamePhone
+ }
+
SignalSpy {
id: spyDocumentsChanged
target: defaultPhone
@@ -131,6 +136,13 @@
spyDocumentsChanged.wait();
}
+ function test_0_wrongUse () {
+ ignoreWarning('u1db: Unexpected type QVariantMap for query')
+ wrongQuery.query = { 'name': 'Ivanka' }
+ ignoreWarning('u1db: Unexpected type QObject* for query')
+ wrongQuery.query = defaultPhone
+ }
+
function test_1_defaults () {
// We should get all documents
workaroundQueryAndWait(defaultPhone)
Follow ups