Update contrib.
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.
16 #include "T_CheckLocale.h"
18 RTest test(_L("T_OldAPIinOldModel"));
21 //Old locale API should matain backward compatibility in the old locale model
22 //(with the old locale DLL format)
24 void TestOldLocaleAPI()
26 TExtendedLocale firstExtendLocale;
28 test.Start(_L(" @SYMTestCaseID:TI18N-EUSER-CIT-4015 old LoadLocale() API on old locale model"));
29 firstExtendLocale.LoadSystemSettings();
30 test( KErrNone == firstExtendLocale.LoadLocale(KOldCNLocaleName()) );
31 test( KErrNone == firstExtendLocale.SaveSystemSettings() );
32 TestLocaleDLLName(test, KOldCNLocaleName(), KOldCNLocaleName(), KOldCNLocaleName() );
33 TestLocaleContent(test, KCNLanguageID, KCNCurrencySymbol, KCNTCollationMethodID);
35 firstExtendLocale.LoadSystemSettings();
36 test( KErrNone == firstExtendLocale.LoadLocale(KOldUKLocaleName()) );
37 test( KErrNone == firstExtendLocale.SaveSystemSettings() );
38 TestLocaleDLLName(test, KOldUKLocaleName(), KOldUKLocaleName(), KOldUKLocaleName() );
39 TestLocaleContent(test, KEnglishLanguageID, KUKCurrencySymbol, KStandardCollationID);
42 //becasue TestLocaleContent() naturally check the system locale content, we mark this test case here.
43 test.Start(_L(" @SYMTestCaseID:TI18N-EUSER-CIT-4019 publish locale content to the system"));
46 test.Start(_L(" @SYMTestCaseID:TI18N-EUSER-CIT-4016 old LoadLocaleAspect() API on old locale model"));
47 firstExtendLocale.LoadSystemSettings();
48 test( KErrNone == firstExtendLocale.LoadLocaleAspect(ELocaleLanguageSettings, KOldUKLocaleName()));
49 test( KErrNone == firstExtendLocale.LoadLocaleAspect(ELocaleCollateSetting, KOldCNLocaleName()));
50 test( KErrNone == firstExtendLocale.LoadLocaleAspect(ELocaleLocaleSettings, KOldUSLocaleName()));
51 test( KErrNone == firstExtendLocale.SaveSystemSettings() );
52 TestLocaleDLLName(test, KOldUKLocaleName(), KOldUSLocaleName(), KOldCNLocaleName() );
53 TestLocaleContent(test, KEnglishLanguageID, KUSCurrencySymbol, KCNTCollationMethodID);
55 firstExtendLocale.LoadSystemSettings();
56 test( KErrNone == firstExtendLocale.LoadLocaleAspect(ELocaleLanguageSettings, KOldGELocaleName()));
57 test( KErrNone == firstExtendLocale.LoadLocaleAspect(ELocaleCollateSetting, KOldGELocaleName()));
58 test( KErrNone == firstExtendLocale.LoadLocaleAspect(ELocaleLocaleSettings, KOldGELocaleName()));
59 test( KErrNone == firstExtendLocale.SaveSystemSettings() );
60 TestLocaleDLLName(test, KOldGELocaleName(), KOldGELocaleName(), KOldGELocaleName() );
61 TestLocaleContent(test, KGELanguageID, KGECurrencySymbol, KGETCollationMethodID);
66 void TestOldLocaleModel()
73 CTrapCleanup* tc = CTrapCleanup::New();
78 test.Start(_L("The test for old locale API in old locale model"));
80 TRAPD(err, ::TestOldLocaleModel())
81 test(err == KErrNone);
83 test.Printf(_L("\nTest for old locale API in old locale model finished!"));