diff options
author | Eike Rathke <erack@redhat.com> | 2013-03-27 20:31:55 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2013-03-27 20:38:19 +0100 |
commit | 609507a8737277b1e8a53165882c346931477e4b (patch) | |
tree | 04ed7c1857e3ed3fddee8aadaa25a0e3024bbdd5 /i18npool | |
parent | d35ed10d1d75c6ce3a850e844a931b95c12cd127 (diff) |
unit test for x-... privateuse
Change-Id: I46062bcece6ccbcebf421bc4334c1af05f27a8fb
Diffstat (limited to 'i18npool')
-rw-r--r-- | i18npool/qa/cppunit/test_languagetag.cxx | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/i18npool/qa/cppunit/test_languagetag.cxx b/i18npool/qa/cppunit/test_languagetag.cxx index f748802e5e53..f2f6e3073153 100644 --- a/i18npool/qa/cppunit/test_languagetag.cxx +++ b/i18npool/qa/cppunit/test_languagetag.cxx @@ -205,6 +205,30 @@ void TestLanguageTag::testAllTags() CPPUNIT_ASSERT( qty.getLanguageType() == LANGUAGE_SYSTEM ); } + // 'x-comment' is a privateuse known "locale" + { + OUString s_xcomment( "x-comment" ); + LanguageTag xcomment( s_xcomment ); + lang::Locale aLocale = xcomment.getLocale(); + CPPUNIT_ASSERT( xcomment.getBcp47() == s_xcomment ); + CPPUNIT_ASSERT( aLocale.Language == "qlt" ); + CPPUNIT_ASSERT( aLocale.Country == "" ); + CPPUNIT_ASSERT( aLocale.Variant == "x-comment" ); + CPPUNIT_ASSERT( xcomment.getLanguageType() == LANGUAGE_USER_PRIV_COMMENT ); + } + + // 'x-foobar' is a privateuse unknown "locale" + { + OUString s_xfoobar( "x-foobar" ); + LanguageTag xfoobar( s_xfoobar ); + lang::Locale aLocale = xfoobar.getLocale(); + CPPUNIT_ASSERT( xfoobar.getBcp47() == s_xfoobar ); + CPPUNIT_ASSERT( aLocale.Language == "qlt" ); + CPPUNIT_ASSERT( aLocale.Country == "" ); + CPPUNIT_ASSERT( aLocale.Variant == "x-foobar" ); + CPPUNIT_ASSERT( xfoobar.getLanguageType() == LANGUAGE_SYSTEM ); + } + // test reset() methods { LanguageTag aTag( LANGUAGE_DONTKNOW ); |