summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/json
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@nokia.com>2012-01-26 12:12:44 +0100
committerQt by Nokia <qt-info@nokia.com>2012-01-30 18:48:28 +0100
commit34e8dd5d6f250463194e9b7a0f63e7e021ec8d6b (patch)
treef3fc48ff2dfdb378d9ad4551bf530393f9e26454 /tests/auto/corelib/json
parentd3fdc132fe67806fe4a5ab73c43effa281c6d8a2 (diff)
Add the missing test file and give it a proper name.
Change-Id: Icb9bc2aab99d52b5ffbd6153ce94d64a494330d8 Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
Diffstat (limited to 'tests/auto/corelib/json')
-rw-r--r--tests/auto/corelib/json/test3.json15
-rw-r--r--tests/auto/corelib/json/tst_qtjson.cpp7
2 files changed, 19 insertions, 3 deletions
diff --git a/tests/auto/corelib/json/test3.json b/tests/auto/corelib/json/test3.json
new file mode 100644
index 0000000000..48cb29a47f
--- /dev/null
+++ b/tests/auto/corelib/json/test3.json
@@ -0,0 +1,15 @@
+{
+ "firstName": "John",
+ "lastName" : "Smith",
+ "age" : 25,
+ "address" : {
+ "streetAddress": "21 2nd Street",
+ "city" : "New York",
+ "state" : "NY",
+ "postalCode" : "10021"
+ },
+ "phoneNumber": [
+ { "type" : "home", "number": "212 555-1234" },
+ { "type" : "fax", "number": "646 555-4567" }
+ ]
+}
diff --git a/tests/auto/corelib/json/tst_qtjson.cpp b/tests/auto/corelib/json/tst_qtjson.cpp
index a0f36d551d..dd2d611ded 100644
--- a/tests/auto/corelib/json/tst_qtjson.cpp
+++ b/tests/auto/corelib/json/tst_qtjson.cpp
@@ -1337,6 +1337,7 @@ void TestQtJson::validation()
QVERIFY(!testJson.isEmpty());
QJsonDocument doc = QJsonDocument::fromJson(testJson);
+ QVERIFY(!doc.isNull());
QByteArray binary = doc.toBinaryData();
@@ -1351,13 +1352,13 @@ void TestQtJson::validation()
}
- QFile file2(QLatin1String(SRCDIR "foo.json"));
-// QVERIFY(file2.open(QFile::ReadOnly)); // ### the file is missing o_O
+ QFile file2(QLatin1String(SRCDIR "test3.json"));
file2.open(QFile::ReadOnly);
testJson = file2.readAll();
-// QVERIFY(!testJson.isEmpty());
+ QVERIFY(!testJson.isEmpty());
doc = QJsonDocument::fromJson(testJson);
+ QVERIFY(!doc.isNull());
binary = doc.toBinaryData();