textrendering/texthandling/ttext/T_FMT.CPP
branchRCL_3
changeset 17 336bee5c2d35
parent 16 748ec5531811
--- a/textrendering/texthandling/ttext/T_FMT.CPP	Tue Aug 31 17:01:26 2010 +0300
+++ b/textrendering/texthandling/ttext/T_FMT.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"
@@ -16,28 +16,13 @@
 */
 
 
+#include <e32test.h>
 #include <txtfmlyr.h>
 #include <txtrich.h>
 #include <txtfrmat.h>
 #include <gdi.h>
-#include "T_FMT.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))
+LOCAL_D RTest test(_L("TFormat Test Code"));
 
 template<class S>
 class TestFormat
@@ -69,7 +54,7 @@
 // Checks TTabStop construction and methods.
 //
 	{
-	INFO_PRINTF1(_L("Checking all methods"));
+	test.Start(_L("Checking all methods"));
 	
 	// Default constructor.
 	TTabStop tab1;
@@ -77,22 +62,22 @@
 	TTabStop tab3;
 	tab3=tab1;
 
-	INFO_PRINTF1(_L("Default constructor"));
+	test.Next(_L("Default constructor"));
 	test(tab1.iTwipsPosition==0);
 	if (tab1.iType==TTabStop::ELeftTab)
-	    INFO_PRINTF2(_L("\nleft tab - %d\n"),tab1.iType);
+		test.Printf(_L("\nleft tab - %d\n"),tab1.iType);
 	else if (tab1.iType==TTabStop::ECenteredTab)
-	    INFO_PRINTF2(_L("\ncentered tab - %d\n"),tab1.iType);
+		test.Printf(_L("\ncentered tab - %d\n"),tab1.iType);
 	else if (tab1.iType==TTabStop::ERightTab)
-	    INFO_PRINTF2(_L("\nright tab - %d\n"),tab1.iType);
+		test.Printf(_L("\nright tab - %d\n"),tab1.iType);
 	else if (tab1.iType==TTabStop::ENullTab)
-	    INFO_PRINTF2(_L("\nnull tab - %d\n"),tab1.iType);
+		test.Printf(_L("\nnull tab - %d\n"),tab1.iType);
 	else
-	    INFO_PRINTF2(_L("\nsomething completely different - %d \n"),tab1.iType);
+		test.Printf(_L("\nsomething completely different - %d \n"),tab1.iType);
 	test(tab1.iType==TTabStop::ELeftTab);
 //	test.Getch();
 
-	INFO_PRINTF1(_L("Copy constructor"));
+	test.Next(_L("Copy constructor"));
 	TTabStop tab4;
 	tab4.iTwipsPosition=1440;
 	tab4.iType=TTabStop::ERightTab;
@@ -100,17 +85,18 @@
 	test(tab5.iTwipsPosition==tab4.iTwipsPosition);
 	test(tab5.iType==tab4.iType);
 
-	INFO_PRINTF1(_L("Assignment operator"));
+	test.Next(_L("Assignment operator"));
 	tab1=tab5;;
 	test(tab1.iTwipsPosition==tab5.iTwipsPosition);
 	test(tab1.iType==tab5.iType);
 
-	INFO_PRINTF1(_L("Equality operator"));
+	test.Next(_L("Equality operator"));
 	test(tab1==tab5);
 
-	INFO_PRINTF1(_L("Inequality operator"));
+	test.Next(_L("Inequality operator"));
 	tab1.iTwipsPosition=2;
 	test(tab1!=tab5);
+	test.End();
 	}
 
 
@@ -120,21 +106,21 @@
 // Checks TParaBorder construction.
 //
 	{
-	INFO_PRINTF1(_L("Checking all methods"));
+	test.Start(_L("Checking all methods"));
 	// Default Constructor.
 	TParaBorder border1;
 
-	INFO_PRINTF1(_L("Default constructor"));
+	test.Next(_L("Default constructor"));
 	test(border1.iLineStyle==TParaBorder::ENullLineStyle);
 	test(border1.iAutoColor);
 	TLogicalRgb c(TLogicalRgb::ESystemForegroundColor);
 	test(border1.iColor == c);
 
 	TParaBorder border2;
-	INFO_PRINTF1(_L("Equality operator"));
+	test.Next(_L("Equality operator"));
 	test(border2==border1);
 
-	INFO_PRINTF1(_L("Inequality operator"));
+	test.Next(_L("Inequality operator"));
 	border2.iLineStyle=TParaBorder::ESolid;
 	border2.iThickness=2;
 	test(border2!=border1);
@@ -142,6 +128,8 @@
 	border1.iLineStyle=TParaBorder::ESolid;
 	border1.iThickness=2;
 	test(border2==border1);
+
+	test.End();
 	}
 
 
