charconvfw/fatfilenameconversionplugins/test/T_CP54936.CPP
branchRCL_3
changeset 54 748ec5531811
parent 0 1fb32624e06b
child 55 336bee5c2d35
equal deleted inserted replaced
36:f902e87c146f 54:748ec5531811
     1 /*
     1 /*
     2 * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    14 * Description: 
    14 * Description: 
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 
    18 
    19 #include <e32test.h>
    19 #include "T_CP54936.h"
    20 #include <e32des8.h>
    20 #include <e32des8.h>
    21 #include <hal.h>
    21 #include <hal.h>
    22 
    22 
    23 LOCAL_D RTest test(_L("T_CP54936.exe"));
    23 #define test(cond)                                          \
       
    24     {                                                       \
       
    25     TBool __bb = (cond);                                    \
       
    26     TEST(__bb);                                             \
       
    27     if (!__bb)                                              \
       
    28         {                                                   \
       
    29         ERR_PRINTF1(_L("ERROR: Test Failed"));              \
       
    30         User::Leave(1);                                     \
       
    31         }                                                   \
       
    32     }
       
    33 
       
    34 
       
    35 const TInt MaxCount = 10000;    // iteration number for performance tests
       
    36 
       
    37 // cp54936 should be faster than cp936
       
    38 _LIT(KName936,"CP936");
       
    39 const TUid KPluginUid936={0x10206A91};
    24 
    40 
    25 
    41 
    26 _LIT(KName,"CP54936");
    42 _LIT(KName,"CP54936");
    27 const TUid KPluginUid={0x1028703b};
    43 const TUid KPluginUid={0x1028703b};
    28 
    44 
    29 
    45 
    30 void TestOut(const TDesC16 &des)
    46 void CT_CP54936::TestOut(const TDesC16 &des)
    31 	{
    47 	{
    32 	for (TInt i=0; i<des.Length(); i++)
    48 	for (TInt i=0; i<des.Length(); i++)
    33 		test.Printf(_L("%04X "), des[i]);
    49 	    INFO_PRINTF2(_L("%04X "), des[i]);
    34 	}
    50 	}
    35 
    51 
    36 void TestOut(const TDesC8 &des)
    52 void CT_CP54936::TestOut(const TDesC8 &des)
    37 	{
    53 	{
    38 	for (TInt i=0; i<des.Length(); i++)
    54 	for (TInt i=0; i<des.Length(); i++)
    39 		test.Printf(_L("%02X "), des[i]);
    55 	    INFO_PRINTF2(_L("%02X "), des[i]);
    40 	}
    56 	}
    41 
    57 
    42 // Used for supressing warning in OOM tests
    58 // Used for supressing warning in OOM tests
    43 #define __UNUSED_VAR(var) var = var
    59 #define __UNUSED_VAR(var) var = var
    44 
    60 
    47 @SYMTestCaseDesc	    Tests API behaviours of UnicodeConv class
    63 @SYMTestCaseDesc	    Tests API behaviours of UnicodeConv class
    48 @SYMTestPriority 	    High
    64 @SYMTestPriority 	    High
    49 @SYMTestActions  	    Tests for conversions from/to Unicode, using a function pointer
    65 @SYMTestActions  	    Tests for conversions from/to Unicode, using a function pointer
    50 @SYMTestExpectedResults Test must not fail 
    66 @SYMTestExpectedResults Test must not fail 
    51 */
    67 */
    52 void Test()
    68 void CT_CP54936::TestL()
    53 	{ 
    69 	{ 
    54 	test.Next(_L(" @SYMTestCaseID:SYSLIB-FATCHARSETCONV-CT-1778 "));
    70     INFO_PRINTF1(_L(" @SYMTestCaseID:SYSLIB-FATCHARSETCONV-CT-1778 "));
    55 	RLibrary lib;
    71 	RLibrary lib;
    56 
    72 
    57 	const TUidType serverUid(KNullUid,KNullUid,KPluginUid);	
    73 	const TUidType serverUid(KNullUid,KNullUid,KPluginUid);	
    58 	// load the dll	
    74 	// load the dll	
    59 	TInt returnValue = lib.Load(KName,serverUid);
    75 	TInt returnValue = lib.Load(KName,serverUid);
    92 
   108 
    93 	TBuf8<200> foreign1;
   109 	TBuf8<200> foreign1;
    94 	TBuf16<200> unicode2;
   110 	TBuf16<200> unicode2;
    95 	
   111 	
    96 	const TDesC16& unicode1(Uni_1);
   112 	const TDesC16& unicode1(Uni_1);
    97 	test.Printf(_L("source: "));	TestOut(unicode1);	test.Printf(_L("\n"));
   113 	INFO_PRINTF1(_L("source: "));	TestOut(unicode1);	INFO_PRINTF1(_L("\n"));
    98 	test.Printf(_L("expect: "));	TestOut(CP54936_1);	test.Printf(_L("\n"));
   114 	INFO_PRINTF1(_L("expect: "));	TestOut(CP54936_1);	INFO_PRINTF1(_L("\n"));
    99 	//TRAPD(err, (*aConvertFromUnicodeL)(foreign1, unicode1));
   115 	//TRAPD(err, (*aConvertFromUnicodeL)(foreign1, unicode1));
   100 	(*aConvertFromUnicodeL)(foreign1, unicode1); 	//testing conversion from Unicode
   116 	(*aConvertFromUnicodeL)(foreign1, unicode1); 	//testing conversion from Unicode
   101 	test.Printf(_L("result: "));	TestOut(foreign1);	test.Printf(_L("\n"));
   117 	INFO_PRINTF1(_L("result: "));	TestOut(foreign1);	INFO_PRINTF1(_L("\n"));
   102 	TInt error = foreign1.Compare(CP54936_1);
   118 	TInt error = foreign1.Compare(CP54936_1);
   103 	test(error==0);
   119 	test(error==0);
   104 	foreign1.Zero();
   120 	foreign1.Zero();
   105 
   121 
   106 	// from Test Analysis:
   122 	// from Test Analysis:
   121 	// p30-p31:	N/A
   137 	// p30-p31:	N/A
   122 	_LIT16(Uni_2, "\x0040\x0024\x706C\x4E96\x20AC\x3622\x060C\xD840\xDDAD\xE525\xFFFD\xD83F\xDFFA\xFFFD");
   138 	_LIT16(Uni_2, "\x0040\x0024\x706C\x4E96\x20AC\x3622\x060C\xD840\xDDAD\xE525\xFFFD\xD83F\xDFFA\xFFFD");
   123 	_LIT8(CP54936_2, "\x40\x24\xEC\xE1\x81\x81\xA2\xE3\x82\x30\xA7\x30\x81\x31\x81\x32\x95\x32\xAD\x35\xA1\xA0\xA0\x7F\x95\x32\x82\x30\x81\x30\x81\x3A");
   139 	_LIT8(CP54936_2, "\x40\x24\xEC\xE1\x81\x81\xA2\xE3\x82\x30\xA7\x30\x81\x31\x81\x32\x95\x32\xAD\x35\xA1\xA0\xA0\x7F\x95\x32\x82\x30\x81\x30\x81\x3A");
   124 
   140 
   125 	const TDesC8& foreign2(CP54936_2);
   141 	const TDesC8& foreign2(CP54936_2);
   126 	test.Printf(_L("source: "));	TestOut(foreign2);	test.Printf(_L("\n"));
   142 	INFO_PRINTF1(_L("source: "));	TestOut(foreign2);	INFO_PRINTF1(_L("\n"));
   127 	test.Printf(_L("expect: "));	TestOut(Uni_2);		test.Printf(_L("\n"));
   143 	INFO_PRINTF1(_L("expect: "));	TestOut(Uni_2);		INFO_PRINTF1(_L("\n"));
   128 	//TRAP(err, (*aConvertToUnicodeL)(unicode2,foreign2));
   144 	//TRAP(err, (*aConvertToUnicodeL)(unicode2,foreign2));
   129 	(*aConvertToUnicodeL)(unicode2,foreign2);//); 	//testing conversion to Unicode
   145 	(*aConvertToUnicodeL)(unicode2,foreign2);//); 	//testing conversion to Unicode
   130 	test.Printf(_L("result: "));	TestOut(unicode2);	test.Printf(_L("\n"));
   146 	INFO_PRINTF1(_L("result: "));	TestOut(unicode2);	INFO_PRINTF1(_L("\n"));
   131 	error = unicode2.Compare(Uni_2);
   147 	error = unicode2.Compare(Uni_2);
   132 	test(error==0);
   148 	test(error==0);
   133 	unicode2.Zero();
   149 	unicode2.Zero();
   134 	
   150 	
   135 	
   151 	
   151 @SYMTestCaseDesc	    Tests API behaviours of UnicodeConv class as part of INC090073
   167 @SYMTestCaseDesc	    Tests API behaviours of UnicodeConv class as part of INC090073
   152 @SYMTestPriority 	    High
   168 @SYMTestPriority 	    High
   153 @SYMTestActions  	    Tests for correct character conversion on certain chinese characters for CP936 
   169 @SYMTestActions  	    Tests for correct character conversion on certain chinese characters for CP936 
   154 @SYMTestExpectedResults Test must not fail 
   170 @SYMTestExpectedResults Test must not fail 
   155 */	
   171 */	
   156 void TestINC090073()
   172 void CT_CP54936::TestINC090073L()
   157 	{
   173 	{
   158 	test.Next(_L(" @SYMTestCaseID:SYSLIB-FATCHARSETCONV-CT-1847-0001 ")); 
   174     INFO_PRINTF1(_L(" @SYMTestCaseID:SYSLIB-FATCHARSETCONV-CT-1847-0001 ")); 
       
   175 	
   159  	_LIT16(unicode, "\x7CCD\x74EF\x8026\x8F8F\x94F3\x7633\x6DFC\x9785\x7F81\x7A37\x61A9\x80B1\x86A3\x89E5\x80F2\x9B48\x9E47\x6C19\x7B71\x946B\x6B46\x6615");
   176  	_LIT16(unicode, "\x7CCD\x74EF\x8026\x8F8F\x94F3\x7633\x6DFC\x9785\x7F81\x7A37\x61A9\x80B1\x86A3\x89E5\x80F2\x9B48\x9E47\x6C19\x7B71\x946B\x6B46\x6615");
   160 	_LIT8(CP932Code, "\xF4\xD9\xEA\xB1\xF1\xEE\xEA\xA3\xEF\xA5\xF1\xAC\xED\xB5\xF7\xB1\xEE\xBF\xF0\xA2\xED\xAC\xEB\xC5\xF2\xBC\xF6\xA1\xEB\xDC\xF7\xCC\xF0\xC2\xEB\xAF\xF3\xE3\xF6\xCE\xEC\xA7\xEA\xBF");
   177 	_LIT8(CP932Code, "\xF4\xD9\xEA\xB1\xF1\xEE\xEA\xA3\xEF\xA5\xF1\xAC\xED\xB5\xF7\xB1\xEE\xBF\xF0\xA2\xED\xAC\xEB\xC5\xF2\xBC\xF6\xA1\xEB\xDC\xF7\xCC\xF0\xC2\xEB\xAF\xF3\xE3\xF6\xCE\xEC\xA7\xEA\xBF");
   161 
   178 
   162 	RLibrary lib;
   179 	RLibrary lib;
   163 
   180 
   185 	foreign1.Zero();
   202 	foreign1.Zero();
   186 
   203 
   187 	lib.Close();
   204 	lib.Close();
   188 	}	
   205 	}	
   189 
   206 
   190 void OOMTest()
   207 void CT_CP54936::OOMTestL()
   191 	{
   208 	{
   192 	test.Next(_L("OOM testing"));
   209     INFO_PRINTF1(_L("OOM testing"));
   193 	TInt err, tryCount = 0;
   210 	TInt err, tryCount = 0;
   194 	do	
   211 	do	
   195 		{
   212 		{
   196 			__UHEAP_MARK;
   213 			__UHEAP_MARK;
   197   		// find out the number of open handles
   214   		// find out the number of open handles
   200 		RThread().HandleCount(startProcessHandleCount, startThreadHandleCount);
   217 		RThread().HandleCount(startProcessHandleCount, startThreadHandleCount);
   201 		
   218 		
   202 			// Setting Heap failure for OOM test
   219 			// Setting Heap failure for OOM test
   203 		__UHEAP_SETFAIL(RHeap::EDeterministic, ++tryCount);
   220 		__UHEAP_SETFAIL(RHeap::EDeterministic, ++tryCount);
   204 
   221 
   205 		TRAP(err,Test());
   222 		TRAP(err,TestL());
   206 			
   223 			
   207 		__UHEAP_SETFAIL(RHeap::ENone, 0);
   224 		__UHEAP_SETFAIL(RHeap::ENone, 0);
   208 		
   225 		
   209 		// check that no handles have leaked
   226 		// check that no handles have leaked
   210 		TInt endProcessHandleCount;
   227 		TInt endProcessHandleCount;
   216 
   233 
   217 		__UHEAP_MARKEND;
   234 		__UHEAP_MARKEND;
   218 		}while (err == KErrNoMemory);
   235 		}while (err == KErrNoMemory);
   219 		
   236 		
   220 	test(err == KErrNone);
   237 	test(err == KErrNone);
   221 	test.Printf(_L("- server succeeded at heap failure rate of %i\n"), tryCount);
   238 	INFO_PRINTF2(_L("- server succeeded at heap failure rate of %i\n"), tryCount);
   222 	}
   239 	}
   223 
   240 
   224 
   241 
   225 const TInt MaxCount = 10000;	// iteration number for performance tests
   242 void CT_CP54936::PerformanceTest1L()
   226 
   243 	{
   227 // cp54936 should be faster than cp936
   244     INFO_PRINTF1(_L("Performance test 1 (comparing with cp936)"));
   228 _LIT(KName936,"CP936");
       
   229 const TUid KPluginUid936={0x10206A91};
       
   230 void PerformanceTest1()
       
   231 	{
       
   232 	test.Next(_L("Performance test 1 (comparing with cp936)"));
       
   233 	RLibrary lib936;
   245 	RLibrary lib936;
   234 	RLibrary lib54936;
   246 	RLibrary lib54936;
   235 
   247 
   236 	const TUidType serverUid936(KNullUid,KNullUid,KPluginUid936);	
   248 	const TUidType serverUid936(KNullUid,KNullUid,KPluginUid936);	
   237 	const TUidType serverUid54936(KNullUid,KNullUid,KPluginUid);
   249 	const TUidType serverUid54936(KNullUid,KNullUid,KPluginUid);
   279 	
   291 	
   280 //////////////////////////////////////////////////////////////////////////////
   292 //////////////////////////////////////////////////////////////////////////////
   281 //////////////////////////////////////////////////////////////////////////////
   293 //////////////////////////////////////////////////////////////////////////////
   282 	// 1, unicode -> 936
   294 	// 1, unicode -> 936
   283 	// test result: 1448 ms for 100000 iterations
   295 	// test result: 1448 ms for 100000 iterations
   284 	test.Printf(_L("unicode --> 936:\n"));
   296 	INFO_PRINTF1(_L("unicode --> 936:\n"));
   285 	test.Printf(_L("        source: "));	TestOut(unicode1);	test.Printf(_L("\n"));
   297 	INFO_PRINTF1(_L("        source: "));	TestOut(unicode1);	INFO_PRINTF1(_L("\n"));
   286 	test.Printf(_L("        expect: "));	TestOut(CP54936_1);	test.Printf(_L("\n"));
   298 	INFO_PRINTF1(_L("        expect: "));	TestOut(CP54936_1);	INFO_PRINTF1(_L("\n"));
   287 	prevTime = User::FastCounter();
   299 	prevTime = User::FastCounter();
   288 	for (count=0; count<MaxCount; count++)
   300 	for (count=0; count<MaxCount; count++)
   289 		{
   301 		{
   290 		foreign1.Zero();
   302 		foreign1.Zero();
   291 		(*aConvertFromUnicode936L)(foreign1, unicode1);
   303 		(*aConvertFromUnicode936L)(foreign1, unicode1);
   292 		}
   304 		}
   293 	timeDiff = User::FastCounter() - prevTime;
   305 	timeDiff = User::FastCounter() - prevTime;
   294 	fsSessionMicroSecs = timeDiff / (ticksPerMicroSec);
   306 	fsSessionMicroSecs = timeDiff / (ticksPerMicroSec);
   295 	msg.Format(_L("                    %10.2lf us, "), fsSessionMicroSecs);
   307 	msg.Format(_L("                    %10.2lf us, "), fsSessionMicroSecs);
   296 	test.Printf(_L("        result: "));	TestOut(foreign1);	test.Printf(_L("\n"));
   308 	INFO_PRINTF1(_L("        result: "));	TestOut(foreign1);	INFO_PRINTF1(_L("\n"));
   297 	test.Printf(msg);
   309 	INFO_PRINTF1(msg);
   298 	error = foreign1.Compare(CP54936_1);
   310 	error = foreign1.Compare(CP54936_1);
   299 	test(error==0);
   311 	test(error==0);
   300 	foreign1.Zero();
   312 	foreign1.Zero();
   301 	test.Printf(_L("\n"));
   313 	INFO_PRINTF1(_L("\n"));
   302 	
   314 	
   303 	// 2, unicode -> 54936
   315 	// 2, unicode -> 54936
   304 	// test result: 44 ms for 100000 iterations
   316 	// test result: 44 ms for 100000 iterations
   305 	test.Printf(_L("unicode --> 54936:\n"));
   317 	INFO_PRINTF1(_L("unicode --> 54936:\n"));
   306 	test.Printf(_L("        source: "));	TestOut(unicode1);	test.Printf(_L("\n"));
   318 	INFO_PRINTF1(_L("        source: "));	TestOut(unicode1);	INFO_PRINTF1(_L("\n"));
   307 	test.Printf(_L("        expect: "));	TestOut(CP54936_1);	test.Printf(_L("\n"));
   319 	INFO_PRINTF1(_L("        expect: "));	TestOut(CP54936_1);	INFO_PRINTF1(_L("\n"));
   308 	prevTime = User::FastCounter();
   320 	prevTime = User::FastCounter();
   309 	for (count=0; count<MaxCount; count++)
   321 	for (count=0; count<MaxCount; count++)
   310 		{
   322 		{
   311 		foreign1.Zero();
   323 		foreign1.Zero();
   312 		(*aConvertFromUnicode54936L)(foreign1, unicode1);
   324 		(*aConvertFromUnicode54936L)(foreign1, unicode1);
   313 		}
   325 		}
   314 	timeDiff = User::FastCounter() - prevTime;
   326 	timeDiff = User::FastCounter() - prevTime;
   315 	fsSessionMicroSecs = timeDiff / (ticksPerMicroSec);
   327 	fsSessionMicroSecs = timeDiff / (ticksPerMicroSec);
   316 	msg.Format(_L("                    %10.2lf us, "), fsSessionMicroSecs);
   328 	msg.Format(_L("                    %10.2lf us, "), fsSessionMicroSecs);
   317 	test.Printf(_L("        result: "));	TestOut(foreign1);	test.Printf(_L("\n"));
   329 	INFO_PRINTF1(_L("        result: "));	TestOut(foreign1);	INFO_PRINTF1(_L("\n"));
   318 	test.Printf(msg);
   330 	INFO_PRINTF1(msg);
   319 	error = foreign1.Compare(CP54936_1);
   331 	error = foreign1.Compare(CP54936_1);
   320 	test(error==0);
   332 	test(error==0);
   321 	foreign1.Zero();
   333 	foreign1.Zero();
   322 	test.Printf(_L("\n"));
   334 	INFO_PRINTF1(_L("\n"));
   323 
   335 
   324 //////////////////////////////////////////////////////////////////////////////
   336 //////////////////////////////////////////////////////////////////////////////
   325 //////////////////////////////////////////////////////////////////////////////
   337 //////////////////////////////////////////////////////////////////////////////
   326 	_LIT16(Uni_2, "\x0032\xFFFD\x7FB1\x0032\xFFFD\x7FB1\x7FB1");
   338 	_LIT16(Uni_2, "\x0032\xFFFD\x7FB1\x0032\xFFFD\x7FB1\x7FB1");
   327 	_LIT8(CP54936_2, "\x32\xC1\x7F\xC1\x7E\x32\xC1\x7F\xC1\x7E\xC1\x7E");
   339 	_LIT8(CP54936_2, "\x32\xC1\x7F\xC1\x7E\x32\xC1\x7F\xC1\x7E\xC1\x7E");
   328 	const TDesC8& foreign2(CP54936_2);
   340 	const TDesC8& foreign2(CP54936_2);
   329 
   341 
   330 	// 3, 936 -> unicode
   342 	// 3, 936 -> unicode
   331 	// test result: 89 ms for 100000 iterations
   343 	// test result: 89 ms for 100000 iterations
   332 	test.Printf(_L("936 ---> unicode:\n"));
   344 	INFO_PRINTF1(_L("936 ---> unicode:\n"));
   333 	test.Printf(_L("        source: "));	TestOut(foreign2);	test.Printf(_L("\n"));
   345 	INFO_PRINTF1(_L("        source: "));	TestOut(foreign2);	INFO_PRINTF1(_L("\n"));
   334 	test.Printf(_L("        expect: "));	TestOut(Uni_2);		test.Printf(_L("\n"));
   346 	INFO_PRINTF1(_L("        expect: "));	TestOut(Uni_2);		INFO_PRINTF1(_L("\n"));
   335 	prevTime = User::FastCounter();
   347 	prevTime = User::FastCounter();
   336 	for (count=0; count<MaxCount; count++)
   348 	for (count=0; count<MaxCount; count++)
   337 		{
   349 		{
   338 		unicode2.Zero();
   350 		unicode2.Zero();
   339 		(*aConvertToUnicode936L)(unicode2,foreign2);
   351 		(*aConvertToUnicode936L)(unicode2,foreign2);
   340 		}
   352 		}
   341 	timeDiff = User::FastCounter() - prevTime;
   353 	timeDiff = User::FastCounter() - prevTime;
   342 	fsSessionMicroSecs = timeDiff / (ticksPerMicroSec);
   354 	fsSessionMicroSecs = timeDiff / (ticksPerMicroSec);
   343 	msg.Format(_L("                    %10.2lf us, "), fsSessionMicroSecs);
   355 	msg.Format(_L("                    %10.2lf us, "), fsSessionMicroSecs);
   344 	test.Printf(_L("        result: "));	TestOut(unicode2);	test.Printf(_L("\n"));
   356 	INFO_PRINTF1(_L("        result: "));	TestOut(unicode2);	INFO_PRINTF1(_L("\n"));
   345 	test.Printf(msg);
   357 	INFO_PRINTF1(msg);
   346 	error = unicode2.Compare(Uni_2);
   358 	error = unicode2.Compare(Uni_2);
   347 	test(error==0);
   359 	test(error==0);
   348 	unicode2.Zero();
   360 	unicode2.Zero();
   349 	test.Printf(_L("\n"));
   361 	INFO_PRINTF1(_L("\n"));
   350 
   362 
   351 	// 4, 54936 -> unicode
   363 	// 4, 54936 -> unicode
   352 	// test result: 36 ms for 100000 iterations
   364 	// test result: 36 ms for 100000 iterations
   353 	test.Printf(_L("54936 ---> unicode:\n"));
   365 	INFO_PRINTF1(_L("54936 ---> unicode:\n"));
   354 	test.Printf(_L("        source: "));	TestOut(foreign2);	test.Printf(_L("\n"));
   366 	INFO_PRINTF1(_L("        source: "));	TestOut(foreign2);	INFO_PRINTF1(_L("\n"));
   355 	test.Printf(_L("        expect: "));	TestOut(Uni_2);		test.Printf(_L("\n"));
   367 	INFO_PRINTF1(_L("        expect: "));	TestOut(Uni_2);		INFO_PRINTF1(_L("\n"));
   356 	prevTime = User::FastCounter();
   368 	prevTime = User::FastCounter();
   357 	for (count=0; count<MaxCount; count++)
   369 	for (count=0; count<MaxCount; count++)
   358 		{
   370 		{
   359 		unicode2.Zero();
   371 		unicode2.Zero();
   360 		(*aConvertToUnicode54936L)(unicode2,foreign2);
   372 		(*aConvertToUnicode54936L)(unicode2,foreign2);
   361 		}
   373 		}
   362 	timeDiff = User::FastCounter() - prevTime;
   374 	timeDiff = User::FastCounter() - prevTime;
   363 	fsSessionMicroSecs = timeDiff / (ticksPerMicroSec);
   375 	fsSessionMicroSecs = timeDiff / (ticksPerMicroSec);
   364 	msg.Format(_L("                    %10.2lf us, "), fsSessionMicroSecs);
   376 	msg.Format(_L("                    %10.2lf us, "), fsSessionMicroSecs);
   365 	test.Printf(_L("        result: "));	TestOut(unicode2);	test.Printf(_L("\n"));
   377 	INFO_PRINTF1(_L("        result: "));	TestOut(unicode2);	INFO_PRINTF1(_L("\n"));
   366 	test.Printf(msg);
   378 	INFO_PRINTF1(msg);
   367 	error = unicode2.Compare(Uni_2);
   379 	error = unicode2.Compare(Uni_2);
   368 	test(error==0);
   380 	test(error==0);
   369 	unicode2.Zero();
   381 	unicode2.Zero();
   370 	test.Printf(_L("\n"));
   382 	INFO_PRINTF1(_L("\n"));
   371 	
   383 	
   372 	lib936.Close();
   384 	lib936.Close();
   373 	lib54936.Close();
   385 	lib54936.Close();
   374 	
   386 	
   375 //	test.Printf(_L("Press any key...\n"));
   387 //	INFO_PRINTF1(_L("Press any key...\n"));
   376 //	test.Getch();
   388 //	test.Getch();
   377 	}
   389 	}
   378 
   390 
   379 
   391 
   380 // performance when converting mixed data.
   392 // performance when converting mixed data.
   381 // just for reference.
   393 // just for reference.
   382 // ideally, the test result should be similar to that in PerformanceTest1()
   394 // ideally, the test result should be similar to that in PerformanceTest1()
   383 void PerformanceTest2()
   395 void CT_CP54936::PerformanceTest2L()
   384 	{
   396 	{
   385 	test.Next(_L("Performance test 2 (reference)"));
   397     INFO_PRINTF1(_L("Performance test 2 (reference)"));
   386 	RLibrary lib54936;
   398 	RLibrary lib54936;
   387 	const TUidType serverUid54936(KNullUid,KNullUid,KPluginUid);
   399 	const TUidType serverUid54936(KNullUid,KNullUid,KPluginUid);
   388 	
   400 	
   389 	// load the dll	
   401 	// load the dll	
   390 	TInt returnValue2 = lib54936.Load(KName,serverUid54936);
   402 	TInt returnValue2 = lib54936.Load(KName,serverUid54936);
   421 	const TDesC16& unicode1(Uni_1);
   433 	const TDesC16& unicode1(Uni_1);
   422 	TInt error;
   434 	TInt error;
   423 
   435 
   424 	// 2, unicode -> 54936
   436 	// 2, unicode -> 54936
   425 	// test result: 130 ms for 100000 iterations (44 ms if one huge table for BMP characters)
   437 	// test result: 130 ms for 100000 iterations (44 ms if one huge table for BMP characters)
   426 	test.Printf(_L("unicode --> 54936:\n"));
   438 	INFO_PRINTF1(_L("unicode --> 54936:\n"));
   427 	test.Printf(_L("        source: "));	TestOut(unicode1);	test.Printf(_L("\n"));
   439 	INFO_PRINTF1(_L("        source: "));	TestOut(unicode1);	INFO_PRINTF1(_L("\n"));
   428 	test.Printf(_L("        expect: "));	TestOut(CP54936_1);	test.Printf(_L("\n"));
   440 	INFO_PRINTF1(_L("        expect: "));	TestOut(CP54936_1);	INFO_PRINTF1(_L("\n"));
   429 	prevTime = User::FastCounter();
   441 	prevTime = User::FastCounter();
   430 	for (count=0; count<MaxCount; count++)
   442 	for (count=0; count<MaxCount; count++)
   431 		{
   443 		{
   432 		foreign1.Zero();
   444 		foreign1.Zero();
   433 		(*aConvertFromUnicode54936L)(foreign1, unicode1);
   445 		(*aConvertFromUnicode54936L)(foreign1, unicode1);
   434 		}
   446 		}
   435 	timeDiff = User::FastCounter() - prevTime;
   447 	timeDiff = User::FastCounter() - prevTime;
   436 	fsSessionMicroSecs = timeDiff / (ticksPerMicroSec);
   448 	fsSessionMicroSecs = timeDiff / (ticksPerMicroSec);
   437 	msg.Format(_L("                    %10.2lf us, "), fsSessionMicroSecs);
   449 	msg.Format(_L("                    %10.2lf us, "), fsSessionMicroSecs);
   438 	test.Printf(_L("        result: "));	TestOut(foreign1);	test.Printf(_L("\n"));
   450 	INFO_PRINTF1(_L("        result: "));	TestOut(foreign1);	INFO_PRINTF1(_L("\n"));
   439 	test.Printf(msg);
   451 	INFO_PRINTF1(msg);
   440 	error = foreign1.Compare(CP54936_1);
   452 	error = foreign1.Compare(CP54936_1);
   441 	test(error==0);
   453 	test(error==0);
   442 	foreign1.Zero();
   454 	foreign1.Zero();
   443 	test.Printf(_L("\n"));
   455 	INFO_PRINTF1(_L("\n"));
   444 
   456 
   445 //////////////////////////////////////////////////////////////////////////////
   457 //////////////////////////////////////////////////////////////////////////////
   446 //////////////////////////////////////////////////////////////////////////////
   458 //////////////////////////////////////////////////////////////////////////////
   447 	_LIT16(Uni_2, "\x0032\x20AC\xFFFD\x7FB1\x47BB\xD840\xDC00");
   459 	_LIT16(Uni_2, "\x0032\x20AC\xFFFD\x7FB1\x47BB\xD840\xDC00");
   448 	_LIT8(CP54936_2, "\x32\xA2\xE3\xC1\x7F\xC1\x7E\x82\x33\xED\x33\x95\x32\x82\x36");
   460 	_LIT8(CP54936_2, "\x32\xA2\xE3\xC1\x7F\xC1\x7E\x82\x33\xED\x33\x95\x32\x82\x36");
   449 	const TDesC8& foreign2(CP54936_2);
   461 	const TDesC8& foreign2(CP54936_2);
   450 
   462 
   451 	// 4, 54936 -> unicode
   463 	// 4, 54936 -> unicode
   452 	// test result: 36 ms for 100000 iterations
   464 	// test result: 36 ms for 100000 iterations
   453 	test.Printf(_L("54936 ---> unicode:\n"));
   465 	INFO_PRINTF1(_L("54936 ---> unicode:\n"));
   454 	test.Printf(_L("        source: "));	TestOut(foreign2);	test.Printf(_L("\n"));
   466 	INFO_PRINTF1(_L("        source: "));	TestOut(foreign2);	INFO_PRINTF1(_L("\n"));
   455 	test.Printf(_L("        expect: "));	TestOut(Uni_2);		test.Printf(_L("\n"));
   467 	INFO_PRINTF1(_L("        expect: "));	TestOut(Uni_2);		INFO_PRINTF1(_L("\n"));
   456 	prevTime = User::FastCounter();
   468 	prevTime = User::FastCounter();
   457 	for (count=0; count<MaxCount; count++)
   469 	for (count=0; count<MaxCount; count++)
   458 		{
   470 		{
   459 		unicode2.Zero();
   471 		unicode2.Zero();
   460 		(*aConvertToUnicode54936L)(unicode2,foreign2);
   472 		(*aConvertToUnicode54936L)(unicode2,foreign2);
   461 		}
   473 		}
   462 	timeDiff = User::FastCounter() - prevTime;
   474 	timeDiff = User::FastCounter() - prevTime;
   463 	fsSessionMicroSecs = timeDiff / (ticksPerMicroSec);
   475 	fsSessionMicroSecs = timeDiff / (ticksPerMicroSec);
   464 	msg.Format(_L("                    %10.2lf us, "), fsSessionMicroSecs);
   476 	msg.Format(_L("                    %10.2lf us, "), fsSessionMicroSecs);
   465 	test.Printf(_L("        result: "));	TestOut(unicode2);	test.Printf(_L("\n"));
   477 	INFO_PRINTF1(_L("        result: "));	TestOut(unicode2);	INFO_PRINTF1(_L("\n"));
   466 	test.Printf(msg);
   478 	INFO_PRINTF1(msg);
   467 	error = unicode2.Compare(Uni_2);
   479 	error = unicode2.Compare(Uni_2);
   468 	test(error==0);
   480 	test(error==0);
   469 	unicode2.Zero();
   481 	unicode2.Zero();
   470 	test.Printf(_L("\n"));
   482 	INFO_PRINTF1(_L("\n"));
   471 	
   483 	
   472 	lib54936.Close();
   484 	lib54936.Close();
   473 	
   485 	
   474 //	test.Printf(_L("Press any key...\n"));
   486 //	INFO_PRINTF1(_L("Press any key...\n"));
   475 //	test.Getch();
   487 //	test.Getch();
   476 	}
   488 	}
   477 
   489 
   478 /**
   490 /**
   479 @SYMTestCaseID          TI18N-FATCHARCONV-CIT-4001
   491 @SYMTestCaseID          TI18N-FATCHARCONV-CIT-4001
   486                         5. Get four-byte Unicode codepoint
   498                         5. Get four-byte Unicode codepoint
   487                         6. Convert to/from GB18030 to/from Unicode
   499                         6. Convert to/from GB18030 to/from Unicode
   488 @SYMTestExpectedResults No side effect
   500 @SYMTestExpectedResults No side effect
   489 @SYMREQ                 REQ12067
   501 @SYMREQ                 REQ12067
   490 */
   502 */
   491 LOCAL_C void TestConversion( const TDesC16& aUnicode, const TDesC8& a54936, TBool aZero1=ETrue, TBool aZero2=ETrue )
   503 void CT_CP54936::TestConversionL( const TDesC16& aUnicode, const TDesC8& a54936, TBool aZero1, TBool aZero2)
   492 {
   504 {
   493 	test.Next(_L(" @SYMTestCaseID:SYSLIB-FATCHARSETCONV-CT-1778 "));
   505     INFO_PRINTF1(_L(" @SYMTestCaseID:SYSLIB-FATCHARSETCONV-CT-1778 "));
   494 	RLibrary lib;
   506 	RLibrary lib;
   495 
   507 
   496 	const TUidType serverUid(KNullUid,KNullUid,KPluginUid);	
   508 	const TUidType serverUid(KNullUid,KNullUid,KPluginUid);	
   497 	// load the dll	
   509 	// load the dll	
   498 	TInt returnValue = lib.Load(KName,serverUid);
   510 	TInt returnValue = lib.Load(KName,serverUid);
   510 	typedef void (*TConvertToUnicodeL)(TDes16&, const TDesC8&);	
   522 	typedef void (*TConvertToUnicodeL)(TDes16&, const TDesC8&);	
   511 	TConvertToUnicodeL aConvertToUnicodeL = reinterpret_cast <TConvertToUnicodeL> (function2);
   523 	TConvertToUnicodeL aConvertToUnicodeL = reinterpret_cast <TConvertToUnicodeL> (function2);
   512 	
   524 	
   513 	//	testing conversion from Unicode
   525 	//	testing conversion from Unicode
   514 	TBuf8<200> generated54936;
   526 	TBuf8<200> generated54936;
   515 	test.Printf(_L("source: "));	
   527 	INFO_PRINTF1(_L("source: "));	
   516 	TestOut(aUnicode);	
   528 	TestOut(aUnicode);	
   517 	test.Printf(_L("\n"));
   529 	INFO_PRINTF1(_L("\n"));
   518 	test.Printf(_L("expect: "));	
   530 	INFO_PRINTF1(_L("expect: "));	
   519 	TestOut(a54936);	
   531 	TestOut(a54936);	
   520 	test.Printf(_L("\n"));
   532 	INFO_PRINTF1(_L("\n"));
   521 	(*aConvertFromUnicodeL)(generated54936, aUnicode); 	
   533 	(*aConvertFromUnicodeL)(generated54936, aUnicode); 	
   522 	test.Printf(_L("result: "));	
   534 	INFO_PRINTF1(_L("result: "));	
   523 	TestOut(generated54936);	
   535 	TestOut(generated54936);	
   524 	test.Printf(_L("\n"));
   536 	INFO_PRINTF1(_L("\n"));
   525 	TInt error = generated54936.Compare(a54936);
   537 	TInt error = generated54936.Compare(a54936);
   526 	if ( aZero1 )
   538 	if ( aZero1 )
   527 	{
   539 	{
   528 		test(error==0);
   540 		test(error==0);
   529 	}
   541 	}
   532 		test(error!=0);
   544 		test(error!=0);
   533 	}
   545 	}
   534 
   546 
   535 	//	testing conversion to Unicode
   547 	//	testing conversion to Unicode
   536 	TBuf16<200> generatedUnicode;
   548 	TBuf16<200> generatedUnicode;
   537 	test.Printf(_L("source: "));	
   549 	INFO_PRINTF1(_L("source: "));	
   538 	TestOut(a54936);	
   550 	TestOut(a54936);	
   539 	test.Printf(_L("\n"));
   551 	INFO_PRINTF1(_L("\n"));
   540 	test.Printf(_L("expect: "));	
   552 	INFO_PRINTF1(_L("expect: "));	
   541 	TestOut(aUnicode);		
   553 	TestOut(aUnicode);		
   542 	test.Printf(_L("\n"));
   554 	INFO_PRINTF1(_L("\n"));
   543 	(*aConvertToUnicodeL)(generatedUnicode,a54936);
   555 	(*aConvertToUnicodeL)(generatedUnicode,a54936);
   544 	test.Printf(_L("result: "));	
   556 	INFO_PRINTF1(_L("result: "));	
   545 	TestOut(generatedUnicode);	
   557 	TestOut(generatedUnicode);	
   546 	test.Printf(_L("\n"));
   558 	INFO_PRINTF1(_L("\n"));
   547 	error = generatedUnicode.Compare(aUnicode);
   559 	error = generatedUnicode.Compare(aUnicode);
   548 	if ( aZero2 )
   560 	if ( aZero2 )
   549 	{
   561 	{
   550 		test(error==0);
   562 		test(error==0);
   551 	}
   563 	}
   569 						5. Get four-byte Unicode codepoint
   581 						5. Get four-byte Unicode codepoint
   570 						6. Convert to/from GB18030 to/from Unicode
   582 						6. Convert to/from GB18030 to/from Unicode
   571 @SYMTestExpectedResults No side effect
   583 @SYMTestExpectedResults No side effect
   572 @SYMREQ                 REQ12067
   584 @SYMREQ                 REQ12067
   573 */
   585 */
   574 LOCAL_C void TestGbConversion()
   586 void CT_CP54936::TestGbConversionL()
   575 {
   587 {
   576 	//	Test() function covers GB 1,2,4 bytes
   588 	//	TestL() function covers GB 1,2,4 bytes
   577 	//	one-byte
   589 	//	one-byte
   578 	//	border 0x80
   590 	//	border 0x80
   579 	_LIT16(Uni_0, "\x0000");
   591 	_LIT16(Uni_0, "\x0000");
   580 	_LIT8(CP54936_0, "\x00");
   592 	_LIT8(CP54936_0, "\x00");
   581 	TestConversion( Uni_0, CP54936_0 );		
   593 	TestConversionL( Uni_0, CP54936_0 );		
   582 
   594 
   583 	_LIT16(Uni_1, "\x0079");
   595 	_LIT16(Uni_1, "\x0079");
   584 	_LIT8(CP54936_1, "\x79");
   596 	_LIT8(CP54936_1, "\x79");
   585 	TestConversion( Uni_1, CP54936_1 );		
   597 	TestConversionL( Uni_1, CP54936_1 );		
   586 
   598 
   587 	_LIT16(Uni_2, "\x0080");
   599 	_LIT16(Uni_2, "\x0080");
   588 	_LIT8(CP54936_2, "\x81\x30\x81\x30");
   600 	_LIT8(CP54936_2, "\x81\x30\x81\x30");
   589 	TestConversion( Uni_2, CP54936_2 );		
   601 	TestConversionL( Uni_2, CP54936_2 );		
   590 
   602 
   591 	_LIT16(Uni_3, "\x0081");
   603 	_LIT16(Uni_3, "\x0081");
   592 	_LIT8(CP54936_3, "\x81\x30\x81\x31");
   604 	_LIT8(CP54936_3, "\x81\x30\x81\x31");
   593 	TestConversion( Uni_3, CP54936_3 );		
   605 	TestConversionL( Uni_3, CP54936_3 );		
   594 	
   606 	
   595 	_LIT16(Uni_4, "\x00fe");
   607 	_LIT16(Uni_4, "\x00fe");
   596 	_LIT8(CP54936_4, "\x81\x30\x8B\x36");
   608 	_LIT8(CP54936_4, "\x81\x30\x8B\x36");
   597 	TestConversion( Uni_4, CP54936_4 );		
   609 	TestConversionL( Uni_4, CP54936_4 );		
   598 
   610 
   599 	_LIT16(Uni_5, "\x00ff");
   611 	_LIT16(Uni_5, "\x00ff");
   600 	_LIT8(CP54936_5, "\x81\x30\x8B\x37");
   612 	_LIT8(CP54936_5, "\x81\x30\x8B\x37");
   601 	TestConversion( Uni_5, CP54936_5 );		
   613 	TestConversionL( Uni_5, CP54936_5 );		
   602 
   614 
   603 	//	two-byte
   615 	//	two-byte
   604 	_LIT16(Uni_6, "\x0100");
   616 	_LIT16(Uni_6, "\x0100");
   605 	_LIT8(CP54936_6, "\x81\x30\x8B\x38");
   617 	_LIT8(CP54936_6, "\x81\x30\x8B\x38");
   606 	TestConversion( Uni_6, CP54936_6 );	
   618 	TestConversionL( Uni_6, CP54936_6 );	
   607 
   619 
   608 	_LIT16(Uni_7, "\x0101");
   620 	_LIT16(Uni_7, "\x0101");
   609 	_LIT8(CP54936_7, "\xA8\xA1");
   621 	_LIT8(CP54936_7, "\xA8\xA1");
   610 	TestConversion( Uni_7, CP54936_7 );	
   622 	TestConversionL( Uni_7, CP54936_7 );	
   611 
   623 
   612 	_LIT16(Uni_8, "\x0ffe");
   624 	_LIT16(Uni_8, "\x0ffe");
   613 	_LIT8(CP54936_8, "\x81\x33\x83\x38");
   625 	_LIT8(CP54936_8, "\x81\x33\x83\x38");
   614 	TestConversion( Uni_8, CP54936_8 );	
   626 	TestConversionL( Uni_8, CP54936_8 );	
   615 
   627 
   616 	_LIT16(Uni_9, "\x0fff");
   628 	_LIT16(Uni_9, "\x0fff");
   617 	_LIT8(CP54936_9, "\x81\x33\x83\x39");
   629 	_LIT8(CP54936_9, "\x81\x33\x83\x39");
   618 	TestConversion( Uni_9, CP54936_9 );	
   630 	TestConversionL( Uni_9, CP54936_9 );	
   619 
   631 
   620 	_LIT16(Uni_10, "\x1000");
   632 	_LIT16(Uni_10, "\x1000");
   621 	_LIT8(CP54936_10, "\x81\x33\x84\x30");
   633 	_LIT8(CP54936_10, "\x81\x33\x84\x30");
   622 	TestConversion( Uni_10, CP54936_10 );	
   634 	TestConversionL( Uni_10, CP54936_10 );	
   623 
   635 
   624 	_LIT16(Uni_11, "\x1001");
   636 	_LIT16(Uni_11, "\x1001");
   625 	_LIT8(CP54936_11, "\x81\x33\x84\x31");
   637 	_LIT8(CP54936_11, "\x81\x33\x84\x31");
   626 	TestConversion( Uni_11, CP54936_11 );	
   638 	TestConversionL( Uni_11, CP54936_11 );	
   627 
   639 
   628 	_LIT16(Uni_12, "\xfffe");
   640 	_LIT16(Uni_12, "\xfffe");
   629 	_LIT8(CP54936_12, "\x84\x31\xA4\x38");
   641 	_LIT8(CP54936_12, "\x84\x31\xA4\x38");
   630 	TestConversion( Uni_12, CP54936_12 );	
   642 	TestConversionL( Uni_12, CP54936_12 );	
   631 
   643 
   632 	_LIT16(Uni_13, "\xffff");
   644 	_LIT16(Uni_13, "\xffff");
   633 	_LIT8(CP54936_13, "\x84\x31\xA4\x39");
   645 	_LIT8(CP54936_13, "\x84\x31\xA4\x39");
   634 	TestConversion( Uni_13, CP54936_13 );	
   646 	TestConversionL( Uni_13, CP54936_13 );	
   635 
   647 
   636 	//	four-byte
   648 	//	four-byte
   637 	_LIT16(Uni_14, "\xd840\xdc00");
   649 	_LIT16(Uni_14, "\xd840\xdc00");
   638 	_LIT8(CP54936_14, "\x95\x32\x82\x36");
   650 	_LIT8(CP54936_14, "\x95\x32\x82\x36");
   639 	TestConversion( Uni_14, CP54936_14 );	
   651 	TestConversionL( Uni_14, CP54936_14 );	
   640 
   652 
   641 	_LIT16(Uni_15, "\xd840\xdc01");
   653 	_LIT16(Uni_15, "\xd840\xdc01");
   642 	_LIT8(CP54936_15, "\x95\x32\x82\x37");
   654 	_LIT8(CP54936_15, "\x95\x32\x82\x37");
   643 	TestConversion( Uni_15, CP54936_15 );	
   655 	TestConversionL( Uni_15, CP54936_15 );	
   644 	
   656 	
   645 	_LIT16(Uni_16, "\xD87F\xdffe");
   657 	_LIT16(Uni_16, "\xD87F\xdffe");
   646 	_LIT8(CP54936_16, "\x9a\x34\x84\x30");
   658 	_LIT8(CP54936_16, "\x9a\x34\x84\x30");
   647 	TestConversion( Uni_16, CP54936_16 );	
   659 	TestConversionL( Uni_16, CP54936_16 );	
   648 
   660 
   649 	_LIT16(Uni_17, "\xD87F\xdfff");
   661 	_LIT16(Uni_17, "\xD87F\xdfff");
   650 	_LIT8(CP54936_17, "\x9a\x34\x84\x31");
   662 	_LIT8(CP54936_17, "\x9a\x34\x84\x31");
   651 	TestConversion( Uni_17, CP54936_17 );	
   663 	TestConversionL( Uni_17, CP54936_17 );	
   652 
   664 
   653 	//	4-byte gb
   665 	//	4-byte gb
   654 	_LIT16(Uni_18, "\xd840\xddad");
   666 	_LIT16(Uni_18, "\xd840\xddad");
   655 	_LIT8(CP54936_18, "\x95\x32\xAD\x35");
   667 	_LIT8(CP54936_18, "\x95\x32\xAD\x35");
   656 	TestConversion( Uni_18, CP54936_18 );	
   668 	TestConversionL( Uni_18, CP54936_18 );	
   657 	
   669 	
   658 	_LIT16(Uni_19, "\xd801\xdd00");
   670 	_LIT16(Uni_19, "\xd801\xdd00");
   659 	_LIT8(CP54936_19, "\x90\x31\x83\x30");
   671 	_LIT8(CP54936_19, "\x90\x31\x83\x30");
   660 	TestConversion( Uni_19, CP54936_19 );	
   672 	TestConversionL( Uni_19, CP54936_19 );	
   661 }
   673 }
   662 
   674 
   663 
   675 
   664 /**
   676 /**
   665 @SYMTestCaseID          TI18N-CHARCONV-CT-
   677 @SYMTestCaseID          TI18N-CHARCONV-CT-
   672 						5. Get four-byte Unicode codepoint
   684 						5. Get four-byte Unicode codepoint
   673 						6. Check if it's legal short name character
   685 						6. Check if it's legal short name character
   674 @SYMTestExpectedResults No side effect
   686 @SYMTestExpectedResults No side effect
   675 @SYMREQ                 REQ12067
   687 @SYMREQ                 REQ12067
   676 */
   688 */
   677 LOCAL_C void TestShortNameCharacter()
   689 void CT_CP54936::TestShortNameCharacterL()
   678 {
   690 {
   679 	test.Next(_L(" @SYMTestCaseID:SYSLIB-FATCHARSETCONV-CT-1778 "));
   691     INFO_PRINTF1(_L(" @SYMTestCaseID:SYSLIB-FATCHARSETCONV-CT-1778 "));
   680 	RLibrary lib;
   692 	RLibrary lib;
   681 
   693 
   682 	const TUidType serverUid(KNullUid,KNullUid,KPluginUid);	
   694 	const TUidType serverUid(KNullUid,KNullUid,KPluginUid);	
   683 	// 	load the dll	
   695 	// 	load the dll	
   684 	TInt returnValue = lib.Load(KName,serverUid);
   696 	TInt returnValue = lib.Load(KName,serverUid);
   813 
   825 
   814 	lib.Close();
   826 	lib.Close();
   815 }
   827 }
   816 
   828 
   817 
   829 
   818 LOCAL_C void DoE32MainL()
   830 CT_CP54936::CT_CP54936()
   819 	{
   831     {
   820 	__UHEAP_MARK;
   832     SetTestStepName(KTestStep_T_CP54936);
   821 	
   833     }
   822 	TestGbConversion();
   834 
   823 	TestShortNameCharacter();
   835 
   824 	Test();
   836 TVerdict CT_CP54936::doTestStepL()
   825 	TestINC090073();
   837     {
   826 	OOMTest();
   838     SetTestStepResult(EFail);
   827 	PerformanceTest1();
   839 
   828 	PerformanceTest2();
   840     __UHEAP_MARK;
   829 	
   841 
   830 	__UHEAP_MARKEND;
   842     TRAPD(error1, TestGbConversionL());
   831 	}
   843     TRAPD(error2, TestShortNameCharacterL());
   832 
   844     TRAPD(error3, TestL());
   833 GLDEF_C TInt E32Main()
   845     TRAPD(error4, TestINC090073L());
   834 	{
   846     TRAPD(error5, OOMTestL());
   835 	__UHEAP_MARK;
   847     TRAPD(error6, PerformanceTest1L());
   836 
   848     TRAPD(error7, PerformanceTest2L());
   837 	test.Title();
   849 
   838 	test.Start(_L("CP54936 test..."));
   850     __UHEAP_MARKEND;
   839 
   851 
   840 	CTrapCleanup* trapCleanup=CTrapCleanup::New();
   852     if(error1 == KErrNone && error2 == KErrNone && error3 == KErrNone
   841 	TRAPD(error, DoE32MainL());
   853             && error4 == KErrNone && error5 == KErrNone 
   842 	test(error==KErrNone);
   854             && error6 == KErrNone && error7 == KErrNone)
   843 	
   855         {
   844 	delete trapCleanup;
   856         SetTestStepResult(EPass);
   845 	
   857         }
   846 	test.End();
   858 
   847 	test.Close();
   859     return TestStepResult();
   848 
   860     }
   849 	__UHEAP_MARKEND;
       
   850 	return error;
       
   851 	}