// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
// All rights reserved.
// This component and the accompanying materials are made available
// under the terms of "Eclipse Public License v1.0"
// which accompanies this distribution, and is available
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
//
// Initial Contributors:
// Nokia Corporation - initial contribution.
//
// Contributors:
//
// Description:
//

LOAD_SUITE tsi_a3f_devsound.dll


//! @SYMTestCaseID				MM-A3F-DEVSOUND-PLAY-PCM-I-0028
//! @SYMTestCaseDesc			Negative: Initialize DevSound in Record mode and play (-ve)
//! @SYMTestPriority			High
//! @SYMTestType				CIT
//! @SYMREQ
//! @SYMPREQ					1540
//! @SYMTestActions				1. Initialise DevSound in Recording state
//!								2. Call PlayInitL
//!								3. Error code should be received
//! @SYMTestExpectedResults		PlayInitL must return with KErrNotReady

RUN_TEST_STEP 600000 TSI_A3F_DEVSOUND MM-A3F-DEVSOUND-PLAY-PCM-I-0028 \tsi_a3f_devsound\tsi_a3f_devsound_play.ini
TEST_COMPLETE

//! @SYMTestCaseID				MM-A3F-DEVSOUND-PLAY-PCM-I-0029
//! @SYMTestCaseDesc			Negative: Empty buffers during playback (-ve)
//! @SYMTestPriority			High
//! @SYMTestType				CIT
//! @SYMREQ
//! @SYMPREQ					1540
//! @SYMTestActions				1. Configure DevSound to play PCM16 raw audio data in mono mode with sampling rate of 8 kHz.
//!								2. Start playing and read recorded data from file.
//!								3. Call EmptyBuffers after the first BTBF state
//! @SYMTestExpectedResults		EmptyBuffers while playing should return with KErrNone

RUN_TEST_STEP 600000 TSI_A3F_DEVSOUND MM-A3F-DEVSOUND-PLAY-PCM-I-0029 \tsi_a3f_devsound\tsi_a3f_devsound_play.ini
TEST_COMPLETE

//! @SYMTestCaseID				MM-A3F-DEVSOUND-PLAY-PCM-I-0030
//! @SYMTestCaseDesc			Negative: Call InitializeL while playback is in progress (-ve)
//! @SYMTestPriority			High
//! @SYMTestType				CIT
//! @SYMREQ 					7927
//! @SYMPREQ					1540
//! @SYMTestActions				1. Configure DevSound to play PCM16 raw audio data in mono mode with sampling rate of 8 kHz.
//!								2. Start playing and read recorded data from file.
//!								3. After 10 seconds have passed, and playback is still in progress, initialise DevSound again
//!								4. Error code should be received
//! @SYMTestExpectedResults		Second call to InitializeL must return with KErrNotReady

RUN_TEST_STEP 600000 TSI_A3F_DEVSOUND MM-A3F-DEVSOUND-PLAY-PCM-I-0030 \tsi_a3f_devsound\tsi_a3f_devsound_play.ini
TEST_COMPLETE

//! @SYMTestCaseID				MM-A3F-DEVSOUND-PLAY-PCM-I-0031
//! @SYMTestCaseDesc			Negative: Initialize DevSound HwDeviceUID (-ve)
//! @SYMTestPriority			High
//! @SYMTestType				CIT
//! @SYMREQ
//! @SYMPREQ					1540
//! @SYMTestActions				1. Initialise DevSound using a HwDeviceUID instead of a FourCC code
//!								2. Error code should be received
//! @SYMTestExpectedResults		InitializeL must return with KErrNotSupported

RUN_TEST_STEP 600000 TSI_A3F_DEVSOUND MM-A3F-DEVSOUND-PLAY-PCM-I-0031 \tsi_a3f_devsound\tsi_a3f_devsound_play.ini
TEST_COMPLETE

//! @SYMTestCaseID				MM-A3F-DEVSOUND-PLAY-PCM-I-0032
//! @SYMTestCaseDesc			Positive: Set Play balance during playback and get it to confirm balance set correctly (+ve)
//! @SYMTestPriority			High
//! @SYMTestType				CIT
//! @SYMREQ
//! @SYMPREQ					1540
//! @SYMTestActions				1. Configure DevSound to play PCM16 raw audio data in mono mode with sampling rate of 8 kHz.
//!								2. Start playing and read recorded data from file.
//!								3. In the BuffertoBeFilled callback set the playback balance
//!								4. Get the balance and check that it's the same as the one that was set
//! @SYMTestExpectedResults		SetPlayBalanceL returns with KErrNone
//!								GetPlayBalanceL returns with KErrNone and the left and right balance values match the ones previously set

RUN_TEST_STEP 600000 TSI_A3F_DEVSOUND MM-A3F-DEVSOUND-PLAY-PCM-I-0032 \tsi_a3f_devsound\tsi_a3f_devsound_play.ini
TEST_COMPLETE