@@ -151,15 +139,15 @@
 // Checks TBullet construction.
 //
 	{
-	INFO_PRINTF1(_L("Checking all methods"));
+	test.Start(_L("Checking all methods"));
 	// Default constructor.
 	TBullet bullet;
 
-	INFO_PRINTF1(_L("Default constructor"));
+	test.Next(_L("Default constructor"));
 	test(0x2022==bullet.iCharacterCode);
 	test(bullet.iHeightInTwips==0);
 
-	INFO_PRINTF1(_L("==/!="));
+	test.Next(_L("==/!="));
 	TBullet bullet2;
 	test(bullet==bullet2);
 	test(!(bullet!=bullet2));
@@ -168,6 +156,7 @@
 	bullet3.iCharacterCode=45;
 	test(bullet!=bullet3);
 	test(!(bullet==bullet3));
+	test.End();
 	}
 
 
@@ -185,7 +174,7 @@
 //	Checks CParaFormat construction and methods.
 //
 	{
-	INFO_PRINTF1(_L("Checking all methods"));
+	test.Start(_L("Checking all methods"));
 	CheckCParaFormatSpecialL();
 	__UHEAP_MARK;
 
@@ -217,7 +206,7 @@
 	
 	CParaFormat* format=CParaFormat::NewL();
 
-	INFO_PRINTF1(_L("Tab methods"));
+	test.Next(_L("Tab methods"));
 	TTabStop control[5];
 	control[4].iTwipsPosition=KMaxTUint32;
 	control[3].iTwipsPosition=8640;
@@ -270,6 +259,7 @@
 	delete format;
 	format=NULL;
 	__UHEAP_MARKEND;
+	test.End();
 	}
 
 
@@ -304,16 +294,14 @@
 #ifdef _DEBUG
 	__UHEAP_MARK;
 	// Construction.
-	INFO_PRINTF1(_L("Construction failing on OOM")); 
+	test.Next(_L("Construction failing on OOM")); 
 	__UHEAP_FAILNEXT(1);
 	TRAP(ret,format=CParaFormat::NewL());
 	if (ret!=KErrNone)
 		check=1;
-    // seems __UHEAP_FAILNEXT does not work well in platsim.
-    // below test does not pass in platsim.
-//	test(check==1);
+	test(check==1);
 #endif
-	INFO_PRINTF1(_L("Construction succeeding"));
+	test.Next(_L("Construction succeeding"));
 	check=0;
 	TRAP(ret,format=CParaFormat::NewL());
 	if (ret!=KErrNone)
@@ -342,19 +330,19 @@
 	test(format->iLineSpacingControl==CParaFormat::ELineSpacingAtLeastInTwips);
 	test(format->iDefaultTabWidthInTwips==360);
 
-	INFO_PRINTF1(_L("Equality operator"));
+	test.Next(_L("Equality operator"));
 	CParaFormat* two=CParaFormat::NewL();
 	test(two->IsEqual(*format));
 	delete two;
 
-	INFO_PRINTF1(_L("Copy constructor"));
+	test.Next(_L("Copy constructor"));
 	CParaFormat* three=CParaFormat::NewL(*two);
 	test(three->IsEqual(*two));
 	delete three;
 
 
 	// Destroy()
-	INFO_PRINTF1(_L("Destroy()"));	
+	test.Next(_L("Destroy()"));	
 	delete format;
 	format=NULL;
 	__UHEAP_MARKEND;
@@ -370,7 +358,7 @@
 	__UHEAP_MARK;
 	TInt count=0;
 // All methods.
-	INFO_PRINTF1(_L("Checking all methods"));
+	test.Start(_L("Checking all methods"));
 	TParaFormatMask mask;
 	mask.SetAttrib(EAttLeftMargin);	
 	mask.AttribIsSet(EAttLeftMargin);
@@ -380,7 +368,7 @@
 	test(!(maskTemp!=mask));
 
 // Construction.
