First public contribution.
2 * Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
21 #include "t_newlin7.h"
23 ///////////////////////////////////////////////////////////////////////////////////////
27 TBool __bb = (cond); \
31 ERR_PRINTF1(_L("ERROR: Test Failed")); \
35 ///////////////////////////////////////////////////////////////////////////////////////
36 ///////////////////////////////////////////////////////////////////////////////////////
38 @SYMTestCaseID SYSLIB-CHARCONV-CT-0570
39 @SYMTestCaseDesc Testing base64 sequences combined with line-breaks
40 @SYMTestPriority Medium
41 @SYMTestActions Tests for conversion from UTF-7 to Unicode with line-breaks
42 @SYMTestExpectedResults Test must not fail
45 void CT_NEWLIN7::TestNEWLIN7()
47 INFO_PRINTF1(_L(" @SYMTestCaseID:SYSLIB-CHARCONV-CT-0570 Testing base64 sequences combined with line-breaks "));
50 TInt state=CnvUtfConverter::KStateDefault;
51 utf7=_L8("+U0E\nU0E");
52 test(CnvUtfConverter::ConvertToUnicodeFromUtf7(unicode, utf7, state)==0);
53 test(state==CnvUtfConverter::KStateDefault);
54 test(unicode.Length()==5);
55 test(unicode[0]==0x5341);
56 test(unicode[1]==0x000a);
57 test(unicode[2]==0x0055);
58 test(unicode[3]==0x0030);
59 test(unicode[4]==0x0045);
60 unicode=_L16(")\n)\n*\n*\n+\n+\n)\n)\n*\n*\n+\n+");
61 test(CnvUtfConverter::ConvertFromUnicodeToUtf7(utf7, unicode, ETrue)==0);
62 test(utf7==_L8(")\n)\n+ACo-\n+ACo-\n+-\n+-\n)\n)\n+ACo-\n+ACo-\n+-\n+-"));
63 test(CnvUtfConverter::ConvertFromUnicodeToUtf7(utf7, unicode, EFalse)==0);
64 test(utf7==_L8(")\n)\n*\n*\n+-\n+-\n)\n)\n*\n*\n+-\n+-"));
67 CT_NEWLIN7::CT_NEWLIN7()
69 SetTestStepName(KTestStep_T_NEWLIN7);
72 TVerdict CT_NEWLIN7::doTestStepL()
74 SetTestStepResult(EFail);
78 TRAPD(error1, TestNEWLIN7());
82 if(error1 == KErrNone )
84 SetTestStepResult(EPass);
87 return TestStepResult();