343 // trailing, unwanted eod character. |
359 // trailing, unwanted eod character. |
344 CheckDocLength(doc2,50); |
360 CheckDocLength(doc2,50); |
345 CheckContent(doc2,iComp2); |
361 CheckContent(doc2,iComp2); |
346 delete doc2; |
362 delete doc2; |
347 |
363 |
348 test.Next(_L("sense from last-1")); |
364 INFO_PRINTF1(_L("sense from last-1")); |
349 iDummy.Set(document->Read(93).Ptr(),document->Read(93).Length()); |
365 iDummy.Set(document->Read(93).Ptr(),document->Read(93).Length()); |
350 CPlainText* doc3=CPlainText::NewL(D); |
366 CPlainText* doc3=CPlainText::NewL(D); |
351 doc3->InsertL(0,iDummy); |
367 doc3->InsertL(0,iDummy); |
352 doc3->DeleteL(2,1); |
368 doc3->DeleteL(2,1); |
353 CheckDocLength(doc3,2); |
369 CheckDocLength(doc3,2); |
354 CheckContent(doc3,iComp3); |
370 CheckContent(doc3,iComp3); |
355 delete doc3; |
371 delete doc3; |
356 |
372 |
357 test.Next(_L("sense from last")); |
373 INFO_PRINTF1(_L("sense from last")); |
358 iDummy.Set(document->Read(94).Ptr(),document->Read(94).Length()); |
374 iDummy.Set(document->Read(94).Ptr(),document->Read(94).Length()); |
359 CPlainText* doc4=CPlainText::NewL(D); |
375 CPlainText* doc4=CPlainText::NewL(D); |
360 doc4->InsertL(0,iDummy); |
376 doc4->InsertL(0,iDummy); |
361 doc4->DeleteL(1,1); |
377 doc4->DeleteL(1,1); |
362 CheckDocLength(doc4,1); |
378 CheckDocLength(doc4,1); |
363 CheckContent(doc4,iComp4); |
379 CheckContent(doc4,iComp4); |
364 delete doc4; |
380 delete doc4; |
365 |
381 |
366 test.Next(_L("sense from last+1")); |
382 INFO_PRINTF1(_L("sense from last+1")); |
367 iDummy.Set(document->Read(95).Ptr(),document->Read(95).Length()); |
383 iDummy.Set(document->Read(95).Ptr(),document->Read(95).Length()); |
368 CPlainText* doc5=CPlainText::NewL(D); |
384 CPlainText* doc5=CPlainText::NewL(D); |
369 doc5->InsertL(0,iDummy); |
385 doc5->InsertL(0,iDummy); |
370 doc5->DeleteL(0,1); |
386 doc5->DeleteL(0,1); |
371 CheckDocLength(doc5,0); |
387 CheckDocLength(doc5,0); |
372 CheckContent(doc5,iComp5); |
388 CheckContent(doc5,iComp5); |
373 delete doc5; |
389 delete doc5; |
374 |
390 |
375 delete document; |
391 delete document; |
376 test.End(); |
|
377 __UHEAP_MARKEND; |
392 __UHEAP_MARKEND; |
378 } |
393 } |
379 |
394 |
380 |
395 |
381 template<class S, class T,CEditableText::TDocumentStorage D> |
396 template<class S, class T,CEditableText::TDocumentStorage D> |
393 document->InsertL(0,iInBuf); |
408 document->InsertL(0,iInBuf); |
394 iOutBuf.Set(document->Read(0)); |
409 iOutBuf.Set(document->Read(0)); |
395 CheckDocLength(document,10); |
410 CheckDocLength(document,10); |
396 CheckContent(document,iOutBufComp); |
411 CheckContent(document,iOutBufComp); |
397 |
412 |
398 test.Start(_L("Inverting at start")); |
413 INFO_PRINTF1(_L("Inverting at start")); |
399 document->InsertL(0,iInBuf2); |
414 document->InsertL(0,iInBuf2); |
400 document->InsertL(0,character); |
415 document->InsertL(0,character); |
401 document->DeleteL(0,1); |
416 document->DeleteL(0,1); |
402 CheckDocLength(document,14); |
417 CheckDocLength(document,14); |
403 document->DeleteL(0,4); |
418 document->DeleteL(0,4); |
404 iOutBuf2.Set(document->Read(0)); |
419 iOutBuf2.Set(document->Read(0)); |
405 CheckDocLength(document,10); |
420 CheckDocLength(document,10); |
406 CheckContent(document,iOutBufComp); |
421 CheckContent(document,iOutBufComp); |
407 |
422 |
408 test.Next(_L("Inverting in middle")); |
423 INFO_PRINTF1(_L("Inverting in middle")); |
409 document->InsertL(4,iInBuf2); |
424 document->InsertL(4,iInBuf2); |
410 document->InsertL(5,character); |
425 document->InsertL(5,character); |
411 document->DeleteL(5,1); |
426 document->DeleteL(5,1); |
412 CheckDocLength(document,14); |
427 CheckDocLength(document,14); |
413 document->DeleteL(4,4); |
428 document->DeleteL(4,4); |
414 iOutBuf2.Set(document->Read(0)); |
429 iOutBuf2.Set(document->Read(0)); |
415 CheckDocLength(document,10); |
430 CheckDocLength(document,10); |
416 CheckContent(document,iOutBufComp); |
431 CheckContent(document,iOutBufComp); |
417 |
432 |
418 test.Next(_L("Inverting at end")); |
433 INFO_PRINTF1(_L("Inverting at end")); |
419 document->InsertL(10,iInBuf2); |
434 document->InsertL(10,iInBuf2); |
420 document->InsertL(11,character); |
435 document->InsertL(11,character); |
421 document->DeleteL(11,1); |
436 document->DeleteL(11,1); |
422 CheckDocLength(document,14); |
437 CheckDocLength(document,14); |
423 document->DeleteL(10,4); |
438 document->DeleteL(10,4); |
457 // Create document. |
472 // Create document. |
458 CPlainText* document=CPlainText::NewL(D); |
473 CPlainText* document=CPlainText::NewL(D); |
459 TPtrC body(content); |
474 TPtrC body(content); |
460 document->InsertL(0,body); |
475 document->InsertL(0,body); |
461 // Now do the tests. |
476 // Now do the tests. |
462 test.Start(_L("Paragraph 1")); |
477 INFO_PRINTF1(_L("Paragraph 1")); |
463 DoParagraphStart(0,55,document); // Paragraph 1 |
478 DoParagraphStart(0,55,document); // Paragraph 1 |
464 test.Next(_L("Paragraph 2")); |
479 INFO_PRINTF1(_L("Paragraph 2")); |
465 DoParagraphStart(55,23,document); // Paragraph 2 |
480 DoParagraphStart(55,23,document); // Paragraph 2 |
466 test.Next(_L("Paragraph 3")); |
481 INFO_PRINTF1(_L("Paragraph 3")); |
467 DoParagraphStart(78,20,document); // Paragraph 3 |
482 DoParagraphStart(78,20,document); // Paragraph 3 |
468 test.Next(_L("Paragraph 4->2 consecutive delimiters, posshould not change")); |
483 INFO_PRINTF1(_L("Paragraph 4->2 consecutive delimiters, posshould not change")); |
469 DoParagraphStart(99,1,document); // Paragraph 6 |
484 DoParagraphStart(99,1,document); // Paragraph 6 |
470 |
485 |
471 delete document; |
486 delete document; |
472 test.End(); |
|
473 } |
487 } |
474 |
488 |
475 |
489 |
476 template<class S,class T,CEditableText::TDocumentStorage D> |
490 template<class S,class T,CEditableText::TDocumentStorage D> |
477 void TestCPlainText<S,T,D>::CPlainTest5L() |
491 void TestCPlainText<S,T,D>::CPlainTest5L() |
481 { |
495 { |
482 __UHEAP_MARK; |
496 __UHEAP_MARK; |
483 CPlainText* doc=CPlainText::NewL(D); |
497 CPlainText* doc=CPlainText::NewL(D); |
484 doc->InsertL(0,iDefaultDoc); |
498 doc->InsertL(0,iDefaultDoc); |
485 |
499 |
486 test.Start(_L("Extract(buf)")); |
500 INFO_PRINTF1(_L("Extract(buf)")); |
487 TBuf<128> buf; |
501 TBuf<128> buf; |
488 doc->Extract(buf); |
502 doc->Extract(buf); |
489 CheckContent(iDefaultDoc,buf); |
503 CheckContent(iDefaultDoc,buf); |
490 |
504 |
491 test.Next(_L("Extract(buf,pos)")); |
505 INFO_PRINTF1(_L("Extract(buf,pos)")); |
492 TInt pos=45; |
506 TInt pos=45; |
493 doc->Extract(buf,pos); |
507 doc->Extract(buf,pos); |
494 CheckContent(iComp2,buf); |
508 CheckContent(iComp2,buf); |
495 |
509 |
496 test.Next(_L("Extract(buf) from multiple segments")); |
510 INFO_PRINTF1(_L("Extract(buf) from multiple segments")); |
497 TBuf<256> bigBuf(_L("abcdefghijklmnopqrstuvwxyzABCEDFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCEDFGHIJKLMNOPQRSTUVWXYZ")); |
511 TBuf<256> bigBuf(_L("abcdefghijklmnopqrstuvwxyzABCEDFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCEDFGHIJKLMNOPQRSTUVWXYZ")); |
498 CPlainText* segDoc=CPlainText::NewL(ESegmentedStorage); |
512 CPlainText* segDoc=CPlainText::NewL(ESegmentedStorage); |
499 segDoc->InsertL(0,bigBuf); |
513 segDoc->InsertL(0,bigBuf); |
500 segDoc->Extract(buf); |
514 segDoc->Extract(buf); |
501 CheckContent(bigBuf,buf); |
515 CheckContent(bigBuf,buf); |
502 delete segDoc; |
516 delete segDoc; |
503 |
517 |
504 test.End(); |
|
505 delete doc; |
518 delete doc; |
506 __UHEAP_MARKEND; |
519 __UHEAP_MARKEND; |
507 } |
520 } |
508 |
521 |
509 |
522 |
817 doc->StartFepInlineEditL(HasChangedFormat,NumberDeleted,NumberInserted,PositionOfInsertion,NewPositionOfInsertion,InitialInlineText,PosOfInlineText,NumberToHide,*InlineTextFormatRetriever); |
828 doc->StartFepInlineEditL(HasChangedFormat,NumberDeleted,NumberInserted,PositionOfInsertion,NewPositionOfInsertion,InitialInlineText,PosOfInlineText,NumberToHide,*InlineTextFormatRetriever); |
818 |
829 |
819 doc->Extract(outputBuf, startingPositionZero, textLengthFifty); // Returns all the text |
830 doc->Extract(outputBuf, startingPositionZero, textLengthFifty); // Returns all the text |
820 test (iTestBuf1 == outputBuf); // testing outputBuf, making sure it contains the inline text - "abcdefINLINE_TEXTghijklmnopqrstuvwxyz" |
831 test (iTestBuf1 == outputBuf); // testing outputBuf, making sure it contains the inline text - "abcdefINLINE_TEXTghijklmnopqrstuvwxyz" |
821 |
832 |
822 test.Next(_L("Extract and discard only the inline text, from Pos0 returning the rest")); |
833 INFO_PRINTF1(_L("Extract and discard only the inline text, from Pos0 returning the rest")); |
823 doc->ExtractSelectively(outputBuf, startingPositionZero, textLengthFifty, EExcludeInlineEditedText); // Returns only non-inline text |
834 doc->ExtractSelectively(outputBuf, startingPositionZero, textLengthFifty, EExcludeInlineEditedText); // Returns only non-inline text |
824 test (iInsertBuf == outputBuf); // testing outputBuf, making sure the inline text has been extracted correctly - "abcdefghijklmnopqrstuvwxyz" |
835 test (iInsertBuf == outputBuf); // testing outputBuf, making sure the inline text has been extracted correctly - "abcdefghijklmnopqrstuvwxyz" |
825 delete doc; |
836 delete doc; |
826 |
837 |
827 |
838 |
828 CPlainText* doc2=CPlainText::NewL(D); |
839 CPlainText* doc2=CPlainText::NewL(D); |
829 doc2->DocumentLength(); |
840 doc2->DocumentLength(); |
830 doc2->InsertL(0,iInsertBuf); // insert "abcdefghijklmnopqrstuvwxyz" |
841 doc2->InsertL(0,iInsertBuf); // insert "abcdefghijklmnopqrstuvwxyz" |
831 |
842 |
832 test.Next(_L("Extract upto 50 character, from Pos10, within the range (no inline editting set)")); |
843 INFO_PRINTF1(_L("Extract upto 50 character, from Pos10, within the range (no inline editting set)")); |
833 // Returns upto 50 characters starting from Pos10 |
844 // Returns upto 50 characters starting from Pos10 |
834 doc2->ExtractSelectively(outputBuf, startingPositionTen, textLengthFifty, EExcludeInlineEditedText); |
845 doc2->ExtractSelectively(outputBuf, startingPositionTen, textLengthFifty, EExcludeInlineEditedText); |
835 test (iTestBuf2 == outputBuf); // "klmnopqrstuvwxyz" |
846 test (iTestBuf2 == outputBuf); // "klmnopqrstuvwxyz" |
836 |
847 |
837 test.Next(_L("Extract upto 10 characters, from Pos10, within the range (no inline editting set)")); |
848 INFO_PRINTF1(_L("Extract upto 10 characters, from Pos10, within the range (no inline editting set)")); |
838 // Returns upto 10 characters starting from Pos10 |
849 // Returns upto 10 characters starting from Pos10 |
839 doc2->ExtractSelectively(outputBuf, startingPositionTen, textLengthTen, EExcludeInlineEditedText); |
850 doc2->ExtractSelectively(outputBuf, startingPositionTen, textLengthTen, EExcludeInlineEditedText); |
840 test (iTestBuf2a == outputBuf); // "klmnopqrst" |
851 test (iTestBuf2a == outputBuf); // "klmnopqrst" |
841 |
852 |
842 test.Next(_L("Extract upto 50 character, from Pos0, 'EExtractAll' flag selected")); |
853 INFO_PRINTF1(_L("Extract upto 50 character, from Pos0, 'EExtractAll' flag selected")); |
843 // Returns upto 50 characters starting from Pos0. |
854 // Returns upto 50 characters starting from Pos0. |
844 doc2->ExtractSelectively(outputBuf, startingPositionZero, textLengthFifty, EExtractAll); |
855 doc2->ExtractSelectively(outputBuf, startingPositionZero, textLengthFifty, EExtractAll); |
845 test (iInsertBuf == outputBuf); // "abcdefghijklmnopqrstuvwxyz" |
856 test (iInsertBuf == outputBuf); // "abcdefghijklmnopqrstuvwxyz" |
846 delete doc2; |
857 delete doc2; |
847 |
858 |
852 |
863 |
853 PosOfInlineText = 4; |
864 PosOfInlineText = 4; |
854 |
865 |
855 doc3->StartFepInlineEditL(HasChangedFormat,NumberDeleted,NumberInserted,PositionOfInsertion,NewPositionOfInsertion,InitialInlineText,PosOfInlineText,NumberToHide,*InlineTextFormatRetriever); |
866 doc3->StartFepInlineEditL(HasChangedFormat,NumberDeleted,NumberInserted,PositionOfInsertion,NewPositionOfInsertion,InitialInlineText,PosOfInlineText,NumberToHide,*InlineTextFormatRetriever); |
856 |
867 |
857 test.Next(_L("Extract all the non-inline text, from Pos10, within the range (inline editting on)")); |
868 INFO_PRINTF1(_L("Extract all the non-inline text, from Pos10, within the range (inline editting on)")); |
858 doc3->ExtractSelectively(outputBuf, startingPositionTen, textLengthTen, EExcludeInlineEditedText); // Returns only non-inline text. |
869 doc3->ExtractSelectively(outputBuf, startingPositionTen, textLengthTen, EExcludeInlineEditedText); // Returns only non-inline text. |
859 test (iTestBuf3 == outputBuf); // testing outputBuf, making sure the inline text has been extracted correctly - "efghi". |
870 test (iTestBuf3 == outputBuf); // testing outputBuf, making sure the inline text has been extracted correctly - "efghi". |
860 delete doc3; |
871 delete doc3; |
861 |
872 |
862 test.End(); |
|
863 |
|
864 __UHEAP_MARKEND; |
873 __UHEAP_MARKEND; |
865 } |
874 } |
866 |
875 |
867 |
876 |
868 template<class S,class T,CEditableText::TDocumentStorage D> |
877 template<class S,class T,CEditableText::TDocumentStorage D> |
869 void TestCPlainText<S,T,D>::TestSegmentedL() |
878 void TestCPlainText<S,T,D>::TestSegmentedL() |
870 // |
879 // |
871 // Controls testing of the segmented storage case. |
880 // Controls testing of the segmented storage case. |
872 // |
881 // |
873 { |
882 { |
874 test.Start(_L("All methods")); |
883 INFO_PRINTF1(_L("All methods")); |
875 CPlainTest0L(); |
884 CPlainTest0L(); |
876 test.Next(_L("Construction")); |
885 INFO_PRINTF1(_L("Construction")); |
877 CPlainTest1L(); |
886 CPlainTest1L(); |
878 test.Next(_L("Read")); |
887 INFO_PRINTF1(_L("Read")); |
879 test.Start(_L("Not yet implemented")); |
888 INFO_PRINTF1(_L("Not yet implemented")); |
880 test.End(); |
889 |
881 test.Next(_L("Inverse Testing using InsertL&Delete: content left intact")); |
890 INFO_PRINTF1(_L("Inverse Testing using InsertL&Delete: content left intact")); |
882 CPlainTest3L(); |
891 CPlainTest3L(); |
883 test.Next(_L("Paragraph Start")); |
892 INFO_PRINTF1(_L("Paragraph Start")); |
884 CPlainTest4L(); |
893 CPlainTest4L(); |
885 test.Next(_L("Extract")); |
894 INFO_PRINTF1(_L("Extract")); |
886 CPlainTest5L(); |
895 CPlainTest5L(); |
887 test.Next(_L("WordInfo")); |
896 INFO_PRINTF1(_L("WordInfo")); |
888 CPlainTest5aL(); |
897 CPlainTest5aL(); |
889 test.Next(_L("CharPosOfParagraph")); |
898 INFO_PRINTF1(_L("CharPosOfParagraph")); |
890 CPlainTest5bL(); |
899 CPlainTest5bL(); |
891 test.Next(_L("ParagraphNumberForPos")); |
900 INFO_PRINTF1(_L("ParagraphNumberForPos")); |
892 CPlainTest5cL(); |
901 CPlainTest5cL(); |
893 test.Next(_L("CountWords")); |
902 INFO_PRINTF1(_L("CountWords")); |
894 CPlainTest6L(); |
903 CPlainTest6L(); |
895 test.Next(_L("CountParas")); |
904 INFO_PRINTF1(_L("CountParas")); |
896 CPlainTest7L(); |
905 CPlainTest7L(); |
897 test.Next(_L("Reset")); |
906 INFO_PRINTF1(_L("Reset")); |
898 CPlainTest8L(); |
907 CPlainTest8L(); |
899 test.End(); |
|
900 } |
908 } |
901 |
909 |
902 |
910 |
903 |
911 |
904 template<class S,class T,CEditableText::TDocumentStorage D> |
912 template<class S,class T,CEditableText::TDocumentStorage D> |
905 void TestCPlainText<S,T,D>::TestL() |
913 void TestCPlainText<S,T,D>::TestL() |
906 // |
914 // |
907 // Test the CPlainText methods |
915 // Test the CPlainText methods |
908 // |
916 // |
909 { |
917 { |
910 test.Start(_L("All methods")); |
918 INFO_PRINTF1(_L("All methods")); |
911 CPlainTest0L(); |
919 CPlainTest0L(); |
912 test.Next(_L("Construction")); |
920 INFO_PRINTF1(_L("Construction")); |
913 CPlainTest1L(); |
921 CPlainTest1L(); |
914 test.Next(_L("Read")); |
922 INFO_PRINTF1(_L("Read")); |
915 CPlainTest2L(); |
923 CPlainTest2L(); |
916 test.Next(_L("Inverse Testing using InsertL&Delete: content left intact")); |
924 INFO_PRINTF1(_L("Inverse Testing using InsertL&Delete: content left intact")); |
917 CPlainTest3L(); |
925 CPlainTest3L(); |
918 test.Next(_L("Paragraph Start")); |
926 INFO_PRINTF1(_L("Paragraph Start")); |
919 CPlainTest4L(); |
927 CPlainTest4L(); |
920 test.Next(_L("Extract")); |
928 INFO_PRINTF1(_L("Extract")); |
921 CPlainTest5L(); |
929 CPlainTest5L(); |
922 test.Next(_L("WordInfo")); |
930 INFO_PRINTF1(_L("WordInfo")); |
923 CPlainTest5aL(); |
931 CPlainTest5aL(); |
924 test.Next(_L("CharPosOfParagraph")); |
932 INFO_PRINTF1(_L("CharPosOfParagraph")); |
925 CPlainTest5bL(); |
933 CPlainTest5bL(); |
926 test.Next(_L("ParagraphNumberForPos")); |
934 INFO_PRINTF1(_L("ParagraphNumberForPos")); |
927 CPlainTest5cL(); |
935 CPlainTest5cL(); |
928 test.Next(_L("CountWords")); |
936 INFO_PRINTF1(_L("CountWords")); |
929 CPlainTest6L(); |
937 CPlainTest6L(); |
930 test.Next(_L("CountParas")); |
938 INFO_PRINTF1(_L("CountParas")); |
931 CPlainTest7L(); |
939 CPlainTest7L(); |
932 test.Next(_L("Reset")); |
940 INFO_PRINTF1(_L("Reset")); |
933 CPlainTest8L(); |
941 CPlainTest8L(); |
934 test.End(); |
|
935 } |
942 } |
936 |
943 |
937 |
944 |
938 |
945 |
939 template<class S,class T,CEditableText::TDocumentStorage D> |
946 template<class S,class T,CEditableText::TDocumentStorage D> |
940 void TestCPlainText<S,T,D>::DefectsL() |
947 void TestCPlainText<S,T,D>::DefectsL() |
941 // |
948 // |
942 // Defect Fixes |
949 // Defect Fixes |
943 // |
950 // |
944 { |
951 { |
945 test.Start(_L(" @SYMTestCaseID:SYSLIB-ETEXT-UT-1574 INC070807 ")); |
952 INFO_PRINTF1(_L(" @SYMTestCaseID:SYSLIB-ETEXT-UT-1574 INC070807 ")); |
946 INC070807L(); |
953 INC070807L(); |
947 test.End(); |
954 } |
948 } |
955 |
949 |
956 CT_CPLAIN::CT_CPLAIN() |
950 |
|
951 |
|
952 GLDEF_C TInt E32Main() |
|
953 // |
|
954 // Test the Document Model Services. |
|
955 // |
|
956 { |
957 { |
957 CTrapCleanup* cleanup=CTrapCleanup::New(); |
958 SetTestStepName(KTestStep_T_CPLAIN); |
958 |
959 pTestStep = this; |
959 __UHEAP_MARK; |
960 } |
960 |
961 |
961 typedef TestCPlainText<TText,TPtrC,CEditableText::EFlatStorage> instance1; |
962 TVerdict CT_CPLAIN::doTestStepL() |
962 typedef TestCPlainText<TText,TPtrC,CEditableText::ESegmentedStorage> instance2; |
963 { |
963 typedef TestCPlainText<TText,TPtrC,CEditableText::EFlatStorage> instance3; |
964 SetTestStepResult(EFail); |
964 |
965 |
965 instance1* doctest=NULL; |
966 CTrapCleanup* cleanup=CTrapCleanup::New(); |
966 |
|
967 TRAPD(ret, doctest=instance1::NewL()); |
|
968 test(ret == KErrNone); |
|
969 |
|
970 test.Start(_L("CPlainText - Flat")); |
|
971 |
|
972 TRAP(ret,doctest->TestL()); |
|
973 test(ret == KErrNone); |
|
974 delete doctest; |
|
975 |
|
976 test.Next(_L("CPlainText - Segmented")); |
|
977 instance2* doctest1=NULL; |
|
978 |
|
979 TRAP(ret, doctest1=instance2::NewL()); |
|
980 test(ret == KErrNone); |
|
981 |
|
982 TRAP(ret, doctest1->TestSegmentedL()); |
|
983 test(ret == KErrNone); |
|
984 delete doctest1; |
|
985 |
|
986 test.Next(_L("Defect...")); |
|
987 instance3* doctest2=NULL; |
|
988 |
|
989 TRAP(ret, doctest2=instance3::NewL()); |
|
990 test(ret == KErrNone); |
|
991 |
967 |
992 TRAP(ret, doctest2->DefectsL()); |
968 __UHEAP_MARK; |
993 test(ret == KErrNone); |
969 |
994 delete doctest2; |
970 typedef TestCPlainText<TText,TPtrC,CEditableText::EFlatStorage> instance1; |
995 |
971 typedef TestCPlainText<TText,TPtrC,CEditableText::ESegmentedStorage> instance2; |
996 test.End(); |
972 typedef TestCPlainText<TText,TPtrC,CEditableText::EFlatStorage> instance3; |
997 test.Close(); |
973 |
998 |
974 instance1* doctest=NULL; |
999 __UHEAP_MARKEND; |
975 |
1000 |
976 TRAPD(ret1, doctest=instance1::NewL()); |
1001 delete cleanup; |
977 |
1002 |
978 INFO_PRINTF1(_L("CPlainText - Flat")); |
1003 return(0); |
979 TRAPD(ret2, doctest->TestL()); |
|
980 delete doctest; |
|
981 |
|
982 INFO_PRINTF1(_L("CPlainText - Segmented")); |
|
983 instance2* doctest1=NULL; |
|
984 TRAPD(ret3, doctest1=instance2::NewL()); |
|
985 TRAPD(ret4, doctest1->TestSegmentedL()); |
|
986 delete doctest1; |
|
987 |
|
988 INFO_PRINTF1(_L("Defect...")); |
|
989 instance3* doctest2=NULL; |
|
990 TRAPD(ret5, doctest2=instance3::NewL()); |
|
991 TRAPD(ret6, doctest2->DefectsL()); |
|
992 delete doctest2; |
|
993 |
|
994 __UHEAP_MARKEND; |
|
995 |
|
996 delete cleanup; |
|
997 |
|
998 if (ret1 == KErrNone && ret2 == KErrNone && ret3 == KErrNone && ret4 == KErrNone && ret5 == KErrNone && ret6 == KErrNone) |
|
999 { |
|
1000 SetTestStepResult(EPass); |
|
1001 } |
|
1002 |
|
1003 return TestStepResult(); |
1004 } |
1004 } |