--- a/textrendering/textformatting/test/src/TTagmaImp.cpp Wed Jun 09 11:40:52 2010 +0300
+++ b/textrendering/textformatting/test/src/TTagmaImp.cpp Tue Aug 31 17:01:26 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2001-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"
@@ -29,15 +29,19 @@
#include "TMINTERP.H"
#include "TmText.h"
#include "InlineText.h"
+#include "ttagmaimp.h"
-namespace LocalToFile
+namespace LocalToTTagmaImp
{
enum TTagmaImpPanic { EAccessOutsideText = 1 };
void Panic(TTagmaImpPanic)
{
User::Panic(_L("TTagmaImp"), EAccessOutsideText);
}
-RTest test(_L("Tagma internals tests"));
+
+CTTagmaImpStep* TestStep = NULL;
+#define TESTPOINT(p) TestStep->testpoint(p,(TText8*)__FILE__,__LINE__)
+#define TESTPRINT(p) TestStep->print(p,(TText8*)__FILE__,__LINE__)
const TInt KPictureCharacter = 0xFFFC;
@@ -146,9 +150,8 @@
{
TInt iProcessHandles;
TInt iThreadHandles;
- RTest& iTest;
public:
- THandleTester(RTest& rt) : iTest(rt)
+ THandleTester()
{
RThread().HandleCount(iProcessHandles, iThreadHandles);
}
@@ -158,8 +161,8 @@
TInt t;
RThread().HandleCount(p, t);
// this seems to break at random...
-// iTest(p == iProcessHandles);
- iTest(t == iThreadHandles);
+// TestStep->test(p == iProcessHandles);
+ TESTPOINT(t == iThreadHandles);
}
};
@@ -282,14 +285,15 @@
};
}
-using namespace LocalToFile;
+using namespace LocalToTTagmaImp;
class CTagmaImpTest : public CBase
{
public:
- CTagmaImpTest() : iDevice(0), iGc(0)
+ CTagmaImpTest(CTTagmaImpStep* aStep) : iDevice(0), iGc(0)
{
+ TestStep = aStep;
}
void ConstructL()
{
@@ -351,9 +355,9 @@
TInt num = reader.ReadNumber();
TRect rect = reader.ReadRect();
TRect testRect(aStartValue + 2, aStartValue + 3, aStartValue + 4, aStartValue + 5);
- test(byte == static_cast<TUint8>(aStartValue));
- test(num == aStartValue + 1);
- test(rect == testRect);
+ TESTPOINT(byte == static_cast<TUint8>(aStartValue));
+ TESTPOINT(num == aStartValue + 1);
+ TESTPOINT(rect == testRect);
}
return reader.CodePos();
}
@@ -426,7 +430,7 @@
code->Delete(size1, size4);
CheckLots(*code, 0, 0, count1);
CheckLots(*code, size1, 0, count2);
- test(code2->Size() == 0);
+ TESTPOINT(code2->Size() == 0);
CleanupStack::PopAndDestroy(code2);
CleanupStack::PopAndDestroy(code);
}
@@ -437,7 +441,7 @@
TInt err;
TInt failAt = 1;
do {
- THandleTester h(test);
+ THandleTester h();
__UHEAP_MARK;
__UHEAP_SETFAIL(RHeap::EDeterministic, failAt);
@@ -447,7 +451,7 @@
++failAt;
} while (err == KErrNoMemory);
- test(err == KErrNone);
+ TESTPOINT(err == KErrNone);
}
CTestSource* CTagmaImpTest::NewTestSourceLC()
@@ -497,7 +501,7 @@
TInt err;
TInt failAt = 1;
do {
- THandleTester h(test);
+ THandleTester h();
__UHEAP_MARK;
__UHEAP_SETFAIL(RHeap::EDeterministic, failAt);
@@ -507,7 +511,7 @@
++failAt;
} while (err == KErrNoMemory);
- test(err == KErrNone);
+ TESTPOINT(err == KErrNone);
}
void CTagmaImpTest::ExerciseRTmTextCacheWidthL()
@@ -532,7 +536,7 @@
TInt err;
TInt failAt = 1;
do {
- THandleTester h(test);
+ THandleTester h();
__UHEAP_MARK;
__UHEAP_SETFAIL(RHeap::EDeterministic, failAt);
@@ -542,7 +546,7 @@
++failAt;
} while (err == KErrNoMemory);
- test(err == KErrNone);
+ TESTPOINT(err == KErrNone);
}
void CTagmaImpTest::ExerciseRTmGeneralInterpreterGetDisplayedTextL()
@@ -573,7 +577,7 @@
TInt err;
TInt failAt = 1;
do {
- THandleTester h(test);
+ THandleTester h();
__UHEAP_MARK;
__UHEAP_SETFAIL(RHeap::EDeterministic, failAt);
@@ -583,7 +587,7 @@
++failAt;
} while (err == KErrNoMemory);
- test(err == KErrNone);
+ TESTPOINT(err == KErrNone);
}
void CTagmaImpTest::WEP_55BHBF_DefectL()
@@ -639,7 +643,7 @@
// check that format has found the break at 11 characters
// This is at the end of "this is a "
- test( info.iFirstLineEndChar == 11 );
+ TESTPOINT(info.iFirstLineEndChar == 11 );
// get the text that would be displayed into displayBuffer
TTmInterpreterParam interpreter_param(*code);
@@ -656,8 +660,8 @@
// The defect caused this buffer to be missing the final 'a'
// from "...this is a" at the end of the line
// When this defect happens noCharsToDisplay != info.iFirstLineEndChar
- test( info.iFirstLineEndChar == noCharsToDisplay );
- test( displayBuffer[9] == 'a' );
+ TESTPOINT( info.iFirstLineEndChar == noCharsToDisplay );
+ TESTPOINT( displayBuffer[9] == 'a' );
interpreter.Close();
CleanupStack::PopAndDestroy(layout);
@@ -702,9 +706,9 @@
CTmFormatContext::FormatL(*source1, formatParam1, *code, info1, layout);
// check that format didn't found any breaks
- test( info1.iFirstLineEndChar == KTest1().Length());
- test( info1.iLastLineStartChar == 0 );
- test( info1.iHeight == 12 ); // just 1 line
+ TESTPOINT( info1.iFirstLineEndChar == KTest1().Length());
+ TESTPOINT( info1.iLastLineStartChar == 0 );
+ TESTPOINT( info1.iHeight == 12 ); // just 1 line
@@ -727,9 +731,9 @@
CTmFormatContext::FormatL(*source2, formatParam2, *code, info2, layout);
// check that format didn't found any breaks
- test( info2.iFirstLineEndChar == KTest2().Length());
- test( info2.iLastLineStartChar == 0 );
- test( info2.iHeight == 12 ); // just 1 line
+ TESTPOINT( info2.iFirstLineEndChar == KTest2().Length());
+ TESTPOINT( info2.iLastLineStartChar == 0 );
+ TESTPOINT( info2.iHeight == 12 ); // just 1 line
@@ -752,9 +756,9 @@
CTmFormatContext::FormatL(*source3, formatParam3, *code, info3, layout);
// check that format didn't found any breaks
- test( info3.iFirstLineEndChar == 54 );
- test( info3.iLastLineStartChar == 108 );
- test( info3.iHeight == 36 ); // 3 lines
+ TESTPOINT( info3.iFirstLineEndChar == 54 );
+ TESTPOINT( info3.iLastLineStartChar == 108 );
+ TESTPOINT( info3.iHeight == 36 ); // 3 lines
CleanupStack::PopAndDestroy(source3);
CleanupStack::PopAndDestroy(source2);
@@ -895,33 +899,33 @@
text->GetText(0, testText, cft);
text->GetParagraphFormatL(0, pft);
- test(testText.Length() == 14);
- test(testText.Compare(_L("first line\x2029sec")) == 0);
- test(cft == cf1);
- test(pft == pf1);
+ TESTPOINT(testText.Length() == 14);
+ TESTPOINT(testText.Compare(_L("first line\x2029sec")) == 0);
+ TESTPOINT(cft == cf1);
+ TESTPOINT(pft == pf1);
text->GetText(11, testText, cft);
text->GetParagraphFormatL(11, pft);
- test(testText.Length() == 3);
- test(testText.Compare(_L("sec")) == 0);
- test(cft == cf1);
- test(pft == pf2);
+ TESTPOINT(testText.Length() == 3);
+ TESTPOINT(testText.Compare(_L("sec")) == 0);
+ TESTPOINT(cft == cf1);
+ TESTPOINT(pft == pf2);
text->GetText(14, testText, cft);
text->GetParagraphFormatL(14, pft);
- test(testText.Length() == 3);
- test(testText.Compare(_L("t p")) == 0);
- test(cft == cf2);
- test(pft == pf2);
+ TESTPOINT(testText.Length() == 3);
+ TESTPOINT(testText.Compare(_L("t p")) == 0);
+ TESTPOINT(cft == cf2);
+ TESTPOINT(pft == pf2);
text->GetText(17, testText, cft);
text->GetParagraphFormatL(17, pft);
- test(cft == cf1);
- test(pft == pf2);
+ TESTPOINT(cft == cf1);
+ TESTPOINT(pft == pf2);
text->GetText(21, testText, cft);
text->GetParagraphFormatL(21, pft);
- test(pft == pf2);
+ TESTPOINT(pft == pf2);
CleanupStack::PopAndDestroy(&pft);
CleanupStack::PopAndDestroy(&pf2);
CleanupStack::PopAndDestroy(&pf1);
@@ -930,7 +934,7 @@
void CTagmaImpTest::GetIndices(TDes8& aBuf, const CTmTextImp::RRunArray& aRunArray)
{
- test(aRunArray.Index(0) == aRunArray.Index(1));
+ TESTPOINT(aRunArray.Index(0) == aRunArray.Index(1));
aBuf.Zero();
TInt index;
for (TInt i = 1; 0 <= (index = aRunArray.Index(i)); ++i)
@@ -962,7 +966,7 @@
TInt memUsed = text->MemoryUsed();
text->ChangeFormatL(formatParam);
- test(text->MemoryUsed()==memUsed);
+ TESTPOINT(text->MemoryUsed()==memUsed);
TTmFormatParam formatParam1;
formatParam1.iStartChar = 0;
@@ -975,12 +979,12 @@
//Setting the format of the text
text->ChangeFormatL(formatParam1);
//After changing the format, memory used by the text differs from the initial value
- test(text->MemoryUsed()!=memUsed);
+ TESTPOINT(text->MemoryUsed()!=memUsed);
TRgb color1(100,10,20);
TRgb color2;
//Setting the system colour with an index representing the system background colour
color2 = text->SystemColor(TLogicalRgb::ESystemBackgroundIndex,color1);
- test(color2==color1);
+ TESTPOINT(color2==color1);
_LIT(KBody, "Body");
_LIT(KLabel, "Label, Longer than Body");
@@ -992,7 +996,7 @@
//Setting the system colour with an index representing the system foreground colour
color2 = text->SystemColor(TLogicalRgb::ESystemSelectionForegroundIndex,color1);
- test(color2!=color1);
+ TESTPOINT(color2!=color1);
CleanupStack::PopAndDestroy(&pf1);
CleanupStack::PopAndDestroy(text);
}
@@ -1003,50 +1007,50 @@
CTmTextImp::RRunArray ra;
CleanupClosePushL(ra);
GetIndices(indexBuf, ra);
- test(0 == indexBuf.Compare(_L8("")));
+ TESTPOINT(0 == indexBuf.Compare(_L8("")));
ra.Insert(0, 10, 0);
GetIndices(indexBuf, ra);
- test(0 == indexBuf.Compare(_L8("0000000000")));
+ TESTPOINT(0 == indexBuf.Compare(_L8("0000000000")));
ra.Insert(5, 10, 1);
GetIndices(indexBuf, ra);
- test(0 == indexBuf.Compare(_L8("00000111111111100000")));
+ TESTPOINT(0 == indexBuf.Compare(_L8("00000111111111100000")));
ra.Delete(13, 4);
GetIndices(indexBuf, ra);
- test(0 == indexBuf.Compare(_L8("0000011111111000")));
+ TESTPOINT(0 == indexBuf.Compare(_L8("0000011111111000")));
ra.Delete(2, 12);
GetIndices(indexBuf, ra);
- test(0 == indexBuf.Compare(_L8("0000")));
+ TESTPOINT(0 == indexBuf.Compare(_L8("0000")));
ra.Delete(0, 4);
GetIndices(indexBuf, ra);
- test(0 == indexBuf.Compare(_L8("")));
+ TESTPOINT(0 == indexBuf.Compare(_L8("")));
ra.Insert(0, 20, 0);
ra.Set(5, 10, 1);
GetIndices(indexBuf, ra);
- test(0 == indexBuf.Compare(_L8("00000111111111100000")));
+ TESTPOINT(0 == indexBuf.Compare(_L8("00000111111111100000")));
ra.Set(6, 4, 2);
GetIndices(indexBuf, ra);
- test(0 == indexBuf.Compare(_L8("00000122221111100000")));
+ TESTPOINT(0 == indexBuf.Compare(_L8("00000122221111100000")));
ra.Set(10, 4, 3);
GetIndices(indexBuf, ra);
- test(0 == indexBuf.Compare(_L8("00000122223333100000")));
+ TESTPOINT(0 == indexBuf.Compare(_L8("00000122223333100000")));
ra.Set(9, 2, 1);
GetIndices(indexBuf, ra);
- test(0 == indexBuf.Compare(_L8("00000122211333100000")));
+ TESTPOINT(0 == indexBuf.Compare(_L8("00000122211333100000")));
ra.Set(6, 1, 1);
GetIndices(indexBuf, ra);
- test(0 == indexBuf.Compare(_L8("00000112211333100000")));
+ TESTPOINT(0 == indexBuf.Compare(_L8("00000112211333100000")));
ra.Set(8, 1, 1);
GetIndices(indexBuf, ra);
- test(0 == indexBuf.Compare(_L8("00000112111333100000")));
+ TESTPOINT(0 == indexBuf.Compare(_L8("00000112111333100000")));
ra.Set(7, 1, 1);
GetIndices(indexBuf, ra);
- test(0 == indexBuf.Compare(_L8("00000111111333100000")));
+ TESTPOINT(0 == indexBuf.Compare(_L8("00000111111333100000")));
ra.Set(7, 2, 2);
GetIndices(indexBuf, ra);
- test(0 == indexBuf.Compare(_L8("00000112211333100000")));
+ TESTPOINT(0 == indexBuf.Compare(_L8("00000112211333100000")));
ra.Set(1, 19, 1);
GetIndices(indexBuf, ra);
- test(0 == indexBuf.Compare(_L8("01111111111111111111")));
+ TESTPOINT(0 == indexBuf.Compare(_L8("01111111111111111111")));
CleanupStack::PopAndDestroy(&ra);
}
@@ -1063,34 +1067,34 @@
CleanupStack::PushL(pF);
RTmParFormat rPF;
- test(RTmParFormat::EAlignNormalBidirectional == rPF.iAlignment);
+ TESTPOINT(RTmParFormat::EAlignNormalBidirectional == rPF.iAlignment);
rPF.CopyL(*pF);
- test(RTmParFormat::EAlignNormal == rPF.iAlignment);
+ TESTPOINT(RTmParFormat::EAlignNormal == rPF.iAlignment);
pF->iHorizontalAlignment = CParaFormat::ELeftAlign;
rPF.CopyL(*pF);
- test(RTmParFormat::EAlignNormal == rPF.iAlignment);
+ TESTPOINT(RTmParFormat::EAlignNormal == rPF.iAlignment);
pF->iHorizontalAlignment = CParaFormat::ECenterAlign;
rPF.CopyL(*pF);
- test(RTmParFormat::EAlignCenter == rPF.iAlignment);
+ TESTPOINT(RTmParFormat::EAlignCenter == rPF.iAlignment);
pF->iHorizontalAlignment = CParaFormat::ERightAlign;
rPF.CopyL(*pF);
- test(RTmParFormat::EAlignReverse == rPF.iAlignment);
+ TESTPOINT(RTmParFormat::EAlignReverse == rPF.iAlignment);
pF->iHorizontalAlignment = CParaFormat::EJustifiedAlign;
rPF.CopyL(*pF);
- test(RTmParFormat::EAlignJustify == rPF.iAlignment);
+ TESTPOINT(RTmParFormat::EAlignJustify == rPF.iAlignment);
pF->iHorizontalAlignment = CParaFormat::EAbsoluteLeftAlign;
rPF.CopyL(*pF);
- test(RTmParFormat::EAlignAbsoluteLeft == rPF.iAlignment);
+ TESTPOINT(RTmParFormat::EAlignAbsoluteLeft == rPF.iAlignment);
pF->iHorizontalAlignment = CParaFormat::EAbsoluteRightAlign;
rPF.CopyL(*pF);
- test(RTmParFormat::EAlignAbsoluteRight == rPF.iAlignment);
+ TESTPOINT(RTmParFormat::EAlignAbsoluteRight == rPF.iAlignment);
rPF.Close();
CleanupStack::PopAndDestroy(); //pF
@@ -1102,31 +1106,31 @@
CleanupStack::PushL(pF);
RTmParFormat rPF;
- test(pF->iHorizontalAlignment == CParaFormat::ELeftAlign);
+ TESTPOINT(pF->iHorizontalAlignment == CParaFormat::ELeftAlign);
rPF.iAlignment = RTmParFormat::EAlignNormal;
rPF.GetCParaFormatL(*pF);
- test(CParaFormat::ELeftAlign == pF->iHorizontalAlignment);
+ TESTPOINT(CParaFormat::ELeftAlign == pF->iHorizontalAlignment);
rPF.iAlignment = RTmParFormat::EAlignCenter;
rPF.GetCParaFormatL(*pF);
- test(CParaFormat::ECenterAlign == pF->iHorizontalAlignment);
+ TESTPOINT(CParaFormat::ECenterAlign == pF->iHorizontalAlignment);
rPF.iAlignment = RTmParFormat::EAlignReverse;
rPF.GetCParaFormatL(*pF);
- test(CParaFormat::ERightAlign == pF->iHorizontalAlignment);
+ TESTPOINT(CParaFormat::ERightAlign == pF->iHorizontalAlignment);
rPF.iAlignment = RTmParFormat::EAlignJustify;
rPF.GetCParaFormatL(*pF);
- test(CParaFormat::EJustifiedAlign == pF->iHorizontalAlignment);
+ TESTPOINT(CParaFormat::EJustifiedAlign == pF->iHorizontalAlignment);
rPF.iAlignment = RTmParFormat::EAlignAbsoluteLeft;
rPF.GetCParaFormatL(*pF);
- test(CParaFormat::EAbsoluteLeftAlign == pF->iHorizontalAlignment);
+ TESTPOINT(CParaFormat::EAbsoluteLeftAlign == pF->iHorizontalAlignment);
rPF.iAlignment = RTmParFormat::EAlignAbsoluteRight;
rPF.GetCParaFormatL(*pF);
- test(CParaFormat::EAbsoluteRightAlign == pF->iHorizontalAlignment);
+ TESTPOINT(CParaFormat::EAbsoluteRightAlign == pF->iHorizontalAlignment);
rPF.Close();
CleanupStack::PopAndDestroy(); // pF
@@ -1143,7 +1147,7 @@
TTestCustomFormattingSource(MGraphicsDeviceMap* aDevice,
const TDesC& aBody, TInt aCustomFormatType)
: iDevice(aDevice)
- {
+ {
iCustomFormatType = aCustomFormatType;
iBody.Set(aBody.Ptr(), aBody.Length());
iCurrent = &iBody;
@@ -1221,7 +1225,9 @@
aNext.iLeadingEdge = EFalse;
if (aNext.iPos - aFrom.iPos < aMaxLength + (aNext.iLeadingEdge ? 0 : 1))
return KErrNotFound;
- test.Printf(_L("GetPos-InlineTextAt-%d %c-From-%d\n"), aNext.iPos, aNext.iLeadingEdge ? 'L' : 'T', aFrom.iPos);
+ TBuf<256> buf;
+ buf.AppendFormat(_L("GetPos-InlineTextAt-%d %c-From-%d\n"),aNext.iPos, aNext.iLeadingEdge ? 'L' : 'T', aFrom.iPos);
+ TESTPRINT(buf);
return KErrNone;
}
return KErrNotFound;
@@ -1246,7 +1252,9 @@
aNext.iLeadingEdge = ETrue;
if (aNext.iPos - aFrom.iPos < aMaxLength + (aNext.iLeadingEdge ? 0 : 1))
return KErrNotFound;
- test.Printf(_L("GetPos-InlineTextAt-%d %c-From-%d\n"), aNext.iPos, aNext.iLeadingEdge ? 'L' : 'T', aFrom.iPos);
+ TBuf<256> buf;
+ buf.AppendFormat(_L("GetPos-InlineTextAt-%d %c-From-%d\n"), aNext.iPos, aNext.iLeadingEdge ? 'L' : 'T', aFrom.iPos);
+ TESTPRINT(buf);
return KErrNone;
}
// if it gets here search position is after the first break space
@@ -1256,7 +1264,9 @@
aNext.iLeadingEdge = EFalse;
if (aNext.iPos - aFrom.iPos < aMaxLength + (aNext.iLeadingEdge ? 0 : 1))
return KErrNotFound;
- test.Printf(_L("GetPos-InlineTextAt-%d %c-From-%d\n"), aNext.iPos, aNext.iLeadingEdge ? 'L' : 'T', aFrom.iPos);
+ TBuf<256> buf;
+ buf.AppendFormat(_L("GetPos-InlineTextAt-%d %c-From-%d\n"), aNext.iPos, aNext.iLeadingEdge ? 'L' : 'T', aFrom.iPos);
+ TESTPRINT(buf);
return KErrNone;
}
}
@@ -1266,7 +1276,9 @@
}
TPtrC GetInlineText(const TTmDocPos& aAt)
{
- test.Printf(_L("QueryTextAt-%d %c\n"), aAt.iPos, aAt.iLeadingEdge ? 'L' : 'T');
+ TBuf<256> buf;
+ buf.AppendFormat(_L("QueryTextAt-%d %c\n"), aAt.iPos, aAt.iLeadingEdge ? 'L' : 'T');
+ TESTPRINT(buf);
if (iCustomFormatType == 0)
{
return iNullText;
@@ -1287,7 +1299,9 @@
{
_LIT(KCFS3, "?");
TPtrC tPtrC(KCFS3);
- test.Printf(_L("GetText-QuestionMark-%d\n"), aAt.iPos);
+ TBuf<256> buf;
+ buf.AppendFormat(_L("GetText-QuestionMark-%d\n"), aAt.iPos);
+ TESTPRINT(buf);
return tPtrC;
}
}
@@ -1310,7 +1324,10 @@
{ // search position is on the first break space
_LIT(KCFS4, " ");
TPtrC tPtrC(KCFS4);
- test.Printf(_L("GetText-Space-%d-L\n"), aAt.iPos);
+
+ TBuf<256> buf;
+ buf.AppendFormat(_L("GetText-Space-%d-L\n"), aAt.iPos);
+ TESTPRINT(buf);
return tPtrC;
}
// if it gets here search position is not on the first break space
@@ -1318,7 +1335,9 @@
{ // but it is on the second
_LIT(KCFS4, " ");
TPtrC tPtrC(KCFS4);
- test.Printf(_L("GetText-Space-%d-T\n"), aAt.iPos);
+ TBuf<256> buf;
+ buf.AppendFormat(_L("GetText-Space-%d-T\n"), aAt.iPos);
+ TESTPRINT(buf);
return tPtrC;
}
}
@@ -1335,7 +1354,7 @@
// Test one
// ========
// First test is where inline text is enabled but where there is none to insert
- _LIT(KBody0, "This is a bunch of boring plain text that doesn't get any inline text inserted.\x2029");
+ _LIT(KBody0, "This is a bunch of boring plain text that doesn't get any inline text inserted.\x2029");
TTestCustomFormattingSource s0(iDevice, KBody0, 0); // No inline text
CTmTextLayout* lay0 = new(ELeave) CTmTextLayout;
TTmFormatParam fp0;
@@ -1408,11 +1427,11 @@
text->GetDisplayedText(0,buffer,needed);
//Verify that the text is formatted correctly
- test(buffer == KDisplayedLatinZWJ);
+ TESTPOINT(buffer == KDisplayedLatinZWJ);
//Verify that the length of the string is as expected
textLength = (text->EndChar()) - (text->StartChar());
- test(textLength == KExpectedTextLength);
+ TESTPOINT(textLength == KExpectedTextLength);
text->Clear();
//Test the sample text with ZWJ in the middle of the string
@@ -1420,11 +1439,11 @@
text->GetDisplayedText(0,buffer,needed);
//Verify that the text is formatted correctly
- test(buffer == KDisplayedLatinZWJ);
+ TESTPOINT(buffer == KDisplayedLatinZWJ);
//Verify that the length of the string is as expected
textLength = (text->EndChar()) - (text->StartChar());
- test(textLength == KExpectedTextLength);
+ TESTPOINT(textLength == KExpectedTextLength);
text->Clear();
//Test the sample text with ZWJ at the end of the string
@@ -1432,11 +1451,11 @@
text->GetDisplayedText(0,buffer,needed);
//Verify that the text is formatted correctly
- test(buffer == KDisplayedLatinZWJ);
+ TESTPOINT(buffer == KDisplayedLatinZWJ);
//Verify that the length of the string is as expected
textLength = (text->EndChar()) - (text->StartChar());
- test(textLength == KExpectedTextLength);
+ TESTPOINT(textLength == KExpectedTextLength);
text->Clear();
CleanupStack::PopAndDestroy(); // text
@@ -1474,11 +1493,11 @@
text->GetDisplayedText(0,buffer,needed);
//Verify that the text is formatted correctly
- test(buffer == KDisplayedKannadaTamil);
+ TESTPOINT(buffer == KDisplayedKannadaTamil);
//Verify that the length of the string is as expected
textLength = (text->EndChar()) - (text->StartChar());
- test(textLength == KExpectedTextLength);
+ TESTPOINT(textLength == KExpectedTextLength);
text->Clear();
CleanupStack::PopAndDestroy(); // text
@@ -1525,27 +1544,27 @@
chunk.SetL(*formatContext,0,0,10,533,0,chunkInfo);
TUint context = chunk.iContextCharInByteCode;
// Test that the first chunk's context has been recognised as not needing supplied context.
- test(0 == context);
+ TESTPOINT(0 == context);
chunk.SetL(*formatContext,3,0,10,533,0,chunkInfo);
context = chunk.iContextCharInByteCode;
// Test that the next chunk retains the Hindi context.
- test(2325 == context);
+ TESTPOINT(2325 == context);
chunk.SetL(*formatContext,4,0,10,533,0,chunkInfo);
context = chunk.iContextCharInByteCode;
// Test that the next chunk retains the Hindi context.
- test(2325 == context);
+ TESTPOINT(2325 == context);
chunk.SetL(*formatContext,5,0,10,533,0,chunkInfo);
context = chunk.iContextCharInByteCode;
// Test that the next chunk retains the Hindi context.
- test(2325 == context);
+ TESTPOINT(2325 == context);
chunk.SetL(*formatContext,6,0,10,533,0,chunkInfo);
context = chunk.iContextCharInByteCode;
// Test that the next chunk has been recognised as not needing supplied context.
- test(0 == context);
+ TESTPOINT(0 == context);
chunk.SetL(*formatContext,9,0,10,533,0,chunkInfo);
context = chunk.iContextCharInByteCode;
// Test that the next chunk retains the Latin context.
- test(99 == context);
+ TESTPOINT(99 == context);
CleanupStack::PopAndDestroy(formatContext); // formatContext
@@ -1605,13 +1624,13 @@
{
if (interpreter.Op() == TTmInterpreter::EOpLine)
{
- test(interpreter.LineContextCharChar() == expectedResults[lines++]);
+ TESTPOINT(interpreter.LineContextCharChar() == expectedResults[lines++]);
}
interpreter.Skip();
}
// Test the correct amount of lines have been tested.
- test(4 == lines);
+ TESTPOINT(4 == lines);
// Close the interpreter and clean up the heap.
interpreter.Close();
@@ -1677,7 +1696,7 @@
TUint32 op = interpreter.Op();
if (interpreter.Op() == TTmInterpreter::EOpText || interpreter.Op() == TTmInterpreter::EOpSpecialChar)
{
- test(expectedResults[chunks++] == interpreter.ContextCharChar());
+ TESTPOINT(expectedResults[chunks++] == interpreter.ContextCharChar());
}
else
{
@@ -1686,7 +1705,7 @@
}
// Test that the expected number of chunks were found in the bytecode.
- test(3 == chunks);
+ TESTPOINT(3 == chunks);
// Close the interpreter and clean up the heap.
interpreter.Close();
@@ -1698,82 +1717,82 @@
void CTagmaImpTest::TestL()
{
// __UHEAP_MARK;
-
- test.Start(_L("Regression test: DEF073838")); // Line break problem with WORD
+
+ TESTPRINT(_L("Regression test: DEF073838")); // Line break problem with WORD
DEF_073838_DefectL();
- test.Next(_L("Regression test: INC044969"));
+ TESTPRINT(_L("Regression test: INC044969"));
INC_044969_DefectL();
- test.Next(_L("CTmTextImp::RRunArray tests"));
+ TESTPRINT(_L("CTmTextImp::RRunArray tests"));
CTmTextImp_RRunArrayL();
- test.Next(_L("Regression test: BUR-58FGE8"));
+ TESTPRINT(_L("Regression test: BUR-58FGE8"));
BUR_58FGE8_DefectL();
- test.Next(_L("Regression test: WEP-55BHBF"));
+ TESTPRINT(_L("Regression test: WEP-55BHBF"));
WEP_55BHBF_DefectL();
- test.Next(_L("Regression test: EXT-5ATF8D"));
+ TESTPRINT(_L("Regression test: EXT-5ATF8D"));
EXT_5ATF8D_DefectL();
- test.Next(_L(" @SYMTestCaseID:SYSLIB-FORM-UT-1886 Test for CTmTextImp API's "));
+ TESTPRINT(_L(" @SYMTestCaseID:SYSLIB-FORM-UT-1886 Test for CTmTextImp API's "));
TestAPIL();
- test.Next(_L("CTmCode tests"));
+ TESTPRINT(_L("CTmCode tests"));
CTmCodeOOML();
- test.Next(_L("CTmFormatContext::FormatL tests"));
+ TESTPRINT(_L("CTmFormatContext::FormatL tests"));
FormatOOML();
- test.Next(_L("RTmTextCache::Width tests"));
+ TESTPRINT(_L("RTmTextCache::Width tests"));
RTmTextCacheWidthOOM();
- test.Next(_L("RTmGeneralInterpreter::GetDisplayedText tests"));
+ TESTPRINT(_L("RTmGeneralInterpreter::GetDisplayedText tests"));
RTmGeneralInterpreterGetDisplayedTextOOM();
- test.Next(_L("Bidirectional alignment tests"));
+ TESTPRINT(_L("Bidirectional alignment tests"));
CTmTextImp_BidirectionalAlignmentL();
- test.Next(_L("Custom formatting tests"));
+ TESTPRINT(_L("Custom formatting tests"));
CustomFormattingL();
- test.Next(_L(" @SYMTestCaseID:SYSLIB-FORM-CT-3353 Regression test: PDEF101464 "));
+ TESTPRINT(_L(" @SYMTestCaseID:SYSLIB-FORM-CT-3353 Regression test: PDEF101464 "));
PDEF_101464_DefectL();
- test.Next(_L(" @SYMTestCaseID:SYSLIB-FORM-CT-3398 Regression test: DEF101994 "));
+ TESTPRINT(_L(" @SYMTestCaseID:SYSLIB-FORM-CT-3398 Regression test: DEF101994 "));
DEF101994_DefectL();
- test.Next(_L(" @SYMTestCaseID:SYSLIB-FORM-UT-4010 Drawing Text within context: Testing chunk context."));
+ TESTPRINT(_L(" @SYMTestCaseID:SYSLIB-FORM-UT-4010 Drawing Text within context: Testing chunk context."));
TestChunkContext();
- test.Next(_L(" @SYMTestCaseID:SYSLIB-FORM-UT-4011 Drawing Text within context: Testing line context within bytecode."));
+ TESTPRINT(_L(" @SYMTestCaseID:SYSLIB-FORM-UT-4011 Drawing Text within context: Testing line context within bytecode."));
TestBytecodeLineContext();
- test.Next(_L(" @SYMTestCaseID:SYSLIB-FORM-UT-4012 Drawing Text within context: Testing chunk context within bytecode."));
- TestBytecodeChunkContext();
-
- test.End();
+ TESTPRINT(_L(" @SYMTestCaseID:SYSLIB-FORM-UT-4012 Drawing Text within context: Testing chunk context within bytecode."));
+ TestBytecodeChunkContext();
// __UHEAP_MARKEND;
}
-
-void RunTestsL()
- {
- CTagmaImpTest* t = new(ELeave) CTagmaImpTest();
- CleanupStack::PushL(t);
- t->ConstructL();
- t->TestL();
- CleanupStack::PopAndDestroy(t);
- }
+CTTagmaImpStep::CTTagmaImpStep()
+ {
+
+ }
-TInt E32Main()
- {
- CTrapCleanup* theCleanup =CTrapCleanup::New();
- test.Title();
- TRAPD(err, RunTestsL());
- test.Close();
- delete theCleanup;
- return err;
- }
+TVerdict CTTagmaImpStep::doTestStepL()
+ {
+ SetTestStepResult(EPass);
+ TestStep = this;
+
+ TESTPRINT(_L("Tagma internals tests"));
+ CTagmaImpTest* t = new(ELeave) CTagmaImpTest(this);
+ CleanupStack::PushL(t);
+ t->ConstructL();
+ t->TestL();
+ CleanupStack::PopAndDestroy(t);
+
+ return TestStepResult();
+ }
+
+