summaryrefslogtreecommitdiff
path: root/i18npool/qa/cppunit
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2013-04-04 21:27:53 +0200
committerEike Rathke <erack@redhat.com>2013-04-05 14:52:45 +0200
commitbabbd149aa9b2b5a28c55cb38fbbe24586bf8e22 (patch)
treeaf9ad4be57671256120d5af4ef63468e40e458db /i18npool/qa/cppunit
parent9d073bcba10b9cbcd56ad58cf5b19bbb129567a8 (diff)
added the dreaded jolly joker
Change-Id: I1bd840391496daab2cfe32af6ac00e98de3ed72e
Diffstat (limited to 'i18npool/qa/cppunit')
-rw-r--r--i18npool/qa/cppunit/test_languagetag.cxx20
1 files changed, 20 insertions, 0 deletions
diff --git a/i18npool/qa/cppunit/test_languagetag.cxx b/i18npool/qa/cppunit/test_languagetag.cxx
index 227be2068677..4e57b39a791a 100644
--- a/i18npool/qa/cppunit/test_languagetag.cxx
+++ b/i18npool/qa/cppunit/test_languagetag.cxx
@@ -232,6 +232,26 @@ void TestLanguageTag::testAllTags()
CPPUNIT_ASSERT( xfoobar.getLanguageType() == LANGUAGE_SYSTEM );
}
+ // '*' the dreaded jolly joker is a "privateuse" known "locale"
+ {
+ OUString s_joker( "*" );
+ LanguageTag joker( s_joker );
+ lang::Locale aLocale = joker.getLocale();
+ CPPUNIT_ASSERT( joker.getBcp47() == s_joker );
+ CPPUNIT_ASSERT( aLocale.Language == "qlt" );
+ CPPUNIT_ASSERT( aLocale.Country == "" );
+ CPPUNIT_ASSERT( aLocale.Variant == "*" );
+ CPPUNIT_ASSERT( joker.getLanguageType() == LANGUAGE_USER_PRIV_JOKER );
+
+ joker.reset( LANGUAGE_USER_PRIV_JOKER );
+ aLocale = joker.getLocale();
+ CPPUNIT_ASSERT( joker.getBcp47() == s_joker );
+ CPPUNIT_ASSERT( aLocale.Language == "qlt" );
+ CPPUNIT_ASSERT( aLocale.Country == "" );
+ CPPUNIT_ASSERT( aLocale.Variant == "*" );
+ CPPUNIT_ASSERT( joker.getLanguageType() == LANGUAGE_USER_PRIV_JOKER );
+ }
+
// test reset() methods
{
LanguageTag aTag( LANGUAGE_DONTKNOW );