diff options
author | Kent Hansen <kent.hansen@nokia.com> | 2010-04-15 15:22:27 (GMT) |
---|---|---|
committer | Kent Hansen <kent.hansen@nokia.com> | 2010-04-15 15:28:15 (GMT) |
commit | f62d8eb38d35d394aca01f9ec309a43525afb557 (patch) | |
tree | 8a7ec142067b9b825adb2c745b2fee39510ff58a /tests | |
parent | 45ec585b46dc71de8a72e3bbc2401f50a2a42a8b (diff) | |
download | Qt-f62d8eb38d35d394aca01f9ec309a43525afb557.zip Qt-f62d8eb38d35d394aca01f9ec309a43525afb557.tar.gz Qt-f62d8eb38d35d394aca01f9ec309a43525afb557.tar.bz2 |
Add translation context to qsTr() benchmark
That's a more realistic case, since translations are usually
tied to a physical script.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/benchmarks/script/qscriptengine/tst_qscriptengine.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/benchmarks/script/qscriptengine/tst_qscriptengine.cpp b/tests/benchmarks/script/qscriptengine/tst_qscriptengine.cpp index 6c6f0b1..35e2f28 100644 --- a/tests/benchmarks/script/qscriptengine/tst_qscriptengine.cpp +++ b/tests/benchmarks/script/qscriptengine/tst_qscriptengine.cpp @@ -269,19 +269,22 @@ void tst_QScriptEngine::nativeCall() void tst_QScriptEngine::translation_data() { QTest::addColumn<QString>("text"); - QTest::newRow("no translation") << "\"hello world\""; - QTest::newRow("qsTr") << "qsTr(\"hello world\")"; - QTest::newRow("qsTranslate") << "qsTranslate(\"\", \"hello world\")"; + QTest::addColumn<QString>("fileName"); + QTest::newRow("no translation") << "\"hello world\"" << ""; + QTest::newRow("qsTr") << "qsTr(\"hello world\")" << ""; + QTest::newRow("qsTranslate") << "qsTranslate(\"\", \"hello world\")" << ""; + QTest::newRow("qsTr:script.js") << "qsTr(\"hello world\")" << "script.js"; } void tst_QScriptEngine::translation() { QFETCH(QString, text); + QFETCH(QString, fileName); QScriptEngine engine; engine.installTranslatorFunctions(); QBENCHMARK { - (void)engine.evaluate(text); + (void)engine.evaluate(text, fileName); } } |