bluetoothapitest/bluetoothsvs/T_BTUserAPI/scripts/BT-USER-L2CapConfig-PublicApi.script
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 27 Apr 2010 17:48:21 +0300
branchRCL_3
changeset 14 f8503e232b0c
parent 0 29b1cd4cb562
permissions -rw-r--r--
Revision: 201011 Kit: 201017

//
// Copyright (c) 2005-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:
//
///////////////////////////////////////////////////////////////////////////////
//! @file
//! @SYMTestSuiteName			T_BTUserAPI
//! @SYMScriptTestEnvironment	This test script requires a basic ROM with bluetooth dongle.
//! @SYMScriptDescription		Tests all public elements of the TL2CapConfig class
//!								as a means of confidence that the API works as expected. 
//!								The purpose is to provide a regression test suite of PublishedAll APIs for 
//!								BT USER related classes.
//!								Negative testing is performed to confirm that correct errors are returned 
//!								when incorrect parameters are given. The tests are fully automated.
//! @SYMAuthor					Cliff Chuang
//! @SYMCreationDate			12/03/2007
///////////////////////////////////////////////////////////////////////////////

RUN_UTILS MkDir ${SYSDRIVE}\bluetooth\
RUN_UTILS MkDir ${SYSDRIVE}\bluetooth\user\

LOAD_SUITE	T_BTUserAPI
DELAY		500


// ****************************************************************************
// TL2CapConfig
// **************************************************************************** 

START_TESTCASE BT-USER-L2CapConfig-PublicApi-8001
//! @SYMTestCaseID					BT-USER-L2CapConfig-PublicApi-8001
//! @SYMAPI							TL2CapConfig
//! @SYMTestCaseDesc				Create a TL2CapConfig object
//!									Uses API elements: TL2CapConfig()
//! @SYMTestActions					Create a new empty TL2CapConfig object
//!	
//! @SYMTestStatus					Implemented
//! @SYMTestPriority				Low
//! @SYMTestExpectedResults			object created
//! @SYMTestType					CIT

	START_TEST_BLOCK	10	T_BTUserAPI	\bluetooth\user\BT-USER-L2CapConfig-PublicApi.ini
			CREATE_OBJECT	TL2CapConfig	TL2CapConfigData	
			COMMAND		TL2CapConfigData	TL2CapConfig	
	END_TEST_BLOCK

END_TESTCASE BT-USER-L2CapConfig-PublicApi-8001


START_TESTCASE BT-USER-L2CapConfig-PublicApi-8002
//! @SYMTestCaseID					BT-USER-L2CapConfig-PublicApi-8002
//! @SYMAPI							TL2CapConfig
//! @SYMTestCaseDesc				Set a new (outgoing) max transmit unit size
//!									Uses API elements: TL2CapConfig() and SetMaxTransmitUnitSize()
//! @SYMTestActions					1. Create a new empty TL2CapConfig object
//!									2. Set a new (outgoing) max transmit unit size (decimal 65535) and return KErrNone
//!
//! @SYMTestStatus					Implemented
//! @SYMTestPriority				Low
//! @SYMTestExpectedResults			KErrNone returned
//! @SYMTestType					CIT

	START_TEST_BLOCK	10	T_BTUserAPI	\bluetooth\user\BT-USER-L2CapConfig-PublicApi.ini
			CREATE_OBJECT	TL2CapConfig	TL2CapConfigData	
			COMMAND		TL2CapConfigData	TL2CapConfig	
			COMMAND		TL2CapConfigData	SetMaxTransmitUnitSize		BT-USER-L2CapConfig-PublicApi-0002-0001command2SetMaxTransmitUnitSize
	END_TEST_BLOCK

END_TESTCASE BT-USER-L2CapConfig-PublicApi-8002


