os/textandloc/charconvfw/charconvplugins/test/rtest/tsrc/main/t_jis.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 /*
     2 * Copyright (c) 2000-2010 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 "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 
    19 #include <e32std.h>
    20 #include <e32base.h>
    21 #include <f32file.h>
    22 #include <charconv.h>
    23 #include "t_jis.h"
    24 
    25 #define test(cond)                                  \
    26     {                                               \
    27     TBool __bb = (cond);                            \
    28     TEST(__bb);                                     \
    29     if (!__bb)                                      \
    30         {                                           \
    31         ERR_PRINTF1(_L("ERROR: Test Failed"));      \
    32         User::Leave(1);                             \
    33         }                                           \
    34     }
    35 
    36 const TInt KBufferLength=100;
    37 /**
    38 @SYMTestCaseID          SYSLIB-CHARCONV-CT-0529
    39 @SYMTestCaseDesc        Tests for truncated conversion from Unicode to JIS
    40 @SYMTestPriority        Medium
    41 @SYMTestActions         Tests for truncated conversion from Unicode to JIS and back to Unicode
    42 @SYMTestExpectedResults Test must not fail
    43 @SYMREQ                 REQ0000
    44 */
    45 void CT_JIS::TestTruncatedConversionFromUnicodeToJis(CCnvCharacterSetConverter& aCharacterSetConverter, const TDesC16& aOriginalUnicode)
    46 	{
    47 	INFO_PRINTF1(_L(" @SYMTestCaseID:SYSLIB-CHARCONV-CT-0529 "));
    48 	for (TInt i=aOriginalUnicode.Length(); i>=0; --i)
    49 		{
    50 		TBuf8<KBufferLength> generatedJis;
    51 		test(aCharacterSetConverter.ConvertFromUnicode(generatedJis, aOriginalUnicode.Left(i))>=0);
    52 		TBuf8<KBufferLength> generatedsecondPartOfJis;
    53 		test(aCharacterSetConverter.ConvertFromUnicode(generatedsecondPartOfJis, aOriginalUnicode.Mid(i))==0);
    54 		generatedJis.Append(generatedsecondPartOfJis);
    55 		TInt state=CCnvCharacterSetConverter::KStateDefault;
    56 		TBuf16<KBufferLength> generatedUnicode;
    57 		test(aCharacterSetConverter.ConvertToUnicode(generatedUnicode, generatedJis, state)==0);
    58 		test(generatedUnicode==aOriginalUnicode);
    59 		}
    60 	}
    61 /**
    62 @SYMTestCaseID          SYSLIB-CHARCONV-CT-0530
    63 @SYMTestCaseDesc        Splitting and converting from Unicode to JIS test
    64 @SYMTestPriority        Medium
    65 @SYMTestActions         Tests for conversion after splitting, from Unicode to JIS and back to Unicode
    66 @SYMTestExpectedResults Test must not fail
    67 @SYMREQ                 REQ0000
    68 */
    69 void CT_JIS::TestSplittingConvertingFromUnicodeToJis(CCnvCharacterSetConverter& aCharacterSetConverter, TInt aMaximumLengthLowerLimit, TInt aMaximumLengthUpperLimit, TInt aExpectedNumberOfUnicodeCharactersNotConvertedAtSplit, const TDesC8& aExpectedFirstPartOfJis, const TDesC8& aExpectedSecondPartOfJis, const TDesC16& aOriginalUnicode)
    70 	{
    71 	INFO_PRINTF1(_L(" @SYMTestCaseID:SYSLIB-CHARCONV-CT-0530 "));
    72 	test(aMaximumLengthLowerLimit<=aMaximumLengthUpperLimit);
    73 	test(aMaximumLengthUpperLimit<=KBufferLength);
    74 	TUint8 jisBuffer[KBufferLength];
    75 	for (TInt i=aMaximumLengthLowerLimit; i<=aMaximumLengthUpperLimit; ++i)
    76 		{
    77 		TPtr8 generatedFirstPartOfJis(jisBuffer, i);
    78 		test(aCharacterSetConverter.ConvertFromUnicode(generatedFirstPartOfJis, aOriginalUnicode)==aExpectedNumberOfUnicodeCharactersNotConvertedAtSplit);
    79 		test(generatedFirstPartOfJis==aExpectedFirstPartOfJis);
    80 		TBuf8<KBufferLength> generatedSecondPartOfJis;
    81 		test(aCharacterSetConverter.ConvertFromUnicode(generatedSecondPartOfJis, aOriginalUnicode.Right(aExpectedNumberOfUnicodeCharactersNotConvertedAtSplit))==0);
    82 		test(generatedSecondPartOfJis==aExpectedSecondPartOfJis);
    83 		TInt state=CCnvCharacterSetConverter::KStateDefault;
    84 		TBuf16<KBufferLength> generatedUnicode;
    85 		test(aCharacterSetConverter.ConvertToUnicode(generatedUnicode, generatedFirstPartOfJis, state)==0);
    86 		TBuf16<KBufferLength> generatedSecondPartOfUnicode;
    87 		test(aCharacterSetConverter.ConvertToUnicode(generatedSecondPartOfUnicode, generatedSecondPartOfJis, state)==0);
    88 		generatedUnicode.Append(generatedSecondPartOfUnicode);
    89 		test(generatedUnicode==aOriginalUnicode);
    90 		}
    91 	}
    92 /**
    93 @SYMTestCaseID          SYSLIB-CHARCONV-CT-0531
    94 @SYMTestCaseDesc        Tests for truncated conversion from JIS to Unicode
    95 @SYMTestPriority        Medium
    96 @SYMTestActions         Tests for truncated conversion from JIS to Unicode and back to JIS
    97 @SYMTestExpectedResults Test must not fail
    98 @SYMREQ                 REQ0000
    99 */
   100 void CT_JIS::TestTruncatedConversionToUnicodeFromJis(CCnvCharacterSetConverter& aCharacterSetConverter, const TDesC16& aExpectedUnicode, const TDesC8& aOriginalJis)
   101 	{
   102 	INFO_PRINTF1(_L(" @SYMTestCaseID:SYSLIB-CHARCONV-CT-0531 "));
   103 	for (TInt i=aOriginalJis.Length(); i>=6; --i) // 6 is the length of JIS' longest escape sequence
   104 		{
   105 		TInt state=CCnvCharacterSetConverter::KStateDefault;
   106 		TBuf16<KBufferLength> generatedUnicode;
   107 		const TInt returnValue=aCharacterSetConverter.ConvertToUnicode(generatedUnicode, aOriginalJis.Left(i), state);
   108 		test(returnValue>=0);
   109 		TBuf16<KBufferLength> generatedsecondPartOfUnicode;
   110 		test(aCharacterSetConverter.ConvertToUnicode(generatedsecondPartOfUnicode, aOriginalJis.Mid(i-returnValue), state)==0);
   111 		generatedUnicode.Append(generatedsecondPartOfUnicode);
   112 		test(generatedUnicode==aExpectedUnicode);
   113 		}
   114 	}
   115 /**
   116 @SYMTestCaseID          SYSLIB-CHARCONV-CT-0532
   117 @SYMTestCaseDesc        Splitting and converting from JIS to Unicode test
   118 @SYMTestPriority        Medium
   119 @SYMTestActions         Tests for conversion after splitting, from JIS to Unicode and back to JIS
   120 @SYMTestExpectedResults Test must not fail
   121 @SYMREQ                 REQ0000
   122 */
   123 void CT_JIS::TestSplittingConvertingToUnicodeFromJis(CCnvCharacterSetConverter& aCharacterSetConverter, TInt aMaximumLengthLowerLimit, TInt aMaximumLengthUpperLimit, TInt aExpectedNumberOfJisBytesNotConvertedAtSplit, TInt aExpectedLengthOfFirstPartOfUnicode, const TDesC16& aExpectedUnicode, const TDesC8& aOriginalJis)
   124 	{
   125 	INFO_PRINTF1(_L(" @SYMTestCaseID:SYSLIB-CHARCONV-CT-0532 "));
   126 	test(aMaximumLengthLowerLimit<=aMaximumLengthUpperLimit);
   127 	test(aMaximumLengthUpperLimit<=KBufferLength);
   128 	TUint16 unicodeBuffer[KBufferLength];
   129 	for (TInt i=aMaximumLengthLowerLimit; i<=aMaximumLengthUpperLimit; ++i)
   130 		{
   131 		TPtr16 generatedFirstPartOfUnicode(unicodeBuffer, i);
   132 		TInt state=CCnvCharacterSetConverter::KStateDefault;
   133 		const TInt returnValue=aCharacterSetConverter.ConvertToUnicode(generatedFirstPartOfUnicode, aOriginalJis, state);
   134 		test(generatedFirstPartOfUnicode==aExpectedUnicode.Left(aExpectedLengthOfFirstPartOfUnicode));
   135 		test(returnValue==aExpectedNumberOfJisBytesNotConvertedAtSplit);
   136 		TBuf16<KBufferLength> generatedSecondPartOfUnicode;
   137 		test(aCharacterSetConverter.ConvertToUnicode(generatedSecondPartOfUnicode, aOriginalJis.Right(aExpectedNumberOfJisBytesNotConvertedAtSplit), state)==0);
   138 		test(generatedSecondPartOfUnicode==aExpectedUnicode.Mid(aExpectedLengthOfFirstPartOfUnicode));
   139 		TBuf8<KBufferLength> generatedJis;
   140 		test(aCharacterSetConverter.ConvertFromUnicode(generatedJis, generatedFirstPartOfUnicode)==0);
   141 		TBuf8<KBufferLength> generatedSecondPartOfJis;
   142 		test(aCharacterSetConverter.ConvertFromUnicode(generatedSecondPartOfJis, generatedSecondPartOfUnicode)==0);
   143 		generatedJis.Append(generatedSecondPartOfJis);
   144 		TBuf16<KBufferLength> regeneratedUnicode;
   145 		state=CCnvCharacterSetConverter::KStateDefault;
   146 		test(aCharacterSetConverter.ConvertToUnicode(regeneratedUnicode, generatedJis, state)==0);
   147 		test(regeneratedUnicode==aExpectedUnicode);
   148 		state=CCnvCharacterSetConverter::KStateDefault;
   149 		test(aCharacterSetConverter.ConvertToUnicode(regeneratedUnicode, aOriginalJis, state)==0);
   150 		test(regeneratedUnicode==aExpectedUnicode);
   151 		}
   152 	}
   153 /**
   154 @SYMTestCaseID          SYSLIB-CHARCONV-CT-0533
   155 @SYMTestCaseDesc        Conversion of bad JIS format to Unicode test
   156 @SYMTestPriority        Medium
   157 @SYMTestActions         Tests to convert bad formatted JIS input to Unicode.
   158 @SYMTestExpectedResults Test must not fail
   159 @SYMREQ                 REQ0000
   160 */
   161 void CT_JIS::TestIsIllFormedJis(CCnvCharacterSetConverter& aCharacterSetConverter, const TDesC8& aJis)
   162 	{
   163 	INFO_PRINTF1(_L(" @SYMTestCaseID:SYSLIB-CHARCONV-CT-0533 "));
   164 	TBuf16<50> generatedUnicode;
   165 	TInt state=CCnvCharacterSetConverter::KStateDefault;
   166 	TPtrC8 remainderOfJis(aJis);
   167 	TInt lastReturnValue=KMaxTInt;
   168 	FOREVER
   169 		{
   170 		const TInt returnValue=aCharacterSetConverter.ConvertToUnicode(generatedUnicode, remainderOfJis, state);
   171 		if (returnValue==CCnvCharacterSetConverter::EErrorIllFormedInput)
   172 			{
   173 			break;
   174 			}
   175 		test(returnValue>0);
   176 		test(returnValue<lastReturnValue);
   177 		lastReturnValue=returnValue;
   178 		remainderOfJis.Set(remainderOfJis.Right(returnValue));
   179 		}
   180 	}
   181 
   182 /**
   183 * Utility for DEF063276 fix.
   184 */
   185 
   186 _LIT(KOriginalJisFilename, "z:\\test\\data\\originalJis.dat");
   187 
   188 void CT_JIS::ReadDesc(TDes8& aDes, const TDesC& aFilename, RFs& aFs)
   189 	{
   190 	RFile file;
   191 	TInt err = file.Open(aFs, aFilename, EFileRead);
   192 	test(err == KErrNone);
   193 	CleanupClosePushL(file);
   194 
   195 	err = file.Read(aDes);
   196 	test(err == KErrNone);
   197 	CleanupStack::PopAndDestroy(&file);
   198 	}
   199 
   200 /**
   201 @SYMTestCaseID          SYSLIB-CHARCONV-CT-0534
   202 @SYMTestCaseDesc        JIS to Unicode and Unicode to JIS conversion tests
   203 @SYMTestPriority        Medium
   204 @SYMTestActions         Calls up all conversion test functions from JIS to Unicode
   205 @SYMTestExpectedResults Test must not fail
   206 @SYMREQ                 REQ0000
   207 */
   208 
   209 void CT_JIS::DoE32MainL()
   210 	{
   211 	INFO_PRINTF1(_L(" @SYMTestCaseID:SYSLIB-CHARCONV-CT-0534 "));
   212 	RFs fileServerSession;
   213 	CleanupClosePushL(fileServerSession);
   214 	User::LeaveIfError(fileServerSession.Connect());
   215 	CCnvCharacterSetConverter* characterSetConverter=CCnvCharacterSetConverter::NewLC();
   216 	CArrayFix<CCnvCharacterSetConverter::SCharacterSet>* arrayOfCharacterSetsAvailable=CCnvCharacterSetConverter::CreateArrayOfCharacterSetsAvailableLC(fileServerSession);
   217 	INFO_PRINTF1(_L("Available:\n"));
   218 	TInt i;
   219 	for (i=arrayOfCharacterSetsAvailable->Count()-1; i>=0; --i)
   220 		{
   221 		const CCnvCharacterSetConverter::SCharacterSet& charactersSet=(*arrayOfCharacterSetsAvailable)[i];
   222 		characterSetConverter->PrepareToConvertToOrFromL(charactersSet.Identifier(), *arrayOfCharacterSetsAvailable, fileServerSession);
   223 		TPtrC charactersSetName(charactersSet.Name());
   224 		if (charactersSet.NameIsFileName())
   225 			{
   226 			charactersSetName.Set(TParsePtrC(charactersSetName).Name());
   227 			}
   228 		INFO_PRINTF2(_L("    %S\n"), &charactersSetName);
   229 		}
   230 	INFO_PRINTF1(_L("Testing JIS conversions"));
   231 	characterSetConverter->PrepareToConvertToOrFromL(KCharacterSetIdentifierJis, *arrayOfCharacterSetsAvailable, fileServerSession);
   232 	//
   233 	INFO_PRINTF1(_L("Empty descriptor"));
   234 	TestSplittingConvertingFromUnicodeToJis(*characterSetConverter, 0, 10, 0, KNullDesC8, KNullDesC8, KNullDesC16);
   235 	TestSplittingConvertingToUnicodeFromJis(*characterSetConverter, 0, 10, 0, 0, KNullDesC16, KNullDesC8);
   236 	INFO_PRINTF1(_L("Testing converting to JIS"));
   237 	TBuf16<50> originalUnicode;
   238 	originalUnicode.Format(_L16("I %c%c%c%c%c%c%c%c"), 0x611b, 0x3059, 0x308b, 0xff74, 0xff9a, 0xff68, 0xff9d, 0x4e04);
   239 	TestTruncatedConversionFromUnicodeToJis(*characterSetConverter, originalUnicode);
   240 	TestSplittingConvertingFromUnicodeToJis(*characterSetConverter, 0, 3, 10, KNullDesC8, _L8("\x1b\x28\x4aI \x1b\x24\x42\x30\x26\x24\x39\x24\x6b\x1b\x28\x49\x34\x5a\x28\x5d\x1b\x24\x28\x44\x30\x22"), originalUnicode);
   241 	TestSplittingConvertingFromUnicodeToJis(*characterSetConverter, 4, 4, 9, _L8("\x1b\x28\x4aI"), _L8("\x1b\x28\x4a \x1b\x24\x42\x30\x26\x24\x39\x24\x6b\x1b\x28\x49\x34\x5a\x28\x5d\x1b\x24\x28\x44\x30\x22"), originalUnicode);
   242 	TestSplittingConvertingFromUnicodeToJis(*characterSetConverter, 5, 9, 8, _L8("\x1b\x28\x4aI "), _L8("\x1b\x24\x42\x30\x26\x24\x39\x24\x6b\x1b\x28\x49\x34\x5a\x28\x5d\x1b\x24\x28\x44\x30\x22"), originalUnicode);
   243 	TestSplittingConvertingFromUnicodeToJis(*characterSetConverter, 10, 11, 7, _L8("\x1b\x28\x4aI \x1b\x24\x42\x30\x26"), _L8("\x1b\x24\x42\x24\x39\x24\x6b\x1b\x28\x49\x34\x5a\x28\x5d\x1b\x24\x28\x44\x30\x22"), originalUnicode);
   244 	TestSplittingConvertingFromUnicodeToJis(*characterSetConverter, 12, 13, 6, _L8("\x1b\x28\x4aI \x1b\x24\x42\x30\x26\x24\x39"), _L8("\x1b\x24\x42\x24\x6b\x1b\x28\x49\x34\x5a\x28\x5d\x1b\x24\x28\x44\x30\x22"), originalUnicode);
   245 	TestSplittingConvertingFromUnicodeToJis(*characterSetConverter, 14, 17, 5, _L8("\x1b\x28\x4aI \x1b\x24\x42\x30\x26\x24\x39\x24\x6b"), _L8("\x1b\x28\x49\x34\x5a\x28\x5d\x1b\x24\x28\x44\x30\x22"), originalUnicode);
   246 	TestSplittingConvertingFromUnicodeToJis(*characterSetConverter, 18, 18, 4, _L8("\x1b\x28\x4aI \x1b\x24\x42\x30\x26\x24\x39\x24\x6b\x1b\x28\x49\x34"), _L8("\x1b\x28\x49\x5a\x28\x5d\x1b\x24\x28\x44\x30\x22"), originalUnicode);
   247 	TestSplittingConvertingFromUnicodeToJis(*characterSetConverter, 19, 19, 3, _L8("\x1b\x28\x4aI \x1b\x24\x42\x30\x26\x24\x39\x24\x6b\x1b\x28\x49\x34\x5a"), _L8("\x1b\x28\x49\x28\x5d\x1b\x24\x28\x44\x30\x22"), originalUnicode);
   248 	TestSplittingConvertingFromUnicodeToJis(*characterSetConverter, 20, 20, 2, _L8("\x1b\x28\x4aI \x1b\x24\x42\x30\x26\x24\x39\x24\x6b\x1b\x28\x49\x34\x5a\x28"), _L8("\x1b\x28\x49\x5d\x1b\x24\x28\x44\x30\x22"), originalUnicode);
   249 	TestSplittingConvertingFromUnicodeToJis(*characterSetConverter, 21, 26, 1, _L8("\x1b\x28\x4aI \x1b\x24\x42\x30\x26\x24\x39\x24\x6b\x1b\x28\x49\x34\x5a\x28\x5d"), _L8("\x1b\x24\x28\x44\x30\x22"), originalUnicode);
   250 	TestSplittingConvertingFromUnicodeToJis(*characterSetConverter, 27, 40, 0, _L8("\x1b\x28\x4aI \x1b\x24\x42\x30\x26\x24\x39\x24\x6b\x1b\x28\x49\x34\x5a\x28\x5d\x1b\x24\x28\x44\x30\x22"), KNullDesC8, originalUnicode);
   251 	INFO_PRINTF1(_L("Testing converting to Unicode"));
   252 
   253 	/**
   254 	* Work around for DEF063276.
   255 	* This literal is now loaded from a z:\test\data\originalJis.dat
   256 	* Bullseye Coverage corrupts this literal to avoid this it is stored in a file as to not be touched by Bullseye Coverage.
   257 	*/
   258 	// const TPtrC8 originalJis(_S8("\\\x1b\x28\x42\\\xb4\\\x0e\x31\x0f\\\x0e\x4a\x5e\x1b\x26\x40\x1b\x24\x42\x30\x24\x1b\x24\x28\x44\x30\x24\x1b\x28\x49\x21\x0e\x22\x0f\x30\x24\x0e"));
   259 
   260 	TBuf8<64> buf;
   261 	ReadDesc(buf, KOriginalJisFilename, fileServerSession);
   262 
   263 	TBuf16<50> expectedUnicode;
   264 	expectedUnicode.Format(_L16("\xa5\\%c\xa5%c\xa5%c%c%c%c%c%c0$"), 0xff74, 0xff71, 0xff8a, 0xff9e, 0x963f, 0x4e0c, 0xff61, 0xff62);
   265 	TestTruncatedConversionToUnicodeFromJis(*characterSetConverter, expectedUnicode, buf);
   266 	TestTruncatedConversionToUnicodeFromJis(*characterSetConverter, _L16(" Hello"), _L8("\x1b\x24\x42\x1b\x28\x4a\x1b\x24\x42\x1b\x28\x4a\x1b\x26\x40\x1b\x24\x42\x1b\x28\x4a Hello"));
   267 	TestTruncatedConversionToUnicodeFromJis(*characterSetConverter, _L16(" Hello"), _L8("\x1b\x26\x40\x1b\x24\x42\x1b\x28\x4a Hello"));
   268 	TestSplittingConvertingToUnicodeFromJis(*characterSetConverter, 0, 0, 38, 0, expectedUnicode, buf);
   269 	TestSplittingConvertingToUnicodeFromJis(*characterSetConverter, 1, 1, 34, 1, expectedUnicode, buf);
   270 	TestSplittingConvertingToUnicodeFromJis(*characterSetConverter, 2, 2, 33, 2, expectedUnicode, buf);
   271 	TestSplittingConvertingToUnicodeFromJis(*characterSetConverter, 3, 3, 32, 3, expectedUnicode, buf);
   272 	TestSplittingConvertingToUnicodeFromJis(*characterSetConverter, 4, 4, 30, 4, expectedUnicode, buf);
   273 	TestSplittingConvertingToUnicodeFromJis(*characterSetConverter, 5, 5, 28, 5, expectedUnicode, buf);
   274 	TestSplittingConvertingToUnicodeFromJis(*characterSetConverter, 6, 6, 26, 6, expectedUnicode, buf);
   275 	TestSplittingConvertingToUnicodeFromJis(*characterSetConverter, 7, 7, 25, 7, expectedUnicode, buf);
   276 	TestSplittingConvertingToUnicodeFromJis(*characterSetConverter, 8, 8, 24, 8, expectedUnicode, buf);
   277 	TestSplittingConvertingToUnicodeFromJis(*characterSetConverter, 9, 9, 12, 9, expectedUnicode, buf);
   278 	TestSplittingConvertingToUnicodeFromJis(*characterSetConverter, 10, 10, 7, 10, expectedUnicode, buf);
   279 	TestSplittingConvertingToUnicodeFromJis(*characterSetConverter, 11, 11, 5, 11, expectedUnicode, buf);
   280 	TestSplittingConvertingToUnicodeFromJis(*characterSetConverter, 12, 12, 3, 12, expectedUnicode, buf);
   281 	TestSplittingConvertingToUnicodeFromJis(*characterSetConverter, 13, 13, 2, 13, expectedUnicode, buf);
   282 	TestSplittingConvertingToUnicodeFromJis(*characterSetConverter, 14, 30, 0, 14, expectedUnicode, buf);
   283 
   284 	// End fix
   285 	INFO_PRINTF1(_L("Testing the default JIS state"));
   286 	for (i=0; i<=6; ++i)
   287 		{
   288 		TestSplittingConvertingToUnicodeFromJis(*characterSetConverter, i, i, 6-i, i, _L16("Hello\xa5"), _L8("Hello\\"));
   289 		}
   290 	INFO_PRINTF1(_L("Testing ill-formed JIS"));
   291 	TestIsIllFormedJis(*characterSetConverter, _L8("abc \x1b\x26\x40\x1b\x24\x42\x21\x1b\x28\x4a def"));
   292 	TestIsIllFormedJis(*characterSetConverter, _L8("abc \x1b\x26\x40\x1b\x24\x42\x21\x21\x21\x1b\x28\x4a def"));
   293 	TestIsIllFormedJis(*characterSetConverter, _L8("abc \x1b\x26\x40\x1b\x24\x42\x21\x21\x21\x21\x21\x1b\x28\x4a def"));
   294 	TestIsIllFormedJis(*characterSetConverter, _L8("abc \x1b"));
   295 	TestIsIllFormedJis(*characterSetConverter, _L8("abc \x1b\x24"));
   296 	TestIsIllFormedJis(*characterSetConverter, _L8("abc \x1b\x24\xff"));
   297 	CleanupStack::PopAndDestroy(3); // arrayOfCharacterSetsAvailable and characterSetConverter and fileServerSession
   298 	}
   299 
   300 CT_JIS::CT_JIS()
   301     {
   302     SetTestStepName(KTestStep_T_JIS);
   303     }
   304 
   305 TVerdict CT_JIS::doTestStepL()
   306     {
   307     SetTestStepResult(EFail);
   308 
   309     __UHEAP_MARK;
   310     TRAPD(error1, DoE32MainL());    
   311     __UHEAP_MARKEND;
   312 
   313     if(error1 == KErrNone)
   314         {
   315         SetTestStepResult(EPass);
   316         }
   317 
   318     return TestStepResult();
   319     }