-	INFO_PRINTF1(_L("Construction"));
+	test.Next(_L("Construction"));
 	TParaFormatMask mask1;
 	for (count=EAttParaLanguage;count<ETextFormatAttributeCount;count++)
 		{
@@ -389,14 +377,14 @@
 	
 
 // SetAttrib()
-	INFO_PRINTF1(_L("SetAttrib()"));
+	test.Next(_L("SetAttrib()"));
 	for (count=EAttParaLanguage;count<ETextFormatAttributeCount;count++)
 		{
 		mask1.SetAttrib((TTextFormatAttribute)count);
 		}
 
 // ClearAttrib()
-	INFO_PRINTF1(_L("ClearAttrib()"));
+	test.Next(_L("ClearAttrib()"));
 	for (count=EAttParaLanguage;count<ETextFormatAttributeCount;count++)
 		{
 		mask1.ClearAttrib((TTextFormatAttribute)count);
@@ -406,10 +394,10 @@
 		test(mask1.AttribIsSet((TTextFormatAttribute)count)==EFalse);
 		}
 // AttribIsSet()
-	INFO_PRINTF1(_L("AttribIsSet()"));
+	test.Next(_L("AttribIsSet()"));
 	// Already tested in the above.
 
-	INFO_PRINTF1(_L("SetAll()"));
+	test.Next(_L("SetAll()"));
 	TParaFormatMask mask2;
 	mask2.SetAll();  // sets border container but not individual borders.
  	for (count=EAttParaLanguage;count<EAttTabStop;count++)
@@ -417,7 +405,7 @@
 		test(mask2.AttribIsSet((TTextFormatAttribute)count));
 		}
 
-	INFO_PRINTF1(_L("ClearAll()"));
+	test.Next(_L("ClearAll()"));
 	mask2.ClearAll();
  	for (count=EAttParaLanguage;count<EAttTabStop;count++)
 		{
@@ -426,6 +414,7 @@
 	mask2.SetAttrib(EAttLeftMargin);
 	test(mask2.AttribIsSet(EAttLeftMargin));
 	
+	test.End();
 	__UHEAP_MARKEND;
 	}
 
@@ -537,11 +526,11 @@
 	CCharFormatLayer* formatLayer2=CCharFormatLayer::NewL(format2,f2);
 	CCharFormatLayer* formatLayer1=CCharFormatLayer::NewL(format1,f1);
 	formatLayer1->SetBase(formatLayer2);
-	INFO_PRINTF1(_L("ChainCount()"));
+	test.Start(_L("ChainCount()"));
 	test(formatLayer1->ChainCount()==2);
 	// Now read them in and compare them:
 	// First just the layers.
-	INFO_PRINTF1(_L("SenseL() - Sensing this layer only"));
+	test.Next(_L("SenseL() - Sensing this layer only"));
 	TCharFormat result1;
 	TCharFormatMask result1Mask;
 	formatLayer1->Sense(result1,result1Mask);
@@ -555,7 +544,7 @@
 	test(result2.iFontSpec.iFontStyle.BitmapType() == EAntiAliasedGlyphBitmap);
 		
 	// Now check the effective formats are correct
-	INFO_PRINTF1(_L("SenseEffectiveL() - utilising basedOn"));
+	test.Next(_L("SenseEffectiveL() - utilising basedOn"));
 	TCharFormatMask dummy;
 	TCharFormat result3;
 	formatLayer1->SenseEffective(result3);
@@ -565,10 +554,10 @@
 	// The result should be the same as above,
 	// since all these values are present in the resultant TCharFormat.
 	// Ie, checking that overlapping attributes in a lower layer are not taken.
-	INFO_PRINTF1(_L("SenseEffectiveL() - checking overlapping attributes are ignored"));
+	test.Next(_L("SenseEffectiveL() - checking overlapping attributes are ignored"));
 	// Add another layer of formatting by implementing the next based on link.
 	formatLayer2->SetBase(formatLayer3);
-		INFO_PRINTF1(_L("ChainCount()"));
+		test.Next(_L("ChainCount()"));
 		test(formatLayer1->ChainCount()==3);
 		test(formatLayer2->ChainCount()==2);
 		test(formatLayer3->ChainCount()==1);
@@ -576,6 +565,7 @@
 	formatLayer1->SenseEffective(result4);
 	CheckFormatsEqual(format3,dummy,result4,dummy);
 
+	test.End();	
 	delete formatLayer1;
 	delete formatLayer2;
 	delete formatLayer3;
@@ -779,7 +769,7 @@
 
 	// Now read them in and compare them:
 	// First just the layers.