//! @SYMTestCaseID				MM-A3F-DEVSOUND-PLAY-PCM-I-0033
//! @SYMTestCaseDesc			Positive: Get the number of samples played after stopping the playback (+ve)
//! @SYMTestPriority			High
//! @SYMTestType				CIT
//! @SYMREQ
//! @SYMPREQ					1540
//! @SYMTestActions				1. Configure DevSound to play PCM16 raw audio data in mono mode with sampling rate of 8 kHz.
//!								2. Start playing and read recorded data from file.
//!								3. Stop playback after 10 seconds and get the number of samples played
//!								4. Samples Played should be more than 0
//! @SYMTestExpectedResults		SamplesPlayed should return a value greater than 0

RUN_TEST_STEP 600000 TSI_A3F_DEVSOUND MM-A3F-DEVSOUND-PLAY-PCM-I-0033 \tsi_a3f_devsound\tsi_a3f_devsound_play.ini
TEST_COMPLETE

//! @SYMTestCaseID				MM-A3F-DEVSOUND-PLAY-PCM-I-0034
//! @SYMTestCaseDesc			Negative: Call second InitializeL before the first InitializeL has completed (-ve)
//! @SYMTestPriority			High
//! @SYMTestType				CIT
//! @SYMREQ 					7927
//! @SYMPREQ					1540
//! @SYMTestActions				1. Initialise DevSound for playback
//!								2. Initialise DevSound again without waiting for the InitializeComplete callback
//! @SYMTestExpectedResults		The first initialisation should complete correctly, the second one should fail with KErrNotReady

RUN_TEST_STEP 600000  TSI_A3F_DEVSOUND MM-A3F-DEVSOUND-PLAY-PCM-I-0034 \tsi_a3f_devsound\tsi_a3f_devsound_play.ini
TEST_COMPLETE

//! @SYMTestCaseID				MM-A3F-DEVSOUND-PLAY-PCM-I-0035
//! @SYMTestCaseDesc			Negative: Call second PlayInitL before the first PlayInitL has completed (-ve)
//! @SYMTestPriority			High
//! @SYMTestType				CIT
//! @SYMREQ 					7927
//! @SYMPREQ					1540
//! @SYMTestActions				1. Configure DevSound to play PCM16 raw audio data in mono mode with sampling rate of 8 kHz.
//!								2. Call PlayInitL twice.
//!								3. In the BufferToBeFilled callback check the error codes of both PlayInitL calls
//! @SYMTestExpectedResults		The first PlayInitL should complete correctly, the second one should fail with KErrNotReady

RUN_TEST_STEP 600000  TSI_A3F_DEVSOUND MM-A3F-DEVSOUND-PLAY-PCM-I-0035 \tsi_a3f_devsound\tsi_a3f_devsound_play.ini
TEST_COMPLETE

//! @SYMTestCaseID				MM-A3F-DEVSOUND-PLAY-PCM-I-0036
//! @SYMTestCaseDesc			Negative: Set the volume beyond the maximum and minimum supported values and get the set volume to check if volume is cropped (-ve)
//! @SYMTestPriority			High
//! @SYMTestType				CIT
//! @SYMREQ 					7927
//! @SYMPREQ					1540
//! @SYMTestActions				1. Initialise DevSound for playback
//!								2. Get the Max Volume supported
//!								3. Set the volume higher than the Max Volume
//!								4. Verify the volume was cropped to the Max Volume
//!								5. Set the volume lower than zero
//!								6. Verify the volume was cropped to zero
//! @SYMTestExpectedResults		Setting the volume to a value beyond the maximum supported volume will crop it to the maximum supported volume.
//!								Setting the volume to a value below the minimum supported volume will crop ot to the minimum supported volume

RUN_TEST_STEP 600000  TSI_A3F_DEVSOUND MM-A3F-DEVSOUND-PLAY-PCM-I-0036 \tsi_a3f_devsound\tsi_a3f_devsound_play.ini
TEST_COMPLETE

//! @SYMTestCaseID				MM-A3F-DEVSOUND-PLAY-PCM-I-0037
//! @SYMTestCaseDesc			Negative: Initialize the DevSound in TMMFState EMMFStateConverting (-ve)
//! @SYMTestPriority			High
//! @SYMTestType				CIT
//! @SYMREQ 					7927
//! @SYMPREQ					1540
//! @SYMTestActions				1. Initialise DevSound in converting state
//! @SYMTestExpectedResults		InitializeL must return with KErrNotSupported. DevSound is not initialised

RUN_TEST_STEP 600000  TSI_A3F_DEVSOUND MM-A3F-DEVSOUND-PLAY-PCM-I-0037 \tsi_a3f_devsound\tsi_a3f_devsound_play.ini
TEST_COMPLETE

