os/mm/mmlibs/mmfw/tsrc/mmfunittest/DevSoundTest/CIPlugins/src/teststepcisbcencoder.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
//
sl@0
    15
sl@0
    16
#include "teststepcisbcencoder.h"
sl@0
    17
sl@0
    18
/*****************************************************************************/
sl@0
    19
CTestStepCISbcEncoder::CTestStepCISbcEncoder()
sl@0
    20
	{
sl@0
    21
	iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0020-HP");
sl@0
    22
	}
sl@0
    23
sl@0
    24
/*****************************************************************************/
sl@0
    25
TVerdict CTestStepCISbcEncoder::DoTestStepL()
sl@0
    26
	{
sl@0
    27
	INFO_PRINTF1(_L("Initializing test SBC Encoder CI device"));
sl@0
    28
	
sl@0
    29
	//Initialize - with the UID of our test HwDevice and try to get the interface
sl@0
    30
	#ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND
sl@0
    31
	TUid testUID = {KUidSbcEncoderTestDevice};
sl@0
    32
	#else
sl@0
    33
	TFourCC testUID('T','0','0','3');
sl@0
    34
	#endif
sl@0
    35
		
sl@0
    36
 	MSbcEncoderIntfc* interface = NULL;
sl@0
    37
	interface = static_cast<MSbcEncoderIntfc*>(InitializeAndInstantiateInterfaceL(testUID, KUidSbcEncoderIntfc));
sl@0
    38
sl@0
    39
	if (interface)
sl@0
    40
		{
sl@0
    41
		iTestStepResult = EPass;
sl@0
    42
		INFO_PRINTF1(_L("Successfully retrieved the interface."));
sl@0
    43
		}
sl@0
    44
	else
sl@0
    45
		{
sl@0
    46
		iTestStepResult = EFail;
sl@0
    47
		ERR_PRINTF1(_L("Failed to retrieve the interface"));
sl@0
    48
		}
sl@0
    49
sl@0
    50
	return iTestStepResult;
sl@0
    51
	}
sl@0
    52
sl@0
    53
/****************************************************************************/
sl@0
    54
CTestStepCISbcEncoderGetSupportedFrequencies::CTestStepCISbcEncoderGetSupportedFrequencies()
sl@0
    55
	{
sl@0
    56
	iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0021-HP");
sl@0
    57
	}
sl@0
    58
sl@0
    59
TVerdict CTestStepCISbcEncoderGetSupportedFrequencies::DoTestStepL()
sl@0
    60
	{
sl@0
    61
	INFO_PRINTF1(_L("Initializing test SBC Encoder CI device"));
sl@0
    62
	
sl@0
    63
	//Initialize - with the UID of our test HwDevice and try to get the interface
sl@0
    64
	#ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND
sl@0
    65
	TUid testUID = {KUidSbcEncoderTestDevice};
sl@0
    66
	#else
sl@0
    67
	TFourCC testUID('T','0','0','3');
sl@0
    68
	#endif
sl@0
    69
	
sl@0
    70
 	MSbcEncoderIntfc* interface = NULL;
sl@0
    71
	interface = static_cast<MSbcEncoderIntfc*>(InitializeAndInstantiateInterfaceL(testUID, KUidSbcEncoderIntfc));
sl@0
    72
	if (interface)
sl@0
    73
		{
sl@0
    74
		INFO_PRINTF1(_L("Getting the SBC Encoder's Supported Sampling Frequencies"));
sl@0
    75
		
sl@0
    76
		RArray<TUint> frequencies;
sl@0
    77
		CleanupClosePushL(frequencies);
sl@0
    78
		TInt err = interface->GetSupportedSamplingFrequencies(frequencies);
sl@0
    79
		
sl@0
    80
		// Data is hard coded in the test HwDevice implementation
sl@0
    81
		// to add 10 values from 0 to 9000 in intervals of 1000.
sl@0
    82
		TBool validValues = ValidateArray(frequencies);
sl@0
    83
		if (err == KErrNone && validValues)
sl@0
    84
			{			
sl@0
    85
			iTestStepResult = EPass;
sl@0
    86
			INFO_PRINTF1(_L("Successfully got the frequencies."));
sl@0
    87
			}
sl@0
    88
		else
sl@0
    89
			{
sl@0
    90
			iTestStepResult = EFail;
sl@0
    91
			ERR_PRINTF1(_L("Failed to get the frequencies"));
sl@0
    92
			}
sl@0
    93
		CleanupStack::PopAndDestroy(); // frequencies
sl@0
    94
		}
sl@0
    95
	else
sl@0
    96
		{
sl@0
    97
		iTestStepResult = EInconclusive;
sl@0
    98
		INFO_PRINTF1(_L("Failed to retrieve the interface."));
sl@0
    99
		}
sl@0
   100
sl@0
   101
	return iTestStepResult;
sl@0
   102
	}
sl@0
   103
sl@0
   104
sl@0
   105
TBool CTestStepCISbcEncoderGetSupportedFrequencies::ValidateArray(const RArray<TUint>& aArray) const
sl@0
   106
	{
sl@0
   107
	TBool iTestStepResult = ETrue;
sl@0
   108
	
sl@0
   109
	TInt count = aArray.Count();
sl@0
   110
	if (count != 10)
sl@0
   111
		{
sl@0
   112
		iTestStepResult = EFalse;
sl@0
   113
		}
sl@0
   114
	else
sl@0
   115
		{
sl@0
   116
		TUint val = 0;
sl@0
   117
		for (TInt i = 0; i < count; i++)
sl@0
   118
			{
sl@0
   119
			if (aArray[i] != val)
sl@0
   120
				{
sl@0
   121
				iTestStepResult = EFalse;
sl@0
   122
				break;
sl@0
   123
				}
sl@0
   124
			val += 1000;
sl@0
   125
			}
sl@0
   126
		}
sl@0
   127
		
sl@0
   128
	return iTestStepResult;
sl@0
   129
	}
sl@0
   130
sl@0
   131