-	INFO_PRINTF1(_L("SenseL() - Sensing this layer only"));
+	test.Next(_L("SenseL() - Sensing this layer only"));
 	CParaFormat* formatResult1=CParaFormat::NewL();
 	TParaFormatMask formatResult1Mask;
 	formatLayer->SenseL(formatResult1,formatResult1Mask);
@@ -795,7 +785,7 @@
 	delete formatResult1;
 
 	// Now check the effective formats are correct
-	INFO_PRINTF1(_L("SenseEffectiveL() - utilising basedOn"));
+	test.Next(_L("SenseEffectiveL() - utilising basedOn"));
 	CParaFormat* formatResult2=CParaFormat::NewL();
 	formatLayer->SenseEffectiveL(formatResult2);
 	CheckFormatsEqual(format3,formatResult2);
@@ -805,7 +795,7 @@
 	// The result should be the same as above,
 	// since all these values are present in the resultant CParaFormat.
 	// Ie, checking that overlapping attributes in a lower layer are not taken.
-	INFO_PRINTF1(_L("SenseEffectiveL() - checking overlapping attributes are ignored"));
+	test.Next(_L("SenseEffectiveL() - checking overlapping attributes are ignored"));
 	// Add another layer of formatting by implementing the next based on link.
 	formatLayer2->SetBase(formatLayer4);
 	formatResult2=CParaFormat::NewL();
@@ -814,7 +804,7 @@
 	delete formatResult2;
 	
 	// Test ChainCount() method
-	INFO_PRINTF1(_L("ChainCount()"));
+	test.Next(_L("ChainCount()"));
 	test(formatLayer4->ChainCount()==1);
 	test(formatLayer2->ChainCount()==2);
 	test(formatLayer->ChainCount()==3);
@@ -837,7 +827,7 @@
 // Checks correct inheritance of bullets.
 //
 	{
-	INFO_PRINTF1(_L("Testing bullet inheritance"));
+	test.Next(_L("Testing bullet inheritance"));
 	__UHEAP_MARK;
 	
 	CParaFormatLayer* baseLayer=CParaFormatLayer::NewL();
@@ -852,7 +842,7 @@
 	specificLayer->SetL(paraFormat,paraMask);
 	//
 	// specific bullet over null inherited
-	INFO_PRINTF1(_L("Specific bullet over null inherited"));
+	test.Start(_L("Specific bullet over null inherited"));
 	CParaFormat* sensed=CParaFormat::NewLC();
 	specificLayer->SenseEffectiveL(sensed);
 	test(sensed->iBullet!=NULL);
@@ -860,7 +850,7 @@
 	CleanupStack::PopAndDestroy();  // sensed
 	//
 	// null bullet over inherited
-	INFO_PRINTF1(_L("Null bullet over inherited"));
+	test.Next(_L("Null bullet over inherited"));
 	baseLayer->Reset();
 	specificLayer->Reset();
 	baseLayer->SetL(paraFormat,paraMask);
@@ -875,7 +865,7 @@
 //	test(sensed->iBullet==NULL);
 	//
 	// non-null bullet over inherited bullet
-	INFO_PRINTF1(_L("Non-Null bullet over inherited"));
+	test.Next(_L("Non-Null bullet over inherited"));
 	specificLayer->Reset();
 	paraFormat->iBullet->iHeightInTwips=1000;
 	specificLayer->SetL(paraFormat,paraMask);
@@ -888,6 +878,7 @@
 	CleanupStack::PopAndDestroy();  // paraFormat.
 	delete specificLayer;
 	delete baseLayer;
+	test.End();
 
 	__UHEAP_MARKEND;
 	}
@@ -906,19 +897,17 @@
 	TInt check=0;
 	CParaFormatLayer* layer0=NULL;
 
-	INFO_PRINTF1(_L("Constructor"));
+	test.Start(_L("Constructor"));
 #ifdef _DEBUG
-	INFO_PRINTF1(_L("Failing on OOM"));
+	test.Next(_L("Failing on OOM"));
 	__UHEAP_FAILNEXT(1);
 	TRAP(ret,layer0=CParaFormatLayer::NewL());
 	if (ret!=KErrNone)
 		check++;
-    // seems __UHEAP_FAILNEXT does not work well in platsim.
-    // below test does not pass in platsim.
-//	test(check>0);
+	test(check>0);
 #endif
 
