diff -r a5496987b1da -r 189ece41fa29 kerneltest/e32test/dmav2/t_dma2.cpp --- a/kerneltest/e32test/dmav2/t_dma2.cpp Thu Jul 01 17:57:33 2010 +0100 +++ b/kerneltest/e32test/dmav2/t_dma2.cpp Fri Jul 09 13:13:20 2010 +0100 @@ -131,6 +131,7 @@ if(iDmaSession.Handle() == KNullHandle) { TInt r = iDmaSession.Open(); + RDebug::Printf("CDmaTest::OpenDmaSession = %d\n", r); TEST_ASSERT(r == KErrNone); r = iDmaSession.OpenSharedChunk(iChunk); TEST_ASSERT(r == KErrNone); @@ -700,6 +701,87 @@ } ////////////////////////////////////////////////////////////////////// +// CPauseResumeNegTest +// +// -Open DMA Channel +// -Pause and Resume DMA channel +// -Check that KErrNotSupported is returned +// -Close DMA Channel +////////////////////////////////////////////////////////////////////// +CPauseResumeNegTest::~CPauseResumeNegTest() + { + } + +void CPauseResumeNegTest::RunTest() + { + OpenDmaSession(); + + //Open a single DMA channel for a transfer + OpenChannel(); + + RDebug::Printf("Resume unpaused idle channel"); + TInt r = iDmaSession.ChannelResume(iChannelSessionCookie); + TEST_ASSERT(KErrNotSupported == r); + + RDebug::Printf("Pause idle channel"); + r = iDmaSession.ChannelPause(iChannelSessionCookie); + TEST_ASSERT(KErrNotSupported == r); + + RDebug::Printf("Pause paused idle Channel"); + r = iDmaSession.ChannelPause(iChannelSessionCookie); + TEST_ASSERT(KErrNotSupported == r); + + RDebug::Printf("Resume paused idle channel"); + r = iDmaSession.ChannelResume(iChannelSessionCookie); + TEST_ASSERT(KErrNotSupported == r); + + CloseChannel(); + CloseDmaSession(); + } + +void CPauseResumeNegTest::PrintTestType() const + { + RDebug::RawPrint(_L("Pause and Resume API Test - Negative Test")); + } + +////////////////////////////////////////////////////////////////////// +// CLinkChannelTest +// +// -Open DMA Channel +// -Link and Unlink DMA channel +// -Check that KErrNotSupported is returned +// -Close DMA Channel +// +////////////////////////////////////////////////////////////////////// +CLinkChannelTest::~CLinkChannelTest() + { + } + +void CLinkChannelTest::RunTest() + { + OpenDmaSession(); + + //Open a single DMA channel for a transfer + OpenChannel(); + + RDebug::Printf("Linking DMA channels"); + TInt r = iDmaSession.ChannelLinking(iChannelSessionCookie); + TEST_ASSERT(KErrNotSupported == r); + + RDebug::Printf("Unlinking DMA channels"); + r = iDmaSession.ChannelUnLinking(iChannelSessionCookie); + TEST_ASSERT(KErrNotSupported == r); + + CloseChannel(); + CloseDmaSession(); + } + +void CLinkChannelTest::PrintTestType() const + { + RDebug::RawPrint(_L("Channel Linking API Test - Negative Test")); + } + +////////////////////////////////////////////////////////////////////// // COpenCloseTest ////////////////////////////////////////////////////////////////////// COpenCloseTest::~COpenCloseTest() @@ -1999,8 +2081,8 @@ case EEndiannessConversion: case EGraphicsOps: case ERepeatingTransfers: - case EChannelLinking: - TEST_FAULT; + case EChannelLinking: + return aChannelCaps.iChannelLinking == (TBool)iValue; case EHwDescriptors: return aChannelCaps.iHwDescriptors == (TBool)iValue; case ESrcDstAsymmetry: @@ -2502,13 +2584,81 @@ testRunner.AddTestCases(TestArray);//Add all test cases } - test.Next(_L("call TTestRunner::RunTests()\n")); testRunner.RunTests(); test.End(); } + +struct TSimTest + { + TUint iPslId; + TBool iFragment; + }; + +const TSimTest KSimTests[] = + { + {0, EFalse}, + {1, EFalse}, + {2, ETrue}, + {3, ETrue}, + }; + +const TInt KSimTestsCount = ARRAY_LENGTH(KSimTests); + +void RunSimDMATests() + { + test.Start(_L("Run simulated DMAC tests\n")); + + test.Next(_L("Open session")); + RDmaSession session; + TInt r = session.OpenSim(); + test_KErrNone(r); + + for(TInt i=0; i