diff -r f902e87c146f -r 748ec5531811 textrendering/texthandling/ttext/T_STYLE.CPP --- a/textrendering/texthandling/ttext/T_STYLE.CPP Wed Jun 09 11:40:52 2010 +0300 +++ b/textrendering/texthandling/ttext/T_STYLE.CPP Tue Aug 31 17:01:26 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 1997-2010 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,18 +21,35 @@ #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; @@ -255,7 +272,7 @@ { CParagraphStyle::TApplyParaStyleMode applyMode=CParagraphStyle::ERetainNoSpecificFormats; - test.Next(_L("Apply style to paragraph with NULL para format")); + INFO_PRINTF1(_L("Apply style to paragraph with NULL para format")); ConstructEnvWithNullParaFormat(); TheText->InsertL(0,_L("HEADINGBODYTEXT")); // @@ -280,7 +297,7 @@ { CParagraphStyle::TApplyParaStyleMode applyMode=CParagraphStyle::ERetainNoSpecificFormats; - test.Next(_L("Apply style to shared paragraph")); + INFO_PRINTF1(_L("Apply style to shared paragraph")); ConstructEnvironment(); TheText->InsertL(0,_L("HEADINGBODYTEXT")); // @@ -305,7 +322,7 @@ { CParagraphStyle::TApplyParaStyleMode applyMode=CParagraphStyle::ERetainNoSpecificFormats; - test.Next(_L("Apply style to non-shared paragraph")); + INFO_PRINTF1(_L("Apply style to non-shared paragraph")); ConstructEnvironment(); // TheText->InsertL(0,_L("This is paragraph one.This is paragraph number two.")); @@ -371,7 +388,7 @@ __UHEAP_MARK; // Test 1 // Construction under OOM - test.Start(_L("Construction under OOM")); + INFO_PRINTF1(_L("Construction under OOM")); CStyleList* list=NULL; TInt nn; for (nn=0; ;nn++) @@ -398,12 +415,12 @@ __UHEAP_RESET; TBuf<36> answer; answer.Format(_L(" #allocs for full c'tion: %d\n"),nn-1); - test.Printf(answer); + INFO_PRINTF1(answer); // Test 2 // Populated style list, Append under OOM; - test.Next(_L("AppendL() under OOM")); + INFO_PRINTF1(_L("AppendL() under OOM")); CParaFormatLayer* paraLayer=CParaFormatLayer::NewL(); CCharFormatLayer* charLayer=CCharFormatLayer::NewL(); __UHEAP_MARK; @@ -449,7 +466,7 @@ // Test 3 // Inserting a duplicate - test.Next(_L("AppendL() a duplicate")); + INFO_PRINTF1(_L("AppendL() a duplicate")); list=CStyleList::NewL(); style=NULL; for (TInt pp=0;pp