129 // Only open a new session if one |
129 // Only open a new session if one |
130 // was not already supplied |
130 // was not already supplied |
131 if(iDmaSession.Handle() == KNullHandle) |
131 if(iDmaSession.Handle() == KNullHandle) |
132 { |
132 { |
133 TInt r = iDmaSession.Open(); |
133 TInt r = iDmaSession.Open(); |
134 RDebug::Printf("CDmaTest::OpenDmaSession = %d\n", r); |
134 if(KErrNone != r) |
|
135 { |
|
136 RDebug::Printf("CDmaTest::OpenDmaSession = %d\n", r); |
|
137 } |
135 TEST_ASSERT(r == KErrNone); |
138 TEST_ASSERT(r == KErrNone); |
136 r = iDmaSession.OpenSharedChunk(iChunk); |
139 r = iDmaSession.OpenSharedChunk(iChunk); |
137 TEST_ASSERT(r == KErrNone); |
140 TEST_ASSERT(r == KErrNone); |
138 } |
141 } |
139 } |
142 } |
777 } |
780 } |
778 |
781 |
779 void CLinkChannelTest::PrintTestType() const |
782 void CLinkChannelTest::PrintTestType() const |
780 { |
783 { |
781 RDebug::RawPrint(_L("Channel Linking API Test - Negative Test")); |
784 RDebug::RawPrint(_L("Channel Linking API Test - Negative Test")); |
|
785 } |
|
786 |
|
787 ////////////////////////////////////////////////////////////////////// |
|
788 // CElementCountingTest |
|
789 // |
|
790 // -Open DMA Channel |
|
791 // -Create Request |
|
792 // -Fragment and Make calls to Element Counting APIs |
|
793 // -Check that TotalNumDstElementsTransferred() and TotalNumSrcElementsTransferred() |
|
794 // return non zero values |
|
795 // -Check that KErrNone(from test driver) returned for other API calls |
|
796 // -Queue Request |
|
797 // -Close DMA Channel |
|
798 ////////////////////////////////////////////////////////////////////// |
|
799 CElementCountingTest::~CElementCountingTest() |
|
800 { |
|
801 } |
|
802 |
|
803 void CElementCountingTest::RunTest() |
|
804 { |
|
805 OpenDmaSession(); |
|
806 PreTransferSetup(); |
|
807 |
|
808 //Open a single DMA channel for a transfer |
|
809 OpenChannel(); |
|
810 |
|
811 //Setup a DMA request and Fragment the request. |
|
812 RDebug::Printf("Create and Fragment DMA Request"); |
|
813 CreateDmaRequest(); |
|
814 Fragment(); |
|
815 |
|
816 //Enable src/dst counting |
|
817 RDebug::Printf("Enable DstElementCounting"); |
|
818 TInt r = iDmaSession.RequestEnableDstElementCounting(iRequestSessionCookie); |
|
819 TEST_ASSERT(KErrNone == r); |
|
820 |
|
821 RDebug::Printf("Enable SrcElementCounting"); |
|
822 r = iDmaSession.RequestEnableSrcElementCounting(iRequestSessionCookie); |
|
823 TEST_ASSERT(KErrNone == r); |
|
824 |
|
825 //Queue request |
|
826 RDebug::Printf("Queue DMA Request"); |
|
827 Queue(); |
|
828 |
|
829 //Disable src/dst counting |
|
830 RDebug::Printf("Disable DstElementCounting"); |
|
831 r = iDmaSession.RequestDisableDstElementCounting(iRequestSessionCookie); |
|
832 TEST_ASSERT(KErrNone == r); |
|
833 |
|
834 RDebug::Printf("Disable SrcElementCounting"); |
|
835 r = iDmaSession.RequestDisableSrcElementCounting(iRequestSessionCookie); |
|
836 TEST_ASSERT(KErrNone == r); |
|
837 |
|
838 //check total src/dst elements transferred |
|
839 RDebug::Printf("Get Total Number of DstElementsTransferred"); |
|
840 r = iDmaSession.RequestTotalNumDstElementsTransferred(iRequestSessionCookie); |
|
841 TEST_ASSERT(r >= 0); |
|
842 |
|
843 RDebug::Printf("Get Total Number of SrcElementsTransferred"); |
|
844 r = iDmaSession.RequestTotalNumSrcElementsTransferred(iRequestSessionCookie); |
|
845 TEST_ASSERT(r >= 0); |
|
846 |
|
847 FreeRequest(); |
|
848 CloseChannel(); |
|
849 |
|
850 PostTransferCheck(); |
|
851 CloseDmaSession(); |
|
852 } |
|
853 |
|
854 void CElementCountingTest::PrintTestType() const |
|
855 { |
|
856 RDebug::RawPrint(_L("Element Counting Tests")); |
782 } |
857 } |
783 |
858 |
784 ////////////////////////////////////////////////////////////////////// |
859 ////////////////////////////////////////////////////////////////////// |
785 // COpenCloseTest |
860 // COpenCloseTest |
786 ////////////////////////////////////////////////////////////////////// |
861 ////////////////////////////////////////////////////////////////////// |