/****************************************************************************/
sl@0
   132
CTestStepCISbcEncoderGetSupportedSubbands::CTestStepCISbcEncoderGetSupportedSubbands()
sl@0
   133
	{
sl@0
   134
	iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0023-HP");
sl@0
   135
	}
sl@0
   136
sl@0
   137
TVerdict CTestStepCISbcEncoderGetSupportedSubbands::DoTestStepL()
sl@0
   138
	{
sl@0
   139
	INFO_PRINTF1(_L("Initializing test SBC Encoder CI device"));
sl@0
   140
	
sl@0
   141
	//Initialize - with the UID of our test HwDevice and try to get the interface
sl@0
   142
	#ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND
sl@0
   143
	TUid testUID = {KUidSbcEncoderTestDevice};
sl@0
   144
	#else
sl@0
   145
	TFourCC testUID('T','0','0','3');
sl@0
   146
	#endif
sl@0
   147
	
sl@0
   148
 	MSbcEncoderIntfc* interface = NULL;
sl@0
   149
	interface = static_cast<MSbcEncoderIntfc*>(InitializeAndInstantiateInterfaceL(testUID, KUidSbcEncoderIntfc));
sl@0
   150
	if (interface)
sl@0
   151
		{
sl@0
   152
		INFO_PRINTF1(_L("Getting the SBC Encoder's Number Of Subbands"));
sl@0
   153
sl@0
   154
		RArray<TUint> subbands;
sl@0
   155
		CleanupClosePushL(subbands);
sl@0
   156
		TInt err = interface->GetSupportedNumOfSubbands(subbands);
sl@0
   157
	
sl@0
   158
		// Data is hard coded in the test HwDevice implementation
sl@0
   159
		// to add 5 values from 100 to 500 in intervals of 100.
sl@0
   160
		TBool validValues = ValidateArray(subbands);
sl@0
   161
		if (err == KErrNone && validValues)
sl@0
   162
			{				
sl@0
   163
			iTestStepResult = EPass;
sl@0
   164
			INFO_PRINTF1(_L("Successfully got the subbands."));
sl@0
   165
			}
sl@0
   166
		else
sl@0
   167
			{
sl@0
   168
			iTestStepResult = EFail;
sl@0
   169
			ERR_PRINTF1(_L("Failed to get the subbands"));
sl@0
   170
			}
sl@0
   171
		CleanupStack::PopAndDestroy(); // subbands
sl@0
   172
		}
sl@0
   173
	else
sl@0
   174
		{
sl@0
   175
		iTestStepResult = EInconclusive;
sl@0
   176
		INFO_PRINTF1(_L("Failed to retrieve the interface."));
sl@0
   177
		}
sl@0
   178
sl@0
   179
	return iTestStepResult;
sl@0
   180
	}
sl@0
   181
sl@0
   182
sl@0
   183
TBool CTestStepCISbcEncoderGetSupportedSubbands::ValidateArray(const RArray<TUint>& aArray) const
sl@0
   184
	{
sl@0
   185
	TBool iTestStepResult = ETrue;
sl@0
   186
	
sl@0
   187
	TInt count = aArray.Count();
sl@0
   188
	if (count != 5)
sl@0
   189
		{
sl@0
   190
		iTestStepResult = EFalse;
sl@0
   191
		}
sl@0
   192
	else
sl@0
   193
		{
sl@0
   194
		TUint val = 100;
sl@0
   195
		for (TInt i = 0; i < count; i++)
sl@0
   196
			{
sl@0
   197
			if (aArray[i] != val)
sl@0
   198
				{
sl@0
   199
				iTestStepResult = EFalse;
sl@0
   200
				break;
sl@0
   201
				}
sl@0
   202
			val += 100;
sl@0
   203
			}
sl@0
   204
		}
sl@0
   205
		
sl@0
   206
	return iTestStepResult;
sl@0
   207
	}
sl@0
   208
sl@0
   209
/****************************************************************************/
sl@0
   210
CTestStepCISbcEncoderGetSupportedNumOfBlocks::CTestStepCISbcEncoderGetSupportedNumOfBlocks()
sl@0
   211
	{
sl@0
   212
	iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0025-HP");
sl@0
   213
	}
sl@0
   214
sl@0
   215
TVerdict CTestStepCISbcEncoderGetSupportedNumOfBlocks::DoTestStepL()
sl@0
   216
	{
sl@0
   217
	INFO_PRINTF1(_L("Initializing test SBC Encoder CI device"));
sl@0
   218
	
sl@0
   219
	//Initialize - with the UID of our test HwDevice and try to get the interface
sl@0
   220
	#ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND
sl@0
   221
	TUid testUID = {KUidSbcEncoderTestDevice};
sl@0
   222
	#else
sl@0
   223
	TFourCC testUID('T','0','0','3');
sl@0
   224
	#endif
sl@0
   225
	
sl@0
   226
 	MSbcEncoderIntfc* interface = NULL;
sl@0
   227
	interface = static_cast<MSbcEncoderIntfc*>(InitializeAndInstantiateInterfaceL(testUID, KUidSbcEncoderIntfc));
sl@0
   228
	if (interface)
sl@0
   229
		{
sl@0
   230
		INFO_PRINTF1(_L("Getting the SBC Encoder's Number Of Supported Blocks"));
sl@0
   231
		
sl@0
   232
		RArray<TUint> blocks;
sl@0
   233
		CleanupClosePushL(blocks);
sl@0
   234
		TInt err = interface->GetSupportedNumOfBlocks(blocks);
sl@0
   235
		
sl@0
   236
		// Data is hard coded in the test HwDevice implementation
sl@0
   237
		// to add 10 values from 1 to 10
sl@0
   238
		TBool validValues = ValidateArray(blocks);
sl@0
   239
		if (err == KErrNone && validValues)
sl@0
   240
			{		
sl@0
   241
			iTestStepResult = EPass;
sl@0
   242
			INFO_PRINTF1(_L("Successfully got the blocks."));
sl@0
   243
			}
sl@0
   244
		else
sl@0
   245
			{
sl@0
   246
			iTestStepResult = EFail;
sl@0
   247
			ERR_PRINTF1(_L("Failed to get the blocks"));
sl@0
   248
			}
sl@0
   249
		CleanupStack::PopAndDestroy(); // blocks
sl@0
   250
		}
sl@0
   251
	else
sl@0
   252
		{
sl@0
   253
		iTestStepResult = EInconclusive;
sl@0
   254
		INFO_PRINTF1(_L("Failed to retrieve the interface."));
sl@0
   255
		}
sl@0
   256
sl@0
   257
	return iTestStepResult;
sl@0
   258
	}
