sl@0: // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: #include "T_CheckLocale.h" sl@0: sl@0: void TestLocaleDLLName(RTest& test, const TDesC& alanguage, const TDesC& aRegion, const TDesC& aCollation) sl@0: { sl@0: test.Printf(_L("\nThe expected locale language, Region, Collation DLL names are: %S, %S, %S"), &alanguage, &aRegion, &aCollation); sl@0: User::After(1000000); sl@0: TExtendedLocale extendLocale; sl@0: extendLocale.LoadSystemSettings(); sl@0: TBuf loadedLocaleDLLName; sl@0: User::After(1000000); sl@0: sl@0: extendLocale.GetLocaleDllName(ELocaleLanguageSettings, loadedLocaleDLLName); sl@0: test.Printf(_L("\nThe system locale lagnuage DLL names is: %S"), &loadedLocaleDLLName); sl@0: test(KErrNotFound != loadedLocaleDLLName.Find(alanguage)); sl@0: sl@0: extendLocale.GetLocaleDllName(ELocaleLocaleSettings, loadedLocaleDLLName); sl@0: test.Printf(_L("\nThe system locale Region DLL names is: %S"), &loadedLocaleDLLName); sl@0: test(KErrNotFound != loadedLocaleDLLName.Find(aRegion)); sl@0: sl@0: extendLocale.GetLocaleDllName(ELocaleCollateSetting, loadedLocaleDLLName); sl@0: test.Printf(_L("\nThe system locale collation DLL names is: %S"), &loadedLocaleDLLName); sl@0: test(KErrNotFound != loadedLocaleDLLName.Find(aCollation)); sl@0: } sl@0: sl@0: void TestLocaleContent(RTest& test, TLanguage alanguageID, TPtrC aCurrencySymbol, TUint aTCollationMethodID) sl@0: { sl@0: test.Printf(_L("\nThe expected locale languageID, CurrencySymbol, TCollationMethodID are: %d, %S, %d"), alanguageID, &aCurrencySymbol, aTCollationMethodID); sl@0: User::After(1000000); sl@0: TExtendedLocale extendLocale; sl@0: extendLocale.LoadSystemSettings(); sl@0: User::After(1000000); sl@0: sl@0: test.Printf(_L("\nThe system locale languageID is: %d"), User::Language()); sl@0: test(alanguageID == User::Language()); sl@0: TPtrC currencySymbol = extendLocale.GetCurrencySymbol(); sl@0: test.Printf(_L("\nThe system locale CurrencySymbol is: %S"), ¤cySymbol); sl@0: test(aCurrencySymbol == extendLocale.GetCurrencySymbol()); sl@0: test.Printf(_L("\nThe system locale TCollationMethodID is: %d"), extendLocale.GetPreferredCollationMethod().iId); sl@0: test(aTCollationMethodID == extendLocale.GetPreferredCollationMethod().iId); sl@0: }