START_TESTCASE BT-USER-L2CapConfig-PublicApi-8003
//! @SYMTestCaseID					BT-USER-L2CapConfig-PublicApi-8003
//! @SYMAPI							TL2CapConfig
//! @SYMTestCaseDesc				Set and Get maximum transmit unit size
//!									Uses API elements: TL2CapConfig() and MaxTransmitUnitSize()
//! @SYMTestActions					1. Create a new empty TL2CapConfig object
//!									2. Get MTU value. Verify that if result (False) is as expected (False).
//!									3. Set a new (outgoing) max transmit unit size (decimal 65534) and return KErrNone
//!									3. Get MTU value
//!									4. Verify that True if MTU value has been set with the value (decimal 65534) as expected
//!
//! @SYMTestStatus					Implemented
//! @SYMTestPriority				Low
//! @SYMTestExpectedResults			True if MTU value has been set, otherwise False
//! @SYMTestType					CIT

	START_TEST_BLOCK	10	T_BTUserAPI	\bluetooth\user\BT-USER-L2CapConfig-PublicApi.ini
			CREATE_OBJECT	TL2CapConfig	TL2CapConfigData	
			COMMAND		TL2CapConfigData	TL2CapConfig	
			COMMAND		TL2CapConfigData	MaxTransmitUnitSize		BT-USER-L2CapConfig-PublicApi-0003-0001command2MaxTransmitUnitSize
			COMMAND		TL2CapConfigData	SetMaxTransmitUnitSize		BT-USER-L2CapConfig-PublicApi-0003-0001command3SetMaxTransmitUnitSize
			COMMAND		TL2CapConfigData	MaxTransmitUnitSize		BT-USER-L2CapConfig-PublicApi-0003-0001command4MaxTransmitUnitSize
	END_TEST_BLOCK

END_TESTCASE BT-USER-L2CapConfig-PublicApi-8003


START_TESTCASE BT-USER-L2CapConfig-PublicApi-8004
//! @SYMTestCaseID					BT-USER-L2CapConfig-PublicApi-8004
//! @SYMAPI							TL2CapConfig
//! @SYMTestCaseDesc				Set a new (incoming) max receive unit size
//!									Uses API elements: TL2CapConfig() and SetMaxReceiveUnitSize()
//! @SYMTestActions					1. Create a new empty TL2CapConfig object
//!									2. Set a new (incoming) max receive unit size (decimal 65535) and return KErrNone
//!
//! @SYMTestStatus					Implemented
//! @SYMTestPriority				Low
//! @SYMTestExpectedResults			KErrNone returned
//! @SYMTestType					CIT

	START_TEST_BLOCK	10	T_BTUserAPI	\bluetooth\user\BT-USER-L2CapConfig-PublicApi.ini
			CREATE_OBJECT	TL2CapConfig	TL2CapConfigData	
			COMMAND		TL2CapConfigData	TL2CapConfig	
			COMMAND		TL2CapConfigData	SetMaxReceiveUnitSize		BT-USER-L2CapConfig-PublicApi-0004-0001command2SetMaxReceiveUnitSize
	END_TEST_BLOCK

END_TESTCASE BT-USER-L2CapConfig-PublicApi-8004


START_TESTCASE BT-USER-L2CapConfig-PublicApi-8005
//! @SYMTestCaseID					BT-USER-L2CapConfig-PublicApi-8005
//! @SYMAPI							TL2CapConfig
//! @SYMTestCaseDesc				Set and Get max receive unit size
//!									Uses API elements: TL2CapConfig() and MaxReceiveUnitSize()
//! @SYMTestActions					1. Create a new empty TL2CapConfig object
//!									2. Get max receive unit size. Verify that if result (False) is as expected (False)
//!									3. Set a new (incoming) max receive unit size (decimal 65535) and return KErrNone
//!									4. Set max receive unit size
//!									5. Verify that True if MRU value has been set with the value (decimal 65534) as expected
//!
//! @SYMTestStatus					Implemented
//! @SYMTestPriority				Low
//! @SYMTestExpectedResults			True if MRU value has been set, otherwise False
//! @SYMTestType					CIT

	START_TEST_BLOCK	10	T_BTUserAPI	\bluetooth\user\BT-USER-L2CapConfig-PublicApi.ini
			CREATE_OBJECT	TL2CapConfig	TL2CapConfigData	
			COMMAND		TL2CapConfigData	TL2CapConfig	
			COMMAND		TL2CapConfigData	MaxReceiveUnitSize		BT-USER-L2CapConfig-PublicApi-0005-0001command2MaxReceiveUnitSize
			COMMAND		TL2CapConfigData	SetMaxReceiveUnitSize		BT-USER-L2CapConfig-PublicApi-0005-0001command3SetMaxReceiveUnitSize
			COMMAND		TL2CapConfigData	MaxReceiveUnitSize		BT-USER-L2CapConfig-PublicApi-0005-0001command4MaxReceiveUnitSize
	END_TEST_BLOCK

END_TESTCASE BT-USER-L2CapConfig-PublicApi-8005