sl@0
   259
sl@0
   260
sl@0
   261
TBool CTestStepCISbcEncoderGetSupportedNumOfBlocks::ValidateArray(const RArray<TUint>& aArray) const
sl@0
   262
	{
sl@0
   263
	TBool iTestStepResult = ETrue;
sl@0
   264
	
sl@0
   265
	TInt count = aArray.Count();
sl@0
   266
	if (count != 10)
sl@0
   267
		{
sl@0
   268
		iTestStepResult = EFalse;
sl@0
   269
		}
sl@0
   270
	else
sl@0
   271
		{
sl@0
   272
		TUint val = 1;
sl@0
   273
		for (TInt i = 0; i < count; i++)
sl@0
   274
			{
sl@0
   275
			if (aArray[i] != val)
sl@0
   276
				{
sl@0
   277
				iTestStepResult = EFalse;
sl@0
   278
				break;
sl@0
   279
				}
sl@0
   280
			val++;
sl@0
   281
			}
sl@0
   282
		}
sl@0
   283
		
sl@0
   284
	return iTestStepResult;
sl@0
   285
	}
sl@0
   286
	
sl@0
   287
/****************************************************************************/
sl@0
   288
CTestStepCISbcEncoderGetSupportedChannelModes::CTestStepCISbcEncoderGetSupportedChannelModes()
sl@0
   289
	{
sl@0
   290
	iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0022-HP");
sl@0
   291
	}
sl@0
   292
sl@0
   293
TVerdict CTestStepCISbcEncoderGetSupportedChannelModes::DoTestStepL()
sl@0
   294
	{
sl@0
   295
	INFO_PRINTF1(_L("Initializing test SBC Encoder CI device"));
sl@0
   296
	
sl@0
   297
	//Initialize - with the UID of our test HwDevice and try to get the interface
sl@0
   298
	#ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND
sl@0
   299
	TUid testUID = {KUidSbcEncoderTestDevice};
sl@0
   300
	#else
sl@0
   301
	TFourCC testUID('T','0','0','3');
sl@0
   302
	#endif
sl@0
   303
	
sl@0
   304
 	MSbcEncoderIntfc* interface = NULL;
sl@0
   305
	interface = static_cast<MSbcEncoderIntfc*>(InitializeAndInstantiateInterfaceL(testUID, KUidSbcEncoderIntfc));
sl@0
   306
	if (interface)
sl@0
   307
		{
sl@0
   308
		INFO_PRINTF1(_L("Getting the SBC Encoder's Supported Channel Modes"));
sl@0
   309
		
sl@0
   310
		RArray<MSbcEncoderIntfc::TSbcChannelMode> modes;
sl@0
   311
		CleanupClosePushL(modes);
sl@0
   312
		TInt err = interface->GetSupportedChannelModes(modes);
sl@0
   313
				
sl@0
   314
		// Data is hard coded in the test HwDevice implementation
sl@0
   315
		// to add the 4 available values
sl@0
   316
		TBool validValues = ValidateArray(modes);
sl@0
   317
		if (err == KErrNone && validValues)
sl@0
   318
			{
sl@0
   319
			iTestStepResult = EPass;
sl@0
   320
			INFO_PRINTF1(_L("Successfully got the supported modes."));
sl@0
   321
			}
sl@0
   322
		else
sl@0
   323
			{
sl@0
   324
			iTestStepResult = EFail;
sl@0
   325
			ERR_PRINTF1(_L("Failed to get the supported modes"));
sl@0
   326
			}
sl@0
   327
		CleanupStack::PopAndDestroy(); // modes
sl@0
   328
		}
sl@0
   329
	else
sl@0
   330
		{
sl@0
   331
		iTestStepResult = EInconclusive;
sl@0
   332
		INFO_PRINTF1(_L("Failed to retrieve the interface."));
sl@0
   333
		}
sl@0
   334
sl@0
   335
	return iTestStepResult;
sl@0
   336
	}
sl@0
   337
sl@0
   338
sl@0
   339
TBool CTestStepCISbcEncoderGetSupportedChannelModes::ValidateArray(const RArray<MSbcEncoderIntfc::TSbcChannelMode>& aArray) const
sl@0
   340
	{
sl@0
   341
	TBool iTestStepResult = ETrue;
sl@0
   342
	
sl@0
   343
	TInt count = aArray.Count();
sl@0
   344
	if (count != 4)
sl@0
   345
		{
sl@0
   346
		iTestStepResult = EFalse;
sl@0
   347
		}
sl@0
   348
	else
sl@0
   349
		{
sl@0
   350
        if ((aArray[0] != MSbcEncoderIntfc::ESbcChannelMono) ||
sl@0
   351
		    (aArray[1] != MSbcEncoderIntfc::ESbcChannelDual) ||
sl@0
   352
		    (aArray[2] != MSbcEncoderIntfc::ESbcChannelStereo) ||
sl@0
   353
		    (aArray[3] != MSbcEncoderIntfc::ESbcChannelJointStereo))
sl@0
   354
		    {
sl@0
   355
        	iTestStepResult = EFalse;
sl@0
   356
        	}
sl@0
   357
   		}
sl@0
   358
		
sl@0
   359
	return iTestStepResult;
sl@0
   360
	}
sl@0
   361
	
sl@0
   362
/****************************************************************************/
sl@0
   363
