diff -r 748ec5531811 -r 336bee5c2d35 textrendering/texthandling/ttext/t_fmt1.cpp --- a/textrendering/texthandling/ttext/t_fmt1.cpp Tue Aug 31 17:01:26 2010 +0300 +++ b/textrendering/texthandling/ttext/t_fmt1.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" @@ -17,29 +17,23 @@ */ +#include #include #include #include #include -#include "../stext/TXTSTD.H" -#include "T_FMT1.h" +#include "TXTSTD.H" + -#define test(cond) \ - { \ - TBool __bb = (cond); \ - pTestStep->TEST(__bb); \ - if (!__bb) \ - { \ - pTestStep->ERR_PRINTF1(_L("ERROR: Test Failed")); \ - User::Leave(1); \ - } \ - } +LOCAL_D RTest test(_L("TFormat Test Code for DEF047316")); -void CT_FMT1::TestDEF047316L() +LOCAL_C void TestDEF047316L() // Test CParaFormat stack definition leave protection // { - INFO_PRINTF1(_L(" @SYMTestCaseID:SYSLIB-ETEXT-LEGACY-t_fmt1-0001 CParaFormat - DEF047316 - stack definition leave protection ")); + + + test.Start(_L(" @SYMTestCaseID:SYSLIB-ETEXT-LEGACY-t_fmt1-0001 CParaFormat - DEF047316 - stack definition leave protection ")); CParaFormat paraFormat; // Allocate resources for paraFormat @@ -60,30 +54,27 @@ // 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(); } -CT_FMT1::CT_FMT1() - { - SetTestStepName(KTestStep_T_FMT1); - } - -TVerdict CT_FMT1::doTestStepL() - { - SetTestStepResult(EFail); +GLDEF_C TInt E32Main() +// +// Tests TFORMAT. +// + { + CTrapCleanup* cleanup=CTrapCleanup::New(); + test.Title(); + + __UHEAP_MARK; + TRAPD(ret,TestDEF047316L()); + test(ret==KErrNone); - CTrapCleanup* cleanup=CTrapCleanup::New(); - INFO_PRINTF1(_L("TFormat Test Code for DEF047316")); - - __UHEAP_MARK; - TRAPD(error1, TestDEF047316L()); + __UHEAP_MARKEND; + + test.Close(); - __UHEAP_MARKEND; - delete cleanup; + delete cleanup; - if(error1 == KErrNone) - { - SetTestStepResult(EPass); - } - - return TestStepResult(); - } + return(0); + }