summaryrefslogtreecommitdiffstats
path: root/tests/shared/util.h
diff options
context:
space:
mode:
Diffstat (limited to 'tests/shared/util.h')
-rw-r--r--tests/shared/util.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/shared/util.h b/tests/shared/util.h
index 6301c36..90e6535 100644
--- a/tests/shared/util.h
+++ b/tests/shared/util.h
@@ -77,9 +77,11 @@ QJsonDocument readJsonFile(const QString &filename, QJsonParseError *error = 0)
{
QString filepath = filename;
QFile jsonFile(filepath);
- if (!jsonFile.exists() && error) {
- error->error = QJsonParseError::EndOfString;
- error->offset = 0;
+ if (!jsonFile.exists()) {
+ if (error) {
+ error->error = QJsonParseError::MissingObject;
+ error->offset = 0;
+ }
return QJsonDocument();
}
jsonFile.open(QIODevice::ReadOnly);