os/textandloc/textrendering/textformatting/test/src/TFormat.cpp
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 /*
     2 * Copyright (c) 2004-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 * TFormat.cpp tests for TTmCharFormat and CTmParFormat
    16 *
    17 */
    18 
    19 
    20 #include "TAGMA.H"
    21 #include <txtfrmat.h>
    22 #include <e32test.h>
    23 #include "tformat.h"
    24 
    25 #define UNUSED_VAR(a) a = a
    26 
    27 namespace LocalToTFormat
    28 {
    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 
    35 void INC041190()
    36 	{
    37 	TTmCharFormat tmcf;
    38 	TCharFormat cf;
    39 	cf.iFontPresentation.iHighlightStyle
    40 		= TFontPresentation::EFontHighlightNoMatchesIndicator;
    41 	tmcf.iEffects = 0;
    42 	tmcf = cf;
    43 	TESTPOINT(tmcf.iEffects == TTmCharFormat::ENoMatchesIndicator);
    44 	cf.iFontPresentation.iHighlightStyle
    45 		= TFontPresentation::EFontHighlightNone;
    46 	tmcf.GetTCharFormat(cf);
    47 	TESTPOINT(cf.iFontPresentation.iHighlightStyle
    48 		== TFontPresentation::EFontHighlightNoMatchesIndicator);
    49 	}
    50 
    51 TVerdict CTFormatStep::doTestStepL()
    52 	{
    53     SetTestStepResult(EPass);
    54     TestStep = this;
    55     TESTPRINT(_L("TFormat - TTmCharFormat and CTmParFormat"));
    56     
    57 	__UHEAP_MARK;
    58 
    59 	TESTPRINT(_L(" @SYMTestCaseID:SYSLIB-FORM-LEGACY-TFORMAT-0001 INC041190 - EText's EFontHighlightNoMatchesIndicator isn't mappd to anythng in TTmCharFormat "));
    60 	INC041190();
    61 
    62 	__UHEAP_MARKENDC(0);
    63 	return TestStepResult();
    64 	}
    65