summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2017-06-02 13:46:37 +0200
committerJoerg Bornemann <joerg.bornemann@qt.io>2017-06-02 18:31:38 +0000
commit2503ffaa94be26c87be411fd658ccaf30a11912b (patch)
tree6a809889c7a23de87747ed3a3cc681b57e7aca15
parent438c774acf103055612022dfe4f6f2a5bbcd2899 (diff)
downloadqbs-2503ffaa94be26c87be411fd658ccaf30a11912b.tar.gz
Tighten QBS_ASSERTs in EvaluatorScriptClass
Let QueryResult::isNull() (which is only used in QBS_ASSERTs) check all struct members to make sure we do not encounter old data in queryProperty/property calls. Change-Id: I8412e8e8cba7ab38f56c303499384711b78f0623 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
-rw-r--r--src/lib/corelib/language/evaluatorscriptclass.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/lib/corelib/language/evaluatorscriptclass.h b/src/lib/corelib/language/evaluatorscriptclass.h
index fe0b56215..c6c16cf44 100644
--- a/src/lib/corelib/language/evaluatorscriptclass.h
+++ b/src/lib/corelib/language/evaluatorscriptclass.h
@@ -91,7 +91,16 @@ private:
bool isNull() const
{
- return !data;
+ static const QueryResult pristine;
+ return *this == pristine;
+ }
+
+ bool operator==(const QueryResult &rhs) const
+ {
+ return foundInParent == rhs.foundInParent
+ && data == rhs.data
+ && itemOfProperty == rhs.itemOfProperty
+ && value == rhs.value;
}
bool foundInParent = false;