CTestStepCISbcEncoderGetSupportedAllocationMethods::CTestStepCISbcEncoderGetSupportedAllocationMethods()
sl@0
   364
	{
sl@0
   365
	iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0024-HP");
sl@0
   366
	}
sl@0
   367
sl@0
   368
TVerdict CTestStepCISbcEncoderGetSupportedAllocationMethods::DoTestStepL()
sl@0
   369
	{
sl@0
   370
	INFO_PRINTF1(_L("Initializing test SBC Encoder CI device"));
sl@0
   371
	
sl@0
   372
	//Initialize - with the UID of our test HwDevice and try to get the interface
sl@0
   373
	#ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND
sl@0
   374
	TUid testUID = {KUidSbcEncoderTestDevice};
sl@0
   375
	#else
sl@0
   376
	TFourCC testUID('T','0','0','3');
sl@0
   377
	#endif
sl@0
   378
	
sl@0
   379
 	MSbcEncoderIntfc* interface = NULL;
sl@0
   380
	interface = static_cast<MSbcEncoderIntfc*>(InitializeAndInstantiateInterfaceL(testUID, KUidSbcEncoderIntfc));
sl@0
   381
	if (interface)
sl@0
   382
		{
sl@0
   383
		INFO_PRINTF1(_L("Getting the SBC Encoder's Supported Allocation Methods"));
sl@0
   384
		
sl@0
   385
		RArray<MSbcEncoderIntfc::TSbcAllocationMethod> allocMethods;
sl@0
   386
		CleanupClosePushL(allocMethods);
sl@0
   387
		TInt err = interface->GetSupportedAllocationMethods(allocMethods);
sl@0
   388
sl@0
   389
		// Data is hard coded in the test HwDevice implementation
sl@0
   390
		// to add the 2 available allocation methods
sl@0
   391
		TBool validValues = ValidateArray(allocMethods);
sl@0
   392
		if (err == KErrNone && validValues)
sl@0
   393
			{
sl@0
   394
			iTestStepResult = EPass;
sl@0
   395
			INFO_PRINTF1(_L("Successfully got the allocation methods."));
sl@0
   396
			}
sl@0
   397
		else
sl@0
   398
			{
sl@0
   399
			iTestStepResult = EFail;
sl@0
   400
			ERR_PRINTF1(_L("Failed to get the allocation methods"));
sl@0
   401
			}
sl@0
   402
		CleanupStack::PopAndDestroy(); // allocMethods
sl@0
   403
		}
sl@0
   404
	else
sl@0
   405
		{
sl@0
   406
		iTestStepResult = EInconclusive;
sl@0
   407
		ERR_PRINTF1(_L("Failed to retrieve the interface."));
sl@0
   408
		}
sl@0
   409
sl@0
   410
	return iTestStepResult;
sl@0
   411
	}
sl@0
   412
sl@0
   413
sl@0
   414
TBool CTestStepCISbcEncoderGetSupportedAllocationMethods::ValidateArray(const RArray<
sl@0
   415
																MSbcEncoderIntfc::TSbcAllocationMethod>&
sl@0
   416
																aArray) const
sl@0
   417
	{
sl@0
   418
	TBool iTestStepResult = ETrue;
sl@0
   419
	
sl@0
   420
	TInt count = aArray.Count();
sl@0
   421
	if (count != 2)
sl@0
   422
		{
sl@0
   423
		iTestStepResult = EFalse;
sl@0
   424
		}
sl@0
   425
	else
sl@0
   426
		{
sl@0
   427
        if ((aArray[0] != MSbcEncoderIntfc::ESbcAllocationSNR) ||
sl@0
   428
		    (aArray[1] != MSbcEncoderIntfc::ESbcAllocationLoudness))
sl@0
   429
		    {
sl@0
   430
        	iTestStepResult = EFalse;
sl@0
   431
        	}
sl@0
   432
		}
sl@0
   433
		
sl@0
   434
	return iTestStepResult;
sl@0
   435
	}
sl@0
   436
sl@0
   437
/*****************************************************************************/
sl@0
   438
CTestStepCISbcEncoderGetSupportedBitpoolRange::CTestStepCISbcEncoderGetSupportedBitpoolRange()
sl@0
   439
	{
sl@0
   440
	iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0026-HP");
sl@0
   441
	}
sl@0
   442
sl@0
   443
TVerdict CTestStepCISbcEncoderGetSupportedBitpoolRange::DoTestStepL()
sl@0
   444
	{
sl@0
   445
	INFO_PRINTF1(_L("Initializing test SBC Encoder CI device"));
sl@0
   446
	
sl@0
   447
	//Initialize - with the UID of our test HwDevice and try to get the interface
sl@0
   448
	#ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND
sl@0
   449
	TUid testUID = {KUidSbcEncoderTestDevice};
sl@0
   450
	#else
sl@0
   451
	TFourCC testUID('T','0','0','3');
sl@0
   452
	#endif
sl@0
   453
	
sl@0
   454
 	MSbcEncoderIntfc* interface = NULL;
sl@0
   455
	interface = static_cast<MSbcEncoderIntfc*>(InitializeAndInstantiateInterfaceL(testUID, KUidSbcEncoderIntfc));
sl@0
   456
	if (interface)
sl@0
   457
		{
sl@0
   458
		INFO_PRINTF1(_L("Getting the SBC Encoder's Supported Bitpool Range"));
sl@0
   459
		TUint minSize = 0;
sl@0
   460
		TUint maxSize = 0;
sl@0
   461
		TInt err = interface->GetSupportedBitpoolRange(minSize, maxSize);
sl@0
   462
sl@0
   463
		// Hard coded min and max values in the test device
sl@0
   464
		if ((err == KErrNone) &&
sl@0
   465
			(minSize == 1) &&
sl@0
   466
			(maxSize == 2))
sl@0
   467
			{
sl@0
   468
			iTestStepResult = EPass;
sl@0
   469
			INFO_PRINTF1(_L("Successfully got the bitpool range."));
sl@0
   470
			}
sl@0
   471
		else
sl@0
   472
			{
sl@0
   473
			iTestStepResult = EFail;
sl@0
   474
			ERR_PRINTF1(_L("Failed to get the bitpool range"));
sl@0
   475
			}
sl@0
   476
		}
sl@0
   477
	else
sl@0
   478
		{
sl@0
   479
		iTestStepResult = EInconclusive;
sl@0
   480
		ERR_PRINTF1(_L("Failed to retrieve the interface."));
sl@0
   481
		}
sl@0
   482
sl@0
   483
	return iTestStepResult;
sl@0
   484
	}
