diff -r f902e87c146f -r 748ec5531811 textrendering/texthandling/ttext/t_fmt1.cpp --- a/textrendering/texthandling/ttext/t_fmt1.cpp Wed Jun 09 11:40:52 2010 +0300 +++ b/textrendering/texthandling/ttext/t_fmt1.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" @@ -17,23 +17,29 @@ */ -#include #include #include #include #include -#include "TXTSTD.H" - +#include "../stext/TXTSTD.H" +#include "T_FMT1.h" -LOCAL_D RTest test(_L("TFormat Test Code for DEF047316")); +#define test(cond) \ + { \ + TBool __bb = (cond); \ + pTestStep->TEST(__bb); \ + if (!__bb) \ + { \ + pTestStep->ERR_PRINTF1(_L("ERROR: Test Failed")); \ + User::Leave(1); \ + } \ + } -LOCAL_C void TestDEF047316L() +void CT_FMT1::TestDEF047316L() // Test CParaFormat stack definition leave protection // { - - - test.Start(_L(" @SYMTestCaseID:SYSLIB-ETEXT-LEGACY-t_fmt1-0001 CParaFormat - DEF047316 - stack definition leave protection ")); + INFO_PRINTF1(_L(" @SYMTestCaseID:SYSLIB-ETEXT-LEGACY-t_fmt1-0001 CParaFormat - DEF047316 - stack definition leave protection ")); CParaFormat paraFormat; // Allocate resources for paraFormat @@ -54,27 +60,30 @@ // Note that test end is when paraFormat's destructor is called when // this function terminates. The destructor should not cause any problems // even though we have already called the cleanup method - - test.End(); } -GLDEF_C TInt E32Main() -// -// Tests TFORMAT. -// - { - CTrapCleanup* cleanup=CTrapCleanup::New(); - test.Title(); - - __UHEAP_MARK; - TRAPD(ret,TestDEF047316L()); - test(ret==KErrNone); +CT_FMT1::CT_FMT1() + { + SetTestStepName(KTestStep_T_FMT1); + } + +TVerdict CT_FMT1::doTestStepL() + { + SetTestStepResult(EFail); - __UHEAP_MARKEND; - - test.Close(); + CTrapCleanup* cleanup=CTrapCleanup::New(); + INFO_PRINTF1(_L("TFormat Test Code for DEF047316")); + + __UHEAP_MARK; + TRAPD(error1, TestDEF047316L()); - delete cleanup; + __UHEAP_MARKEND; + delete cleanup; - return(0); - } + if(error1 == KErrNone) + { + SetTestStepResult(EPass); + } + + return TestStepResult(); + }