sl@0: // Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: #include "CDelimitedPathSegmentTest.h" sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: #include "TDelimitedDataCommon.h" sl@0: #include "DelimitedPathSegmentTests.h" sl@0: sl@0: // Constants sl@0: // sl@0: _LIT(KTitle16Bit, "%S (16-Bit)"); sl@0: _LIT(KTitle8Bit, "%S (8-Bit)"); sl@0: sl@0: CDelimitedPathSegmentTest* CDelimitedPathSegmentTest::NewLC(CIpuTestHarness* aTestHarness) sl@0: { sl@0: CDelimitedPathSegmentTest* self = new (ELeave) CDelimitedPathSegmentTest(aTestHarness); sl@0: CleanupStack::PushL(self); sl@0: self->ConstructL(); sl@0: return self; sl@0: } sl@0: sl@0: CDelimitedPathSegmentTest* CDelimitedPathSegmentTest::NewL(CIpuTestHarness* aTestHarness) sl@0: { sl@0: CDelimitedPathSegmentTest* self = CDelimitedPathSegmentTest::NewLC(aTestHarness); sl@0: CleanupStack::Pop(self); sl@0: return self; sl@0: } sl@0: sl@0: CDelimitedPathSegmentTest::CDelimitedPathSegmentTest(CIpuTestHarness* aTestHarness) sl@0: : iTestHarness(aTestHarness) sl@0: { sl@0: } sl@0: sl@0: void CDelimitedPathSegmentTest::ConstructL() sl@0: { sl@0: } sl@0: sl@0: CDelimitedPathSegmentTest::~CDelimitedPathSegmentTest() sl@0: { sl@0: } sl@0: sl@0: void CDelimitedPathSegmentTest::DoTestsL() sl@0: { sl@0: // sl@0: // sl@0: // Delimited PathSegment Tests sl@0: // sl@0: // sl@0: sl@0: TestDelimitedPathSegmentExtractionL(KPathSegmentParse0, &KPathSegmentParse0Seg0(), &KPathSegmentParse0Seg1(), sl@0: &KPathSegmentParse0Seg2(), NULL); sl@0: TestDelimitedPathSegmentExtractionL(KPathSegmentParse1, &KPathSegmentParse1Seg0(), &KPathSegmentParse1Seg1(), &KPathSegmentParse1Seg2(), sl@0: &KPathSegmentParse1Seg3(), NULL); sl@0: TestDelimitedPathSegmentExtractionL(KPathSegmentParse2, &KPathSegmentParse2Seg0(), &KPathSegmentParse2Seg1(), &KPathSegmentParse2Seg2(), sl@0: &KPathSegmentParse2Seg3(), &KPathSegmentParse2Seg4(), &KPathSegmentParse2Seg5(), &KPathSegmentParse2Seg6(), sl@0: &KPathSegmentParse2Seg7(), NULL); sl@0: sl@0: TestDelimitedPathSegmentReverseExtractionL(KPathSegmentParse0, &KPathSegmentParse0Seg2(), sl@0: &KPathSegmentParse0Seg1(), &KPathSegmentParse0Seg0(), NULL); sl@0: TestDelimitedPathSegmentReverseExtractionL(KPathSegmentParse1, &KPathSegmentParse1Seg3(), &KPathSegmentParse1Seg2(), sl@0: &KPathSegmentParse1Seg1(), &KPathSegmentParse1Seg0(), NULL); sl@0: TestDelimitedPathSegmentReverseExtractionL(KPathSegmentParse2, &KPathSegmentParse2Seg7(), &KPathSegmentParse2Seg6(), sl@0: &KPathSegmentParse2Seg5(), &KPathSegmentParse2Seg4(), &KPathSegmentParse2Seg3(), sl@0: &KPathSegmentParse2Seg2(), &KPathSegmentParse2Seg1(), &KPathSegmentParse2Seg0(), NULL); sl@0: sl@0: TestDelimitedPathSegmentDelimiterPresenceL(KPathSegment_DelimPresence0, KPathSegment_FrontDelim0, KPathSegment_BackDelim0); sl@0: TestDelimitedPathSegmentDelimiterPresenceL(KPathSegment_DelimPresence1, KPathSegment_FrontDelim1, KPathSegment_BackDelim1); sl@0: TestDelimitedPathSegmentDelimiterPresenceL(KPathSegment_DelimPresence2, KPathSegment_FrontDelim2, KPathSegment_BackDelim2); sl@0: TestDelimitedPathSegmentDelimiterPresenceL(KPathSegment_DelimPresence3, KPathSegment_FrontDelim3, KPathSegment_BackDelim3); sl@0: sl@0: TestDelimitedPathSegmentRemainderL(KPathSegment_Rem_Forwards0_0, &KPathSegment_Rem_Forwards0_0(), &KPathSegment_Rem_Forwards0_1(), sl@0: &KPathSegment_Rem_Forwards0_2(), &KPathSegment_Rem_Forwards0_3(), NULL); sl@0: sl@0: TestDelimitedPathSegmentRemainderReverseL(KPathSegment_Rem_Backwards0_0, &KPathSegment_Rem_Backwards0_0(), &KPathSegment_Rem_Backwards0_1(), sl@0: &KPathSegment_Rem_Backwards0_2(), &KPathSegment_Rem_Backwards0_3(), NULL); sl@0: sl@0: TestDelimitedPathSegmentDesL(KPathSegment_Des0); sl@0: sl@0: TestDelimitedPathSegmentPushFrontL(KPathSegment_PushPopFront0_0, &KPathSegment_Push0_a(), &KPathSegment_PushPopFront0_1(), sl@0: &KPathSegment_Push0_b(), &KPathSegment_PushPopFront0_2(), sl@0: &KPathSegment_Push0_c(), &KPathSegment_PushPopFront0_3(), sl@0: &KPathSegment_Push0_d(), &KPathSegment_PushPopFront0_4(), sl@0: &KPathSegment_Push0_e(), &KPathSegment_PushPopFront0_5(), NULL, NULL); sl@0: sl@0: TestDelimitedPathSegmentPushBackL(KPathSegment_PushPopBack0_0, &KPathSegment_Push0_a(), &KPathSegment_PushPopBack0_1(), sl@0: &KPathSegment_Push0_b(), &KPathSegment_PushPopBack0_2(), sl@0: &KPathSegment_Push0_c(), &KPathSegment_PushPopBack0_3(), sl@0: &KPathSegment_Push0_d(), &KPathSegment_PushPopBack0_4(), sl@0: &KPathSegment_Push0_e(), &KPathSegment_PushPopBack0_5(), NULL, NULL); sl@0: sl@0: TestDelimitedPathSegmentPopFrontL(KPathSegment_PushPopFront0_5, &KPathSegment_PushPopFront0_4(), &KPathSegment_PushPopFront0_3(), sl@0: &KPathSegment_PushPopFront0_2(), &KPathSegment_PushPopFront0_1(), &KPathSegment_PushPopFront0_0(), NULL); sl@0: sl@0: TestDelimitedPathSegmentPopBackL(KPathSegment_PushPopBack0_5, &KPathSegment_PushPopBack0_4(), &KPathSegment_PushPopBack0_3(), sl@0: &KPathSegment_PushPopBack0_2(), &KPathSegment_PushPopBack0_1(), &KPathSegment_PushPopBack0_0(), NULL); sl@0: sl@0: TestDelimitedPathSegmentAddAndTrimFrontAndBackDelimiterL(KPathSegment_AddTrimDelim0); sl@0: sl@0: TestDelimitedPathSegmentInsertAndParseL(KPathSegmentInsertForwardsPos0, KPathSegment_InsertForwards0_0, sl@0: &KPathSegment_Insert0_a(), &KPathSegment_InsertForwards0_1(), sl@0: &KPathSegment_Insert0_b(), &KPathSegment_InsertForwards0_2(), sl@0: &KPathSegment_Insert0_c(), &KPathSegment_InsertForwards0_3(), sl@0: &KPathSegment_Insert0_d(), &KPathSegment_InsertForwards0_4(), sl@0: &KPathSegment_Insert0_e(), &KPathSegment_InsertForwards0_5(), NULL, NULL); sl@0: sl@0: TestDelimitedPathSegmentRemoveAndParseL(KPathSegmentRemoveForwardsPos0, KPathSegment_RemoveForwards0_0, sl@0: &KPathSegment_RemoveForwards0_1(), &KPathSegment_RemoveForwards0_2(), sl@0: &KPathSegment_RemoveForwards0_3(), &KPathSegment_RemoveForwards0_4(), sl@0: &KPathSegment_RemoveForwards0_5(), NULL); sl@0: sl@0: TestDelimitedPathSegmentInsertAndParseReverseL(KPathSegmentInsertBackwardsPos0, KPathSegment_InsertBackwards0_0, sl@0: &KPathSegment_Insert0_a(), &KPathSegment_InsertBackwards0_1(), sl@0: &KPathSegment_Insert0_b(), &KPathSegment_InsertBackwards0_2(), sl@0: &KPathSegment_Insert0_c(), &KPathSegment_InsertBackwards0_3(), sl@0: &KPathSegment_Insert0_d(), &KPathSegment_InsertBackwards0_4(), sl@0: &KPathSegment_Insert0_e(), &KPathSegment_InsertBackwards0_5(), NULL, NULL); sl@0: sl@0: TestDelimitedPathSegmentRemoveAndParseReverseL(KPathSegmentRemoveBackwardsPos0, KPathSegment_RemoveBackwards0_0, sl@0: &KPathSegment_RemoveBackwards0_1(), &KPathSegment_RemoveBackwards0_2(), sl@0: &KPathSegment_RemoveBackwards0_3(), &KPathSegment_RemoveBackwards0_4(), sl@0: &KPathSegment_RemoveBackwards0_5(), NULL); sl@0: sl@0: TestDelimitedPathSegmentInsertEscapeAndParseL(KPathSegmentInsertEscapeForwardsPos0, KPathSegment_InsertEscapeForwards0_0, sl@0: &KPathSegment_InsertEscape0_a(), &KPathSegment_InsertEscapeForwards0_1(), sl@0: &KPathSegment_InsertEscape0_b(), &KPathSegment_InsertEscapeForwards0_2(), sl@0: &KPathSegment_InsertEscape0_c(), &KPathSegment_InsertEscapeForwards0_3(), sl@0: &KPathSegment_InsertEscape0_d(), &KPathSegment_InsertEscapeForwards0_4(), sl@0: &KPathSegment_InsertEscape0_e(), &KPathSegment_InsertEscapeForwards0_5(), NULL, NULL); sl@0: sl@0: TestDelimitedPathSegmentInsertEscapeAndParseReverseL(KPathSegmentInsertEscapeBackwardsPos0, KPathSegment_InsertEscapeBackwards0_0, sl@0: &KPathSegment_InsertEscape0_a(), &KPathSegment_InsertEscapeBackwards0_1(), sl@0: &KPathSegment_InsertEscape0_b(), &KPathSegment_InsertEscapeBackwards0_2(), sl@0: &KPathSegment_InsertEscape0_c(), &KPathSegment_InsertEscapeBackwards0_3(), sl@0: &KPathSegment_InsertEscape0_d(), &KPathSegment_InsertEscapeBackwards0_4(), sl@0: &KPathSegment_InsertEscape0_e(), &KPathSegment_InsertEscapeBackwards0_5(), NULL, NULL); sl@0: sl@0: TestDelimitedPathSegmentPushAndEscapeFrontL(KPathSegment_PushEscapeFront0_0, &KPathSegment_PushEscape0_a(), &KPathSegment_PushEscapeFront0_1(), sl@0: &KPathSegment_PushEscape0_b(), &KPathSegment_PushEscapeFront0_2(), sl@0: &KPathSegment_PushEscape0_c(), &KPathSegment_PushEscapeFront0_3(), sl@0: &KPathSegment_PushEscape0_d(), &KPathSegment_PushEscapeFront0_4(), sl@0: &KPathSegment_PushEscape0_e(), &KPathSegment_PushEscapeFront0_5(), NULL, NULL); sl@0: sl@0: TestDelimitedPathSegmentPushAndEscapeBackL(KPathSegment_PushEscapeBack0_0, &KPathSegment_PushEscape0_a(), &KPathSegment_PushEscapeBack0_1(), sl@0: &KPathSegment_PushEscape0_b(), &KPathSegment_PushEscapeBack0_2(), sl@0: &KPathSegment_PushEscape0_c(), &KPathSegment_PushEscapeBack0_3(), sl@0: &KPathSegment_PushEscape0_d(), &KPathSegment_PushEscapeBack0_4(), sl@0: &KPathSegment_PushEscape0_e(), &KPathSegment_PushEscapeBack0_5(), NULL, NULL); sl@0: } sl@0: sl@0: // sl@0: // sl@0: // Delimited PathSegment tests sl@0: // sl@0: // sl@0: sl@0: void CDelimitedPathSegmentTest::TestDelimitedPathSegmentExtractionL(TRefByValue aPath, ...) const sl@0: { sl@0: VA_LIST list1; VA_START(list1, aPath); sl@0: VA_LIST list2; VA_START(list2, aPath); sl@0: const TDesC& path = aPath; sl@0: sl@0: TestDelimitedDataExtractionL(_L("Test TDelimitedPathSegmentParser Parse : GetNext, Dec, Inc, Peek and Eos"), iTestHarness, path, list1, list2); sl@0: VA_END(list1); VA_END(list2); sl@0: } sl@0: sl@0: void CDelimitedPathSegmentTest::TestDelimitedPathSegmentReverseExtractionL(TRefByValue aPath, ...) const sl@0: { sl@0: VA_LIST list1; VA_START(list1, aPath); sl@0: VA_LIST list2; VA_START(list2, aPath); sl@0: const TDesC& path = aPath; sl@0: sl@0: TestDelimitedDataReverseExtractionL(_L("Test TDelimitedPathSegmentParser ParseReverse : GetNext, Dec, Inc, Peek and Eos"), iTestHarness, path, list1, list2); sl@0: VA_END(list1); VA_END(list2); sl@0: } sl@0: sl@0: void CDelimitedPathSegmentTest::TestDelimitedPathSegmentDelimiterPresenceL(const TDesC& aPath, TBool aFrontDelim, TBool aBackDelim) const sl@0: { sl@0: TestDelimitedDataDelimiterPresenceL(_L("Test TDelimitedPathSegmentParser Delimiter Presence"), iTestHarness, aPath, aFrontDelim, aBackDelim); sl@0: } sl@0: sl@0: void CDelimitedPathSegmentTest::TestDelimitedPathSegmentRemainderL(TRefByValue aPath, ...) const sl@0: { sl@0: VA_LIST list1; VA_START(list1, aPath); sl@0: VA_LIST list2; VA_START(list2, aPath); sl@0: const TDesC& path = aPath; sl@0: sl@0: TestDelimitedDataRemainderL(_L("Test TDelimitedPathSegmentParser Remainder, Parse"), iTestHarness, path, list1, list2); sl@0: VA_END(list1); VA_END(list2); sl@0: } sl@0: sl@0: void CDelimitedPathSegmentTest::TestDelimitedPathSegmentRemainderReverseL(TRefByValue aPath, ...) const sl@0: { sl@0: VA_LIST list1; VA_START(list1, aPath); sl@0: VA_LIST list2; VA_START(list2, aPath); sl@0: const TDesC& path = aPath; sl@0: sl@0: TestDelimitedDataRemainderReverseL(_L("Test TDelimitedPathSegmentParser Remainder, ParseReverse"), iTestHarness, path, list1, list2); sl@0: VA_END(list1); VA_END(list2); sl@0: } sl@0: sl@0: void CDelimitedPathSegmentTest::TestDelimitedPathSegmentDesL(const TDesC& aPath) const sl@0: { sl@0: TestDelimitedDataDesL(_L("Test TDelimitedPathSegmentParser Des"), iTestHarness, aPath); sl@0: } sl@0: sl@0: void CDelimitedPathSegmentTest::TestDelimitedPathSegmentPushFrontL(TRefByValue aPath, ...) const sl@0: { sl@0: VA_LIST list1; VA_START(list1, aPath); sl@0: VA_LIST list2; VA_START(list2, aPath); sl@0: const TDesC& path = aPath; sl@0: sl@0: TestDelimitedDataPushFrontL(_L("Test CDelimitedPathSegment PushFront"), iTestHarness, path, list1, list2); sl@0: VA_END(list1); sl@0: VA_END(list2); sl@0: } sl@0: sl@0: void CDelimitedPathSegmentTest::TestDelimitedPathSegmentPushBackL(TRefByValue aPath, ...) const sl@0: { sl@0: VA_LIST list1; VA_START(list1, aPath); sl@0: VA_LIST list2; VA_START(list2, aPath); sl@0: const TDesC& path = aPath; sl@0: sl@0: TestDelimitedDataPushBackL(_L("Test CDelimitedPathSegment PushBack"), iTestHarness, path, list1, list2); sl@0: VA_END(list1); VA_END(list2); sl@0: } sl@0: sl@0: void CDelimitedPathSegmentTest::TestDelimitedPathSegmentPopFrontL(TRefByValue aPath, ...) const sl@0: { sl@0: VA_LIST list1; VA_START(list1, aPath); sl@0: VA_LIST list2; VA_START(list2, aPath); sl@0: const TDesC& path = aPath; sl@0: sl@0: TestDelimitedDataPopFrontL(_L("Test CDelimitedPathSegment PopFront"), iTestHarness, path, list1, list2); sl@0: VA_END(list1); VA_END(list2); sl@0: } sl@0: sl@0: void CDelimitedPathSegmentTest::TestDelimitedPathSegmentPopBackL(TRefByValue aPath, ...) const sl@0: { sl@0: VA_LIST list1; VA_START(list1, aPath); sl@0: VA_LIST list2; VA_START(list2, aPath); sl@0: const TDesC& path = aPath; sl@0: sl@0: TestDelimitedDataPopBackL(_L("Test CDelimitedPathSegment PopBack"), iTestHarness, path, list1, list2); sl@0: VA_END(list1); VA_END(list2); sl@0: } sl@0: sl@0: void CDelimitedPathSegmentTest::TestDelimitedPathSegmentAddAndTrimFrontAndBackDelimiterL(const TDesC& aPath) const sl@0: { sl@0: TestDelimitedDataAddAndTrimFrontAndBackDelimiterL(_L("Test CDelimitedPathSegment Add and Trim Front and Back delimiter"), iTestHarness, aPath); sl@0: } sl@0: sl@0: void CDelimitedPathSegmentTest::TestDelimitedPathSegmentInsertAndParseL(TInt aStartPos, TRefByValue aPath, ...) const sl@0: { sl@0: VA_LIST list1; VA_START(list1, aPath); sl@0: VA_LIST list2; VA_START(list2, aPath); sl@0: const TDesC& path = aPath; sl@0: sl@0: TestDelimitedDataInsertAndParseL(_L("Test CDelimitedPathSegment InsertCurrent, Parse"), iTestHarness, path, list1, list2, aStartPos); sl@0: VA_END(list1); VA_END(list2); sl@0: } sl@0: sl@0: void CDelimitedPathSegmentTest::TestDelimitedPathSegmentRemoveAndParseL(TInt aStartPos, TRefByValue aPath, ...) const sl@0: { sl@0: VA_LIST list1; VA_START(list1, aPath); sl@0: VA_LIST list2; VA_START(list2, aPath); sl@0: const TDesC& path = aPath; sl@0: sl@0: TestDelimitedDataRemoveAndParseL(_L("Test CDelimitedPathSegment RemoveCurrent, Parse"), iTestHarness, path, list1, list2, aStartPos); sl@0: VA_END(list1); VA_END(list2); sl@0: } sl@0: sl@0: void CDelimitedPathSegmentTest::TestDelimitedPathSegmentInsertAndParseReverseL(TInt aStartPos, TRefByValue aPath, ...) const sl@0: { sl@0: VA_LIST list1; VA_START(list1, aPath); sl@0: VA_LIST list2; VA_START(list2, aPath); sl@0: const TDesC& path = aPath; sl@0: sl@0: TestDelimitedDataInsertAndParseReverseL(_L("Test CDelimitedPathSegment InsertCurrent, ParseReverse"), iTestHarness, path, list1, list2, aStartPos); sl@0: VA_END(list1); VA_END(list2); sl@0: } sl@0: sl@0: void CDelimitedPathSegmentTest::TestDelimitedPathSegmentRemoveAndParseReverseL(TInt aStartPos, TRefByValue aPath, ...) const sl@0: { sl@0: VA_LIST list1; VA_START(list1, aPath); sl@0: VA_LIST list2; VA_START(list2, aPath); sl@0: const TDesC& path = aPath; sl@0: sl@0: TestDelimitedDataRemoveAndParseReverseL(_L("Test CDelimitedPathSegment RemoveCurrent, ParseReverse"), iTestHarness, path, list1, list2, aStartPos); sl@0: VA_END(list1); VA_END(list2); sl@0: } sl@0: sl@0: void CDelimitedPathSegmentTest::TestDelimitedPathSegmentInsertEscapeAndParseL(TInt aStartPos, TRefByValue aPath, ...) const sl@0: { sl@0: VA_LIST list1; VA_START(list1, aPath); sl@0: VA_LIST list2; VA_START(list2, aPath); sl@0: const TDesC& path = aPath; sl@0: sl@0: TestDelimitedDataInsertEscapeAndParseL(_L("Test CDelimitedPathSegment InsertAndEscapeCurrent, Parse"), iTestHarness, path, list1, list2, aStartPos); sl@0: VA_END(list1); VA_END(list2); sl@0: } sl@0: sl@0: void CDelimitedPathSegmentTest::TestDelimitedPathSegmentInsertEscapeAndParseReverseL(TInt aStartPos, TRefByValue aPath, ...) const sl@0: { sl@0: VA_LIST list1; VA_START(list1, aPath); sl@0: VA_LIST list2; VA_START(list2, aPath); sl@0: const TDesC& path = aPath; sl@0: sl@0: TestDelimitedDataInsertEscapeAndParseReverseL(_L("Test CDelimitedPathSegment InsertAndEscapeCurrent, ParseReverse"), iTestHarness, path, list1, list2, aStartPos); sl@0: VA_END(list1); VA_END(list2); sl@0: } sl@0: sl@0: void CDelimitedPathSegmentTest::TestDelimitedPathSegmentPushAndEscapeFrontL(TRefByValue aPath, ...) const sl@0: { sl@0: VA_LIST list1; VA_START(list1, aPath); sl@0: VA_LIST list2; VA_START(list2, aPath); sl@0: const TDesC& path = aPath; sl@0: sl@0: TestDelimitedDataPushAndEscapeFrontL(_L("Test CDelimitedPathSegment PushAndEscapeFront"), iTestHarness, path, list1, list2); sl@0: VA_END(list1); VA_END(list2); sl@0: } sl@0: sl@0: void CDelimitedPathSegmentTest::TestDelimitedPathSegmentPushAndEscapeBackL(TRefByValue aPath, ...) const sl@0: { sl@0: VA_LIST list1; VA_START(list1, aPath); sl@0: VA_LIST list2; VA_START(list2, aPath); sl@0: const TDesC& path = aPath; sl@0: sl@0: TestDelimitedDataPushAndEscapeBackL(_L("Test CDelimitedPathSegment PushAndEscapeBack"), iTestHarness, path, list1, list2); sl@0: VA_END(list1); VA_END(list2); sl@0: } sl@0: // sl@0: // sl@0: // Implementation of LOCAL functions - test funcions sl@0: // sl@0: // sl@0: sl@0: void TestDelimitedDataExtractionL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness, sl@0: const TDesC& aData, VA_LIST& aList1, VA_LIST& aList2) { sl@0: // Create title sl@0: HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length()); sl@0: title16Bit->Des().Format(KTitle16Bit, &aTestTitle); sl@0: aTestHarness->StartTestL(*title16Bit); sl@0: sl@0: // Create TDelimitedPathSegmentParser object and do parsing sl@0: TDelimitedPathSegmentParser16 parser16Bit; sl@0: parser16Bit.Parse(aData); sl@0: sl@0: TInt error = DoDelimitedDataParsingL(parser16Bit, aList1); sl@0: sl@0: CleanupStack::PopAndDestroy(title16Bit); // title16Bit sl@0: aTestHarness->EndTest(error); sl@0: sl@0: // Make 8-bit copy sl@0: HBufC8* dataBuf = HBufC8::NewLC(aData.Length()); sl@0: TPtr8 data8Bit = dataBuf->Des(); sl@0: data8Bit.Copy(aData); sl@0: sl@0: HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length()); sl@0: title8Bit->Des().Format(KTitle8Bit, &aTestTitle); sl@0: aTestHarness->StartTestL(*title8Bit); sl@0: sl@0: // Create TDelimitedPathSegmentParser object and do parsing sl@0: TDelimitedPathSegmentParser8 parser8Bit; sl@0: parser8Bit.Parse(data8Bit); sl@0: sl@0: error = DoDelimitedDataParsingL(parser8Bit, aList2); sl@0: sl@0: aTestHarness->EndTest(error); sl@0: CleanupStack::PopAndDestroy(2, dataBuf); // dataBuf, title8Bit sl@0: } sl@0: sl@0: void TestDelimitedDataReverseExtractionL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness, sl@0: const TDesC& aData, VA_LIST& aList1, VA_LIST& aList2) sl@0: { sl@0: // Create title sl@0: HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length()); sl@0: title16Bit->Des().Format(KTitle16Bit, &aTestTitle); sl@0: aTestHarness->StartTestL(*title16Bit); sl@0: sl@0: // Create TDelimitedPathSegmentParser object and do parsing sl@0: TDelimitedPathSegmentParser16 parser16Bit; sl@0: parser16Bit.ParseReverse(aData); sl@0: sl@0: TInt error = DoDelimitedDataParsingL(parser16Bit, aList1); sl@0: sl@0: CleanupStack::PopAndDestroy(title16Bit); // title16Bit sl@0: aTestHarness->EndTest(error); sl@0: sl@0: // Make 8-bit copy sl@0: HBufC8* dataBuf = HBufC8::NewLC(aData.Length()); sl@0: TPtr8 data8Bit = dataBuf->Des(); sl@0: data8Bit.Copy(aData); sl@0: sl@0: // Create title sl@0: HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length()); sl@0: title8Bit->Des().Format(KTitle8Bit, &aTestTitle); sl@0: aTestHarness->StartTestL(*title8Bit); sl@0: sl@0: // Create TDelimitedPathSegmentParser object and do parsing sl@0: TDelimitedPathSegmentParser8 parser8Bit; sl@0: parser8Bit.ParseReverse(data8Bit); sl@0: sl@0: error = DoDelimitedDataParsingL(parser8Bit, aList2); sl@0: sl@0: aTestHarness->EndTest(error); sl@0: CleanupStack::PopAndDestroy(2, dataBuf); // dataBuf, title8Bit sl@0: } sl@0: sl@0: void TestDelimitedDataDelimiterPresenceL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness, sl@0: const TDesC& aData, TBool aFrontDelim, TBool aBackDelim) sl@0: { sl@0: // Create title sl@0: HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length()); sl@0: title16Bit->Des().Format(KTitle16Bit, &aTestTitle); sl@0: aTestHarness->StartTestL(*title16Bit); sl@0: sl@0: // Create TDelimitedPathSegmentParser object sl@0: TDelimitedPathSegmentParser16 parser16Bit; sl@0: parser16Bit.Parse(aData); sl@0: TInt error = DoDelimiterPresenceTest(parser16Bit, aFrontDelim, aBackDelim); sl@0: sl@0: CleanupStack::PopAndDestroy(title16Bit); // title16Bit sl@0: aTestHarness->EndTest(error); sl@0: sl@0: // Make 8-bit copy sl@0: HBufC8* dataBuf = HBufC8::NewLC(aData.Length()); sl@0: TPtr8 data8Bit = dataBuf->Des(); sl@0: data8Bit.Copy(aData); sl@0: sl@0: // Create title sl@0: HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length()); sl@0: title8Bit->Des().Format(KTitle8Bit, &aTestTitle); sl@0: aTestHarness->StartTestL(*title8Bit); sl@0: sl@0: // Create TDelimitedPathSegmentParser object sl@0: TDelimitedPathSegmentParser8 parser8Bit; sl@0: parser8Bit.Parse(data8Bit); sl@0: error = DoDelimiterPresenceTest(parser8Bit, aFrontDelim, aBackDelim); sl@0: sl@0: aTestHarness->EndTest(error); sl@0: CleanupStack::PopAndDestroy(2, dataBuf); // dataBuf, title8Bit sl@0: } sl@0: sl@0: void TestDelimitedDataRemainderL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness, sl@0: const TDesC& aData, VA_LIST& aList1, VA_LIST& aList2) sl@0: { sl@0: // Create title sl@0: HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length()); sl@0: title16Bit->Des().Format(KTitle16Bit, &aTestTitle); sl@0: aTestHarness->StartTestL(*title16Bit); sl@0: sl@0: // Create TDelimiteddataParser object and do parsing sl@0: TDelimitedPathSegmentParser16 parser16Bit; sl@0: parser16Bit.Parse(aData); sl@0: sl@0: TInt error = DoDelimitedDataRemainderTestL(parser16Bit, aList1); sl@0: sl@0: CleanupStack::PopAndDestroy(title16Bit); // title16Bit sl@0: aTestHarness->EndTest(error); sl@0: sl@0: // Make 8-bit copy sl@0: HBufC8* dataBuf = HBufC8::NewLC(aData.Length()); sl@0: TPtr8 data8Bit = dataBuf->Des(); sl@0: data8Bit.Copy(aData); sl@0: sl@0: // Create title sl@0: HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length()); sl@0: title8Bit->Des().Format(KTitle8Bit, &aTestTitle); sl@0: aTestHarness->StartTestL(*title8Bit); sl@0: sl@0: // Create TDelimiteddataParser object and do parsing sl@0: TDelimitedPathSegmentParser8 parser8Bit; sl@0: parser8Bit.Parse(data8Bit); sl@0: sl@0: error = DoDelimitedDataRemainderTestL(parser8Bit, aList2); sl@0: sl@0: aTestHarness->EndTest(error); sl@0: CleanupStack::PopAndDestroy(2, dataBuf); // dataBuf, title8Bit sl@0: } sl@0: sl@0: void TestDelimitedDataRemainderReverseL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness, sl@0: const TDesC& aData, VA_LIST& aList1, VA_LIST& aList2) sl@0: { sl@0: // Create title sl@0: HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length()); sl@0: title16Bit->Des().Format(KTitle16Bit, &aTestTitle); sl@0: aTestHarness->StartTestL(*title16Bit); sl@0: sl@0: // Create TDelimitedPathSegmentParser object and do parsing sl@0: TDelimitedPathSegmentParser16 parser16Bit; sl@0: parser16Bit.ParseReverse(aData); sl@0: sl@0: TInt error = DoDelimitedDataRemainderTestL(parser16Bit, aList1); sl@0: sl@0: CleanupStack::PopAndDestroy(title16Bit); // title16Bit sl@0: aTestHarness->EndTest(error); sl@0: sl@0: // Make 8-bit copy sl@0: HBufC8* dataBuf = HBufC8::NewLC(aData.Length()); sl@0: TPtr8 data8Bit = dataBuf->Des(); sl@0: data8Bit.Copy(aData); sl@0: sl@0: // Create title sl@0: HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length()); sl@0: title8Bit->Des().Format(KTitle8Bit, &aTestTitle); sl@0: aTestHarness->StartTestL(*title8Bit); sl@0: sl@0: // Create TDelimitedPathSegmentParser object and do parsing sl@0: TDelimitedPathSegmentParser8 parser8Bit; sl@0: parser8Bit.ParseReverse(data8Bit); sl@0: sl@0: error = DoDelimitedDataRemainderTestL(parser8Bit, aList2); sl@0: sl@0: aTestHarness->EndTest(error); sl@0: CleanupStack::PopAndDestroy(2, dataBuf); // dataBuf, title8Bit sl@0: } sl@0: sl@0: void TestDelimitedDataDesL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness, const TDesC& aData) sl@0: { sl@0: // Create title sl@0: HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length()); sl@0: title16Bit->Des().Format(KTitle16Bit, &aTestTitle); sl@0: aTestHarness->StartTestL(*title16Bit); sl@0: sl@0: // Create TDelimitedPathSegmentParser object and do parsing sl@0: TDelimitedPathSegmentParser16 parser16Bit; sl@0: parser16Bit.Parse(aData); sl@0: sl@0: TInt error = DoDelimitedDataDes(parser16Bit, aData); sl@0: sl@0: CleanupStack::PopAndDestroy(title16Bit); // title16Bit sl@0: aTestHarness->EndTest(error); sl@0: sl@0: // Make 8-bit copy sl@0: HBufC8* dataBuf = HBufC8::NewLC(aData.Length()); sl@0: TPtr8 data8Bit = dataBuf->Des(); sl@0: data8Bit.Copy(aData); sl@0: sl@0: // Create title sl@0: HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length()); sl@0: title8Bit->Des().Format(KTitle8Bit, &aTestTitle); sl@0: aTestHarness->StartTestL(*title8Bit); sl@0: sl@0: // Create TDelimitedPathSegmentParser object and do parsing sl@0: TDelimitedPathSegmentParser8 parser8Bit; sl@0: parser8Bit.Parse(data8Bit); sl@0: sl@0: error = DoDelimitedDataDes(parser8Bit, data8Bit); sl@0: sl@0: aTestHarness->EndTest(error); sl@0: CleanupStack::PopAndDestroy(2, dataBuf); // dataBuf, title8Bit sl@0: } sl@0: sl@0: void TestDelimitedDataPushFrontL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness, sl@0: const TDesC& aData, VA_LIST& aList1, VA_LIST& aList2) sl@0: { sl@0: // Create title sl@0: HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length()); sl@0: title16Bit->Des().Format(KTitle16Bit, &aTestTitle); sl@0: aTestHarness->StartTestL(*title16Bit); sl@0: sl@0: // Create TDelimitedPathSegmentParser object and do parsing sl@0: CDelimitedPathSegment16* data16Bit = CDelimitedPathSegment16::NewL(aData); // Also excersies NewLC() sl@0: CleanupStack::PushL(data16Bit); sl@0: sl@0: TInt error = DoDelimitedDataPushFrontL(data16Bit, aList1); sl@0: sl@0: CleanupStack::PopAndDestroy(2, title16Bit); // title16Bit, data16Bit sl@0: aTestHarness->EndTest(error); sl@0: sl@0: // Make 8-bit copy sl@0: HBufC8* dataBuf = HBufC8::NewLC(aData.Length()); sl@0: TPtr8 initData8Bit = dataBuf->Des(); sl@0: initData8Bit.Copy(aData); sl@0: sl@0: // Create title sl@0: HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length()); sl@0: title8Bit->Des().Format(KTitle8Bit, &aTestTitle); sl@0: aTestHarness->StartTestL(*title8Bit); sl@0: sl@0: // Create TDelimitedPathSegmentParser object and do parsing sl@0: CDelimitedPathSegment8* data8Bit = CDelimitedPathSegment8::NewL(initData8Bit); // Also excersies NewLC() sl@0: CleanupStack::PushL(data8Bit); sl@0: sl@0: error = DoDelimitedDataPushFrontL(data8Bit, aList2); sl@0: sl@0: aTestHarness->EndTest(error); sl@0: CleanupStack::PopAndDestroy(3, dataBuf); // dataBuf, title8Bit, data8Bit sl@0: } sl@0: sl@0: void TestDelimitedDataPushAndEscapeFrontL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness, sl@0: const TDesC& aData, VA_LIST& aList1, VA_LIST& aList2) sl@0: { sl@0: // Create title sl@0: HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length()); sl@0: title16Bit->Des().Format(KTitle16Bit, &aTestTitle); sl@0: aTestHarness->StartTestL(*title16Bit); sl@0: sl@0: // Create TDelimitedPathSegmentParser object and do parsing sl@0: CDelimitedPathSegment16* data16Bit = CDelimitedPathSegment16::NewL(aData); // Also excersies NewLC() sl@0: CleanupStack::PushL(data16Bit); sl@0: sl@0: TInt error = DoDelimitedDataPushAndEscapeFrontL(data16Bit, aList1); sl@0: sl@0: CleanupStack::PopAndDestroy(2, title16Bit); // title16Bit, data16Bit sl@0: aTestHarness->EndTest(error); sl@0: sl@0: // Make 8-bit copy sl@0: HBufC8* dataBuf = HBufC8::NewLC(aData.Length()); sl@0: TPtr8 initData8Bit = dataBuf->Des(); sl@0: initData8Bit.Copy(aData); sl@0: sl@0: // Create title sl@0: HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length()); sl@0: title8Bit->Des().Format(KTitle8Bit, &aTestTitle); sl@0: aTestHarness->StartTestL(*title8Bit); sl@0: sl@0: // Create TDelimitedPathSegmentParser object and do parsing sl@0: CDelimitedPathSegment8* data8Bit = CDelimitedPathSegment8::NewL(initData8Bit); // Also excersies NewLC() sl@0: CleanupStack::PushL(data8Bit); sl@0: sl@0: error = DoDelimitedDataPushAndEscapeFrontL(data8Bit, aList2); sl@0: sl@0: aTestHarness->EndTest(error); sl@0: CleanupStack::PopAndDestroy(3, dataBuf); // dataBuf, title8Bit, data8Bit sl@0: } sl@0: sl@0: void TestDelimitedDataPushBackL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness, sl@0: const TDesC& aData, VA_LIST& aList1, VA_LIST& aList2) sl@0: { sl@0: // Create title sl@0: HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length()); sl@0: title16Bit->Des().Format(KTitle16Bit, &aTestTitle); sl@0: aTestHarness->StartTestL(*title16Bit); sl@0: sl@0: // Create TDelimitedPathSegmentParser object and do parsing sl@0: CDelimitedPathSegment16* data16Bit = CDelimitedPathSegment16::NewL(aData); // Also excersies NewLC() sl@0: CleanupStack::PushL(data16Bit); sl@0: sl@0: TInt error = DoDelimitedDataPushBackL(data16Bit, aList1); sl@0: sl@0: CleanupStack::PopAndDestroy(2, title16Bit); // title16Bit, data16Bit sl@0: aTestHarness->EndTest(error); sl@0: sl@0: // Make 8-bit copy sl@0: HBufC8* dataBuf = HBufC8::NewLC(aData.Length()); sl@0: TPtr8 initData8Bit = dataBuf->Des(); sl@0: initData8Bit.Copy(aData); sl@0: sl@0: // Create title sl@0: HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length()); sl@0: title8Bit->Des().Format(KTitle8Bit, &aTestTitle); sl@0: aTestHarness->StartTestL(*title8Bit); sl@0: sl@0: // Create TDelimitedPathSegmentParser object and do parsing sl@0: CDelimitedPathSegment8* data8Bit = CDelimitedPathSegment8::NewL(initData8Bit); // Also excersies NewLC() sl@0: CleanupStack::PushL(data8Bit); sl@0: sl@0: error = DoDelimitedDataPushBackL(data8Bit, aList2); sl@0: sl@0: aTestHarness->EndTest(error); sl@0: CleanupStack::PopAndDestroy(3, dataBuf); // dataBuf, title8Bit, data8Bit sl@0: } sl@0: sl@0: void TestDelimitedDataPushAndEscapeBackL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness, sl@0: const TDesC& aData, VA_LIST& aList1, VA_LIST& aList2) sl@0: { sl@0: // Create title sl@0: HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length()); sl@0: title16Bit->Des().Format(KTitle16Bit, &aTestTitle); sl@0: aTestHarness->StartTestL(*title16Bit); sl@0: sl@0: // Create TDelimitedPathSegmentParser object and do parsing sl@0: CDelimitedPathSegment16* data16Bit = CDelimitedPathSegment16::NewL(aData); // Also excersies NewLC() sl@0: CleanupStack::PushL(data16Bit); sl@0: sl@0: TInt error = DoDelimitedDataPushAndEscapeBackL(data16Bit, aList1); sl@0: sl@0: CleanupStack::PopAndDestroy(2, title16Bit); // title16Bit, data16Bit sl@0: aTestHarness->EndTest(error); sl@0: sl@0: // Make 8-bit copy sl@0: HBufC8* dataBuf = HBufC8::NewLC(aData.Length()); sl@0: TPtr8 initData8Bit = dataBuf->Des(); sl@0: initData8Bit.Copy(aData); sl@0: sl@0: // Create title sl@0: HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length()); sl@0: title8Bit->Des().Format(KTitle8Bit, &aTestTitle); sl@0: aTestHarness->StartTestL(*title8Bit); sl@0: sl@0: // Create TDelimitedPathSegmentParser object and do parsing sl@0: CDelimitedPathSegment8* data8Bit = CDelimitedPathSegment8::NewL(initData8Bit); // Also excersies NewLC() sl@0: CleanupStack::PushL(data8Bit); sl@0: sl@0: error = DoDelimitedDataPushAndEscapeBackL(data8Bit, aList2); sl@0: sl@0: aTestHarness->EndTest(error); sl@0: CleanupStack::PopAndDestroy(3, dataBuf); // dataBuf, title8Bit, data8Bit sl@0: } sl@0: sl@0: void TestDelimitedDataPopFrontL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness, sl@0: const TDesC& aData, VA_LIST& aList1, VA_LIST& aList2) sl@0: { sl@0: // Create title sl@0: HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length()); sl@0: title16Bit->Des().Format(KTitle16Bit, &aTestTitle); sl@0: aTestHarness->StartTestL(*title16Bit); sl@0: sl@0: // Create TDelimitedPathSegmentParser object and do parsing sl@0: CDelimitedPathSegment16* data16Bit = CDelimitedPathSegment16::NewL(aData); // Also excersies NewLC() sl@0: CleanupStack::PushL(data16Bit); sl@0: sl@0: TInt error = DoDelimitedDataPopFrontL(data16Bit, aList1); sl@0: sl@0: CleanupStack::PopAndDestroy(2, title16Bit); // title16Bit, data16Bit sl@0: aTestHarness->EndTest(error); sl@0: sl@0: // Make 8-bit copy sl@0: HBufC8* dataBuf = HBufC8::NewLC(aData.Length()); sl@0: TPtr8 initData8Bit = dataBuf->Des(); sl@0: initData8Bit.Copy(aData); sl@0: sl@0: // Create title sl@0: HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length()); sl@0: title8Bit->Des().Format(KTitle8Bit, &aTestTitle); sl@0: aTestHarness->StartTestL(*title8Bit); sl@0: sl@0: // Create TDelimitedPathSegmentParser object and do parsing sl@0: CDelimitedPathSegment8* data8Bit = CDelimitedPathSegment8::NewL(initData8Bit); // Also excersies NewLC() sl@0: CleanupStack::PushL(data8Bit); sl@0: sl@0: error = DoDelimitedDataPopFrontL(data8Bit, aList2); sl@0: sl@0: aTestHarness->EndTest(error); sl@0: CleanupStack::PopAndDestroy(3, dataBuf); // dataBuf, title8Bit, data8Bit sl@0: } sl@0: sl@0: void TestDelimitedDataPopBackL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness, sl@0: const TDesC& aData, VA_LIST& aList1, VA_LIST& aList2) sl@0: { sl@0: // Create title sl@0: HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length()); sl@0: title16Bit->Des().Format(KTitle16Bit, &aTestTitle); sl@0: aTestHarness->StartTestL(*title16Bit); sl@0: sl@0: // Create TDelimitedPathSegmentParser object and do parsing sl@0: CDelimitedPathSegment16* data16Bit = CDelimitedPathSegment16::NewL(aData); // Also excersies NewLC() sl@0: CleanupStack::PushL(data16Bit); sl@0: sl@0: TInt error = DoDelimitedDataPopBackL(data16Bit, aList1); sl@0: sl@0: CleanupStack::PopAndDestroy(2, title16Bit); // title16Bit, data16Bit sl@0: aTestHarness->EndTest(error); sl@0: sl@0: // Make 8-bit copy sl@0: HBufC8* dataBuf = HBufC8::NewLC(aData.Length()); sl@0: TPtr8 initData8Bit = dataBuf->Des(); sl@0: initData8Bit.Copy(aData); sl@0: sl@0: // Create title sl@0: HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length()); sl@0: title8Bit->Des().Format(KTitle8Bit, &aTestTitle); sl@0: aTestHarness->StartTestL(*title8Bit); sl@0: sl@0: // Create TDelimitedPathSegmentParser object and do parsing sl@0: CDelimitedPathSegment8* data8Bit = CDelimitedPathSegment8::NewL(initData8Bit); // Also excersies NewLC() sl@0: CleanupStack::PushL(data8Bit); sl@0: sl@0: error = DoDelimitedDataPopBackL(data8Bit, aList2); sl@0: sl@0: aTestHarness->EndTest(error); sl@0: CleanupStack::PopAndDestroy(3, dataBuf); // dataBuf, title8Bit, data8Bit sl@0: } sl@0: sl@0: void TestDelimitedDataAddAndTrimFrontAndBackDelimiterL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness, const TDesC& aData) sl@0: { sl@0: // Create title sl@0: HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length()); sl@0: title16Bit->Des().Format(KTitle16Bit, &aTestTitle); sl@0: aTestHarness->StartTestL(*title16Bit); sl@0: sl@0: // Create TDelimitedPathSegmentParser object and do parsing sl@0: CDelimitedPathSegment16* data16Bit = CDelimitedPathSegment16::NewL(aData); // Also excersies NewLC() sl@0: CleanupStack::PushL(data16Bit); sl@0: sl@0: TInt error = DoDelimitedDataAddAndTrimFrontAndBackDelimiterL(data16Bit); sl@0: sl@0: CleanupStack::PopAndDestroy(2, title16Bit); // title16Bit, data16Bit sl@0: aTestHarness->EndTest(error); sl@0: sl@0: // Make 8-bit copy sl@0: HBufC8* dataBuf = HBufC8::NewLC(aData.Length()); sl@0: TPtr8 initData8Bit = dataBuf->Des(); sl@0: initData8Bit.Copy(aData); sl@0: sl@0: // Create title sl@0: HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length()); sl@0: title8Bit->Des().Format(KTitle8Bit, &aTestTitle); sl@0: aTestHarness->StartTestL(*title8Bit); sl@0: sl@0: // Create TDelimitedPathSegmentParser object and do parsing sl@0: CDelimitedPathSegment8* data8Bit = CDelimitedPathSegment8::NewL(initData8Bit); // Also excersies NewLC() sl@0: CleanupStack::PushL(data8Bit); sl@0: sl@0: error = DoDelimitedDataAddAndTrimFrontAndBackDelimiterL(data8Bit); sl@0: sl@0: aTestHarness->EndTest(error); sl@0: CleanupStack::PopAndDestroy(3, dataBuf); // dataBuf, title8Bit, data8Bit sl@0: } sl@0: sl@0: void TestDelimitedDataInsertAndParseL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness, sl@0: const TDesC& aData, VA_LIST& aList1, VA_LIST& aList2, TInt aStartPos) sl@0: { sl@0: // Create title sl@0: HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length()); sl@0: title16Bit->Des().Format(KTitle16Bit, &aTestTitle); sl@0: aTestHarness->StartTestL(*title16Bit); sl@0: sl@0: // Create TDelimitedPathSegmentParser object and do parsing sl@0: CDelimitedPathSegment16* data16Bit = CDelimitedPathSegment16::NewL(aData); // Also excersies NewLC() sl@0: CleanupStack::PushL(data16Bit); sl@0: sl@0: // Do initial parse and get to position sl@0: data16Bit->Parse(); sl@0: TInt error = DoDelimitedDataParseToPosition(data16Bit, aStartPos); sl@0: if( error == KErrNone ) sl@0: { sl@0: error = DoDelimitedDataInsertL(data16Bit, aList1); sl@0: } sl@0: CleanupStack::PopAndDestroy(2, title16Bit); // title16Bit, data16Bit sl@0: aTestHarness->EndTest(error); sl@0: sl@0: // Make 8-bit copy sl@0: HBufC8* dataBuf = HBufC8::NewLC(aData.Length()); sl@0: TPtr8 initData8Bit = dataBuf->Des(); sl@0: initData8Bit.Copy(aData); sl@0: sl@0: // Create title sl@0: HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length()); sl@0: title8Bit->Des().Format(KTitle8Bit, &aTestTitle); sl@0: aTestHarness->StartTestL(*title8Bit); sl@0: sl@0: // Create TDelimitedPathSegmentParser object and do parsing sl@0: CDelimitedPathSegment8* data8Bit = CDelimitedPathSegment8::NewL(initData8Bit); // Also excersies NewLC() sl@0: CleanupStack::PushL(data8Bit); sl@0: sl@0: // Do initial parse and get to position sl@0: data8Bit->Parse(); sl@0: error = DoDelimitedDataParseToPosition(data8Bit, aStartPos); sl@0: if( error == KErrNone ) sl@0: { sl@0: error = DoDelimitedDataInsertL(data8Bit, aList2); sl@0: } sl@0: aTestHarness->EndTest(error); sl@0: CleanupStack::PopAndDestroy(3, dataBuf); // dataBuf, title8Bit, data8Bit sl@0: } sl@0: sl@0: void TestDelimitedDataRemoveAndParseL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness, sl@0: const TDesC& aData, VA_LIST& aList1, VA_LIST& aList2, TInt aStartPos) sl@0: { sl@0: // Create title sl@0: HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length()); sl@0: title16Bit->Des().Format(KTitle16Bit, &aTestTitle); sl@0: aTestHarness->StartTestL(*title16Bit); sl@0: sl@0: // Create TDelimitedPathSegmentParser object and do parsing sl@0: CDelimitedPathSegment16* data16Bit = CDelimitedPathSegment16::NewL(aData); // Also excersies NewLC() sl@0: CleanupStack::PushL(data16Bit); sl@0: sl@0: // Do initial parse and get to position sl@0: data16Bit->Parse(); sl@0: TInt error = DoDelimitedDataParseToPosition(data16Bit, aStartPos); sl@0: if( error == KErrNone ) sl@0: { sl@0: error = DoDelimitedDataRemoveL(data16Bit, aList1); sl@0: } sl@0: CleanupStack::PopAndDestroy(2, title16Bit); // title16Bit, data16Bit sl@0: aTestHarness->EndTest(error); sl@0: sl@0: // Make 8-bit copy sl@0: HBufC8* dataBuf = HBufC8::NewLC(aData.Length()); sl@0: TPtr8 initData8Bit = dataBuf->Des(); sl@0: initData8Bit.Copy(aData); sl@0: sl@0: // Create title sl@0: HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length()); sl@0: title8Bit->Des().Format(KTitle8Bit, &aTestTitle); sl@0: aTestHarness->StartTestL(*title8Bit); sl@0: sl@0: // Create TDelimitedPathSegmentParser object and do parsing sl@0: CDelimitedPathSegment8* data8Bit = CDelimitedPathSegment8::NewL(initData8Bit); // Also excersies NewLC() sl@0: CleanupStack::PushL(data8Bit); sl@0: sl@0: // Do initial parse and get to position sl@0: data8Bit->Parse(); sl@0: error = DoDelimitedDataParseToPosition(data8Bit, aStartPos); sl@0: if( error == KErrNone ) sl@0: { sl@0: error = DoDelimitedDataRemoveL(data8Bit, aList2); sl@0: } sl@0: aTestHarness->EndTest(error); sl@0: CleanupStack::PopAndDestroy(3, dataBuf); // dataBuf, title8Bit, data8Bit sl@0: } sl@0: sl@0: void TestDelimitedDataInsertAndParseReverseL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness, sl@0: const TDesC& aData, VA_LIST& aList1, VA_LIST& aList2, TInt aStartPos) sl@0: { sl@0: // Create title sl@0: HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length()); sl@0: title16Bit->Des().Format(KTitle16Bit, &aTestTitle); sl@0: aTestHarness->StartTestL(*title16Bit); sl@0: sl@0: // Create TDelimitedPathSegmentParser object and do parsing sl@0: CDelimitedPathSegment16* data16Bit = CDelimitedPathSegment16::NewL(aData); // Also excersies NewLC() sl@0: CleanupStack::PushL(data16Bit); sl@0: sl@0: // Do initial parse and get to position sl@0: data16Bit->ParseReverse(); sl@0: TInt error = DoDelimitedDataParseToPosition(data16Bit, aStartPos); sl@0: if( error == KErrNone ) sl@0: { sl@0: error = DoDelimitedDataInsertL(data16Bit, aList1); sl@0: } sl@0: CleanupStack::PopAndDestroy(2, title16Bit); // title16Bit, data16Bit sl@0: aTestHarness->EndTest(error); sl@0: sl@0: // Make 8-bit copy sl@0: HBufC8* dataBuf = HBufC8::NewLC(aData.Length()); sl@0: TPtr8 initData8Bit = dataBuf->Des(); sl@0: initData8Bit.Copy(aData); sl@0: sl@0: // Create title sl@0: HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length()); sl@0: title8Bit->Des().Format(KTitle8Bit, &aTestTitle); sl@0: aTestHarness->StartTestL(*title8Bit); sl@0: sl@0: // Create TDelimitedPathSegmentParser object and do parsing sl@0: CDelimitedPathSegment8* data8Bit = CDelimitedPathSegment8::NewL(initData8Bit); // Also excersies NewLC() sl@0: CleanupStack::PushL(data8Bit); sl@0: sl@0: // Do initial parse and get to position sl@0: data8Bit->ParseReverse(); sl@0: error = DoDelimitedDataParseToPosition(data8Bit, aStartPos); sl@0: if( error == KErrNone ) sl@0: { sl@0: error = DoDelimitedDataInsertL(data8Bit, aList2); sl@0: } sl@0: aTestHarness->EndTest(error); sl@0: CleanupStack::PopAndDestroy(3, dataBuf); // dataBuf, title8Bit, data8Bit sl@0: } sl@0: sl@0: void TestDelimitedDataRemoveAndParseReverseL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness, sl@0: const TDesC& aData, VA_LIST& aList1, VA_LIST& aList2, TInt aStartPos) sl@0: { sl@0: // Create title sl@0: HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length()); sl@0: title16Bit->Des().Format(KTitle16Bit, &aTestTitle); sl@0: aTestHarness->StartTestL(*title16Bit); sl@0: sl@0: // Create TDelimitedPathSegmentParser object and do parsing sl@0: CDelimitedPathSegment16* data16Bit = CDelimitedPathSegment16::NewL(aData); // Also excersies NewLC() sl@0: CleanupStack::PushL(data16Bit); sl@0: sl@0: // Do initial parse and get to position sl@0: data16Bit->ParseReverse(); sl@0: TInt error = DoDelimitedDataParseToPosition(data16Bit, aStartPos); sl@0: if( error == KErrNone ) sl@0: { sl@0: error = DoDelimitedDataRemoveL(data16Bit, aList1); sl@0: } sl@0: CleanupStack::PopAndDestroy(2, title16Bit); // title16Bit, data16Bit sl@0: aTestHarness->EndTest(error); sl@0: sl@0: // Make 8-bit copy sl@0: HBufC8* dataBuf = HBufC8::NewLC(aData.Length()); sl@0: TPtr8 initData8Bit = dataBuf->Des(); sl@0: initData8Bit.Copy(aData); sl@0: sl@0: // Create title sl@0: HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length()); sl@0: title8Bit->Des().Format(KTitle8Bit, &aTestTitle); sl@0: aTestHarness->StartTestL(*title8Bit); sl@0: sl@0: // Create TDelimitedPathSegmentParser object and do parsing sl@0: CDelimitedPathSegment8* data8Bit = CDelimitedPathSegment8::NewL(initData8Bit); // Also excersies NewLC() sl@0: CleanupStack::PushL(data8Bit); sl@0: sl@0: // Do initial parse and get to position sl@0: data8Bit->ParseReverse(); sl@0: error = DoDelimitedDataParseToPosition(data8Bit, aStartPos); sl@0: if( error == KErrNone ) sl@0: { sl@0: error = DoDelimitedDataRemoveL(data8Bit, aList2); sl@0: } sl@0: aTestHarness->EndTest(error); sl@0: CleanupStack::PopAndDestroy(3, dataBuf); // dataBuf, title8Bit, data8Bit sl@0: } sl@0: sl@0: void TestDelimitedDataInsertEscapeAndParseL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness, sl@0: const TDesC& aData, VA_LIST& aList1, VA_LIST& aList2, TInt aStartPos) sl@0: { sl@0: // Create title sl@0: HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length()); sl@0: title16Bit->Des().Format(KTitle16Bit, &aTestTitle); sl@0: aTestHarness->StartTestL(*title16Bit); sl@0: sl@0: // Create TDelimitedPathSegmentParser object and do parsing sl@0: CDelimitedPathSegment16* data16Bit = CDelimitedPathSegment16::NewL(aData); // Also excersies NewLC() sl@0: CleanupStack::PushL(data16Bit); sl@0: sl@0: // Do initial parse and get to position sl@0: data16Bit->Parse(); sl@0: TInt error = DoDelimitedDataParseToPosition(data16Bit, aStartPos); sl@0: if( error == KErrNone ) sl@0: { sl@0: error = DoDelimitedDataInsertAndEscapeL(data16Bit, aList1); sl@0: } sl@0: CleanupStack::PopAndDestroy(2, title16Bit); // title16Bit, data16Bit sl@0: aTestHarness->EndTest(error); sl@0: sl@0: // Make 8-bit copy sl@0: HBufC8* dataBuf = HBufC8::NewLC(aData.Length()); sl@0: TPtr8 initData8Bit = dataBuf->Des(); sl@0: initData8Bit.Copy(aData); sl@0: sl@0: // Create title sl@0: HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length()); sl@0: title8Bit->Des().Format(KTitle8Bit, &aTestTitle); sl@0: aTestHarness->StartTestL(*title8Bit); sl@0: sl@0: // Create TDelimitedPathSegmentParser object and do parsing sl@0: CDelimitedPathSegment8* data8Bit = CDelimitedPathSegment8::NewL(initData8Bit); // Also excersies NewLC() sl@0: CleanupStack::PushL(data8Bit); sl@0: sl@0: // Do initial parse and get to position sl@0: data8Bit->Parse(); sl@0: error = DoDelimitedDataParseToPosition(data8Bit, aStartPos); sl@0: if( error == KErrNone ) sl@0: { sl@0: error = DoDelimitedDataInsertAndEscapeL(data8Bit, aList2); sl@0: } sl@0: aTestHarness->EndTest(error); sl@0: CleanupStack::PopAndDestroy(3, dataBuf); // dataBuf, title8Bit, data8Bit sl@0: } sl@0: sl@0: void TestDelimitedDataInsertEscapeAndParseReverseL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness, sl@0: const TDesC& aData, VA_LIST& aList1, VA_LIST& aList2, TInt aStartPos) sl@0: { sl@0: // Create title sl@0: HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length()); sl@0: title16Bit->Des().Format(KTitle16Bit, &aTestTitle); sl@0: aTestHarness->StartTestL(*title16Bit); sl@0: sl@0: // Create TDelimitedPathSegmentParser object and do parsing sl@0: CDelimitedPathSegment16* data16Bit = CDelimitedPathSegment16::NewL(aData); // Also excersies NewLC() sl@0: CleanupStack::PushL(data16Bit); sl@0: sl@0: // Do initial parse and get to position sl@0: data16Bit->ParseReverse(); sl@0: TInt error = DoDelimitedDataParseToPosition(data16Bit, aStartPos); sl@0: if( error == KErrNone ) sl@0: { sl@0: error = DoDelimitedDataInsertAndEscapeL(data16Bit, aList1); sl@0: } sl@0: CleanupStack::PopAndDestroy(2, title16Bit); // title16Bit, data16Bit sl@0: aTestHarness->EndTest(error); sl@0: sl@0: // Make 8-bit copy sl@0: HBufC8* dataBuf = HBufC8::NewLC(aData.Length()); sl@0: TPtr8 initData8Bit = dataBuf->Des(); sl@0: initData8Bit.Copy(aData); sl@0: sl@0: // Create title sl@0: HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length()); sl@0: title8Bit->Des().Format(KTitle8Bit, &aTestTitle); sl@0: aTestHarness->StartTestL(*title8Bit); sl@0: sl@0: // Create TDelimitedPathSegmentParser object and do parsing sl@0: CDelimitedPathSegment8* data8Bit = CDelimitedPathSegment8::NewL(initData8Bit); // Also excersies NewLC() sl@0: CleanupStack::PushL(data8Bit); sl@0: sl@0: // Do initial parse and get to position sl@0: data8Bit->ParseReverse(); sl@0: error = DoDelimitedDataParseToPosition(data8Bit, aStartPos); sl@0: if( error == KErrNone ) sl@0: { sl@0: error = DoDelimitedDataInsertAndEscapeL(data8Bit, aList2); sl@0: } sl@0: aTestHarness->EndTest(error); sl@0: CleanupStack::PopAndDestroy(3, dataBuf); // dataBuf, title8Bit, data8Bit sl@0: } sl@0: sl@0: // sl@0: // sl@0: // Implementation of LOCAL functions - helper functions sl@0: // sl@0: // sl@0: sl@0: #include "TDelimitedDataCommon.cpp" sl@0: