textrendering/texthandling/ttext/T_INDTER.CPP
branchRCL_3
changeset 16 748ec5531811
parent 0 1fb32624e06b
child 17 336bee5c2d35
--- a/textrendering/texthandling/ttext/T_INDTER.CPP	Wed Jun 09 11:40:52 2010 +0300
+++ b/textrendering/texthandling/ttext/T_INDTER.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"
@@ -18,7 +18,6 @@
 
 #include <e32std.h>
 #include <e32base.h>
-#include <e32test.h>
 
 #include <txtfrmat.h>
 #include <txtfmlyr.h>
@@ -26,13 +25,29 @@
 #include <gdi.h>
 
 #include "../incp/T_PMLPAR.H"
+#include "T_INDTER.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("Rich Text Format attribute Indeterminate State tests"));
 LOCAL_D CTrapCleanup* TheTrapCleanup=NULL;
 LOCAL_D CRichText* TheText=NULL;
 LOCAL_D CParaFormatLayer* TheGlobalParaLayer=NULL;
@@ -164,7 +179,7 @@
 // Test the indeterminate state of paragraph format attributes.
 //
 	{
-	test.Start(_L(" @SYMTestCaseID:SYSLIB-TTEXT-LEGACY-T_INDTER-0001 Paragraph format attributes "));
+	INFO_PRINTF1(_L(" @SYMTestCaseID:SYSLIB-TTEXT-LEGACY-T_INDTER-0001 Paragraph format attributes "));
 	TestParaBordersL();
 	}
 
@@ -173,7 +188,7 @@
 // Test the indeterminate state of character format attributes.
 //
 	{
-	test.Next(_L("Character format attributes"));
+	INFO_PRINTF1(_L("Character format attributes"));
 	//
 	ResetTextL();
 	TCharFormat applyFormat;
@@ -221,7 +236,7 @@
 	CreateRichTextL();
 	TestParaFormatL();
 	TestCharFormatL();
-	test.End();
+	
 	DestroyRichText();
     }
 
@@ -241,22 +256,30 @@
 		});
 	}
 
-
-GLDEF_C TInt E32Main()
-//
-// Test the streaming framework.
-//
+CT_INDTER::CT_INDTER()
     {
+    SetTestStepName(KTestStep_T_INDTER);
+    pTestStep = this;
+    }
 
-	test.Title();
-	__UHEAP_MARK;
-	setupCleanup();
-	TRAPD(r, DoTestL());
+TVerdict CT_INDTER::doTestStepL()
+    {
+    SetTestStepResult(EFail);
+
+    INFO_PRINTF1(_L("Rich Text Format attribute Indeterminate State tests"));
+    __UHEAP_MARK;
+    setupCleanup();
+    TRAPD(r, DoTestL());
     test(r == KErrNone);
 
-	delete TheTrapCleanup;
-	
-	__UHEAP_MARKEND;
-	test.Close();
-	return 0;
+    delete TheTrapCleanup;
+    
+    __UHEAP_MARKEND;
+    
+    if (r == KErrNone)
+        {
+        SetTestStepResult(EPass);
+        }
+
+    return TestStepResult();
     }