START_TESTCASE BT-USER-L2CapConfig-PublicApi-8006
//! @SYMTestCaseID					BT-USER-L2CapConfig-PublicApi-8006
//! @SYMAPI							TL2CapConfig
//! @SYMTestCaseDesc				Set a reliable channel
//!									Uses API elements: TL2CapConfig() and ConfigureReliableChannel()
//! @SYMTestActions					1. Create a new empty TL2CapConfig object
//!									2. Request a reliable channel and the length of time allowed for l2Cap retransmissions (decimal 1) 
//!									   and return KErrNone
//!									3. Request a reliable channel and the length of time allowed for l2Cap retransmissions (decimal 60) 
//!									   and return KErrNone
//!
//! @SYMTestStatus					Implemented
//! @SYMTestPriority				Low
//! @SYMTestExpectedResults			Always KErrNone returned
//! @SYMTestType					CIT

	START_TEST_BLOCK	10	T_BTUserAPI	\bluetooth\user\BT-USER-L2CapConfig-PublicApi.ini
			CREATE_OBJECT	TL2CapConfig	TL2CapConfigData	
			COMMAND		TL2CapConfigData	TL2CapConfig	
			COMMAND		TL2CapConfigData	ConfigureReliableChannel		BT-USER-L2CapConfig-PublicApi-0006-0001command2ConfigureReliableChannel
			COMMAND		TL2CapConfigData	ConfigureReliableChannel		BT-USER-L2CapConfig-PublicApi-0006-0001command3ConfigureReliableChannel
	END_TEST_BLOCK

END_TESTCASE BT-USER-L2CapConfig-PublicApi-8006


START_TESTCASE BT-USER-L2CapConfig-PublicApi-8007
//! @SYMTestCaseID					BT-USER-L2CapConfig-PublicApi-8007
//! @SYMAPI							TL2CapConfig
//! @SYMTestCaseDesc				Set an unreliable channel
//!									Uses API elements: TL2CapConfig() and ConfigureUnreliableChannel()
//! @SYMTestActions					1. Create a new empty TL2CapConfig object
//!									2. Request an unreliable channel and give the time (decimal 300) after which a packet may be dropped 
//!									   or "flushed" by the baseband and return KErrNone
//!
//! @SYMTestStatus					Implemented
//! @SYMTestPriority				Low
//! @SYMTestExpectedResults			KErrNone returned
//! @SYMTestType					CIT

	START_TEST_BLOCK	10	T_BTUserAPI	\bluetooth\user\BT-USER-L2CapConfig-PublicApi.ini
			CREATE_OBJECT	TL2CapConfig	TL2CapConfigData	
			COMMAND		TL2CapConfigData	TL2CapConfig	
			COMMAND		TL2CapConfigData	ConfigureUnreliableChannel		BT-USER-L2CapConfig-PublicApi-0007-0001command2ConfigureUnreliableChannel
	END_TEST_BLOCK

END_TESTCASE BT-USER-L2CapConfig-PublicApi-8007


START_TESTCASE BT-USER-L2CapConfig-PublicApi-8008
//! @SYMTestCaseID					BT-USER-L2CapConfig-PublicApi-8008
//! @SYMAPI							TL2CapConfig
//! @SYMTestCaseDesc				Set and get the channel reliability and the associated timer
//!									Uses API elements: TL2CapConfig(), ConfigureReliableChannel(), ConfigureUnreliableChannel() and ChannelReliability()
//! @SYMTestActions					1. Create a new empty TL2CapConfig object
//!									2. Get the channel reliability and the assoicated timer. Verify that if result (False) is as expected (False)
//!									3. Set a reliable channel and the length of time (decimal 60) allowed for l2Cap retransmissions and return KErrNone
//!									4. Get the channel reliability (return True) and verify that if TChannelReliability (EReliableChannel) is as expected (EReliableChannel)
//!									5. If TChannelReliability is as expected, verify that the assoicated timer (decimal 60) is as expected (decimal 60) 
//!									6. Set an unreliable channel and give the time (decimal 300) after which a packet may be dropped or "flushed" by the 
//									   baseband and return KErrNone
//!									7. Get the channel reliability (return True) and verify that if TChannelReliability (EUnreliableChannel) is as expected (EUnreliableChannel)
//!									8. If TChannelReliability is as expected, verify that the assoicated timer (decimal 300) is as expected (decimal 300) 
//!
//! @SYMTestStatus					Implemented
//! @SYMTestPriority				Low
//! @SYMTestExpectedResults			True if channel reliability and assoicated timer have been set, otherwise false
//! @SYMTestType					CIT

	START_TEST_BLOCK	10	T_BTUserAPI	\bluetooth\user\BT-USER-L2CapConfig-PublicApi.ini
			CREATE_OBJECT	TL2CapConfig	TL2CapConfigData	
			COMMAND		TL2CapConfigData	TL2CapConfig	
			COMMAND		TL2CapConfigData	ChannelReliability		BT-USER-L2CapConfig-PublicApi-0008-0001command2ChannelReliability
			COMMAND		TL2CapConfigData	ConfigureReliableChannel		BT-USER-L2CapConfig-PublicApi-0008-0001command3ConfigureReliableChannel
			COMMAND		TL2CapConfigData	ChannelReliability		BT-USER-L2CapConfig-PublicApi-0008-0001command4ChannelReliability
			COMMAND		TL2CapConfigData	ConfigureUnreliableChannel		BT-USER-L2CapConfig-PublicApi-0008-0001command5ConfigureUnreliableChannel
			COMMAND		TL2CapConfigData	ChannelReliability		BT-USER-L2CapConfig-PublicApi-0008-0001command6ChannelReliability
	END_TEST_BLOCK

