1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/kernelhwsrv/kerneltest/e32test/locl/t_locl.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,88 @@
1.4 +/*
1.5 +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* All rights reserved.
1.7 +* This component and the accompanying materials are made available
1.8 +* under the terms of the License "Eclipse Public License v1.0"
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description:
1.18 +*
1.19 +*/
1.20 +
1.21 +#include <kernel/localise.h>
1.22 +#include <collate.h>
1.23 +
1.24 +const TUint KUidTlocl_CollationMethod = 0x10888888;
1.25 +const TUint KUidTlocl2_CollationMethod = 0x10999999;
1.26 +
1.27 +//Test locale table 1
1.28 +//Override A=B ; a=b
1.29 +static const TUint32 TheTlocl_Key[] =
1.30 + {
1.31 + 0x6cf0109,0x6cf0121,
1.32 + };
1.33 +
1.34 +static const TUint32 TheTlocl_Index[] =
1.35 + {
1.36 + 0x420001,0x620000,
1.37 + };
1.38 +
1.39 +static const TCollationKeyTable TheTlocl_Table =
1.40 + { TheTlocl_Key, TheTlocl_Index, 2, 0, 0, 0 };
1.41 +
1.42 +//Test locale table 2
1.43 +//Override B>A ; b>a
1.44 +static const TUint32 TheTlocl2_Key[] =
1.45 + {
1.46 + 0x6e30109,0x6cf0109,0x6cf0121,0x6e30121,
1.47 + };
1.48 +
1.49 +static const TUint32 TheTlocl2_Index[] =
1.50 + {
1.51 + 0x410003,0x420002,0x610000,0x620001,
1.52 + };
1.53 +
1.54 +static const TCollationKeyTable TheTlocl2_Table =
1.55 + { TheTlocl2_Key, TheTlocl2_Index, 4, 0, 0, 0 };
1.56 +
1.57 +//Test CollationMethod
1.58 +static const TCollationMethod TheCollationMethod[] =
1.59 + {
1.60 + {
1.61 + KUidTlocl2_CollationMethod, // the method for the locale
1.62 + NULL, // use the standard table as the main table
1.63 + &TheTlocl2_Table, // the locale values override the standard values
1.64 + 0 // the flags are standard
1.65 + },
1.66 + {
1.67 + KUidBasicCollationMethod, // the standard unlocalised method
1.68 + NULL, // null means use the standard table
1.69 + NULL, // there's no override table
1.70 + 0 // the flags are standard
1.71 + },
1.72 + {
1.73 + KUidTlocl_CollationMethod, // the method for the locale
1.74 + NULL, // use the standard table as the main table
1.75 + &TheTlocl_Table, // the locale values override the standard values
1.76 + TCollationMethod::EMatchingTable // add matching flag here
1.77 + }
1.78 + };
1.79 +
1.80 +static const TCollationDataSet TheCollationDataSet =
1.81 + {
1.82 + TheCollationMethod,
1.83 + 3
1.84 + };
1.85 +
1.86 +// The one and only locale character set object.
1.87 +const LCharSet TheCharSet =
1.88 + {
1.89 + NULL,
1.90 + &TheCollationDataSet
1.91 + };