From babbd149aa9b2b5a28c55cb38fbbe24586bf8e22 Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Thu, 4 Apr 2013 21:27:53 +0200 Subject: added the dreaded jolly joker Change-Id: I1bd840391496daab2cfe32af6ac00e98de3ed72e --- i18npool/qa/cppunit/test_languagetag.cxx | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'i18npool/qa/cppunit') 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 ); -- cgit