kerneltest/e32test/dmav2/test_cases.cpp
changeset 247 d8d70de2bd36
parent 139 95f71bcdcdb7
equal deleted inserted replaced
201:43365a9b78a3 247:d8d70de2bd36
   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 	}
       
  1185 
       
  1186 //--------------------------------------------------------------------------------------------
       
  1187 //! TestCaseID      KBASE-DMA-2574
       
  1188 //! TestType        CIT
       
  1189 //! PREQ            REQ
       
  1190 //! TestCaseDesc    This test verifies that the DMA Element Counting APIs can be called. The calls 
       
  1191 //!					to these functions are meant to be used to meet a code coverage requirement.These APIs
       
  1192 //!					are not yet supported so the functionality of the APIs are not currently tested.
       
  1193 //!
       
  1194 //! TestActions     
       
  1195 //!						1.	Open a DMA channel for a transfer.
       
  1196 //!						2.  Make calls to Element Counting APIs
       
  1197 //!						3.  Close DMA channel.
       
  1198 //!					
       
  1199 //! 
       
  1200 //!	TestExpectedResults 1.  DMA channel opens and KErrNone returned.
       
  1201 //!						2.  Element Counting APIs are called without crashing the framework
       
  1202 //!						3.	DMA channel closes and KErrNone returned.
       
  1203 //!
       
  1204 //! TestPriority        High
       
  1205 //! TestStatus          Implemented
       
  1206 //----------------------------------------------------------------------------------------------
       
  1207 namespace ElementCountingTest
       
  1208 	{
       
  1209 	const TInt srcAddr		= 0;
       
  1210 	const TInt desAddr		= 2 * KMega;	
       
  1211 	const TInt transferSize = 1 * KMega;	
       
  1212 
       
  1213 	TDmaTransferArgs transferArgs(srcAddr, desAddr, transferSize, KDmaMemAddr);	
       
  1214 
       
  1215 	const TResultSet expectedResults(threadCallback);
       
  1216 	CElementCountingTest testElementCounting(_L("DMA Element Counting Test"), 1, transferArgs, expectedResults);
       
  1217 	TTestCase testCaseElementCounting(&testElementCounting, EFalse, capAboveV1);
       
  1218 	}
  1114 
  1219 
  1115 static TTestCase* StaticSimpleTestArray[] = {
  1220 static TTestCase* StaticSimpleTestArray[] = {
  1116 	&Simple_1::testCase,
  1221 	&Simple_1::testCase,
  1117 	&Simple_1::testCaseConcurrent,
  1222 	&Simple_1::testCaseConcurrent,
  1118 };
  1223 };
  1196 	&OpenApiTest::testCaseOpenApi,
  1301 	&OpenApiTest::testCaseOpenApi,
  1197 };
  1302 };
  1198 
  1303 
  1199 static TTestCase* StaticSuspendTestArray[] = {
  1304 static TTestCase* StaticSuspendTestArray[] = {
  1200 	&PauseResumeApiTest::testCasePauseResume,  
  1305 	&PauseResumeApiTest::testCasePauseResume,  
       
  1306 	&PauseResumeApiNegTest::testCasePauseResumeNeg,
  1201 };
  1307 };
  1202 
  1308 
  1203 static TTestCase* StaticQueueTestArray[] = {
  1309 static TTestCase* StaticQueueTestArray[] = {
  1204 	&CancelAllTest::testCase, 
  1310 	&CancelAllTest::testCase, 
  1205 	&IsQueueEmptyTest::testCase,	
  1311 	&IsQueueEmptyTest::testCase,	
  1263 	&DDmaRequest_2::testCase,
  1369 	&DDmaRequest_2::testCase,
  1264 	&DDmaRequest_2::testCaseConcurrent,
  1370 	&DDmaRequest_2::testCaseConcurrent,
  1265 	&CloseApiTest::testCaseCloseApi,
  1371 	&CloseApiTest::testCaseCloseApi,
  1266 	&OpenApiTest::testCaseOpenApi,
  1372 	&OpenApiTest::testCaseOpenApi,
  1267 	&PauseResumeApiTest::testCasePauseResume,  
  1373 	&PauseResumeApiTest::testCasePauseResume,  
       
  1374 	&PauseResumeApiNegTest::testCasePauseResumeNeg,	
  1268 	&CancelAllTest::testCase,
  1375 	&CancelAllTest::testCase,
  1269 	&IsQueueEmptyTest::testCase,	
  1376 	&IsQueueEmptyTest::testCase,
       
  1377 	&ChannelLinkingTest::testCaseChannelLinking,
       
  1378 	&ElementCountingTest::testCaseElementCounting,
  1270 };
  1379 };
  1271 
  1380 
  1272 RPointerArray<TTestCase> TestArray(StaticTestArray, ARRAY_LENGTH(StaticTestArray));
  1381 RPointerArray<TTestCase> TestArray(StaticTestArray, ARRAY_LENGTH(StaticTestArray));
  1273 RPointerArray<TTestCase> TestArrayIsrAndDfc(StaticIsrAndDfcTestArray, ARRAY_LENGTH(StaticIsrAndDfcTestArray));
  1382 RPointerArray<TTestCase> TestArrayIsrAndDfc(StaticIsrAndDfcTestArray, ARRAY_LENGTH(StaticIsrAndDfcTestArray));
  1274 RPointerArray<TTestCase> TestArraySimple(StaticSimpleTestArray, ARRAY_LENGTH(StaticSimpleTestArray));
  1383 RPointerArray<TTestCase> TestArraySimple(StaticSimpleTestArray, ARRAY_LENGTH(StaticSimpleTestArray));