~ubuntu-branches/ubuntu/vivid/qtdeclarative-opensource-src-gles/vivid

« back to all changes in this revision

Viewing changes to tests/auto/qml/qjsengine/tst_qjsengine.cpp

  • Committer: Package Import Robot
  • Author(s): Timo Jyrinki
  • Date: 2015-03-11 16:51:45 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20150311165145-7653iqap3mau92gy
Tags: 5.4.1-0ubuntu1
Sync package with qtdeclarative-opensource-src - 5.4.1-1ubuntu3

Show diffs side-by-side

added added

removed removed

Lines of Context:
173
173
 
174
174
    void privateMethods();
175
175
 
 
176
    void intConversion_QTBUG43309();
 
177
 
176
178
signals:
177
179
    void testSignal();
178
180
};
3138
3140
                    "  var one; one();\n"
3139
3141
                    "  var two = null; two();\n"
3140
3142
                    "}\n");
 
3143
    QJSValue exceptionResult = engine.evaluate("true()");
 
3144
    QCOMPARE(exceptionResult.toString(), QString("TypeError: true is not a function"));
3141
3145
}
3142
3146
 
3143
3147
void tst_QJSEngine::installTranslatorFunctions()
3601
3605
    }
3602
3606
}
3603
3607
 
 
3608
void tst_QJSEngine::intConversion_QTBUG43309()
 
3609
{
 
3610
    // This failed in the interpreter:
 
3611
    QJSEngine engine;
 
3612
    QString jsCode = "var n = 0.1; var m = (n*255) | 0; m";
 
3613
    QJSValue result = engine.evaluate( jsCode );
 
3614
    QVERIFY(result.isNumber());
 
3615
    QCOMPARE(result.toNumber(), 25.0);
 
3616
}
 
3617
 
3604
3618
QTEST_MAIN(tst_QJSEngine)
3605
3619
 
3606
3620
#include "tst_qjsengine.moc"