summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2011-11-15 16:06:20 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2011-11-15 16:06:20 (GMT)
commit19f53dd23c29d9a6b256ea1473b118abcde3cc5a (patch)
tree483e6a45a93d9c6db05c53e48ca7a0dfed05d233 /tests
parent12fc4ad4189f059a806bdf4f50fe090ed7031352 (diff)
parent22bfd2b05a72e1e7d7babcc9c5d824dd87903b6f (diff)
downloadQt-19f53dd23c29d9a6b256ea1473b118abcde3cc5a.zip
Qt-19f53dd23c29d9a6b256ea1473b118abcde3cc5a.tar.gz
Qt-19f53dd23c29d9a6b256ea1473b118abcde3cc5a.tar.bz2
Merge branch 'qt-4.8-from-4.7' of scm.dev.nokia.troll.no:qt/qt-integration into master-integration
* 'qt-4.8-from-4.7' of scm.dev.nokia.troll.no:qt/qt-integration: tests: allow unstable tests to be marked with CONFIG+=insignificant_test Fix focusScopeItemChange setting crash Fix crash in QHttpNetworkReplyPrivate::gunzipBodyPartiallyEnd symbian - handle path being passed as part of filename in QTranslator Symbian - fix compile error when default configured Compile when -no-rtti is specified as a configure option Ensure that the RC_FILE is correctly handled in a single configuration
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qtranslator/i18n/hellotr_en.qmbin0 -> 230 bytes
-rw-r--r--tests/auto/qtranslator/tst_qtranslator.cpp40
2 files changed, 38 insertions, 2 deletions
diff --git a/tests/auto/qtranslator/i18n/hellotr_en.qm b/tests/auto/qtranslator/i18n/hellotr_en.qm
new file mode 100644
index 0000000..cc42afe
--- /dev/null
+++ b/tests/auto/qtranslator/i18n/hellotr_en.qm
Binary files differ
diff --git a/tests/auto/qtranslator/tst_qtranslator.cpp b/tests/auto/qtranslator/tst_qtranslator.cpp
index 8e2ed15..6f65e6a 100644
--- a/tests/auto/qtranslator/tst_qtranslator.cpp
+++ b/tests/auto/qtranslator/tst_qtranslator.cpp
@@ -66,6 +66,10 @@ protected:
private slots:
void load();
void load2();
+ void loadSubdir();
+ void loadSubdir2();
+ void loadSubdir3();
+ void loadSubdir4();
void threadLoad();
void testLanguageChange();
void plural();
@@ -124,6 +128,38 @@ void tst_QTranslator::load2()
QCOMPARE(tor.translate("QPushButton", "Hello world!"), QString::fromLatin1("Hallo Welt!"));
}
+void tst_QTranslator::loadSubdir()
+{
+ QTranslator tor( 0 );
+ tor.load("hellotr_en_GB", "i18n");
+ QVERIFY(!tor.isEmpty());
+ QCOMPARE(tor.translate("QPushButton", "Hello world!"), QString::fromLatin1("Hallo Welt!"));
+}
+
+void tst_QTranslator::loadSubdir2()
+{
+ QTranslator tor( 0 );
+ tor.load("i18n/hellotr_en_GB");
+ QVERIFY(!tor.isEmpty());
+ QCOMPARE(tor.translate("QPushButton", "Hello world!"), QString::fromLatin1("Hallo Welt!"));
+}
+
+void tst_QTranslator::loadSubdir3()
+{
+ QTranslator tor( 0 );
+ tor.load(QString(QLatin1String("i18n%1hellotr_en_GB")).arg(QDir::separator()));
+ QVERIFY(!tor.isEmpty());
+ QCOMPARE(tor.translate("QPushButton", "Hello world!"), QString::fromLatin1("Hallo Welt!"));
+}
+
+void tst_QTranslator::loadSubdir4()
+{
+ QTranslator tor( 0 );
+ tor.load("./hellotr_en_GB", "i18n");
+ QVERIFY(!tor.isEmpty());
+ QCOMPARE(tor.translate("QPushButton", "Hello world!"), QString::fromLatin1("Hallo Welt!"));
+}
+
class TranslatorThread : public QThread
{
void run() {
@@ -249,10 +285,10 @@ void tst_QTranslator::loadFromResource()
void tst_QTranslator::loadDirectory()
{
- QVERIFY(QFileInfo("../qtranslator").isDir());
+ QVERIFY(QFileInfo("i18n").isDir());
QTranslator tor;
- tor.load("qtranslator", "..");
+ tor.load("qtranslator", "i18n");
QVERIFY(tor.isEmpty());
}