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