sl@0
   485
sl@0
   486
/*****************************************************************************/
sl@0
   487
CTestStepCISbcEncoderGetSetFrequency::CTestStepCISbcEncoderGetSetFrequency(TBool aIsGetTest)
sl@0
   488
								: iIsGetTest(aIsGetTest)
sl@0
   489
	{
sl@0
   490
	if (iIsGetTest)
sl@0
   491
		{
sl@0
   492
		iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0034-HP");
sl@0
   493
		}
sl@0
   494
	else
sl@0
   495
		{
sl@0
   496
		iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0027-HP");		
sl@0
   497
		}
sl@0
   498
	}
sl@0
   499
sl@0
   500
TVerdict CTestStepCISbcEncoderGetSetFrequency::DoTestStepL()
sl@0
   501
	{
sl@0
   502
	INFO_PRINTF1(_L("Initializing test SBC Encoder CI device"));
sl@0
   503
	
sl@0
   504
	//Initialize - with the UID of our test HwDevice and try to get the interface
sl@0
   505
	#ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND
sl@0
   506
	TUid testUID = {KUidSbcEncoderTestDevice};
sl@0
   507
	#else
sl@0
   508
	TFourCC testUID('T','0','0','3');
sl@0
   509
	#endif
sl@0
   510
	
sl@0
   511
 	MSbcEncoderIntfc* interface = NULL;
sl@0
   512
	interface = static_cast<MSbcEncoderIntfc*>(InitializeAndInstantiateInterfaceL(testUID, KUidSbcEncoderIntfc));
sl@0
   513
	if (interface)
sl@0
   514
		{
sl@0
   515
		INFO_PRINTF1(_L("Setting the SBC Encoder's Sampling Frequency"));
sl@0
   516
		
sl@0
   517
		TUint frequency = 666;
sl@0
   518
		interface->SetSamplingFrequency(frequency);
sl@0
   519
		
sl@0
   520
		TUint testFreq = 0;
sl@0
   521
		TInt err = interface->GetSamplingFrequency(testFreq);
sl@0
   522
		if (err == KErrNone && (frequency == testFreq))
sl@0
   523
			{
sl@0
   524
			iTestStepResult = EPass;
sl@0
   525
			if (iIsGetTest)
sl@0
   526
				{
sl@0
   527
				INFO_PRINTF1(_L("Successfully got the frequency."));
sl@0
   528
				}
sl@0
   529
			else
sl@0
   530
				{
sl@0
   531
				INFO_PRINTF1(_L("Successfully set the frequency."));			
sl@0
   532
				}
sl@0
   533
			}
sl@0
   534
		else
sl@0
   535
			{
sl@0
   536
			iTestStepResult = EFail;
sl@0
   537
			if (iIsGetTest)
sl@0
   538
				{
sl@0
   539
				ERR_PRINTF1(_L("Failed to get the frequency"));
sl@0
   540
				}
sl@0
   541
			else
sl@0
   542
				{
sl@0
   543
				ERR_PRINTF1(_L("Failed to set the frequency"));
sl@0
   544
				}
sl@0
   545
			}
sl@0
   546
		}
sl@0
   547
	else
sl@0
   548
		{
sl@0
   549
		iTestStepResult = EInconclusive;
sl@0
   550
		ERR_PRINTF1(_L("Failed to retrieve the interface."));
sl@0
   551
		}
sl@0
   552
sl@0
   553
	return iTestStepResult;
sl@0
   554
	}
sl@0
   555
	
sl@0
   556
/*****************************************************************************/
sl@0
   557
CTestStepCISbcEncoderGetSetChannelMode::CTestStepCISbcEncoderGetSetChannelMode(TBool aIsGetTest)
sl@0
   558
										: iIsGetTest(aIsGetTest)
sl@0
   559
	{
sl@0
   560
	if (iIsGetTest)
sl@0
   561
		{
sl@0
   562
		iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0035-HP");
sl@0
   563
		}
sl@0
   564
	else
sl@0
   565
		{
sl@0
   566
		iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0028-HP");		
sl@0
   567
		}
sl@0
   568
	}
sl@0
   569
sl@0
   570