END_TESTCASE BT-USER-L2CapConfig-PublicApi-8008


START_TESTCASE BT-USER-L2CapConfig-PublicApi-8009
//! @SYMTestCaseID					BT-USER-L2CapConfig-PublicApi-8009
//! @SYMAPI							TL2CapConfig
//! @SYMTestCaseDesc				Set a new channel priority
//!									Uses API elements: TL2CapConfig() and ConfigureChannelPriority()
//! @SYMTestActions					1. Create a new empty TL2CapConfig object
//!									2. Set a new channel priority (EHigh) and return KErrNone
//!									3. Set a new channel priority (EMedium) and return KErrNone
//!									4. Set a new channel priority (ELow) and return KErrNone
//!
//! @SYMTestStatus					Implemented
//! @SYMTestPriority				Low
//! @SYMTestExpectedResults			Always KErrNone returned
//! @SYMTestType					CIT

	START_TEST_BLOCK	10	T_BTUserAPI	\bluetooth\user\BT-USER-L2CapConfig-PublicApi.ini
			CREATE_OBJECT	TL2CapConfig	TL2CapConfigData	
			COMMAND		TL2CapConfigData	TL2CapConfig	
			COMMAND		TL2CapConfigData	ConfigureChannelPriority		BT-USER-L2CapConfig-PublicApi-0009-0001command2ConfigureChannelPriority
			COMMAND		TL2CapConfigData	ConfigureChannelPriority		BT-USER-L2CapConfig-PublicApi-0009-0001command3ConfigureChannelPriority
			COMMAND		TL2CapConfigData	ConfigureChannelPriority		BT-USER-L2CapConfig-PublicApi-0009-0001command4ConfigureChannelPriority
	END_TEST_BLOCK

END_TESTCASE BT-USER-L2CapConfig-PublicApi-8009


START_TESTCASE BT-USER-L2CapConfig-PublicApi-8010
//! @SYMTestCaseID					BT-USER-L2CapConfig-PublicApi-8010
//! @SYMAPI							TL2CapConfig
//! @SYMTestCaseDesc				Set and Get channel priority
//!									Uses API elements: TL2CapConfig(), ChannelPriority() and ConfigureChannelPriority()
//! @SYMTestActions					1. Create a new empty TL2CapConfig object
//!									2. Get the channel priority. Verify that if result (False) is as expected (False)
//!									3. Set the new channel priority (EHigh) and return KErrNone
//!									4. Get the new channel priority
//!									5. Verify that True if channel priority has been set with value (EHigh) as expected (EHigh)
//!
//! @SYMTestStatus					Implemented
//! @SYMTestPriority				Low
//! @SYMTestExpectedResults			True if channel priority has been set, otherwise fail
//! @SYMTestType					CIT

	START_TEST_BLOCK	10	T_BTUserAPI	\bluetooth\user\BT-USER-L2CapConfig-PublicApi.ini
			CREATE_OBJECT	TL2CapConfig	TL2CapConfigData	
			COMMAND		TL2CapConfigData	TL2CapConfig	
			COMMAND		TL2CapConfigData	ChannelPriority		BT-USER-L2CapConfig-PublicApi-0010-0001command2ChannelPriority
			COMMAND		TL2CapConfigData	ConfigureChannelPriority		BT-USER-L2CapConfig-PublicApi-0010-0001command3ConfigureChannelPriority
			COMMAND		TL2CapConfigData	ChannelPriority		BT-USER-L2CapConfig-PublicApi-0010-0001command4ChannelPriority
	END_TEST_BLOCK

