kerneltest/e32test/dmav2/test_cases.cpp
changeset 199 189ece41fa29
parent 130 c30940f6d922
child 243 c7a0ce20c48c
equal deleted inserted replaced
189:a5496987b1da 199:189ece41fa29
   117 	TDmaTransferArgs transferArgs(srcAddr, desAddr, transferSize, KDmaMemAddr);
   117 	TDmaTransferArgs transferArgs(srcAddr, desAddr, transferSize, KDmaMemAddr);
   118 	const TResultSet expectedResults(threadCallback);
   118 	const TResultSet expectedResults(threadCallback);
   119 	CPauseResumeTest testPauseResume = CPauseResumeTest(_L("Pause and Resume Test"), 1, transferArgs, expectedResults); 
   119 	CPauseResumeTest testPauseResume = CPauseResumeTest(_L("Pause and Resume Test"), 1, transferArgs, expectedResults); 
   120 	TTestCase testCasePauseResume(&testPauseResume, EFalse, capAboveV1,pauseRequired_skip);	
   120 	TTestCase testCasePauseResume(&testPauseResume, EFalse, capAboveV1,pauseRequired_skip);	
   121 	}
   121 	}
   122 
   122 //--------------------------------------------------------------------------------------------
       
   123 //! TestCaseID      KBASE-DMA-2572
       
   124 //! TestType        CIT
       
   125 //! PREQ            REQ
       
   126 //! TestCaseDesc    This test verifies the correct behavior of Pause and Resume API in the new DMA 
       
   127 //!					framework 
       
   128 //!
       
   129 //! TestActions     
       
   130 //!						1.	Open a DMA channel for a transfer.
       
   131 //!						2.  Pause and Resume DMA channel.
       
   132 //!						3.  Close DMA channel.
       
   133 //!					
       
   134 //! 
       
   135 //!	TestExpectedResults 1.  DMA channel opens and KErrNone returned.
       
   136 //!						2.  KErrNotSupported returned when Pause and Resume API are called.
       
   137 //!						3.	DMA channel closes and KErrNone returned.
       
   138 //!
       
   139 //! TestPriority        High
       
   140 //! TestStatus          Implemented
       
   141 //----------------------------------------------------------------------------------------------
       
   142 namespace PauseResumeApiNegTest
       
   143 	{
       
   144 	const TInt srcAddr		= 0;
       
   145 	const TInt desAddr		= 2 * KMega;	
       
   146 	const TInt transferSize = 1 * KMega;	
       
   147 
       
   148 	TDmaTransferArgs transferArgs(srcAddr, desAddr, transferSize, KDmaMemAddr);	
       
   149 
       
   150 	TResultSet noTransferExpected = TResultSet().
       
   151 		RequestResult(TRequestResults().CreationResult(KErrUnknown).FragmentationResult(KErrUnknown).QueueResult(KErrUnknown)).
       
   152 		CallbackRecord(TCallbackRecord::Empty()).
       
   153 		PostTransferResult(KErrUnknown);
       
   154 
       
   155 	CPauseResumeNegTest testPauseResumeNeg = CPauseResumeNegTest(_L("Pause and Resume Negative Test"), 1, transferArgs, noTransferExpected); 
       
   156 	TTestCase testCasePauseResumeNeg(&testPauseResumeNeg , EFalse, capAboveV1,pauseNotWanted);	
       
   157 	}
   123 //--------------------------------------------------------------------------------------------
   158 //--------------------------------------------------------------------------------------------
   124 //! TestCaseID      KBASE-DMA-2560
   159 //! TestCaseID      KBASE-DMA-2560
   125 //! TestType        CIT
   160 //! TestType        CIT
   126 //! PREQ            REQ
   161 //! PREQ            REQ
   127 //! TestCaseDesc    Simple DMA transfer test using CSingleTransferTest and New DMA APIs
   162 //! TestCaseDesc    Simple DMA transfer test using CSingleTransferTest and New DMA APIs
  1109 			.SetPostTransferTest(&KCompareSrcDst);
  1144 			.SetPostTransferTest(&KCompareSrcDst);
  1110 
  1145 
  1111 	TTestCase testCase(&isQueueEmpty,EFalse,capAboveV1,pauseRequired_skip);
  1146 	TTestCase testCase(&isQueueEmpty,EFalse,capAboveV1,pauseRequired_skip);
  1112 	}
  1147 	}
  1113 
  1148 
       
  1149 //--------------------------------------------------------------------------------------------
       
  1150 //! TestCaseID      KBASE-DMA-2573
       
  1151 //! TestType        CIT
       
  1152 //! PREQ            REQ
       
  1153 //! TestCaseDesc    This test verifies the correct behavior of the DMA Channel Linking API 
       
  1154 //!					in the new DMA framework 
       
  1155 //!
       
  1156 //! TestActions     
       
  1157 //!						1.	Open a DMA channel for a transfer.
       
  1158 //!						2.  Link and Unlink DMA channel.
       
  1159 //!						3.  Close DMA channel.
       
  1160 //!					
       
  1161 //! 
       
  1162 //!	TestExpectedResults 1.  DMA channel opens and KErrNone returned.
       
  1163 //!						2.  KErrNotSupported returned when DMA Linking and Unlinking API are called.
       
  1164 //!						3.	DMA channel closes and KErrNone returned.
       
  1165 //!
       
  1166 //! TestPriority        High
       
  1167 //! TestStatus          Implemented
       
  1168 //----------------------------------------------------------------------------------------------
       
  1169 namespace ChannelLinkingTest
       
  1170 	{
       
  1171 	const TInt srcAddr		= 0;
       
  1172 	const TInt desAddr		= 2 * KMega;	
       
  1173 	const TInt transferSize = 1 * KMega;	
       
  1174 
       
  1175 	TDmaTransferArgs transferArgs(srcAddr, desAddr, transferSize, KDmaMemAddr);	
       
  1176 
       
  1177 	TResultSet noTransferExpected = TResultSet().
       
  1178 		RequestResult(TRequestResults().CreationResult(KErrUnknown).FragmentationResult(KErrUnknown).QueueResult(KErrUnknown)).
       
  1179 		CallbackRecord(TCallbackRecord::Empty()).
       
  1180 		PostTransferResult(KErrUnknown);
       
  1181 
       
  1182 	CLinkChannelTest testChannelLinking = CLinkChannelTest(_L("DMA Channel Linking and Unlinking Negative Test"), 1, transferArgs, noTransferExpected); 
       
  1183 	TTestCase testCaseChannelLinking(&testChannelLinking , EFalse, capAboveV1,LinkingNotWanted);	
       
  1184 	}
  1114 
  1185 
  1115 static TTestCase* StaticSimpleTestArray[] = {
  1186 static TTestCase* StaticSimpleTestArray[] = {
  1116 	&Simple_1::testCase,
  1187 	&Simple_1::testCase,
  1117 	&Simple_1::testCaseConcurrent,
  1188 	&Simple_1::testCaseConcurrent,
  1118 };
  1189 };
  1196 	&OpenApiTest::testCaseOpenApi,
  1267 	&OpenApiTest::testCaseOpenApi,
  1197 };
  1268 };
  1198 
  1269 
  1199 static TTestCase* StaticSuspendTestArray[] = {
  1270 static TTestCase* StaticSuspendTestArray[] = {
  1200 	&PauseResumeApiTest::testCasePauseResume,  
  1271 	&PauseResumeApiTest::testCasePauseResume,  
       
  1272 	&PauseResumeApiNegTest::testCasePauseResumeNeg,
  1201 };
  1273 };
  1202 
  1274 
  1203 static TTestCase* StaticQueueTestArray[] = {
  1275 static TTestCase* StaticQueueTestArray[] = {
  1204 	&CancelAllTest::testCase, 
  1276 	&CancelAllTest::testCase, 
  1205 	&IsQueueEmptyTest::testCase,	
  1277 	&IsQueueEmptyTest::testCase,	
  1263 	&DDmaRequest_2::testCase,
  1335 	&DDmaRequest_2::testCase,
  1264 	&DDmaRequest_2::testCaseConcurrent,
  1336 	&DDmaRequest_2::testCaseConcurrent,
  1265 	&CloseApiTest::testCaseCloseApi,
  1337 	&CloseApiTest::testCaseCloseApi,
  1266 	&OpenApiTest::testCaseOpenApi,
  1338 	&OpenApiTest::testCaseOpenApi,
  1267 	&PauseResumeApiTest::testCasePauseResume,  
  1339 	&PauseResumeApiTest::testCasePauseResume,  
       
  1340 	&PauseResumeApiNegTest::testCasePauseResumeNeg,	
  1268 	&CancelAllTest::testCase,
  1341 	&CancelAllTest::testCase,
  1269 	&IsQueueEmptyTest::testCase,	
  1342 	&IsQueueEmptyTest::testCase,
       
  1343 	&ChannelLinkingTest::testCaseChannelLinking,
  1270 };
  1344 };
  1271 
  1345 
  1272 RPointerArray<TTestCase> TestArray(StaticTestArray, ARRAY_LENGTH(StaticTestArray));
  1346 RPointerArray<TTestCase> TestArray(StaticTestArray, ARRAY_LENGTH(StaticTestArray));
  1273 RPointerArray<TTestCase> TestArrayIsrAndDfc(StaticIsrAndDfcTestArray, ARRAY_LENGTH(StaticIsrAndDfcTestArray));
  1347 RPointerArray<TTestCase> TestArrayIsrAndDfc(StaticIsrAndDfcTestArray, ARRAY_LENGTH(StaticIsrAndDfcTestArray));
  1274 RPointerArray<TTestCase> TestArraySimple(StaticSimpleTestArray, ARRAY_LENGTH(StaticSimpleTestArray));
  1348 RPointerArray<TTestCase> TestArraySimple(StaticSimpleTestArray, ARRAY_LENGTH(StaticSimpleTestArray));