summaryrefslogtreecommitdiffstats
path: root/tests/auto/qresourceengine/tst_qresourceengine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qresourceengine/tst_qresourceengine.cpp')
-rw-r--r--tests/auto/qresourceengine/tst_qresourceengine.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/auto/qresourceengine/tst_qresourceengine.cpp b/tests/auto/qresourceengine/tst_qresourceengine.cpp
index cc6eda3..ed7de23 100644
--- a/tests/auto/qresourceengine/tst_qresourceengine.cpp
+++ b/tests/auto/qresourceengine/tst_qresourceengine.cpp
@@ -62,6 +62,7 @@ private slots:
void searchPath_data();
void searchPath();
void doubleSlashInRoot();
+ void setLocale();
private:
QString builddir;
@@ -460,6 +461,27 @@ void tst_QResourceEngine::doubleSlashInRoot()
QVERIFY(QFile::exists("://secondary_root/runtime_resource/search_file.txt"));
}
+void tst_QResourceEngine::setLocale()
+{
+ QLocale::setDefault(QLocale::c());
+
+ // default constructed QResource gets the default locale
+ QResource resource;
+ resource.setFileName("aliasdir/aliasdir.txt");
+ QVERIFY(!resource.isCompressed());
+
+ // change the default locale and make sure it doesn't affect the resource
+ QLocale::setDefault(QLocale("de_CH"));
+ QVERIFY(!resource.isCompressed());
+
+ // then explicitly set the locale on qresource
+ resource.setLocale(QLocale("de_CH"));
+ QVERIFY(resource.isCompressed());
+
+ // the reset the default locale back
+ QLocale::setDefault(QLocale::system());
+}
+
QTEST_MAIN(tst_QResourceEngine)
#include "tst_qresourceengine.moc"