END_TESTCASE BT-USER-L2CapConfig-PublicApi-8010

// ****************************************************************************
// Negative test cases
// ****************************************************************************

START_TESTCASE BT-USER-L2CapConfig-PublicApi-8011
//! @SYMTestCaseID					BT-USER-L2CapConfig-PublicApi-8011
//! @SYMAPI							TL2CapConfig
//! @SYMTestCaseDesc				Set a new (incoming) max receive unit size
//!									Uses API elements: TL2CapConfig() and SetMaxReceiveUnitSize()
//! @SYMTestActions					1. Create a new empty TL2CapConfig object
//!									2. Set a new (incoming) max receive unit size (decimal 0)
//!
//! @SYMTestStatus					Implemented
//! @SYMTestPriority				Low
//! @SYMTestExpectedResults			KErrArgument returned
//! @SYMTestType					CIT

	START_TEST_BLOCK	10	T_BTUserAPI	\bluetooth\user\BT-USER-L2CapConfig-PublicApi.ini
			CREATE_OBJECT	TL2CapConfig	TL2CapConfigData	
			COMMAND		TL2CapConfigData	TL2CapConfig	
			COMMAND	!Error=-6	TL2CapConfigData	SetMaxReceiveUnitSize		BT-USER-L2CapConfig-PublicApi-0011-0001command2SetMaxReceiveUnitSize
	END_TEST_BLOCK

END_TESTCASE BT-USER-L2CapConfig-PublicApi-8011


START_TESTCASE BT-USER-L2CapConfig-PublicApi-8012
//! @SYMTestCaseID					BT-USER-L2CapConfig-PublicApi-8012
//! @SYMAPI							TL2CapConfig
//! @SYMTestCaseDesc				Set a new (outgoing) max transmit unit size
//!									Uses API elements: Constructor and SetMaxTransmitUnitSize()
//! @SYMTestActions					1. Create an empty TL2CapConfig object
//!									2. Set a new (outgoing) max transmit unit size (decimal 0) and return KErrArgument
//!
//! @SYMTestStatus					Implemented
//! @SYMTestPriority				Low
//! @SYMTestExpectedResults			KErrArgument returned
//! @SYMTestType					CIT

	START_TEST_BLOCK	10	T_BTUserAPI	\bluetooth\user\BT-USER-L2CapConfig-PublicApi.ini
			CREATE_OBJECT	TL2CapConfig	TL2CapConfigData	
			COMMAND		TL2CapConfigData	TL2CapConfig	
			COMMAND	!Error=-6	TL2CapConfigData	SetMaxTransmitUnitSize		BT-USER-L2CapConfig-PublicApi-0012-0001command2SetMaxTransmitUnitSize
	END_TEST_BLOCK

END_TESTCASE BT-USER-L2CapConfig-PublicApi-8012


START_TESTCASE BT-USER-L2CapConfig-PublicApi-8013
//! @SYMTestCaseID					BT-USER-L2CapConfig-PublicApi-8013
//! @SYMAPI							TL2CapConfig
//! @SYMTestCaseDesc				Set an unreliable channel
//!									Uses API elements: ConfigureUnreliableChannel()
//! @SYMTestActions					1. Create an empty TL2CapConfig object
//!									2. Request an unreliable channel and give the time (decimal 1) after which a packet may be dropped or 
//!									   "flushed" by the baseband and return KErrArgument
//!
//! @SYMTestStatus					Implemented
//! @SYMTestPriority				Low
//! @SYMTestExpectedResults			KErrArgument returned
//! @SYMTestType					CIT

	START_TEST_BLOCK	10	T_BTUserAPI	\bluetooth\user\BT-USER-L2CapConfig-PublicApi.ini
			CREATE_OBJECT	TL2CapConfig	TL2CapConfigData	
			COMMAND		TL2CapConfigData	TL2CapConfig	
			COMMAND	!Error=-6	TL2CapConfigData	ConfigureUnreliableChannel		BT-USER-L2CapConfig-PublicApi-0013-0001command2ConfigureUnreliableChannel
	END_TEST_BLOCK

END_TESTCASE BT-USER-L2CapConfig-PublicApi-8013

DELAY		2000