os/kernelhwsrv/kerneltest/e32test/locl/t_locl.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 /*
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     5 * under the terms of the License "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description:
    15 *
    16 */
    17 
    18 #include <kernel/localise.h>
    19 #include <collate.h>
    20 
    21 const TUint KUidTlocl_CollationMethod = 0x10888888;
    22 const TUint KUidTlocl2_CollationMethod = 0x10999999;
    23 
    24 //Test locale table 1
    25 //Override A=B ; a=b
    26 static const TUint32 TheTlocl_Key[] = 
    27 	{
    28 	0x6cf0109,0x6cf0121,
    29 	};
    30 
    31 static const TUint32 TheTlocl_Index[] = 
    32 	{
    33 	0x420001,0x620000,
    34 	};
    35 
    36 static const TCollationKeyTable TheTlocl_Table = 
    37 	{ TheTlocl_Key, TheTlocl_Index, 2, 0, 0, 0 };
    38 
    39 //Test locale table 2
    40 //Override B>A ; b>a
    41 static const TUint32 TheTlocl2_Key[] = 
    42 	{
    43 	0x6e30109,0x6cf0109,0x6cf0121,0x6e30121,
    44 	};
    45 
    46 static const TUint32 TheTlocl2_Index[] = 
    47 	{
    48 	0x410003,0x420002,0x610000,0x620001,
    49 	};
    50 
    51 static const TCollationKeyTable TheTlocl2_Table = 
    52 	{ TheTlocl2_Key, TheTlocl2_Index, 4, 0, 0, 0 };
    53 
    54 //Test CollationMethod
    55 static const TCollationMethod TheCollationMethod[] = 
    56 	{
    57 		{
    58 		KUidTlocl2_CollationMethod, // the method for the locale
    59 		NULL, // use the standard table as the main table
    60 		&TheTlocl2_Table, // the locale values override the standard values
    61 		0 // the flags are standard
    62 		},
    63 		{
    64 		KUidBasicCollationMethod, // the standard unlocalised method
    65 		NULL, // null means use the standard table
    66 		NULL, // there's no override table
    67 		0 // the flags are standard
    68 		},
    69 		{
    70 		KUidTlocl_CollationMethod, // the method for the locale
    71 		NULL, // use the standard table as the main table
    72 		&TheTlocl_Table, // the locale values override the standard values
    73 		TCollationMethod::EMatchingTable // add matching flag here
    74 		}
    75 	};
    76 
    77 static const TCollationDataSet TheCollationDataSet =
    78 	{
    79 	TheCollationMethod,
    80 	3
    81 	};
    82 
    83 // The one and only locale character set object.
    84 const LCharSet TheCharSet =
    85 	{
    86 	NULL,
    87 	&TheCollationDataSet
    88 	};