TVerdict CTestStepCISbcEncoderGetSetChannelMode::DoTestStepL()
sl@0
   571
	{
sl@0
   572
	INFO_PRINTF1(_L("Initializing test SBC Encoder CI device"));
sl@0
   573
	
sl@0
   574
	//Initialize - with the UID of our test HwDevice and try to get the interface
sl@0
   575
	#ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND
sl@0
   576
	TUid testUID = {KUidSbcEncoderTestDevice};
sl@0
   577
	#else
sl@0
   578
	TFourCC testUID('T','0','0','3');
sl@0
   579
	#endif
sl@0
   580
	
sl@0
   581
 	MSbcEncoderIntfc* interface = NULL;
sl@0
   582
	interface = static_cast<MSbcEncoderIntfc*>(InitializeAndInstantiateInterfaceL(testUID, KUidSbcEncoderIntfc));
sl@0
   583
	if (interface)
sl@0
   584
		{
sl@0
   585
		INFO_PRINTF1(_L("Setting the SBC Encoder's Channel Mode"));
sl@0
   586
		MSbcEncoderIntfc::TSbcChannelMode channelMode = MSbcEncoderIntfc::ESbcChannelStereo;
sl@0
   587
		interface->SetChannelMode(channelMode);
sl@0
   588
		
sl@0
   589
		MSbcEncoderIntfc::TSbcChannelMode testChannelMode = MSbcEncoderIntfc::ESbcChannelMono;
sl@0
   590
		TInt err = interface->GetChannelMode(testChannelMode);
sl@0
   591
		if ((err == KErrNone) && (channelMode == testChannelMode))
sl@0
   592
			{
sl@0
   593
			iTestStepResult = EPass;
sl@0
   594
			if (iIsGetTest)
sl@0
   595
				{
sl@0
   596
				INFO_PRINTF1(_L("Successfully got the channel mode."));	
sl@0
   597
				}
sl@0
   598
			else
sl@0
   599
				{
sl@0
   600
				INFO_PRINTF1(_L("Successfully set the channel mode."));	
sl@0
   601
				}
sl@0
   602
			}
sl@0
   603
		else
sl@0
   604
			{
sl@0
   605
			iTestStepResult = EFail;
sl@0
   606
			if (iIsGetTest)
sl@0
   607
				{
sl@0
   608
				ERR_PRINTF1(_L("Failed to get channel mode"));	
sl@0
   609
				}
sl@0
   610
			else
sl@0
   611
				{
sl@0
   612
				ERR_PRINTF1(_L("Failed to set channel mode"));	
sl@0
   613
				}
sl@0
   614
			}
sl@0
   615
		}
sl@0
   616
	else
sl@0
   617
		{
sl@0
   618
		iTestStepResult = EInconclusive;
sl@0
   619
		ERR_PRINTF1(_L("Failed to retrieve the interface."));
sl@0
   620
		}
sl@0
   621
sl@0
   622
	return iTestStepResult;
sl@0
   623
	}
sl@0
   624
sl@0
   625
/*****************************************************************************/
sl@0
   626
CTestStepCISbcEncoderGetSetNumOfSubbands::CTestStepCISbcEncoderGetSetNumOfSubbands(TBool aIsGetTest)
sl@0
   627
										: iIsGetTest(aIsGetTest)
sl@0
   628
	{
sl@0
   629
	if (iIsGetTest)
sl@0
   630
		{
sl@0
   631
		iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0036-HP");
sl@0
   632
		}
sl@0
   633
	else
sl@0
   634
		{
sl@0
   635
		iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0029-HP");
sl@0
   636
		}
sl@0
   637
	}
sl@0
   638
sl@0
   639
TVerdict CTestStepCISbcEncoderGetSetNumOfSubbands::DoTestStepL()
sl@0
   640
	{
sl@0
   641
	INFO_PRINTF1(_L("Initializing test SBC Encoder CI device"));
sl@0
   642
	
sl@0
   643
	//Initialize - with the UID of our test HwDevice and try to get the interface
sl@0
   644
	#ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND
sl@0
   645
	TUid testUID = {KUidSbcEncoderTestDevice};
sl@0
   646
	#else
sl@0
   647
	TFourCC testUID('T','0','0','3');
sl@0
   648
	#endif
sl@0
   649
	
sl@0
   650
 	MSbcEncoderIntfc* interface = NULL;
sl@0
   651
	interface = static_cast<MSbcEncoderIntfc*>(InitializeAndInstantiateInterfaceL(testUID, KUidSbcEncoderIntfc));
sl@0
   652
	if (interface)
sl@0
   653
		{
sl@0
   654
		INFO_PRINTF1(_L("Setting the SBC Encoder's Number of Subbands"));
sl@0
   655
		TUint numOfSubbands = 6;
sl@0
   656
		interface->SetNumOfSubbands(numOfSubbands);
sl@0
   657
		
sl@0
   658
		TUint testSubbands = 0;
sl@0
   659
		TInt err = interface->GetNumOfSubbands(testSubbands);
sl@0
   660
		if (err == KErrNone && (testSubbands == numOfSubbands))
sl@0
   661
			{
sl@0
   662
			iTestStepResult = EPass;
sl@0
   663
			if (iIsGetTest)
sl@0
   664
				{
sl@0
   665
				INFO_PRINTF1(_L("Successfully got subbands."));
sl@0
   666
				}
sl@0
   667
			else
sl@0
   668
				{
sl@0
   669
				INFO_PRINTF1(_L("Successfully set subbands."));
sl@0
   670
				}
sl@0
   671
			}
sl@0
   672
		else
sl@0
   673
			{
sl@0
   674
			iTestStepResult = EFail;
sl@0
   675
			if (iIsGetTest)
sl@0
   676
				{
sl@0
   677
				ERR_PRINTF1(_L("Failed to get subbands."));
sl@0
   678
				}
sl@0
   679
			else
sl@0
   680
				{
sl@0
   681
				ERR_PRINTF1(_L("Failed to set subbands."));
sl@0
   682
				}
sl@0
   683
			}
sl@0
   684
		}
sl@0
   685
	else
sl@0
   686
		{
sl@0
   687
		iTestStepResult = EInconclusive;
sl@0
   688
		ERR_PRINTF1(_L("Failed to retrieve the interface."));
sl@0
   689
		}
sl@0
   690
sl@0
   691
	return iTestStepResult;
sl@0
   692
	}
sl@0
   693
	
sl@0
   694
/*****************************************************************************/
sl@0
   695
CTestStepCISbcEncoderGetSetNumOfBlocks::CTestStepCISbcEncoderGetSetNumOfBlocks(TBool aIsGetTest)
sl@0
   696
										: iIsGetTest(aIsGetTest)
sl@0
   697
	{
sl@0
   698
	if (iIsGetTest)
sl@0
   699
		{
sl@0
   700
		iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0037-HP");
sl@0
   701
		}
sl@0
   702
	else
sl@0
   703
		{
sl@0
   704
		iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0030-HP");
sl@0
   705
		}
sl@0
   706
	}
sl@0
   707
sl@0
   708
