os/ossrv/lowlevellibsandfws/apputils/initLocale/test/T_CheckLocale.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/ossrv/lowlevellibsandfws/apputils/initLocale/test/T_CheckLocale.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,54 @@
     1.4 +// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +#include "T_CheckLocale.h"
    1.19 +
    1.20 +void TestLocaleDLLName(RTest& test, const TDesC& alanguage, const TDesC& aRegion, const TDesC& aCollation)
    1.21 +    {
    1.22 +    test.Printf(_L("\nThe expected locale language, Region, Collation DLL names are: %S, %S, %S"), &alanguage, &aRegion, &aCollation);
    1.23 +    User::After(1000000);
    1.24 +    TExtendedLocale extendLocale;
    1.25 +    extendLocale.LoadSystemSettings();
    1.26 +    TBuf<KMaxFullName> loadedLocaleDLLName;
    1.27 +    User::After(1000000);
    1.28 +    
    1.29 +    extendLocale.GetLocaleDllName(ELocaleLanguageSettings, loadedLocaleDLLName);
    1.30 +    test.Printf(_L("\nThe system locale lagnuage DLL names is: %S"), &loadedLocaleDLLName);
    1.31 +    test(KErrNotFound != loadedLocaleDLLName.Find(alanguage));
    1.32 + 
    1.33 +    extendLocale.GetLocaleDllName(ELocaleLocaleSettings, loadedLocaleDLLName);
    1.34 +    test.Printf(_L("\nThe system locale Region DLL names is: %S"), &loadedLocaleDLLName);
    1.35 +    test(KErrNotFound != loadedLocaleDLLName.Find(aRegion));
    1.36 +    
    1.37 +    extendLocale.GetLocaleDllName(ELocaleCollateSetting, loadedLocaleDLLName);
    1.38 +    test.Printf(_L("\nThe system locale collation DLL names is: %S"), &loadedLocaleDLLName);
    1.39 +    test(KErrNotFound != loadedLocaleDLLName.Find(aCollation));
    1.40 +    }
    1.41 +
    1.42 +void TestLocaleContent(RTest& test, TLanguage alanguageID, TPtrC aCurrencySymbol, TUint aTCollationMethodID)
    1.43 +    {
    1.44 +    test.Printf(_L("\nThe expected locale languageID, CurrencySymbol, TCollationMethodID are: %d, %S, %d"), alanguageID, &aCurrencySymbol, aTCollationMethodID);
    1.45 +    User::After(1000000);
    1.46 +    TExtendedLocale extendLocale;
    1.47 +    extendLocale.LoadSystemSettings();
    1.48 +    User::After(1000000);
    1.49 +
    1.50 +    test.Printf(_L("\nThe system locale languageID is: %d"), User::Language());
    1.51 +    test(alanguageID == User::Language());
    1.52 +    TPtrC currencySymbol = extendLocale.GetCurrencySymbol();
    1.53 +    test.Printf(_L("\nThe system locale CurrencySymbol is: %S"), &currencySymbol);
    1.54 +    test(aCurrencySymbol == extendLocale.GetCurrencySymbol());
    1.55 +    test.Printf(_L("\nThe system locale TCollationMethodID is: %d"), extendLocale.GetPreferredCollationMethod().iId);
    1.56 +    test(aTCollationMethodID == extendLocale.GetPreferredCollationMethod().iId);
    1.57 +    }