aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2018-02-07 11:03:01 +0100
committerLiang Qi <liang.qi@qt.io>2018-02-07 11:03:01 +0100
commit3e3c6717ba634825a65069541500c40645a808ee (patch)
treeed47bf1c276e81f5585b4ac139f6bf2a09c1a437 /tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
parent6fe4c1f2803abac74da152b9a5656eff2d71dceb (diff)
parentc6b3c69e014f846a142c2429cd2d675c75b74245 (diff)
Merge remote-tracking branch 'origin/5.9' into 5.105.10
Diffstat (limited to 'tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp')
-rw-r--r--tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
index c662fdfb8b..2cb5db2cef 100644
--- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
+++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
@@ -342,6 +342,7 @@ private slots:
void freeze_empty_object();
void singleBlockLoops();
void qtbug_60547();
+ void anotherNaN();
private:
// static void propertyVarWeakRefCallback(v8::Persistent<v8::Value> object, void* parameter);
@@ -8374,6 +8375,20 @@ void tst_qqmlecmascript::qtbug_60547()
QCOMPARE(object->property("counter"), QVariant(int(1)));
}
+void tst_qqmlecmascript::anotherNaN()
+{
+ QQmlComponent component(&engine, testFileUrl("nans.qml"));
+ QScopedPointer<QObject> object(component.create());
+ QVERIFY2(!object.isNull(), qPrintable(component.errorString()));
+ object->setProperty("prop", std::numeric_limits<double>::quiet_NaN()); // don't crash
+
+ std::uint64_t anotherNaN = 0xFFFFFF01000000F7ul;
+ double d;
+ std::memcpy(&d, &anotherNaN, sizeof(d));
+ QVERIFY(std::isnan(d));
+ object->setProperty("prop", d); // don't crash
+}
+
QTEST_MAIN(tst_qqmlecmascript)
#include "tst_qqmlecmascript.moc"