TVerdict CTestStepCISbcEncoderGetSetNumOfBlocks::DoTestStepL()
sl@0
   709
	{
sl@0
   710
	INFO_PRINTF1(_L("Initializing test SBC Encoder CI device"));
sl@0
   711
	
sl@0
   712
	//Initialize - with the UID of our test HwDevice and try to get the interface
sl@0
   713
	#ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND
sl@0
   714
	TUid testUID = {KUidSbcEncoderTestDevice};
sl@0
   715
	#else
sl@0
   716
	TFourCC testUID('T','0','0','3');
sl@0
   717
	#endif
sl@0
   718
	
sl@0
   719
 	MSbcEncoderIntfc* interface = NULL;
sl@0
   720
	interface = static_cast<MSbcEncoderIntfc*>(InitializeAndInstantiateInterfaceL(testUID, KUidSbcEncoderIntfc));
sl@0
   721
	if (interface)
sl@0
   722
		{
sl@0
   723
		INFO_PRINTF1(_L("Setting the SBC Encoder's Number of Blocks"));
sl@0
   724
		TUint numOfBlocks = 6;
sl@0
   725
		interface->SetNumOfBlocks(numOfBlocks);
sl@0
   726
		TUint testBlocks = 0;
sl@0
   727
		TInt err = interface->GetNumOfBlocks(testBlocks);
sl@0
   728
		if ((err == KErrNone) && (numOfBlocks == testBlocks))
sl@0
   729
			{
sl@0
   730
			iTestStepResult = EPass;
sl@0
   731
			if (iIsGetTest)
sl@0
   732
				{
sl@0
   733
				INFO_PRINTF1(_L("Successfully got the number of blocks."));
sl@0
   734
				}
sl@0
   735
			else
sl@0
   736
				{
sl@0
   737
				INFO_PRINTF1(_L("Successfully set the number of blocks."));
sl@0
   738
				}
sl@0
   739
			}
sl@0
   740
		else
sl@0
   741
			{
sl@0
   742
			iTestStepResult = EFail;
sl@0
   743
			if (iIsGetTest)
sl@0
   744
				{
sl@0
   745
				ERR_PRINTF1(_L("Failed to get the number of blocks."));
sl@0
   746
				}
sl@0
   747
			else
sl@0
   748
				{
sl@0
   749
				ERR_PRINTF1(_L("Failed to set the number of blocks."));
sl@0
   750
				}
sl@0
   751
			}
sl@0
   752
		}
sl@0
   753
	else
sl@0
   754
		{
sl@0
   755
		iTestStepResult = EInconclusive;
sl@0
   756
		ERR_PRINTF1(_L("Failed to retrieve the interface."));
sl@0
   757
		}
sl@0
   758
sl@0
   759
	return iTestStepResult;
sl@0
   760
	}
sl@0
   761
	
sl@0
   762
/*****************************************************************************/
sl@0
   763
CTestStepCISbcEncoderGetSetAllocationMethod::CTestStepCISbcEncoderGetSetAllocationMethod(TBool aIsGetTest)
sl@0
   764
										: iIsGetTest(aIsGetTest)
sl@0
   765
	{
sl@0
   766
	if (iIsGetTest)
sl@0
   767
		{
sl@0
   768
		iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0038-HP");
sl@0
   769
		}
sl@0
   770
	else
sl@0
   771
		{
sl@0
   772
		iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0031-HP");
sl@0
   773
		}
sl@0
   774
	}
sl@0
   775
sl@0
   776
TVerdict CTestStepCISbcEncoderGetSetAllocationMethod::DoTestStepL()
sl@0
   777
	{
sl@0
   778
	INFO_PRINTF1(_L("Initializing test SBC Encoder CI device"));
sl@0
   779
	
sl@0
   780
	//Initialize - with the UID of our test HwDevice and try to get the interface
sl@0
   781
	#ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND
sl@0
   782
	TUid testUID = {KUidSbcEncoderTestDevice};
sl@0
   783
	#else
sl@0
   784
	TFourCC testUID('T','0','0','3');
sl@0
   785
	#endif
sl@0
   786
	
sl@0
   787
 	MSbcEncoderIntfc* interface = NULL;
sl@0
   788
	interface = static_cast<MSbcEncoderIntfc*>(InitializeAndInstantiateInterfaceL(testUID, KUidSbcEncoderIntfc));
sl@0
   789
	if (interface)
sl@0
   790
		{
sl@0
   791
		INFO_PRINTF1(_L("Setting the SBC Encoder's Allocation Method"));
sl@0
   792
		MSbcEncoderIntfc::TSbcAllocationMethod allocationMethod = MSbcEncoderIntfc::ESbcAllocationLoudness;
sl@0
   793
		interface->SetAllocationMethod(allocationMethod);
sl@0
   794
		
sl@0
   795
		MSbcEncoderIntfc::TSbcAllocationMethod testAllocationMethod;
sl@0
   796
		TInt err = interface->GetAllocationMethod(testAllocationMethod);
sl@0
   797
		if ((err == KErrNone) && (allocationMethod == testAllocationMethod))
sl@0
   798
			{
sl@0
   799
			iTestStepResult = EPass;
sl@0
   800
			if (iIsGetTest)
sl@0
   801
				{
sl@0
   802
				INFO_PRINTF1(_L("Successfully got the allocation method."));
sl@0
   803
				}
sl@0
   804
			else
sl@0
   805
				{
sl@0
   806
				INFO_PRINTF1(_L("Successfully set the allocation method."));
sl@0
   807
				}			}
sl@0
   808
		else
sl@0
   809
			{
sl@0
   810
			iTestStepResult = EFail;
sl@0
   811
			if (iIsGetTest)
sl@0
   812
				{
sl@0
   813
				ERR_PRINTF1(_L("Failed to get the allocation method."));
sl@0
   814
				}
sl@0
   815
			else
sl@0
   816
				{
sl@0
   817
				ERR_PRINTF1(_L("Failed to set the allocation method."));
sl@0
   818
				}
sl@0
   819
			}
sl@0
   820
		}
sl@0
   821
	else
sl@0
   822
		{
sl@0
   823
		iTestStepResult = EInconclusive;
sl@0
   824
		ERR_PRINTF1(_L("Failed to retrieve the interface."));
sl@0
   825
		}
sl@0
   826
sl@0
   827
	return iTestStepResult;
sl@0
   828
	}
