24 #include <e32svr.h> |
24 #include <e32svr.h> |
25 #include <e32def_private.h> |
25 #include <e32def_private.h> |
26 |
26 |
27 // DMA test framework command parameter options |
27 // DMA test framework command parameter options |
28 |
28 |
29 // SelfTest Option |
29 // SelfTest option |
30 _LIT(KArgSelfTest, "/SELFTEST"); |
30 _LIT(KArgSelfTest, "/SELFTEST"); |
31 _LIT(KArgSelfTest2, "/S"); |
31 _LIT(KArgSelfTest2, "/S"); |
32 |
32 |
33 //Verbose Option |
33 //Verbose option |
34 _LIT(KArgVerboseOutput, "/VERBOSE"); |
34 _LIT(KArgVerboseOutput, "/VERBOSE"); |
35 _LIT(KArgVerboseOutput2, "/V"); |
35 _LIT(KArgVerboseOutput2, "/V"); |
36 |
36 |
|
37 //Simple transfer test option |
|
38 _LIT(KArgSimpleTest, "/simple"); |
|
39 |
|
40 //Callback test option |
|
41 _LIT(KArgCallBackTest, "/callback"); |
|
42 |
|
43 //Suspend test option |
|
44 _LIT(KArgSuspendTest, "/suspend"); |
|
45 |
|
46 //Multipart transfer tests |
|
47 _LIT(KArgMultiPartTest, "/multi"); |
|
48 |
|
49 //Isr and dfc test option |
|
50 _LIT(KArgIsrDfcTest, "/isrdfc"); |
|
51 |
|
52 //Isr reque test option |
|
53 _LIT(KArgIsrequeTest, "/isreque"); |
|
54 |
|
55 //Benchmark test option |
|
56 _LIT(KArgBenchmarkTest, "/bench"); |
|
57 |
|
58 //Graphics test option |
|
59 _LIT(KArgGraphicTest, "/graphic"); |
|
60 |
|
61 //DMA channel (opening and closing) test option |
|
62 _LIT(KArgChannelTest, "/channel"); |
|
63 |
|
64 //Queue test option |
|
65 _LIT(KArgQueueTest, "/queue"); |
|
66 |
|
67 //Fragment test option |
|
68 _LIT(KArgFragmentTest, "/fragment"); |
|
69 |
|
70 //Request test option |
|
71 _LIT(KArgRequestTest, "/request"); |
|
72 |
|
73 |
37 |
74 |
38 TBool gHelpRequested; // print usage |
75 TBool gHelpRequested; // print usage |
39 TBool gVerboseOutput; // enable verbose output |
76 TBool gVerboseOutput; // enable verbose output |
40 TBool gSelfTest; // run SelfTest |
77 TBool gSelfTest; // run SelfTest |
|
78 TBool gSimpleTest; // run only Simple transfer test |
|
79 TBool gCallBack; // run only Callback test |
|
80 TBool gSuspend; // run only Pause and resume tests |
|
81 TBool gIsrReque; // run only IsrReque tests |
|
82 TBool gMultiPart; // run only Multipart tests |
|
83 TBool gIsrAndDfc; // run only IsrAndDfc tests |
|
84 TBool gBenchmark; // run only Benchmark tests |
|
85 TBool gGraphic; // run only Graphic tests |
|
86 TBool gFragment; // run only Fragment related tests |
|
87 TBool gChannel; // run only Channel(open/close)tests |
|
88 TBool gQueue; // run only Queue related tests |
|
89 TBool gRequest; // run only Request related tests |
41 |
90 |
42 /** |
91 /** |
43 This function prints out the PSL test Information |
92 This function prints out the PSL test Information |
44 */ |
93 */ |
45 void Print(const TDmaV2TestInfo& aInfo) |
94 void Print(const TDmaV2TestInfo& aInfo) |
75 // CDmaTest |
124 // CDmaTest |
76 ////////////////////////////////////////////////////////////////////// |
125 ////////////////////////////////////////////////////////////////////// |
77 |
126 |
78 void CDmaTest::OpenDmaSession() |
127 void CDmaTest::OpenDmaSession() |
79 { |
128 { |
80 TInt r = iDmaSession.Open(); |
129 // Only open a new session if one |
|
130 // was not already supplied |
|
131 if(iDmaSession.Handle() == KNullHandle) |
|
132 { |
|
133 TInt r = iDmaSession.Open(); |
|
134 TEST_ASSERT(r == KErrNone); |
|
135 r = iDmaSession.OpenSharedChunk(iChunk); |
|
136 TEST_ASSERT(r == KErrNone); |
|
137 } |
|
138 } |
|
139 |
|
140 // Open another handle to the test driver |
|
141 void CDmaTest::OpenDmaSession(const RDmaSession& aSession) |
|
142 { |
|
143 iDmaSession = aSession; |
|
144 TInt r = iDmaSession.Duplicate(RThread(), EOwnerThread); |
81 TEST_ASSERT(r == KErrNone); |
145 TEST_ASSERT(r == KErrNone); |
|
146 |
|
147 // open another handle to the test driver chunk |
82 r = iDmaSession.OpenSharedChunk(iChunk); |
148 r = iDmaSession.OpenSharedChunk(iChunk); |
83 TEST_ASSERT(r == KErrNone); |
149 TEST_ASSERT(r == KErrNone); |
84 } |
150 } |
85 |
151 |
86 void CDmaTest::CloseDmaSession() |
152 void CDmaTest::CloseDmaSession() |
87 { |
153 { |
88 iChunk.Close(); |
154 iChunk.Close(); |
89 iDmaSession.Close(); |
155 iDmaSession.Close(); |
90 } |
156 } |
91 |
157 |
|
158 void CDmaTest::PreTransferSetup() |
|
159 { |
|
160 } |
|
161 |
|
162 TInt CDmaTest::DoPostTransferCheck() |
|
163 { |
|
164 return KErrNotSupported; |
|
165 } |
|
166 |
|
167 void CDmaTest::ChannelPause(TUint aChannelSessionCookie) |
|
168 { |
|
169 TInt r = iDmaSession.ChannelPause(aChannelSessionCookie); |
|
170 TEST_ASSERT(r == KErrNone); |
|
171 } |
|
172 |
|
173 void CDmaTest::ChannelResume(TUint aChannelSessionCookie) |
|
174 { |
|
175 TInt r = iDmaSession.ChannelResume(aChannelSessionCookie); |
|
176 TEST_ASSERT(r == KErrNone); |
|
177 } |
92 ////////////////////////////////////////////////////////////////////// |
178 ////////////////////////////////////////////////////////////////////// |
93 // CSingleTransferTest |
179 // CSingleTransferTest |
94 ////////////////////////////////////////////////////////////////////// |
180 ////////////////////////////////////////////////////////////////////// |
95 void CSingleTransferTest::RunTest() |
181 void CSingleTransferTest::RunTest() |
96 { |
182 { |
237 iActual.iCallbackRecord.Print(); |
338 iActual.iCallbackRecord.Print(); |
238 } |
339 } |
239 return result; |
340 return result; |
240 } |
341 } |
241 |
342 |
242 |
343 ////////////////////////////////////////////////////////////////////// |
|
344 // CDmaTestDecorator |
|
345 ////////////////////////////////////////////////////////////////////// |
|
346 |
|
347 CDmaTestDecorator::CDmaTestDecorator(CDmaTest* aDecoratedTest) |
|
348 : CDmaTest(_L("Decorated Test"), 1, NULL, NULL), iDecoratedTest(aDecoratedTest) |
|
349 {} |
|
350 |
|
351 CDmaTestDecorator::CDmaTestDecorator(const CDmaTestDecorator& aOther) |
|
352 : CDmaTest(aOther), iDecoratedTest( static_cast<CDmaTest*>( aOther.iDecoratedTest->Clone() ) ) |
|
353 // Need cast because Clone does not have a covariant return type, |
|
354 // as not all compillers allow it |
|
355 {} |
|
356 |
|
357 ////////////////////////////////////////////////////////////////////// |
|
358 // CMultiVersionTest |
|
359 ////////////////////////////////////////////////////////////////////// |
|
360 |
|
361 CMultiVersionTest::CMultiVersionTest(CSingleTransferTest* aDmaTest) |
|
362 : CDmaTestDecorator(aDmaTest), iNewVersionTest(NULL) |
|
363 { |
|
364 } |
|
365 |
|
366 CMultiVersionTest::CMultiVersionTest(const CMultiVersionTest& aOther) |
|
367 : CDmaTestDecorator(aOther), iNewVersionTest( aOther.iNewVersionTest ? static_cast<CSingleTransferTest*>(aOther.iNewVersionTest->Clone()) : NULL) |
|
368 { |
|
369 } |
|
370 |
|
371 CMultiVersionTest::~CMultiVersionTest() |
|
372 { |
|
373 delete iDecoratedTest; |
|
374 delete iNewVersionTest; |
|
375 } |
|
376 |
|
377 void CMultiVersionTest::SetupL() |
|
378 { |
|
379 // Open a tempory dma session to find out the |
|
380 // capabilities of the dma channel. |
|
381 OpenDmaSession(); |
|
382 Configure(); |
|
383 CloseDmaSession(); |
|
384 } |
|
385 |
|
386 void CMultiVersionTest::Announce() const |
|
387 { |
|
388 CTest::Announce(); |
|
389 |
|
390 iDecoratedTest->Announce(); |
|
391 |
|
392 if(iNewVersionTest) |
|
393 iNewVersionTest->Announce(); |
|
394 } |
|
395 |
|
396 void CMultiVersionTest::PrintTestType() const |
|
397 { |
|
398 RDebug::RawPrint(_L("Multi version test wrapper")); |
|
399 } |
|
400 |
|
401 void CMultiVersionTest::PrintTestInfo() const |
|
402 { |
|
403 if(iNewVersionTest) |
|
404 { |
|
405 RDebug::RawPrint(_L("Running tests using Version 2 PIL")); |
|
406 } |
|
407 else |
|
408 { |
|
409 RDebug::RawPrint(_L("Running tests using Version 1 PIL")); |
|
410 } |
|
411 } |
|
412 |
|
413 void CMultiVersionTest::RunTest() |
|
414 { |
|
415 OpenDmaSession(); |
|
416 |
|
417 // iDecoratedTest is the test, in the old configuration |
|
418 // iNewVersionTest is the same test, configured |
|
419 // to use the new APIs |
|
420 // |
|
421 // 2 objects are needed since they can each store |
|
422 // their own results |
|
423 |
|
424 iDecoratedTest->OpenDmaSession(iDmaSession); |
|
425 (*iDecoratedTest)(); |
|
426 |
|
427 if(iNewVersionTest) |
|
428 { |
|
429 iNewVersionTest->OpenDmaSession(iDmaSession); |
|
430 (*iNewVersionTest)(); |
|
431 } |
|
432 |
|
433 CloseDmaSession(); |
|
434 } |
|
435 |
|
436 /** |
|
437 Maybe create another test object to run with new API |
|
438 |
|
439 Pass on the cookie for the channel they must test |
|
440 */ |
|
441 void CMultiVersionTest::Configure() |
|
442 { |
|
443 static_cast<CSingleTransferTest*>(iDecoratedTest)->UseNewDmaApi(EFalse); |
|
444 iDecoratedTest->SetChannelCookie(iChannelCookie); |
|
445 |
|
446 if(Version2PILAvailable()) |
|
447 { |
|
448 iNewVersionTest = static_cast<CSingleTransferTest*>(iDecoratedTest->Clone()); |
|
449 TEST_ASSERT(iNewVersionTest != NULL); |
|
450 |
|
451 iNewVersionTest->UseNewDmaApi(ETrue); |
|
452 iNewVersionTest->SetChannelCookie(iChannelCookie); |
|
453 } |
|
454 } |
|
455 |
|
456 /** |
|
457 Discover from DMA channel what PIL versions are available. |
|
458 In practice V1 APIs will always be available, V2 may be. |
|
459 */ |
|
460 TBool CMultiVersionTest::Version2PILAvailable() |
|
461 { |
|
462 TUint channelSessionCookie; |
|
463 TInt r = iDmaSession.ChannelOpen(iChannelCookie, channelSessionCookie); |
|
464 TEST_ASSERT(r == KErrNone); |
|
465 |
|
466 TDmacTestCaps channelCaps; |
|
467 r = iDmaSession.ChannelCaps(channelSessionCookie, channelCaps); |
|
468 TEST_ASSERT(r == KErrNone); |
|
469 |
|
470 r = iDmaSession.ChannelClose(channelSessionCookie); |
|
471 TEST_ASSERT(r == KErrNone); |
|
472 |
|
473 return channelCaps.iPILVersion >= 2; |
|
474 } |
|
475 |
|
476 TBool CMultiVersionTest::Result() |
|
477 { |
|
478 TBool v1Result = iDecoratedTest->Result(); |
|
479 if(gVerboseOutput || !v1Result) |
|
480 RDebug::Printf("V1 API result: %s", v1Result ? "success" : "failure"); |
|
481 |
|
482 TBool v2Result = iNewVersionTest ? iNewVersionTest->Result() : ETrue; |
|
483 if(gVerboseOutput || !v1Result) |
|
484 RDebug::Printf("V2 API result: %s", v2Result ? "success" : "failure"); |
|
485 return v1Result && v2Result; |
|
486 } |
243 |
487 |
244 ////////////////////////////////////////////////////////////////////// |
488 ////////////////////////////////////////////////////////////////////// |
245 // CDmaBenchmark |
489 // CDmaBenchmark |
246 ////////////////////////////////////////////////////////////////////// |
490 ////////////////////////////////////////////////////////////////////// |
247 |
|
248 CDmaBenchmark::CDmaBenchmark(const TDesC& aName, TInt aIterations, const TResultSet& aExpectedResults, const TDmaTransferArgs& aTransferArgs, TUint aMaxFragmentSize) |
491 CDmaBenchmark::CDmaBenchmark(const TDesC& aName, TInt aIterations, const TResultSet& aExpectedResults, const TDmaTransferArgs& aTransferArgs, TUint aMaxFragmentSize) |
249 :CSingleTransferTest(aName, aIterations, aTransferArgs, aExpectedResults, aMaxFragmentSize, NULL, NULL) |
492 :CSingleTransferTest(aName, aIterations, aTransferArgs, aExpectedResults, aMaxFragmentSize, NULL, NULL) |
250 { |
493 { |
251 UseNewDmaApi(EFalse); |
494 UseNewDmaApi(EFalse); |
|
495 } |
|
496 |
|
497 CDmaBenchmark::CDmaBenchmark(const CDmaBenchmark& aOriginal) |
|
498 :CSingleTransferTest(aOriginal) |
|
499 { |
|
500 CopyL(aOriginal.iResultArray, iResultArray); |
252 } |
501 } |
253 |
502 |
254 CDmaBenchmark::~CDmaBenchmark() |
503 CDmaBenchmark::~CDmaBenchmark() |
255 { |
504 { |
256 iResultArray.Close(); |
505 iResultArray.Close(); |
329 OpenChannel(); |
573 OpenChannel(); |
330 CreateDmaRequest(); |
574 CreateDmaRequest(); |
331 Fragment(); |
575 Fragment(); |
332 FreeRequest(); |
576 FreeRequest(); |
333 CloseChannel(); |
577 CloseChannel(); |
334 |
|
335 CloseDmaSession(); |
578 CloseDmaSession(); |
336 } |
579 } |
337 |
580 |
338 ////////////////////////////////////////////////////////////////////// |
581 ////////////////////////////////////////////////////////////////////// |
|
582 // CPauseResumeTest |
|
583 // |
|
584 // -Time how long a given transfer takes |
|
585 // -Pause the channel |
|
586 // -repeat the transfer (queued asynchronously) |
|
587 // -wait for some time (say, 3 times the time measured) |
|
588 // -read the value of the TRequestStatus object, to check it is still pending |
|
589 // -resume the channel |
|
590 // -Wait on the request |
|
591 // -Confirm that the request completed |
|
592 ////////////////////////////////////////////////////////////////////// |
|
593 CPauseResumeTest::~CPauseResumeTest() |
|
594 { |
|
595 } |
|
596 |
|
597 void CPauseResumeTest::RunTest() |
|
598 { |
|
599 OpenDmaSession(); |
|
600 |
|
601 //Open a single DMA channel for a transfer |
|
602 OpenChannel(); |
|
603 |
|
604 RDebug::Printf("Resume unpaused idle channel"); |
|
605 TInt r = iDmaSession.ChannelResume(iChannelSessionCookie); |
|
606 TEST_ASSERT(KErrCompletion == r); |
|
607 |
|
608 RDebug::Printf("Pause idle channel"); |
|
609 r = iDmaSession.ChannelPause(iChannelSessionCookie); |
|
610 TEST_ASSERT(KErrNone == r); |
|
611 |
|
612 RDebug::Printf("Pause paused idle Channel"); |
|
613 r = iDmaSession.ChannelPause(iChannelSessionCookie); |
|
614 TEST_ASSERT(KErrCompletion == r); |
|
615 |
|
616 RDebug::Printf("Resume paused idle channel"); |
|
617 r = iDmaSession.ChannelResume(iChannelSessionCookie); |
|
618 TEST_ASSERT(KErrNone == r); |
|
619 |
|
620 //Setup a DMA request and Fragment the request. |
|
621 CreateDmaRequest(); |
|
622 Fragment(); |
|
623 |
|
624 //Queue the DMA request and time how long a transfer takes |
|
625 TUint64 queueTime; |
|
626 DoCalibrationTransfer(queueTime); |
|
627 |
|
628 RDebug::Printf("Calibration transfer completed in %Lu us",queueTime); |
|
629 TUint32 waitQueueReqTime = I64LOW(queueTime*3); //3 times the time measured in DoCalibrationTransfer |
|
630 TEST_ASSERT(I64HIGH(queueTime*3) == 0); // If transfer takes over an hour, something has gone wrong anyway |
|
631 |
|
632 // Initialise buffers, after calibration transfer |
|
633 PreTransferSetup(); |
|
634 |
|
635 RDebug::Printf("Resume unpaused channel"); |
|
636 r = iDmaSession.ChannelResume(iChannelSessionCookie); |
|
637 TEST_ASSERT(KErrCompletion == r); |
|
638 |
|
639 //Pause DMA Transfer |
|
640 RDebug::Printf("Pausing DMA Channel"); |
|
641 r = iDmaSession.ChannelPause(iChannelSessionCookie); |
|
642 TEST_ASSERT(KErrNone == r); |
|
643 |
|
644 RDebug::Printf("Pause paused Channel"); |
|
645 r = iDmaSession.ChannelPause(iChannelSessionCookie); |
|
646 TEST_ASSERT(KErrCompletion == r); |
|
647 |
|
648 //Repeat the transfer (queued asynchronously) |
|
649 TRequestStatus queueRequestStatus; |
|
650 iActual.iRequestResult.iQueueResult = QueueAsyncRequest(queueRequestStatus,queueTime); |
|
651 RDebug::Printf("Queue a DMA Request and wait for %u us ", waitQueueReqTime); |
|
652 |
|
653 User::After(waitQueueReqTime); |
|
654 RDebug::Printf("Finished waiting"); |
|
655 TEST_ASSERT(queueRequestStatus.Int() == KRequestPending); |
|
656 |
|
657 TBool queueEmpty = ETrue; |
|
658 r = iDmaSession.ChannelIsQueueEmpty(iChannelSessionCookie,queueEmpty); |
|
659 TEST_ASSERT(r == KErrNone); |
|
660 TEST_ASSERT(!queueEmpty); |
|
661 |
|
662 //Resume DMA channel |
|
663 RDebug::Printf("Resuming paused DMA Channel"); |
|
664 r = iDmaSession.ChannelResume(iChannelSessionCookie); |
|
665 TEST_ASSERT(KErrNone == r); |
|
666 |
|
667 //Wait for transfer to complete |
|
668 User::WaitForRequest(queueRequestStatus); |
|
669 if (queueRequestStatus.Int() == KErrNone) |
|
670 { |
|
671 RDebug::Printf("DMA QueueAsyncRequest completed"); |
|
672 } |
|
673 |
|
674 FreeRequest(); |
|
675 CloseChannel(); |
|
676 |
|
677 PostTransferCheck(); |
|
678 CloseDmaSession(); |
|
679 } |
|
680 |
|
681 /** |
|
682 Time how long transfer takes, with no pausing |
|
683 */ |
|
684 void CPauseResumeTest::DoCalibrationTransfer(TUint64 &atime) |
|
685 { |
|
686 //Queue the DMA request. |
|
687 TCallbackRecord pCallbackRecord; |
|
688 TInt r = iDmaSession.QueueRequest(iRequestSessionCookie,&pCallbackRecord,&atime); |
|
689 TEST_ASSERT(r == KErrNone); |
|
690 } |
|
691 |
|
692 TInt CPauseResumeTest::QueueAsyncRequest(TRequestStatus &aRequestState, TUint64 &atime) |
|
693 { |
|
694 return iDmaSession.QueueRequest(iRequestSessionCookie,aRequestState, &iActual.iCallbackRecord, &atime); |
|
695 } |
|
696 |
|
697 void CPauseResumeTest::PrintTestType() const |
|
698 { |
|
699 RDebug::RawPrint(_L("Pause and Resume API Test")); |
|
700 } |
|
701 |
|
702 ////////////////////////////////////////////////////////////////////// |
|
703 // COpenCloseTest |
|
704 ////////////////////////////////////////////////////////////////////// |
|
705 COpenCloseTest::~COpenCloseTest() |
|
706 { |
|
707 } |
|
708 |
|
709 TBool COpenCloseTest::DoRunClose() |
|
710 { |
|
711 // For storing cookie during neagtive test i,e open channel twice |
|
712 TUint testChannelSessionCookie = 0; |
|
713 |
|
714 // Open a single DMA channel |
|
715 TInt r = iDmaSession.ChannelOpen(iChannelCookie, iChannelSessionCookie); |
|
716 if (r == KErrNone)//Check that DMA channel opened with no errors |
|
717 { |
|
718 RDebug::Printf("DMA channel opened"); |
|
719 } |
|
720 else |
|
721 { |
|
722 RDebug::Printf("Open DMA channel failed"); |
|
723 return EFalse; |
|
724 } |
|
725 |
|
726 // Open DMA channel again and check that opening DMA channel again fails |
|
727 r = iDmaSession.ChannelOpen(iChannelCookie, testChannelSessionCookie); |
|
728 if (r == KErrInUse) |
|
729 { |
|
730 RDebug::Printf("Opening DMA channel again fails as expected"); |
|
731 } |
|
732 else |
|
733 { |
|
734 RDebug::Printf("Open DMA channel again failed"); |
|
735 return EFalse; |
|
736 } |
|
737 |
|
738 // Close the DMA channel and check that DMA channel closes with no errors |
|
739 r =iDmaSession.ChannelClose(iChannelSessionCookie); |
|
740 if (r == KErrNone) |
|
741 { |
|
742 RDebug::Printf("DMA channel closes with no errors"); |
|
743 } |
|
744 else |
|
745 { |
|
746 RDebug::Printf("Close the DMA channel failed"); |
|
747 return EFalse; |
|
748 } |
|
749 |
|
750 // Verify that the DMA channel was actually closed by opening DMA channel |
|
751 r = iDmaSession.ChannelOpen(iChannelCookie, iChannelSessionCookie); |
|
752 if (r == KErrNone) |
|
753 { |
|
754 RDebug::Printf("DMA channel opened after a previous close operation"); |
|
755 return ETrue; |
|
756 } |
|
757 else |
|
758 { |
|
759 RDebug::Printf("Open DMA channel to verify that the DMA channel closed failed"); |
|
760 return EFalse; |
|
761 } |
|
762 } |
|
763 |
|
764 TBool COpenCloseTest::DoRunOpen() |
|
765 { |
|
766 // Open a single DMA channel |
|
767 TInt r = iDmaSession.ChannelOpen(iChannelCookie, iChannelSessionCookie); |
|
768 if (r == KErrNone)//Check that DMA channel opened with no errors |
|
769 { |
|
770 RDebug::Printf("DoRunOpen:DMA channel opened"); |
|
771 } |
|
772 else |
|
773 { |
|
774 RDebug::Printf("DoRunOpenDMA channel failed to open"); |
|
775 return EFalse; |
|
776 } |
|
777 |
|
778 // Verify that channel is really open by closing DMA channel |
|
779 // and checking that DMA channel closes with no errors |
|
780 r = iDmaSession.ChannelClose(iChannelSessionCookie); |
|
781 if (r == KErrNone) |
|
782 { |
|
783 RDebug::Printf("DoRunOpen:DMA channel closes with no errors"); |
|
784 return ETrue; |
|
785 } |
|
786 else |
|
787 { |
|
788 RDebug::Printf("DoRunOpen:DMA channel failed to close"); |
|
789 return EFalse; |
|
790 } |
|
791 } |
|
792 |
|
793 TBool COpenCloseTest::DoRunOpenExposed() |
|
794 { |
|
795 SCreateInfoTest TOpenInfo; |
|
796 TOpenInfo.iCookie =iChannelCookie; |
|
797 TOpenInfo.iDfcPriority = 3; |
|
798 |
|
799 const TInt desCount[3] = {0,1,128}; |
|
800 const TBool dynChannel[3] = {EFalse,EFalse,ETrue}; |
|
801 const TInt expectedResults[3] = {KErrArgument,KErrNone,KErrInUse}; |
|
802 TInt actualResults[3] = {1, 1, 1}; |
|
803 |
|
804 for (TInt i =0; i<3; i++) |
|
805 { |
|
806 TOpenInfo.iDesCount = desCount[i]; |
|
807 TOpenInfo.iDynChannel = dynChannel[i]; |
|
808 |
|
809 // Open a single DMA channel |
|
810 RDebug::Printf("DoRunOpenExposed:Trying to open DMA channel using iDesCount(%d) and iDynChannel(%d) ", TOpenInfo.iDesCount,TOpenInfo.iDynChannel); |
|
811 actualResults[i] = iDmaSession.ChannelOpen(iChannelSessionCookie, TOpenInfo); |
|
812 if (actualResults[i] == KErrNone)// Verify that channel is really open by closing DMA channel |
|
813 { |
|
814 TInt err = iDmaSession.ChannelClose(iChannelSessionCookie); |
|
815 TEST_ASSERT(err == KErrNone)//Check that DMA channel closed with no errors |
|
816 } |
|
817 } |
|
818 |
|
819 // This case should fail if idesCount = 0. |
|
820 // PIL has been changed to return KErrArgument instead of using an assertion check |
|
821 if (expectedResults[0] == actualResults[0]) |
|
822 { |
|
823 RDebug::Printf("DoRunOpenExposed:DMA channel failed to open as expected as for iDesCount = 0 "); |
|
824 } |
|
825 else |
|
826 { |
|
827 RDebug::Printf("DoRunOpenExposed:Error code returned (%d), expected KErrArgument as iDesCount= 0) ", actualResults[0]); |
|
828 return EFalse; |
|
829 } |
|
830 |
|
831 // For this case( idesCount = 1), DMA channel should open with no issues |
|
832 if (expectedResults[1] == actualResults[1]) |
|
833 { |
|
834 RDebug::Printf("DoRunOpenExposed:DMA channel closes with no errors as expected for iDesCount = 1 "); |
|
835 } |
|
836 else |
|
837 { |
|
838 RDebug::Printf("DoRunOpenExposed:Failed to open DMA channel with error code (%d)", actualResults[1]); |
|
839 return EFalse; |
|
840 } |
|
841 |
|
842 // For this case(dynaChannel=ETrue), DMA channel now returns KErrInUse. dynaChannel is not supported in the PSL. |
|
843 // PSL now returns a NULL pointer when dynaChannel is requested. The PIL interprets a NULL |
|
844 // pointer being returned from opening a DMA channel as a channel in use. Hence, KErrInUse is returned. |
|
845 if (expectedResults[2] == actualResults[2]) |
|
846 { |
|
847 RDebug::Printf("DoRunOpenExposed:DMA channel failed to open as expected as dynamic channel is not supported"); |
|
848 } |
|
849 else |
|
850 { |
|
851 RDebug::Printf("DoRunOpenExposed:Error code returned (%d), expected KErrInUse as as dynamic channel is not supported", actualResults[2]); |
|
852 return EFalse; |
|
853 } |
|
854 |
|
855 return ETrue; |
|
856 } |
|
857 |
|
858 void COpenCloseTest::RunTest() |
|
859 { |
|
860 OpenDmaSession(); |
|
861 |
|
862 if (iRunOpen) |
|
863 { // Run Open() API test |
|
864 iOpenCloseResult = DoRunOpenExposed(); |
|
865 if(iOpenCloseResult) |
|
866 iOpenCloseResult = DoRunOpen(); |
|
867 } |
|
868 else |
|
869 { |
|
870 // Run Close() API test |
|
871 iOpenCloseResult = DoRunClose(); |
|
872 } |
|
873 |
|
874 CloseDmaSession(); |
|
875 } |
|
876 |
|
877 void COpenCloseTest::PrintTestType() const |
|
878 { |
|
879 RDebug::RawPrint(_L("Close/Open API Test")); |
|
880 |
|
881 } |
|
882 |
|
883 TBool COpenCloseTest::Result() |
|
884 { |
|
885 if(gVerboseOutput) |
|
886 { |
|
887 RDebug::Printf("Results for Close/Open API Test"); |
|
888 } |
|
889 |
|
890 if(!iOpenCloseResult) |
|
891 { |
|
892 RDebug::Printf("Open/Close test sequence failed"); |
|
893 } |
|
894 |
|
895 return iOpenCloseResult; |
|
896 } |
|
897 ////////////////////////////////////////////////////////////////////// |
339 // CDmaBmTransfer |
898 // CDmaBmTransfer |
340 ////////////////////////////////////////////////////////////////////// |
899 ////////////////////////////////////////////////////////////////////// |
341 |
|
342 CDmaBmTransfer::CDmaBmTransfer(const TDesC& aName, TInt aIterations, const TDmaTransferArgs& aTransferArgs, TUint aMaxFragmentSize) |
900 CDmaBmTransfer::CDmaBmTransfer(const TDesC& aName, TInt aIterations, const TDmaTransferArgs& aTransferArgs, TUint aMaxFragmentSize) |
343 :CDmaBenchmark(aName, aIterations, |
901 :CDmaBenchmark(aName, aIterations, |
344 TResultSet(KErrNone, TRequestResults(), KErrUnknown, TCallbackRecord(TCallbackRecord::EThread,1)), |
902 TResultSet(KErrNone, TRequestResults(), KErrUnknown, TCallbackRecord(TCallbackRecord::EThread,1)), |
345 aTransferArgs, aMaxFragmentSize) |
903 aTransferArgs, aMaxFragmentSize) |
346 {} |
904 {} |
347 |
|
348 |
905 |
349 void CDmaBmTransfer::PrintTestType() const |
906 void CDmaBmTransfer::PrintTestType() const |
350 { |
907 { |
351 RDebug::RawPrint(_L("Transfer Benchmark")); |
908 RDebug::RawPrint(_L("Transfer Benchmark")); |
352 } |
909 } |
373 iActual.iRequestResult.iQueueResult = iDmaSession.QueueRequest(iRequestSessionCookie, &iActual.iCallbackRecord, &time); |
930 iActual.iRequestResult.iQueueResult = iDmaSession.QueueRequest(iRequestSessionCookie, &iActual.iCallbackRecord, &time); |
374 iResultArray.Append(time); |
931 iResultArray.Append(time); |
375 } |
932 } |
376 } |
933 } |
377 |
934 |
|
935 /* |
|
936 1. Open a DMA channel for a transfer. |
|
937 2. Queue multiple request on the DMA channel. |
|
938 3. Call CancelAll () on the DMA channel. |
|
939 4. Verify that all transfers have been cancelled. |
|
940 5. Open a DMA channel for a transfer. This channel should support pause and resume. |
|
941 6. Call Pause () on the channel. |
|
942 7. Queue multiple request on the DMA channel. |
|
943 8. Call CancelAll () on the channel. |
|
944 9. Verify that all transfers have been cancelled. |
|
945 |
|
946 Note: This check does not add results to TResultSet like some |
|
947 other tests as its operation is different. The test checks for |
|
948 the the cancelllation of all transfers queued on a channel by |
|
949 calling iDmaSession.ChannelIsQueueEmpty(); |
|
950 */ |
|
951 |
|
952 ////////////////////////////////////////////////////////////////////// |
|
953 // CCancelAllTest |
|
954 ////////////////////////////////////////////////////////////////////// |
|
955 |
|
956 |
|
957 CCancelAllTest::CCancelAllTest(const TDesC& aName, TInt aIterations, |
|
958 const TDmaTransferArgs* aTransferArgs, const TResultSet* aResultSets, |
|
959 TInt aCount) |
|
960 :CMultiTransferTest(aName, aIterations, aTransferArgs, aResultSets, aCount) |
|
961 {} |
|
962 |
|
963 void CCancelAllTest::RunTest() |
|
964 { |
|
965 OpenDmaSession(); |
|
966 PreTransferSetup(); |
|
967 |
|
968 // Open a DMA channel for a transfer.This channel should support pause and resume. |
|
969 OpenChannel(); |
|
970 |
|
971 //Call Pause () on the channel |
|
972 RDebug::Printf("Pausing DMA Channel"); |
|
973 ChannelPause(iChannelSessionCookie); |
|
974 |
|
975 // Queue multiple request on the DMA channel. |
|
976 CreateDmaRequests(); |
|
977 Fragment(); |
|
978 |
|
979 QueueRequestsAsync(); |
|
980 |
|
981 // Call CancelAll () on the DMA channel and Verify that all transfers have been cancelled. |
|
982 TInt r = CancelAllRequests(); |
|
983 TEST_ASSERT(r == KErrNone); |
|
984 |
|
985 //Call Resume () on the channel. |
|
986 RDebug::Printf("Cancel should clear Pause state: resuming channel should fail"); |
|
987 ChannelResume(iChannelSessionCookie); |
|
988 //TEST_ASSERT(r == KErrCompletion); |
|
989 |
|
990 r = DoPostTransferCheck(); |
|
991 TEST_ASSERT(r == KErrNone); |
|
992 //Destroy request |
|
993 for(TInt i=0; i<2; i++) |
|
994 { |
|
995 r = iDmaSession.RequestDestroy(iRequestCookies[i]); |
|
996 TEST_ASSERT(r == KErrNone); |
|
997 } |
|
998 |
|
999 //Close DMA channel |
|
1000 CloseChannel(); |
|
1001 |
|
1002 CloseDmaSession(); |
|
1003 } |
|
1004 |
|
1005 TInt CCancelAllTest::CancelAllRequests() |
|
1006 { |
|
1007 if(gVerboseOutput) |
|
1008 { |
|
1009 RDebug::Printf("CCancelAllTest::CancelAllRequests()"); |
|
1010 } |
|
1011 TInt r = KErrGeneral; |
|
1012 r = iDmaSession.ChannelCancelAll(iChannelSessionCookie); |
|
1013 if (r != KErrNone) |
|
1014 return r; |
|
1015 |
|
1016 TBool queueEmpty; |
|
1017 r = iDmaSession.ChannelIsQueueEmpty(iChannelSessionCookie,queueEmpty); |
|
1018 if (r != KErrNone) |
|
1019 return r; |
|
1020 |
|
1021 if(!queueEmpty) |
|
1022 return KErrGeneral; |
|
1023 |
|
1024 if(gVerboseOutput) |
|
1025 { |
|
1026 RDebug::Printf("Both current and pending requests cancelled"); |
|
1027 } |
|
1028 return KErrNone; |
|
1029 } |
|
1030 |
|
1031 void CCancelAllTest::PrintTestType() const |
|
1032 { |
|
1033 RDebug::RawPrint(_L("CCancelAllTest")); |
|
1034 } |
|
1035 |
|
1036 void CCancelAllTest::QueueRequestsAsync() |
|
1037 { |
|
1038 if(iPauseWhileQueuing) |
|
1039 { |
|
1040 TInt r = iDmaSession.ChannelPause(iChannelSessionCookie); |
|
1041 TEST_ASSERT(r == KErrNone); |
|
1042 } |
|
1043 |
|
1044 // Queue all the DMA requests asynchronously |
|
1045 TEST_ASSERT(iActualResults.Count() == iTransferArgsCount); |
|
1046 for(TInt i=0; i<iTransferArgsCount; i++) |
|
1047 { |
|
1048 TResultSet& resultSet = iActualResults[i]; |
|
1049 if(resultSet.iRequestResult.iFragmentationResult != KErrNone) |
|
1050 continue; |
|
1051 |
|
1052 TInt r = iDmaSession.QueueRequest(iRequestCookies[i], iDummyRequestStatus, &resultSet.iCallbackRecord, NULL); |
|
1053 resultSet.iRequestResult.iQueueResult = r; |
|
1054 } |
|
1055 |
|
1056 if(iPauseWhileQueuing) |
|
1057 { |
|
1058 TInt r = iDmaSession.ChannelResume(iChannelSessionCookie); |
|
1059 TEST_ASSERT(r == KErrNone); |
|
1060 } |
|
1061 } |
|
1062 |
|
1063 ////////////////////////////////////////////////////////////////////// |
|
1064 // CIsQueueEmptyTest |
|
1065 ////////////////////////////////////////////////////////////////////// |
|
1066 CIsQueueEmptyTest::CIsQueueEmptyTest(const TDesC& aName, TInt aIterations, const TDmaTransferArgs* aTransferArgs, |
|
1067 const TResultSet* aResultSets, TInt aCount) |
|
1068 :CMultiTransferTest(aName, aIterations, aTransferArgs, aResultSets, aCount) |
|
1069 {} |
|
1070 |
|
1071 CIsQueueEmptyTest::CIsQueueEmptyTest(const CIsQueueEmptyTest& aOther) |
|
1072 :CMultiTransferTest(aOther) |
|
1073 {} |
|
1074 |
|
1075 CIsQueueEmptyTest::~CIsQueueEmptyTest() |
|
1076 { |
|
1077 } |
|
1078 |
|
1079 void CIsQueueEmptyTest::RunTest() |
|
1080 { |
|
1081 OpenDmaSession(); |
|
1082 PreTransferSetup(); |
|
1083 |
|
1084 OpenChannel(); |
|
1085 |
|
1086 CreateDmaRequests(); |
|
1087 Fragment(); |
|
1088 QueueRequests(); |
|
1089 |
|
1090 TInt r = DoPostTransferCheck(); |
|
1091 TEST_ASSERT(r == KErrNone); |
|
1092 |
|
1093 CloseDmaSession(); |
|
1094 } |
|
1095 |
|
1096 void CIsQueueEmptyTest::DoIsQueueEmpty() |
|
1097 { |
|
1098 TBool queueEmpty; |
|
1099 TInt r = iDmaSession.ChannelIsQueueEmpty(iChannelSessionCookie,queueEmpty); |
|
1100 TEST_ASSERT(r == KErrNone); |
|
1101 |
|
1102 if(queueEmpty) |
|
1103 { |
|
1104 RDebug::Printf("Verified that calling IsQueueEmpty() returns ETrue before calling Queue()"); |
|
1105 } |
|
1106 else |
|
1107 { |
|
1108 RDebug::Printf("IsQueueEmpty() fails to return ETrue before calling Queue()"); |
|
1109 TEST_ASSERT(queueEmpty); |
|
1110 } |
|
1111 } |
|
1112 |
|
1113 void CIsQueueEmptyTest::DoQueueNotEmpty() |
|
1114 { |
|
1115 TBool queueEmpty; |
|
1116 TInt r = iDmaSession.ChannelIsQueueEmpty(iChannelSessionCookie,queueEmpty); |
|
1117 TEST_ASSERT(r == KErrNone); |
|
1118 |
|
1119 if (!queueEmpty) |
|
1120 { |
|
1121 RDebug::Printf("Verified that calling IsQueueEmpty() returns EFalse after calling Queue()"); |
|
1122 } |
|
1123 else |
|
1124 { |
|
1125 RDebug::Printf("IsQueueEmpty() fails to return EFalse after calling Queue()"); |
|
1126 TEST_ASSERT(!queueEmpty); |
|
1127 } |
|
1128 } |
|
1129 |
|
1130 void CIsQueueEmptyTest::PrintTestType() const |
|
1131 { |
|
1132 RDebug::RawPrint(_L("IsQueue Empty Test using Multi Transfer")); |
|
1133 } |
|
1134 |
|
1135 void CIsQueueEmptyTest::QueueRequests() |
|
1136 { |
|
1137 // Queue all the DMA requests asynchronously |
|
1138 TInt i; |
|
1139 RArray<TRequestStatus> requestStates; |
|
1140 |
|
1141 ChannelPause(iChannelSessionCookie); |
|
1142 DoIsQueueEmpty(); |
|
1143 |
|
1144 TEST_ASSERT(iActualResults.Count() == iTransferArgsCount); |
|
1145 for(i=0; i<iTransferArgsCount; i++) |
|
1146 { |
|
1147 TResultSet& resultSet = iActualResults[i]; |
|
1148 if(resultSet.iRequestResult.iFragmentationResult != KErrNone) |
|
1149 continue; |
|
1150 |
|
1151 TInt r = requestStates.Append(TRequestStatus()); |
|
1152 TEST_ASSERT(r == KErrNone); |
|
1153 |
|
1154 r = iDmaSession.QueueRequest(iRequestCookies[i], requestStates[i], &resultSet.iCallbackRecord, NULL); |
|
1155 resultSet.iRequestResult.iQueueResult = r; |
|
1156 |
|
1157 DoQueueNotEmpty(); |
|
1158 } |
|
1159 |
|
1160 ChannelResume(iChannelSessionCookie); |
|
1161 |
|
1162 // wait for all transfers to complete |
|
1163 const TInt count = requestStates.Count(); |
|
1164 |
|
1165 for(i=0; i<count; i++) |
|
1166 { |
|
1167 User::WaitForRequest(requestStates[i]); |
|
1168 } |
|
1169 |
|
1170 requestStates.Close(); |
|
1171 } |
378 |
1172 |
379 ////////////////////////////////////////////////////////////////////// |
1173 ////////////////////////////////////////////////////////////////////// |
380 // CMultiTransferTest |
1174 // CMultiTransferTest |
381 ////////////////////////////////////////////////////////////////////// |
1175 ////////////////////////////////////////////////////////////////////// |
382 |
|
383 //TODO |
|
384 // Add pre and post transfer for CMultiTransferTest |
|
385 CMultiTransferTest::CMultiTransferTest(const TDesC& aName, TInt aIterations, const TDmaTransferArgs* aTransferArgs, |
1176 CMultiTransferTest::CMultiTransferTest(const TDesC& aName, TInt aIterations, const TDmaTransferArgs* aTransferArgs, |
386 const TResultSet* aResultSets, TInt aCount) |
1177 const TResultSet* aResultSets, TInt aCount) |
387 : CDmaTest(aName, aIterations, NULL, NULL), iTransferArgs(aTransferArgs), iTransferArgsCount(aCount), iNewDmaApi(ETrue), |
1178 : CDmaTest(aName, aIterations, NULL, NULL), iTransferArgs(aTransferArgs), iTransferArgsCount(aCount), iNewDmaApi(ETrue), |
388 iChannelSessionCookie(0), iExpectedArray(aResultSets), iPauseWhileQueuing(EFalse) |
1179 iChannelSessionCookie(0), iExpectedArray(aResultSets), iPauseWhileQueuing(EFalse) |
389 {} |
1180 {} |
390 |
1181 |
391 CMultiTransferTest::CMultiTransferTest(const CMultiTransferTest& aOther) |
1182 CMultiTransferTest::CMultiTransferTest(const CMultiTransferTest& aOther) |
392 : CDmaTest(aOther), iTransferArgs(aOther.iTransferArgs), iTransferArgsCount(aOther.iTransferArgsCount), |
1183 : CDmaTest(aOther), iTransferArgs(aOther.iTransferArgs), iTransferArgsCount(aOther.iTransferArgsCount), |
393 iNewDmaApi(aOther.iNewDmaApi), |
1184 iNewDmaApi(aOther.iNewDmaApi), |
394 iExpectedArray(aOther.iExpectedArray), iPauseWhileQueuing(aOther.iPauseWhileQueuing) |
1185 iExpectedArray(aOther.iExpectedArray), iPauseWhileQueuing(aOther.iPauseWhileQueuing) |
395 //const cast is required because their isn't a ctor taking const |
1186 { |
396 //array values |
1187 CopyL(aOther.iRequestCookies, iRequestCookies); |
397 //TODO iRequestCookies(const_cast<TUint*>(&aOther.iRequestCookies[0]), aOther.iRequestCookies.Count()) |
|
398 { |
|
399 } |
1188 } |
400 |
1189 |
401 CMultiTransferTest::~CMultiTransferTest() |
1190 CMultiTransferTest::~CMultiTransferTest() |
402 { |
1191 { |
403 iRequestCookies.Close(); |
1192 iRequestCookies.Close(); |
938 |
1782 |
939 const TBool result = CheckBuffers(array); |
1783 const TBool result = CheckBuffers(array); |
940 |
1784 |
941 array.Close(); |
1785 array.Close(); |
942 return result; |
1786 return result; |
|
1787 } |
|
1788 |
|
1789 /** |
|
1790 A CMultiTransferTest will wait for all transfers to complete |
|
1791 before comapairing source and destination buffers. For this to be successful |
|
1792 each transfer must be independent ie. no destination or source may be |
|
1793 overwritten by another transfer and source buffers may not depend on an |
|
1794 earlier transfer |
|
1795 */ |
|
1796 TBool TPreTransferIncrBytes::CheckBuffers(const CMultiTransferTest& aTest) const |
|
1797 { |
|
1798 TUint8* const chunkBase = aTest.Chunk().Base(); |
|
1799 const TInt transferCount = aTest.TransferCount(); |
|
1800 |
|
1801 // assemble an array of TAddressParams from aTest, that |
|
1802 // can then be passed to CheckBuffers(RArray<TAddressParms>) |
|
1803 RArray<const TAddressParms> array; |
|
1804 |
|
1805 for(TInt i=0; i<transferCount; i++) |
|
1806 { |
|
1807 TAddressParms params = GetAddrParms(aTest.TransferArgs(i)); |
|
1808 params.Fixup((TLinAddr)chunkBase); |
|
1809 |
|
1810 array.AppendL(params); |
|
1811 } |
|
1812 |
|
1813 // 2nd arg EFalse as there is no need to permit exact repeats |
|
1814 const TBool r = CheckBuffers(array, EFalse); |
|
1815 |
|
1816 array.Close(); |
|
1817 return r; |
943 } |
1818 } |
944 |
1819 |
945 /** |
1820 /** |
946 Check that the destination of each TAddressParms does not overlap with |
1821 Check that the destination of each TAddressParms does not overlap with |
947 any previous source or destination or that if it does the whole transfer |
1822 any previous source or destination or that if it does the whole transfer |
948 matches. |
1823 matches. |
949 This is so that successive transfers do not overwrite the destinations or |
1824 This is so that successive transfers do not overwrite the destinations or |
950 sources of preceeding ones. |
1825 sources of preceeding ones. |
951 Exactly matching transfers are allowed to test the case that a repeat |
1826 |
952 transfer is required - though it can't then be determined just from |
1827 If aAllowExactRepeat is true then exactly matching transfers are allowed |
953 looking at the buffers that the repeat was successful |
1828 to test the case where a repeat transfer is required - though it can't |
|
1829 then be determined just from looking at the buffers that the repeat was |
|
1830 successful |
954 */ |
1831 */ |
955 TBool TPreTransferIncrBytes::CheckBuffers(const RArray<const TAddressParms> aTransferParams) const |
1832 TBool TPreTransferIncrBytes::CheckBuffers(const RArray<const TAddressParms>& aTransferParams, TBool aAllowExactRepeat) const |
956 { |
1833 { |
|
1834 |
957 const TInt count = aTransferParams.Count(); |
1835 const TInt count = aTransferParams.Count(); |
958 |
1836 |
|
1837 if(gVerboseOutput) |
|
1838 { |
|
1839 RDebug::Printf("CheckBuffers, %d transfers", count); |
|
1840 } |
|
1841 |
|
1842 TBuf<128> buf; |
959 for(TInt i=1; i<count; i++) |
1843 for(TInt i=1; i<count; i++) |
960 { |
1844 { |
961 const TAddressParms& current = aTransferParams[i]; |
1845 const TAddressParms& current = aTransferParams[i]; |
|
1846 |
|
1847 if(gVerboseOutput) |
|
1848 { |
|
1849 buf.Zero(); |
|
1850 current.AppendString(buf); |
|
1851 RDebug::Print(_L("Check current: %S, against:"), &buf); |
|
1852 } |
|
1853 |
962 for(TInt j=0; j<i; j++) |
1854 for(TInt j=0; j<i; j++) |
963 { |
1855 { |
964 const TAddressParms& previous = aTransferParams[j]; |
1856 const TAddressParms& previous = aTransferParams[j]; |
965 const TBool ok = !previous.Overlaps(current.DestRange()) || current == previous; |
1857 if(gVerboseOutput) |
|
1858 { |
|
1859 buf.Zero(); |
|
1860 previous.AppendString(buf); |
|
1861 RDebug::Print(_L("Previous: %S"), &buf); |
|
1862 } |
|
1863 |
|
1864 const TBool curDstOverlapsPrevTfer = previous.Overlaps(current.DestRange()); |
|
1865 const TBool curSrcDependsOnPrevDest = current.SourceRange().Overlaps(previous.DestRange()); |
|
1866 const TBool permitExactRepeat = aAllowExactRepeat && (current == previous); |
|
1867 |
|
1868 const TBool ok = !(curDstOverlapsPrevTfer || curSrcDependsOnPrevDest) || permitExactRepeat; |
966 if(!ok) |
1869 if(!ok) |
967 return EFalse; |
1870 return EFalse; |
968 } |
1871 } |
969 } |
1872 } |
970 return ETrue; |
1873 return ETrue; |
971 } |
1874 } |
972 ////////////////////////////////////////////////////////////////////// |
1875 ////////////////////////////////////////////////////////////////////// |
973 // TTransferIter class |
1876 // TTransferIter class |
974 ////////////////////////////////////////////////////////////////////// |
1877 ////////////////////////////////////////////////////////////////////// |
975 |
|
976 void TTransferIter::operator++ () |
1878 void TTransferIter::operator++ () |
977 { |
1879 { |
978 iPtr++; //the standard post increment |
1880 iPtr++; //the standard post increment |
979 if(iElem < (iCfg->iElementsPerFrame-1)) |
1881 if(iElem < (iCfg->iElementsPerFrame-1)) |
980 { |
1882 { |
1422 test.Printf(_L("Command Line Options:Verbose option specified.\n")); |
2342 test.Printf(_L("Command Line Options:Verbose option specified.\n")); |
1423 gVerboseOutput = ETrue; |
2343 gVerboseOutput = ETrue; |
1424 tokenParsed = ETrue; |
2344 tokenParsed = ETrue; |
1425 } |
2345 } |
1426 |
2346 |
|
2347 // '/suspend' option |
|
2348 if ((0== tc->FindF(KArgSuspendTest))) |
|
2349 { |
|
2350 gSuspend = ETrue; |
|
2351 tokenParsed = ETrue; |
|
2352 } |
|
2353 |
|
2354 // '/simple' option |
|
2355 if ((0== tc->FindF(KArgSimpleTest))) |
|
2356 { |
|
2357 gSimpleTest = ETrue; |
|
2358 tokenParsed = ETrue; |
|
2359 } |
|
2360 |
|
2361 // '/multi' option |
|
2362 if ((0== tc->FindF(KArgMultiPartTest))) |
|
2363 { |
|
2364 gMultiPart = ETrue; |
|
2365 tokenParsed = ETrue; |
|
2366 } |
|
2367 |
|
2368 // '/callback' option |
|
2369 if ((0== tc->FindF(KArgCallBackTest))) |
|
2370 { |
|
2371 gCallBack = ETrue; |
|
2372 tokenParsed = ETrue; |
|
2373 } |
|
2374 |
|
2375 // '/IsrAndDfc' option |
|
2376 if ((0== tc->FindF(KArgIsrDfcTest))) |
|
2377 { |
|
2378 gIsrAndDfc = ETrue; |
|
2379 tokenParsed = ETrue; |
|
2380 } |
|
2381 |
|
2382 // '/IsrReque' option |
|
2383 if ((0== tc->FindF(KArgIsrequeTest))) |
|
2384 { |
|
2385 gIsrReque = ETrue; |
|
2386 tokenParsed = ETrue; |
|
2387 } |
|
2388 |
|
2389 // '/Benchmark' option |
|
2390 if ((0== tc->FindF(KArgBenchmarkTest))) |
|
2391 { |
|
2392 gBenchmark = ETrue; |
|
2393 tokenParsed = ETrue; |
|
2394 } |
|
2395 |
|
2396 // '/Queue' option |
|
2397 if ((0== tc->FindF(KArgQueueTest))) |
|
2398 { |
|
2399 gQueue = ETrue; |
|
2400 tokenParsed = ETrue; |
|
2401 } |
|
2402 |
|
2403 // '/Fragment' option |
|
2404 if ((0== tc->FindF(KArgFragmentTest))) |
|
2405 { |
|
2406 gFragment = ETrue; |
|
2407 tokenParsed = ETrue; |
|
2408 } |
|
2409 |
|
2410 // '/Channel' option |
|
2411 if ((0== tc->FindF(KArgChannelTest))) |
|
2412 { |
|
2413 gChannel = ETrue; |
|
2414 tokenParsed = ETrue; |
|
2415 } |
|
2416 |
|
2417 // '/Graphic' option |
|
2418 if ((0== tc->FindF(KArgGraphicTest))) |
|
2419 { |
|
2420 gGraphic = ETrue; |
|
2421 tokenParsed = ETrue; |
|
2422 } |
|
2423 |
|
2424 // '/Request' option |
|
2425 if ((0== tc->FindF(KArgRequestTest))) |
|
2426 { |
|
2427 gRequest = ETrue; |
|
2428 tokenParsed = ETrue; |
|
2429 } |
|
2430 |
1427 if (!tokenParsed) |
2431 if (!tokenParsed) |
1428 { |
2432 { |
1429 // warn about unparsed parameter |
2433 // warn about unparsed parameter |
1430 test.Printf(_L("Warning: '%lS'??? not parsed\n"), tc); |
2434 test.Printf(_L("Warning: '%lS'??? not parsed\n"), tc); |
1431 gHelpRequested = ETrue; |
2435 gHelpRequested = ETrue; |