diff -r f902e87c146f -r 748ec5531811 textrendering/textformatting/test/src/TLINEPAG.CPP --- a/textrendering/textformatting/test/src/TLINEPAG.CPP Wed Jun 09 11:40:52 2010 +0300 +++ b/textrendering/textformatting/test/src/TLINEPAG.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" @@ -22,31 +22,30 @@ #include #include #include +#include "tlinepag.h" +namespace LocalToTLinePag +{ _LIT(KTLinePag, "TLinePag"); -RTest TheTest(KTLinePag); - +CTLinePagStep* TestStep = NULL; +#define TESTPOINT(p) TestStep->testpoint(p,(TText8*)__FILE__,__LINE__) +#define TESTPRINT(p) TestStep->print(p,(TText8*)__FILE__,__LINE__) +} +using namespace LocalToTLinePag; /////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////// //Test macroses and functions -LOCAL_C void CheckL(TInt aValue, TInt aLine) - { - if(!aValue) - { - TheTest(EFalse, aLine); - } - } LOCAL_C void CheckL(TInt aValue, TInt aExpected, TInt aLine) { if(aValue != aExpected) { - RDebug::Print(_L("*** Expected error: %d, got: %d\r\n"), aExpected, aValue); - TheTest(EFalse, aLine); + TBuf<256> buf; + buf.AppendFormat(_L("*** Expected error: %d, got: %d\r\n"), aExpected, aValue); + TestStep->print(buf,(TText8*)__FILE__,aLine); + TestStep->testpoint(EFalse,(TText8*)__FILE__,aLine); } } -#define TEST(arg) ::CheckL((arg), __LINE__) -#define TEST2(aValue, aExpected) ::CheckL(aValue, aExpected, __LINE__) class CLinePaginatorTest : public CBase { @@ -116,7 +115,7 @@ { } TBool success=CompareArrays(); - TEST2(success, ETrue); + CheckL(success, ETrue,__LINE__); } @@ -153,7 +152,9 @@ lex.Val(pageHeight); iPaginator.SetPageHeight(pageHeight); - TheTest.Printf(_L("DocPos\tHeight\tKeep\tStart\tHeight of Pages = <%d>\n"), pageHeight); + TBuf<254> buf; + buf.AppendFormat(_L("DocPos\tHeight\tKeep\tStart\tHeight of Pages = <%d>\n"), pageHeight); + TESTPRINT(buf); } TBool CLinePaginatorTest::ReadTestFile(TPageLine& aLine) @@ -171,7 +172,9 @@ iFilePos+=startNum; lex=textBuffer; lex.Val(aLine.iDocPos); - TheTest.Printf(_L("%d\tX\n"), aLine.iDocPos); + TBuf<254> buf; + buf.AppendFormat(_L("%d\tX\n"), aLine.iDocPos); + TESTPRINT(buf); return EFalse; } @@ -212,13 +215,17 @@ void CLinePaginatorTest::WriteOutputFile(TPageLine aLine) { + TBuf<256> buf; if (iTestPageBreak) { - TheTest.Printf(_L("%d\t%d\t%d\t%d\tBREAK\n"), aLine.iDocPos, aLine.iLineHeight, aLine.iKeepWithNext, aLine.iStartNewPage); + buf.AppendFormat(_L("%d\t%d\t%d\t%d\tBREAK\n"), aLine.iDocPos, aLine.iLineHeight, aLine.iKeepWithNext, aLine.iStartNewPage); + TESTPRINT(buf); } else { - TheTest.Printf(_L("%d\t%d\t%d\t%d\n"), aLine.iDocPos, aLine.iLineHeight, aLine.iKeepWithNext, aLine.iStartNewPage); + buf.Zero(); + buf.AppendFormat(_L("%d\t%d\t%d\t%d\n"), aLine.iDocPos, aLine.iLineHeight, aLine.iKeepWithNext, aLine.iStartNewPage); + TESTPRINT(buf); } } @@ -241,9 +248,11 @@ TInt prevDocPos=0; TInt docPosError=0; + TBuf<256> buf; if (numPages==numTestPages) { - TheTest.Printf(_L("Correct Number of Pages = %d\n"), numPages); + buf.AppendFormat(_L("Correct Number of Pages = %d\n"), numPages); + TESTPRINT(buf); pagesSame=ETrue; for (TInt i=0; i