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