First public contribution.
1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
15 #include "T_CheckLocale.h"
17 void TestLocaleDLLName(RTest& test, const TDesC& alanguage, const TDesC& aRegion, const TDesC& aCollation)
19 test.Printf(_L("\nThe expected locale language, Region, Collation DLL names are: %S, %S, %S"), &alanguage, &aRegion, &aCollation);
21 TExtendedLocale extendLocale;
22 extendLocale.LoadSystemSettings();
23 TBuf<KMaxFullName> loadedLocaleDLLName;
26 extendLocale.GetLocaleDllName(ELocaleLanguageSettings, loadedLocaleDLLName);
27 test.Printf(_L("\nThe system locale lagnuage DLL names is: %S"), &loadedLocaleDLLName);
28 test(KErrNotFound != loadedLocaleDLLName.Find(alanguage));
30 extendLocale.GetLocaleDllName(ELocaleLocaleSettings, loadedLocaleDLLName);
31 test.Printf(_L("\nThe system locale Region DLL names is: %S"), &loadedLocaleDLLName);
32 test(KErrNotFound != loadedLocaleDLLName.Find(aRegion));
34 extendLocale.GetLocaleDllName(ELocaleCollateSetting, loadedLocaleDLLName);
35 test.Printf(_L("\nThe system locale collation DLL names is: %S"), &loadedLocaleDLLName);
36 test(KErrNotFound != loadedLocaleDLLName.Find(aCollation));
39 void TestLocaleContent(RTest& test, TLanguage alanguageID, TPtrC aCurrencySymbol, TUint aTCollationMethodID)
41 test.Printf(_L("\nThe expected locale languageID, CurrencySymbol, TCollationMethodID are: %d, %S, %d"), alanguageID, &aCurrencySymbol, aTCollationMethodID);
43 TExtendedLocale extendLocale;
44 extendLocale.LoadSystemSettings();
47 test.Printf(_L("\nThe system locale languageID is: %d"), User::Language());
48 test(alanguageID == User::Language());
49 TPtrC currencySymbol = extendLocale.GetCurrencySymbol();
50 test.Printf(_L("\nThe system locale CurrencySymbol is: %S"), ¤cySymbol);
51 test(aCurrencySymbol == extendLocale.GetCurrencySymbol());
52 test.Printf(_L("\nThe system locale TCollationMethodID is: %d"), extendLocale.GetPreferredCollationMethod().iId);
53 test(aTCollationMethodID == extendLocale.GetPreferredCollationMethod().iId);