diff -r f902e87c146f -r 748ec5531811 textrendering/texthandling/ttext/TRTCOPY.CPP --- a/textrendering/texthandling/ttext/TRTCOPY.CPP Wed Jun 09 11:40:52 2010 +0300 +++ b/textrendering/texthandling/ttext/TRTCOPY.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" @@ -16,7 +16,6 @@ */ -#include #include #include #include @@ -26,8 +25,19 @@ #include #include #include "../incp/T_PMLPAR.H" +#include "TRTCOPY.h" -GLDEF_C RTest test(_L("TRTCOPY")); +#define test(cond) \ + { \ + TBool __bb = (cond); \ + TEST(__bb); \ + if (!__bb) \ + { \ + ERR_PRINTF1(_L("ERROR: Test Failed")); \ + User::Leave(1); \ + } \ + } + LOCAL_D RFs theFs; LOCAL_D CRichText* ComponentText; LOCAL_D CParaFormatLayer* GlobalParaFormatLayer; @@ -38,7 +48,7 @@ const TInt KTestCleanupStack=0x500; -LOCAL_C CRichText* LoadIntoTextL(TFileName& aFileName) +CRichText* CT_TRTCOPY::LoadIntoTextL(TFileName& aFileName) // { TRAPD(ret, @@ -54,7 +64,7 @@ } /* -LOCAL_C CStyleList* CreatePopulatedStyleList() +CStyleList* CT_TRTCOPY::CreatePopulatedStyleList() // { // @@ -70,7 +80,7 @@ } */ -LOCAL_C void CreateAggregateTextL() +void CT_TRTCOPY::CreateAggregateTextL() // { TFileName theFileName=_L("z:\\test\\app-framework\\etext\\aggregat.pml"); @@ -103,15 +113,13 @@ } -LOCAL_C void doMainL() +void CT_TRTCOPY::doMainL() { CreateAggregateTextL(); - - } -LOCAL_C void setupCleanup() +void CT_TRTCOPY::setupCleanup() // // Initialise the cleanup stack. // @@ -127,24 +135,29 @@ test(r==KErrNone); } - -GLDEF_C TInt E32Main() -// -// Test permanent file store. -// +CT_TRTCOPY::CT_TRTCOPY() { - test.Title(); - setupCleanup(); - __UHEAP_MARK; -// - test.Start(_L(" @SYMTestCaseID:SYSLIB-TTEXT-LEGACY-T_TRTCOPY-0001 RichText Copy Testing ")); - TRAPD(ret,doMainL()); - test(ret==KErrNone); - test.End(); -// - __UHEAP_MARKEND; - delete TheTrapCleanup; - test.Close(); - return KErrNone; + SetTestStepName(KTestStep_T_TRTCOPY); } +TVerdict CT_TRTCOPY::doTestStepL() + { + SetTestStepResult(EFail); + + INFO_PRINTF1(_L("TRTCOPY")); + setupCleanup(); + __UHEAP_MARK; + + INFO_PRINTF1(_L(" @SYMTestCaseID:SYSLIB-TTEXT-LEGACY-T_TRTCOPY-0001 RichText Copy Testing ")); + TRAPD(error1, doMainL()); + + __UHEAP_MARKEND; + delete TheTrapCleanup; + + if(error1 == KErrNone) + { + SetTestStepResult(EPass); + } + + return TestStepResult(); + }