diff -r 748ec5531811 -r 336bee5c2d35 textrendering/texthandling/ttext/T_STYLE.CPP --- a/textrendering/texthandling/ttext/T_STYLE.CPP Tue Aug 31 17:01:26 2010 +0300 +++ b/textrendering/texthandling/ttext/T_STYLE.CPP Wed Sep 01 12:39:40 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 1997-2010 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -21,35 +21,18 @@ #include #include +#include #include #include #include #include -#include "T_STYLE.h" - -LOCAL_D CTestStep *pTestStep = NULL; -#define test(cond) \ - { \ - TBool __bb = (cond); \ - pTestStep->TEST(__bb); \ - if (!__bb) \ - { \ - pTestStep->ERR_PRINTF1(_L("ERROR: Test Failed")); \ - User::Leave(1); \ - } \ - } -#undef INFO_PRINTF1 -#undef INFO_PRINTF2 -// copy from tefexportconst.h -#define INFO_PRINTF1(p1) pTestStep->Logger().LogExtra(((TText8*)__FILE__), __LINE__, ESevrInfo, (p1)) -#define INFO_PRINTF2(p1, p2) pTestStep->Logger().LogExtra(((TText8*)__FILE__), __LINE__, ESevrInfo, (p1), (p2)) - #define UNUSED_VAR(a) a = a const TInt KTestCleanupStack=0x40; +LOCAL_D RTest test(_L("Testing Paragraph Styles")); LOCAL_D CTrapCleanup* TheTrapCleanup; LOCAL_D CRichText* TheText; @@ -272,7 +255,7 @@ { CParagraphStyle::TApplyParaStyleMode applyMode=CParagraphStyle::ERetainNoSpecificFormats; - INFO_PRINTF1(_L("Apply style to paragraph with NULL para format")); + test.Next(_L("Apply style to paragraph with NULL para format")); ConstructEnvWithNullParaFormat(); TheText->InsertL(0,_L("HEADINGBODYTEXT")); // @@ -297,7 +280,7 @@ { CParagraphStyle::TApplyParaStyleMode applyMode=CParagraphStyle::ERetainNoSpecificFormats; - INFO_PRINTF1(_L("Apply style to shared paragraph")); + test.Next(_L("Apply style to shared paragraph")); ConstructEnvironment(); TheText->InsertL(0,_L("HEADINGBODYTEXT")); // @@ -322,7 +305,7 @@ { CParagraphStyle::TApplyParaStyleMode applyMode=CParagraphStyle::ERetainNoSpecificFormats; - INFO_PRINTF1(_L("Apply style to non-shared paragraph")); + test.Next(_L("Apply style to non-shared paragraph")); ConstructEnvironment(); // TheText->InsertL(0,_L("This is paragraph one.This is paragraph number two.")); @@ -388,7 +371,7 @@ __UHEAP_MARK; // Test 1 // Construction under OOM - INFO_PRINTF1(_L("Construction under OOM")); + test.Start(_L("Construction under OOM")); CStyleList* list=NULL; TInt nn; for (nn=0; ;nn++) @@ -415,12 +398,12 @@ __UHEAP_RESET; TBuf<36> answer; answer.Format(_L(" #allocs for full c'tion: %d\n"),nn-1); - INFO_PRINTF1(answer); + test.Printf(answer); // Test 2 // Populated style list, Append under OOM; - INFO_PRINTF1(_L("AppendL() under OOM")); + test.Next(_L("AppendL() under OOM")); CParaFormatLayer* paraLayer=CParaFormatLayer::NewL(); CCharFormatLayer* charLayer=CCharFormatLayer::NewL(); __UHEAP_MARK; @@ -466,7 +449,7 @@ // Test 3 // Inserting a duplicate - INFO_PRINTF1(_L("AppendL() a duplicate")); + test.Next(_L("AppendL() a duplicate")); list=CStyleList::NewL(); style=NULL; for (TInt pp=0;pp