diff options
Diffstat (limited to 'tests/auto/corelib/serialization/qcborvalue_json/tst_qcborvalue_json.cpp')
-rw-r--r-- | tests/auto/corelib/serialization/qcborvalue_json/tst_qcborvalue_json.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/tests/auto/corelib/serialization/qcborvalue_json/tst_qcborvalue_json.cpp b/tests/auto/corelib/serialization/qcborvalue_json/tst_qcborvalue_json.cpp index 56245a7173..76f2bb924a 100644 --- a/tests/auto/corelib/serialization/qcborvalue_json/tst_qcborvalue_json.cpp +++ b/tests/auto/corelib/serialization/qcborvalue_json/tst_qcborvalue_json.cpp @@ -97,9 +97,12 @@ void tst_QCborValue_Json::toVariant_data() add(1, 1, 1); add(-1, -1, -1); add(0., 0., 0.); + add(2., 2., 2.); add(1.25, 1.25, 1.25); add(-1.25, -1.25, -1.25); add("Hello", "Hello", "Hello"); + add(std::numeric_limits<qint64>::max(), std::numeric_limits<qint64>::max(), std::numeric_limits<qint64>::max()); + add(std::numeric_limits<qint64>::min(), std::numeric_limits<qint64>::min(), std::numeric_limits<qint64>::min()); // converts to string in JSON: add(QByteArray("Hello"), QByteArray("Hello"), "SGVsbG8"); @@ -123,14 +126,6 @@ void tst_QCborValue_Json::toVariant_data() << QVariant(qQNaN()) << QJsonValue(); - // large integral values lose precision in JSON - QTest::newRow("Integer:max") << QCborValue(std::numeric_limits<qint64>::max()) - << QVariant(std::numeric_limits<qint64>::max()) - << QJsonValue(std::numeric_limits<qint64>::max()); - QTest::newRow("Integer:min") << QCborValue(std::numeric_limits<qint64>::min()) - << QVariant(std::numeric_limits<qint64>::min()) - << QJsonValue(std::numeric_limits<qint64>::min()); - // empty arrays and maps add(QCborArray(), QVariantList(), QJsonArray()); add(QCborMap(), QVariantMap(), QJsonObject()); @@ -257,6 +252,10 @@ void tst_QCborValue_Json::fromJson_data() QTest::newRow("0") << QCborValue(0) << QJsonValue(0.); QTest::newRow("1") << QCborValue(1) << QJsonValue(1); QTest::newRow("1.5") << QCborValue(1.5) << QJsonValue(1.5); + QTest::newRow("Integer:max") << QCborValue(std::numeric_limits<qint64>::max()) + << QJsonValue(std::numeric_limits<qint64>::max()); + QTest::newRow("Integer:min") << QCborValue(std::numeric_limits<qint64>::min()) + << QJsonValue(std::numeric_limits<qint64>::min()); QTest::newRow("string") << QCborValue("Hello") << QJsonValue("Hello"); QTest::newRow("array") << QCborValue(QCborValue::Array) << QJsonValue(QJsonValue::Array); QTest::newRow("map") << QCborValue(QCborValue::Map) << QJsonValue(QJsonValue::Object); |