sl@0
   829
	
sl@0
   830
/*****************************************************************************/
sl@0
   831
CTestStepCISbcEncoderGetSetBitpoolSize::CTestStepCISbcEncoderGetSetBitpoolSize(TBool aIsGetTest)
sl@0
   832
										: iIsGetTest(aIsGetTest)
sl@0
   833
	{
sl@0
   834
	if (iIsGetTest)
sl@0
   835
		{
sl@0
   836
		iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0039-HP");
sl@0
   837
		}
sl@0
   838
	else
sl@0
   839
		{
sl@0
   840
		iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0032-HP");
sl@0
   841
		}
sl@0
   842
	}
sl@0
   843
sl@0
   844
TVerdict CTestStepCISbcEncoderGetSetBitpoolSize::DoTestStepL()
sl@0
   845
	{
sl@0
   846
	INFO_PRINTF1(_L("Initializing test SBC Encoder CI device"));
sl@0
   847
	
sl@0
   848
	//Initialize - with the UID of our test HwDevice and try to get the interface
sl@0
   849
	#ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND
sl@0
   850
	TUid testUID = {KUidSbcEncoderTestDevice};
sl@0
   851
	#else
sl@0
   852
	TFourCC testUID('T','0','0','3');
sl@0
   853
	#endif
sl@0
   854
	
sl@0
   855
 	MSbcEncoderIntfc* interface = NULL;
sl@0
   856
	interface = static_cast<MSbcEncoderIntfc*>(InitializeAndInstantiateInterfaceL(testUID, KUidSbcEncoderIntfc));
sl@0
   857
	if (interface)
sl@0
   858
		{
sl@0
   859
		INFO_PRINTF1(_L("Setting the SBC Encoder's Bitpool Size"));
sl@0
   860
		TUint bitpoolSize = 6;
sl@0
   861
		interface->SetBitpoolSize(bitpoolSize);
sl@0
   862
		
sl@0
   863
		TUint testBitpoolSize = 0;
sl@0
   864
		TInt err = interface->GetBitpoolSize(testBitpoolSize);
sl@0
   865
		if ((err == KErrNone) && (bitpoolSize == testBitpoolSize))
sl@0
   866
			{
sl@0
   867
			iTestStepResult = EPass;
sl@0
   868
			if (iIsGetTest)
sl@0
   869
				{			
sl@0
   870
				INFO_PRINTF1(_L("Successfully got the bitpool size."));
sl@0
   871
				}
sl@0
   872
			else
sl@0
   873
				{
sl@0
   874
				INFO_PRINTF1(_L("Successfully set the bitpool size."));
sl@0
   875
				}
sl@0
   876
			}
sl@0
   877
		else
sl@0
   878
			{
sl@0
   879
			iTestStepResult = EFail;
sl@0
   880
			if (iIsGetTest)
sl@0
   881
				{
sl@0
   882
				ERR_PRINTF1(_L("Failed to get the bitpool size."));
sl@0
   883
				}
sl@0
   884
			else
sl@0
   885
				{
sl@0
   886
				ERR_PRINTF1(_L("Failed to set the bitpool size."));		
sl@0
   887
				}
sl@0
   888
			}
sl@0
   889
		}
sl@0
   890
	else
sl@0
   891
		{
sl@0
   892
		iTestStepResult = EInconclusive;
sl@0
   893
		ERR_PRINTF1(_L("Failed to retrieve the interface."));
sl@0
   894
		}
sl@0
   895
sl@0
   896
	return iTestStepResult;
sl@0
   897
	}
sl@0
   898
sl@0
   899
/*****************************************************************************/
sl@0
   900
CTestStepCISbcEncoderApplyConfig::CTestStepCISbcEncoderApplyConfig()
sl@0
   901
	{
sl@0
   902
	iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0033-HP");
sl@0
   903
	}
sl@0
   904
sl@0
   905
TVerdict CTestStepCISbcEncoderApplyConfig::DoTestStepL()
sl@0
   906
	{
sl@0
   907
	INFO_PRINTF1(_L("Initializing test SBC Encoder CI device"));
sl@0
   908
	
sl@0
   909
	//Initialize - with the UID of our test HwDevice and try to get the interface
sl@0
   910
	#ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND
sl@0
   911
	TUid testUID = {KUidSbcEncoderTestDevice};
sl@0
   912
	#else
sl@0
   913
	TFourCC testUID('T','0','0','3');
sl@0
   914
	#endif
sl@0
   915
	
sl@0
   916
 	MSbcEncoderIntfc* interface = NULL;
sl@0
   917
	interface = static_cast<MSbcEncoderIntfc*>(InitializeAndInstantiateInterfaceL(testUID, KUidSbcEncoderIntfc));
sl@0
   918
	if (interface)
sl@0
   919
		{
sl@0
   920
		INFO_PRINTF1(_L("Applying the config to the SBC Encoder"));
sl@0
   921
		TInt err = interface->ApplyConfig();
sl@0
   922
		if (err == KErrNone)
sl@0
   923
			{
sl@0
   924
			iTestStepResult = EPass;
sl@0
   925
			INFO_PRINTF1(_L("Successfully applied the config."));
sl@0
   926
			}
sl@0
   927
		else
sl@0
   928
			{
sl@0
   929
			iTestStepResult = EFail;
sl@0
   930
			ERR_PRINTF2(_L("Failed to apply the config, error: %d"), err);
sl@0
   931
			}
sl@0
   932
		}
sl@0
   933
	else
sl@0
   934
		{
sl@0
   935
		iTestStepResult = EInconclusive;
sl@0
   936
		ERR_PRINTF1(_L("Failed to retrieve the interface."));
sl@0
   937
		}
sl@0
   938
	return iTestStepResult;
sl@0
   939
	}