-	INFO_PRINTF1(_L("Succeeding"));
+	test.Next(_L("Succeeding"));
 	check=0;
 	TRAP(ret,layer0=CParaFormatLayer::NewL());
 	if (ret!=KErrNone)
@@ -927,7 +916,7 @@
 	delete layer0;
 
 // Set/Sense Default Para Format.	
-	INFO_PRINTF1(_L("Set/Sense Default ParaFormat"));
+	test.Next(_L("Set/Sense Default ParaFormat"));
 	CParaFormat* defaultFormat=CParaFormat::NewL();
 	
 	//to test EAttParaLanguageX
@@ -977,6 +966,7 @@
 
 	CheckCParaFormatLayerRestL();
 	__UHEAP_MARKEND;
+	test.End();
 	}
 
 
@@ -988,11 +978,11 @@
 	{
 	__UHEAP_MARK;
 // All methods
-	INFO_PRINTF1(_L("Constructor"));
+	test.Start(_L("Constructor"));
 	TCharFormat format;
 	test(format.iLanguage==0);
 
-	INFO_PRINTF1(_L("Constructor with arguments"));
+	test.Next(_L("Constructor with arguments"));
 	TInt height=240;
 	TBuf<32> name=_S("arial");
 	TCharFormat format1(name,height);
@@ -1002,6 +992,7 @@
 	control.iFontSpec.iTypeface.iName=_S("arial");
 	test(format1.IsEqual(control));
 
+	test.End();
 	__UHEAP_MARKEND;
 	}
 	
@@ -1015,20 +1006,20 @@
 	__UHEAP_MARK;
 // All methods.
 	TInt count=0;
-	INFO_PRINTF1(_L("Checking all methods"));
+	test.Start(_L("Checking all methods"));
 	TCharFormatMask mask;
 	mask.SetAttrib(EAttFontHeight);	
 	mask.AttribIsSet(EAttFontHeight);
 	mask.ClearAttrib(EAttFontHeight);
 // Construction.
-	INFO_PRINTF1(_L("Construction"));
+	test.Next(_L("Construction"));
 	TCharFormatMask mask1;
 	for (count=EAttCharLanguage;count<ETextFormatAttributeCount;count++)
 		{
 		test(mask1.AttribIsSet((TTextFormatAttribute)count)==EFalse);
 		}
 // SetAttrib()
-	INFO_PRINTF1(_L("SetAttrib()"));
+	test.Next(_L("SetAttrib()"));
 	for (count=EAttCharLanguage;count<ETextFormatAttributeCount;count++)
 		{
 		mask1.SetAttrib((TTextFormatAttribute)count);
@@ -1038,7 +1029,7 @@
 		test(mask1.AttribIsSet((TTextFormatAttribute)count));
 		}
 // ClearAttrib()
-	INFO_PRINTF1(_L("ClearAttrib()"));
+	test.Next(_L("ClearAttrib()"));
 	for (count=EAttCharLanguage;count<ETextFormatAttributeCount;count++)
 		{
 		mask1.ClearAttrib((TTextFormatAttribute)count);
@@ -1048,21 +1039,22 @@
 		test(mask1.AttribIsSet((TTextFormatAttribute)count)==EFalse);
 		}
 // AttribIsSet()
-	INFO_PRINTF1(_L("AttribIsSet()"));
+	test.Next(_L("AttribIsSet()"));
 	// Already tested in the above.
-	INFO_PRINTF1(_L("SetAll()"));
+	test.Next(_L("SetAll()"));
 	TCharFormatMask mask2;
 	mask2.SetAll();
 	for (count=EAttCharLanguage;count<ETextFormatAttributeCount;count++)
 		{
 		test(mask2.AttribIsSet((TTextFormatAttribute)count));
 		}
-	INFO_PRINTF1(_L("ClearAll()"));
+	test.Next(_L("ClearAll()"));
 	mask2.ClearAll();
 	for (count=EAttCharLanguage;count<ETextFormatAttributeCount;count++)
 		{
 		test(mask2.AttribIsSet((TTextFormatAttribute)count)==EFalse);
 		}
+	test.End();
 	__UHEAP_MARKEND;
 	}
 