//! @SYMTestCaseID				MM-A3F-DEVSOUND-PLAY-PCM-I-0038
//! @SYMTestCaseDesc			Positive: Call CMMFDevSound::CancelInitialize before the InitializeComplete callback. (+ve)
//! 							
//! @SYMTestPriority			High
//! @SYMTestType				CIT
//! @SYMREQ 					????
//! @SYMPREQ					1540
//! @SYMTestActions 			1.	Configure DevSound to play PCM16 raw audio data.
//! 							2.	Initialize DevSound via CMMFDevSound::InitializeL in play mode using TMMFState::EMMFStatePlaying.
//! 							3.	Call CMMFDevSound::CancelInitialize before the InitializeComplete callback is received
//! 							4.	Wait 10 seconds to ensure the InitializeComplete callback is not received.
//! 							5.	Call SetConfig to verify DevSound is not initialized.
//!
//! @SYMTestExpectedResults 	The CMMFDevSound::CancelInitialize call cancels the InitializeComplete callback. DevSound is not Initialized

RUN_TEST_STEP 600000  TSI_A3F_DEVSOUND MM-A3F-DEVSOUND-PLAY-PCM-I-0038 \tsi_a3f_devsound\tsi_a3f_devsound_play.ini
TEST_COMPLETE

//! @SYMTestCaseID				MM-A3F-DEVSOUND-PLAY-PCM-I-0039
//! @SYMTestCaseDesc			Negative: Call CMMFDevSound::CancelInitialize after the InitializeComplete callback. (-ve)
//! 							
//! @SYMTestPriority			High
//! @SYMTestType				CIT
//! @SYMREQ 					????
//! @SYMPREQ					1540
//! @SYMTestActions 			1.	Configure DevSound to play PCM16 raw audio data.
//! 							2.	Initialize DevSound via CMMFDevSound::InitializeL in record mode using TMMFState::EMMFStateRecording.
//! 							3.	Call CMMFDevSound::CancelInitialize after the InitializeComplete callback is received
//!
//! @SYMTestExpectedResults 	The CMMFDevSound::CancelInitialize call returns with KErrNotReady. DevSound is Initialized

RUN_TEST_STEP 600000  TSI_A3F_DEVSOUND MM-A3F-DEVSOUND-PLAY-PCM-I-0039 \tsi_a3f_devsound\tsi_a3f_devsound_play.ini
TEST_COMPLETE

//! @SYMTestCaseID				MM-A3F-DEVSOUND-PLAY-PCM-I-0040
//! @SYMTestCaseDesc			Negative: Call CMMFDevSound::EmptyBuffers after creating the DevSound object. (-ve)
//! 							
//! @SYMTestPriority			High
//! @SYMTestType				CIT
//! @SYMREQ 					????
//! @SYMPREQ					1540
//! @SYMTestActions 			1.	Create the DevSound object
//! 							2.	Call CMMFDevSound::EmptyBuffers
//!
//! @SYMTestExpectedResults 	The CMMFDevSound::EmptyBuffers call returns with KErrNotReady.

RUN_TEST_STEP 600000  TSI_A3F_DEVSOUND MM-A3F-DEVSOUND-PLAY-PCM-I-0040
TEST_COMPLETE

//! @SYMTestCaseID				MM-A3F-DEVSOUND-PLAY-PCM-I-0041
//! @SYMTestCaseDesc			Negative: Call CMMFDevSound::EmptyBuffers after the InitializeComplete callback. (-ve)
//! 							
//! @SYMTestPriority			High
//! @SYMTestType				CIT
//! @SYMREQ 					????
//! @SYMPREQ					1540
//! @SYMTestActions 			1.	Configure DevSound to play PCM16 raw audio data.
//! 							2.	Initialize DevSound via CMMFDevSound::InitializeL in play mode using TMMFState::EMMFStatePlaying.
//! 							3.	Call CMMFDevSound::EmptyBuffers after the InitializeComplete callback is received
//!
//! @SYMTestExpectedResults 	The CMMFDevSound::EmptyBuffers call returns with KErrNotReady.

RUN_TEST_STEP 600000  TSI_A3F_DEVSOUND MM-A3F-DEVSOUND-PLAY-PCM-I-0041 \tsi_a3f_devsound\tsi_a3f_devsound_play.ini
TEST_COMPLETE

//! @SYMTestCaseID				MM-A3F-DEVSOUND-PLAY-PCM-I-0042
//! @SYMTestCaseDesc			Negative: Call CMMFDevSound::EmptyBuffers before the InitializeComplete callback. (-ve)
//! 							
//! @SYMTestPriority			High
//! @SYMTestType				CIT
//! @SYMREQ 					????
//! @SYMPREQ					1540
//! @SYMTestActions 			1.	Configure DevSound to play PCM16 raw audio data.
//! 							2.	Initialize DevSound via CMMFDevSound::InitializeL in play mode using TMMFState::EMMFStatePlaying.
//! 							3.	Call CMMFDevSound::EmptyBuffers before the InitializeComplete callback is received
//!
//! @SYMTestExpectedResults 	The CMMFDevSound::EmptyBuffers call returns with KErrNotReady.

RUN_TEST_STEP 600000  TSI_A3F_DEVSOUND MM-A3F-DEVSOUND-PLAY-PCM-I-0042 \tsi_a3f_devsound\tsi_a3f_devsound_play.ini
TEST_COMPLETE
