textrendering/textformatting/test/src/TFormat.cpp
branchRCL_3
changeset 17 336bee5c2d35
parent 16 748ec5531811
equal deleted inserted replaced
16:748ec5531811 17:336bee5c2d35
     1 /*
     1 /*
     2 * Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2004-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".
    18 
    18 
    19 
    19 
    20 #include "TAGMA.H"
    20 #include "TAGMA.H"
    21 #include <txtfrmat.h>
    21 #include <txtfrmat.h>
    22 #include <e32test.h>
    22 #include <e32test.h>
    23 #include "tformat.h"
       
    24 
    23 
    25 #define UNUSED_VAR(a) a = a
    24 #define UNUSED_VAR(a) a = a
    26 
    25 
    27 namespace LocalToTFormat
    26 CTrapCleanup* TrapCleanup;
    28 {
    27 RTest test(_L("TFormat - TTmCharFormat and CTmParFormat"));
    29 CTFormatStep* TestStep = NULL;
       
    30 #define TESTPOINT(p) TestStep->testpoint(p,(TText8*)__FILE__,__LINE__)
       
    31 #define TESTPRINT(p) TestStep->print(p,(TText8*)__FILE__,__LINE__)
       
    32 }
       
    33 using namespace LocalToTFormat;
       
    34 
    28 
    35 void INC041190()
    29 void INC041190()
    36 	{
    30 	{
    37 	TTmCharFormat tmcf;
    31 	TTmCharFormat tmcf;
    38 	TCharFormat cf;
    32 	TCharFormat cf;
    39 	cf.iFontPresentation.iHighlightStyle
    33 	cf.iFontPresentation.iHighlightStyle
    40 		= TFontPresentation::EFontHighlightNoMatchesIndicator;
    34 		= TFontPresentation::EFontHighlightNoMatchesIndicator;
    41 	tmcf.iEffects = 0;
    35 	tmcf.iEffects = 0;
    42 	tmcf = cf;
    36 	tmcf = cf;
    43 	TESTPOINT(tmcf.iEffects == TTmCharFormat::ENoMatchesIndicator);
    37 	test(tmcf.iEffects == TTmCharFormat::ENoMatchesIndicator);
    44 	cf.iFontPresentation.iHighlightStyle
    38 	cf.iFontPresentation.iHighlightStyle
    45 		= TFontPresentation::EFontHighlightNone;
    39 		= TFontPresentation::EFontHighlightNone;
    46 	tmcf.GetTCharFormat(cf);
    40 	tmcf.GetTCharFormat(cf);
    47 	TESTPOINT(cf.iFontPresentation.iHighlightStyle
    41 	test(cf.iFontPresentation.iHighlightStyle
    48 		== TFontPresentation::EFontHighlightNoMatchesIndicator);
    42 		== TFontPresentation::EFontHighlightNoMatchesIndicator);
    49 	}
    43 	}
    50 
    44 
    51 TVerdict CTFormatStep::doTestStepL()
    45 void RunTestsL()
    52 	{
    46 	{
    53     SetTestStepResult(EPass);
       
    54     TestStep = this;
       
    55     TESTPRINT(_L("TFormat - TTmCharFormat and CTmParFormat"));
       
    56     
       
    57 	__UHEAP_MARK;
    47 	__UHEAP_MARK;
    58 
    48 
    59 	TESTPRINT(_L(" @SYMTestCaseID:SYSLIB-FORM-LEGACY-TFORMAT-0001 INC041190 - EText's EFontHighlightNoMatchesIndicator isn't mappd to anythng in TTmCharFormat "));
    49 	test.Title();
       
    50 	test.Start(_L(" @SYMTestCaseID:SYSLIB-FORM-LEGACY-TFORMAT-0001 INC041190 - EText's EFontHighlightNoMatchesIndicator isn't mappd to anythng in TTmCharFormat "));
    60 	INC041190();
    51 	INC041190();
    61 
    52 
       
    53 	test.End();
       
    54 	test.Close();
       
    55 
    62 	__UHEAP_MARKENDC(0);
    56 	__UHEAP_MARKENDC(0);
    63 	return TestStepResult();
       
    64 	}
    57 	}
    65 
    58 
       
    59 TInt E32Main()
       
    60 	{
       
    61 	TrapCleanup = CTrapCleanup::New();
       
    62 	TRAPD(err, RunTestsL());
       
    63     test(err == KErrNone);
       
    64 	delete TrapCleanup;
       
    65 	return 0;
       
    66 	}