@@ -1073,31 +1065,31 @@
 // Check all classes and structs exist.
 //
 	{
-	INFO_PRINTF1(_L(" @SYMTestCaseID:SYSLIB-ETEXT-LEGACY-T_FMT-0001 TTabStop "));
+	test.Start(_L(" @SYMTestCaseID:SYSLIB-ETEXT-LEGACY-T_FMT-0001 TTabStop "));
 	CheckTTabStop();
 
-	INFO_PRINTF1(_L("TParaBorder"));
+	test.Next(_L("TParaBorder"));
 	CheckTParaBorder();
 
-	INFO_PRINTF1(_L("TBullet"));
+	test.Next(_L("TBullet"));
 	CheckTBullet();
 
-	INFO_PRINTF1(_L("CParaFormat"));
+	test.Next(_L("CParaFormat"));
 	CheckCParaFormatL();
 
-	INFO_PRINTF1(_L("TParaFormatMask"));
+	test.Next(_L("TParaFormatMask"));
 	CheckTParaFormatMask();
     
-	INFO_PRINTF1(_L("CParaFormatLayer"));
+	test.Next(_L("CParaFormatLayer"));
 	CheckCParaFormatLayerL();
 	
-	INFO_PRINTF1(_L("TCharFormat"));
+	test.Next(_L("TCharFormat"));
 	CheckTCharFormat();
 
-	INFO_PRINTF1(_L("TCharFormatMask"));
+	test.Next(_L("TCharFormatMask"));
 	CheckTCharFormatMask();
 
-	INFO_PRINTF1(_L("CCharFormatLayer"));
+	test.Next(_L("CCharFormatLayer"));
 	CheckCCharFormatLayerL();
 
 	}
@@ -1107,7 +1099,7 @@
 // Tests setting null tabs into a para format with tab stops.
 //
 	{
-	INFO_PRINTF1(_L("Setting Null Tabs"));
+	test.Start(_L("Setting Null Tabs"));
 
 	CCharFormatLayer* charLayer=CCharFormatLayer::NewL();
 	CParaFormatLayer* paraLayer=CParaFormatLayer::NewL();
@@ -1159,6 +1151,7 @@
 	delete text;
 	delete paraLayer;
 	delete charLayer;
+	test.End();
 	}
 
 
@@ -1166,7 +1159,7 @@
 // Test CFormatLayer::Reset();
 //
 	{
-	INFO_PRINTF1(_L("CFormatLayer::Reset()"));
+	test.Start(_L("CFormatLayer::Reset()"));
 
 	CCharFormatLayer* charLayer=CCharFormatLayer::NewL();
 	TCharFormat charFormat;
@@ -1193,37 +1186,41 @@
 	test(result.IsEqual(comparator));
 	//
 	delete charLayer;
+	test.End();
 	}
 
-CT_FMT::CT_FMT()
-    {
-    SetTestStepName(KTestStep_T_FMT);
-    pTestStep = this;
-    }
 
-TVerdict CT_FMT::doTestStepL()
-    {
-    SetTestStepResult(EFail);
-
-    CTrapCleanup* cleanup=CTrapCleanup::New();
-    INFO_PRINTF1(_L("TFormat Test Code"));
+GLDEF_C TInt E32Main()
+//
+// Tests TFORMAT.
+//
+	{
+	CTrapCleanup* cleanup=CTrapCleanup::New();
+	test.Title();
     TestFormat<TText>* fmt=new(ELeave) TestFormat<TText>;
-    TRAPD(ret1, fmt->CheckAllClassesL());
-    TRAPD(ret2, TestFormatLayerResetL());
-    TRAPD(ret3, TestSettingNullTabsL());
-    TRAPD(ret4, CheckBulletInheritance());
-        
-    __UHEAP_MARK;
-    delete(fmt);
-    fmt=NULL;
-    __UHEAP_MARKEND;
+	TRAPD(ret,fmt->CheckAllClassesL());
+	
+	TRAP(ret,
+	TestFormatLayerResetL());
+	test(ret==KErrNone);
 
-    delete cleanup;
+	TRAP(ret,
+	TestSettingNullTabsL());
+	test(ret==KErrNone);
+		
+	TRAP(ret,
+	CheckBulletInheritance());
+	test(ret==KErrNone);
+		
+	test.End();
 
-    if (ret1 == KErrNone && ret2 == KErrNone && ret3 == KErrNone && ret4 == KErrNone)
-        {
-        SetTestStepResult(EPass);
-        }
+	__UHEAP_MARK;
+	delete(fmt);
+	fmt=NULL;
+	__UHEAP_MARKEND;
+	test.Close();
 
-    return TestStepResult();
-    }
+	delete cleanup;
+
+	return(0);
+	}