os/mm/mmhais/dvbhunittest/hai/dvbh/src/dvbhhaitest.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 /**
    17  @file
    18  @internalComponent
    19  @prototype
    20 */
    21 
    22 #include "dvbhhaitest.h"
    23 #include "dvbhhaitestutil.h"
    24 #include <mobiletv/hai/dvbh/dvbhtypes.h>
    25 
    26 /**
    27 * RDvbhHaiTest 
    28 *	DVB-H HAI Unit Tests on stub implementations
    29 */
    30 		
    31 RDvbhHaiTest* RDvbhHaiTest::NewL(TBool aRequireReceiverInfo, const TDesC& aTestName)
    32 	{
    33 	RDvbhHaiTest* self = new (ELeave) RDvbhHaiTest(aRequireReceiverInfo, aTestName);
    34 	return self;	
    35 	}
    36 	
    37 RDvbhHaiTest::RDvbhHaiTest(TBool aRequireReceiverInfo, const TDesC& aTestName)
    38 : RTestStep(), iDvbhTestDriverVersion(1, 2, 3), iDvbhTestTime(TDateTime(2007, EJuly, 30, 16, 35, 22, 18)),
    39   iDvbhTestPerformanceData(), iDvbhTestScanConfiguration(), iDvbhTestPlatform(), iDvbhTestHardwareInfo(),
    40   iDvbhTestNetwork(), iDvbhTestNetworkTime(), iDvbhTestScanResult(), iRequireReceiverInfo(aRequireReceiverInfo),
    41   iRxInfo(NULL), iTestUtils(NULL), iReceiverType(EDvbhReceiverBluetooth)
    42 	{
    43 	iTestStepName.Copy(aTestName);
    44 	SetupParameterData();
    45 	}
    46 
    47 void RDvbhHaiTest::SetupParameterData()
    48 	{
    49 	// The members initialised here should be treated as constants
    50 	// and not changed.
    51 	iDvbhTestPerformanceData.iFilterCount = 1;
    52 	iDvbhTestPerformanceData.iMaxFilters = 2;
    53 	iDvbhTestPerformanceData.iDataCount = 3;
    54 	iDvbhTestPerformanceData.iWriteCount = 4;
    55 	iDvbhTestPerformanceData.iWriteCommandCount = 5;
    56 	iDvbhTestPerformanceData.iReadCount = 6;
    57 	iDvbhTestPerformanceData.iReadCommandCount = 7;
    58 	
    59 	iDvbhTestScanConfiguration.iScanStartFrequency = 100;
    60 	iDvbhTestScanConfiguration.iScanEndFrequency = 200;
    61 	iDvbhTestScanConfiguration.iSignalBandwidth = 10;
    62 	iDvbhTestScanConfiguration.iScanOptions = EDvbhScanOptionFullScan;
    63 
    64 	iDvbhTestPlatform.iPlatform.iId = KInitialPlatformId;
    65 	iDvbhTestPlatform.iPlatform.iName = KInitialPlatformName;
    66 	iDvbhTestPlatform.iEsgRoot = KDvbhTestIpV6Addr;
    67 	
    68 	iDvbhTestHardwareInfo = KDvbhTestHardwareInfo;
    69 	
    70 	iDvbhTestNetworkTime.iNetworkTime = iDvbhTestTime;
    71 	iDvbhTestNetworkTime.iTerminalTimeStamp = KDvbhTestTerminalTimeStamp;
    72 	iDvbhTestNetworkTime.iPlatformId = KInitialPlatformId;
    73 	}
    74 
    75 void RDvbhHaiTest::InfoPrintf3(const TDesC16& aString, TInt aInt1, TInt aInt2)
    76 	{
    77 	INFO_PRINTF3(aString, aInt1, aInt2);
    78 	}
    79 
    80 void RDvbhHaiTest::InfoPrintf4(const TDesC16& aString, TInt aInt1, TInt aInt2, TInt aInt3)
    81 	{
    82 	INFO_PRINTF4(aString, aInt1, aInt2, aInt3);
    83 	}
    84 		
    85 TVerdict RDvbhHaiTest::DoTestStepPreambleL()
    86 	{
    87 	TRAPD(result, iTestUtils = CDvbhTestUtil::NewL(*this));
    88 	if (result != KErrNone)
    89 		{
    90 		INFO_PRINTF2(_L("Error %d creating CDvbhTestUtil"), result);
    91 		return EInconclusive;		
    92 		}
    93 	
    94 	if (iRequireReceiverInfo)
    95 		{
    96 		TRAP(result, iRxInfo = CDvbhReceiverInfo::NewL())
    97 		if (result != KErrNone)
    98 			{
    99 			INFO_PRINTF2(_L("Error %d creating CDvbhReceiverInfo"), result);
   100 			return EInconclusive;
   101 			}
   102 		}
   103 		
   104 	if (iTestStepName.Compare(_L("MM-TV-DVBH-U-101")) == 0)		
   105 		{
   106 		result = iTestUtils->DefineAllDvbhProperties();
   107 		}
   108 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-103")) == 0)	
   109 		{
   110 		result = iTestUtils->DefineDvbhStateProperty(EDvbhStateInactive);
   111 		}
   112 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-104")) == 0)	
   113 		{
   114 		 // Receiver state must be EDvbhStateReceiving before we can do this test.
   115 		result = iTestUtils->DefineDvbhStateProperty(EDvbhStateReceiving);
   116 		if (result == KErrNone)
   117 			{
   118 			result = iTestUtils->DefineDvbhIntegerProperty(EDvbhPropertyKeySignalQuality, KInitialSignalQuality);
   119 			}		
   120 		}
   121 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-105")) == 0)		
   122 		{
   123 		 // Receiver state must be EDvbhStateReady or EDvbhStateReceiving before we can do this test.
   124 		result = iTestUtils->DefineDvbhStateProperty(EDvbhStateReady);
   125 		if (result == KErrNone)
   126 			{
   127 			TPckg<TDvbhPlatformProperty> initialPlatformPckg(iDvbhTestPlatform);
   128 			result = iTestUtils->DefineDvbhProperty(EDvbhPropertyKeyPlatform, CDvbhTestUtil::GetType(EDvbhPropertyKeyPlatform), initialPlatformPckg);			
   129 			}
   130 		}
   131 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-106")) == 0)		
   132 		{
   133 		 // Receiver state must be EDvbhStateReady or EDvbhStateReceiving before we can do this test.
   134 		result = iTestUtils->DefineDvbhStateProperty(EDvbhStateReady);
   135 		if (result == KErrNone)
   136 			{
   137 			TPckg<TDvbhNetworkTime> initialTimePckg(iDvbhTestNetworkTime);
   138 			result = iTestUtils->DefineDvbhProperty(EDvbhPropertyKeyNetworkTime, CDvbhTestUtil::GetType(EDvbhPropertyKeyNetworkTime), initialTimePckg);			
   139 			}		
   140 		}
   141 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-107")) == 0)		
   142 		{
   143 		 // Receiver state must be EDvbhStateReady or EDvbhStateReceiving before we can do this test.
   144 		result = iTestUtils->DefineDvbhStateProperty(EDvbhStateReady);
   145 		if (result == KErrNone)
   146 			{
   147 			TPckg<TDvbhPerformanceData> initialDataPckg(iDvbhTestPerformanceData);
   148 			result = iTestUtils->DefineDvbhProperty(EDvbhPropertyKeyPerformanceData, CDvbhTestUtil::GetType(EDvbhPropertyKeyPerformanceData), initialDataPckg);			
   149 			}		
   150 		}
   151 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-108")) == 0)		
   152 		{
   153 		 // Receiver state must be EDvbhStateReady or EDvbhStateReceiving before we can do this test.
   154 		result = iTestUtils->DefineDvbhStateProperty(EDvbhStateReady);
   155 		if (result == KErrNone)
   156 			{
   157 			result = iTestUtils->DefineDvbhIntegerProperty(EDvbhPropertyKeyFrequency, KInitialFrequency);			
   158 			}		
   159 		}
   160 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-109")) == 0)		
   161 		{
   162 		 // Receiver state must be EDvbhStateReady or EDvbhStateReceiving before we can do this test.
   163 		result = iTestUtils->DefineDvbhStateProperty(EDvbhStateReady);
   164 		if (result == KErrNone)
   165 			{
   166 			result = iTestUtils->DefineDvbhIntegerProperty(EDvbhPropertyKeyCellId, KInitialCellId);			
   167 			}		
   168 		}
   169 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-110")) == 0)		
   170 		{
   171 		 // Receiver state must be EDvbhStateReady or EDvbhStateReceiving before we can do this test.
   172 		result = iTestUtils->DefineDvbhStateProperty(EDvbhStateReady);
   173 		if (result == KErrNone)
   174 			{
   175 			result = iTestUtils->DefineDvbhIntegerProperty(EDvbhPropertyKeyNetworkId, KInitialNetworkId);			
   176 			}		
   177 		}
   178 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-309")) == 0)		
   179 		{
   180 		 // Receiver state must be EDvbhStateReceiving before we can do this test.
   181 		result = iTestUtils->DefineDvbhStateProperty(EDvbhStateReceiving);
   182 		}
   183 
   184 	return (result == KErrNone ? EPass : EInconclusive);				
   185 	}
   186 	
   187 TVerdict RDvbhHaiTest::DoTestStepPostambleL()
   188 	{
   189 	delete iRxInfo;
   190 	iRxInfo = NULL;
   191 	
   192 	TInt result = KErrNone;
   193 	if (iTestStepName.Compare(_L("MM-TV-DVBH-U-101")) == 0)		
   194 		{
   195 		result = iTestUtils->DeleteAllDvbhProperties();
   196 		}
   197 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-103")) == 0)		
   198 		{
   199 		result = iTestUtils->DeleteDvbhProperty(EDvbhPropertyKeyState);
   200 		}
   201 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-104")) == 0)		
   202 		{
   203 		result = iTestUtils->DeleteDvbhProperty(EDvbhPropertyKeyState);
   204 		TInt result2 = iTestUtils->DeleteDvbhProperty(EDvbhPropertyKeySignalQuality);
   205 		result = result2 != KErrNone ? result2 : result; 		
   206 		}
   207 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-105")) == 0)		
   208 		{
   209 		result = iTestUtils->DeleteDvbhProperty(EDvbhPropertyKeyState);
   210 		TInt result2 = iTestUtils->DeleteDvbhProperty(EDvbhPropertyKeyPlatform);
   211 		result = result2 != KErrNone ? result2 : result;			
   212 		}
   213 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-106")) == 0)		
   214 		{
   215 		result = iTestUtils->DeleteDvbhProperty(EDvbhPropertyKeyState);
   216 		TInt result2 = iTestUtils->DeleteDvbhProperty(EDvbhPropertyKeyNetworkTime);
   217 		result = result2 != KErrNone ? result2 : result;					
   218 		}
   219 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-107")) == 0)		
   220 		{
   221 		result = iTestUtils->DeleteDvbhProperty(EDvbhPropertyKeyState);
   222 		TInt result2 = iTestUtils->DeleteDvbhProperty(EDvbhPropertyKeyPerformanceData);
   223 		result = result2 != KErrNone ? result2 : result;			
   224 		}
   225 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-108")) == 0)		
   226 		{
   227 		result = iTestUtils->DeleteDvbhProperty(EDvbhPropertyKeyState);
   228 		TInt result2 = iTestUtils->DeleteDvbhProperty(EDvbhPropertyKeyFrequency);	
   229 		result = result2 != KErrNone ? result2 : result;		
   230 		}
   231 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-109")) == 0)		
   232 		{
   233 		result = iTestUtils->DeleteDvbhProperty(EDvbhPropertyKeyState );
   234 		TInt result2 = iTestUtils->DeleteDvbhProperty(EDvbhPropertyKeyCellId);
   235 		result = result2 != KErrNone ? result2 : result;			
   236 		}
   237 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-110")) == 0)	
   238 		{
   239 		result = iTestUtils->DeleteDvbhProperty(EDvbhPropertyKeyState );
   240 		TInt result2 = iTestUtils->DeleteDvbhProperty(EDvbhPropertyKeyNetworkId);
   241 		result = result2 != KErrNone ? result2 : result;			
   242 		}
   243 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-309")) == 0)	
   244 		{
   245 		result = iTestUtils->DeleteDvbhProperty(EDvbhPropertyKeyState );			
   246 		}
   247 		
   248 	delete iTestUtils;
   249 	iTestUtils = NULL;
   250 	return (result == KErrNone ? EPass : EInconclusive);
   251 	}
   252 	
   253 TVerdict RDvbhHaiTest::DoTestStepL()
   254 	{
   255 	if(iTestStepName.Compare(_L("MM-TV-DVBH-U-001")) == 0)
   256 		{
   257 		return DoCreateReceiverOnStackTestStep();
   258 		}
   259 	else if(iTestStepName.Compare(_L("MM-TV-DVBH-U-002")) == 0)		
   260 		{
   261 		return DoCreateReceiverOnHeapTestStep();
   262 		}
   263 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-003")) == 0)		
   264 		{
   265 		return DoGetDriverVersionBeforeOpenTestStep();
   266 		}
   267 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-004")) == 0)		
   268 		{
   269 		return DoReceiverOpenTestStep();
   270 		}
   271 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-005")) == 0)		
   272 		{
   273 		return DoMultipleReceiverOpenTestStep();
   274 		}
   275 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-006")) == 0)		
   276 		{
   277 		return DoGetDriverVersionAfterOpenTestStep();
   278 		}
   279 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-007")) == 0)		
   280 		{
   281 		return DoPowerOnAfterOpenTestStep();
   282 		}
   283 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-008")) == 0)		
   284 		{
   285 		return DoSetScanConfigurationAfterOpenTestStep();
   286 		}
   287 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-009")) == 0)		
   288 		{
   289 		return DoGetScanConfigurationAfterOpenTestStep();
   290 		}
   291 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-010")) == 0)		
   292 		{
   293 		return DoGetDvbhVersionAfterOpenTestStep();
   294 		}
   295 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-011")) == 0)		
   296 		{
   297 		return DoGetHardwareInfoAfterOpenTestStep();
   298 		}
   299 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-012")) == 0)		
   300 		{
   301 		return DoScanAfterOpenTestStep();
   302 		}
   303 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-013")) == 0)		
   304 		{
   305 		return DoSetPlatformAfterOpenTestStep();
   306 		}
   307 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-014")) == 0)		
   308 		{
   309 		return DoCreateFilterAfterOpenTestStep();
   310 		}
   311 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-015")) == 0)		
   312 		{
   313 		return DoCancelFilterAfterOpenTestStep();
   314 		}
   315 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-016")) == 0)		
   316 		{
   317 		return DoReceiveIpDataAfterOpenTestStep();
   318 		}
   319 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-017")) == 0)		
   320 		{
   321 		return DoUpdateNetworkTimeAfterOpenTestStep();
   322 		}
   323 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-018")) == 0)		
   324 		{
   325 		return DoCustomAsyncAfterOpenTestStep();
   326 		}
   327 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-019")) == 0)		
   328 		{
   329 		return DoCancelCustomAsyncAfterOpenTestStep();
   330 		}
   331 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-020")) == 0)		
   332 		{
   333 		return DoCustomAfterOpenTestStep();
   334 		}
   335 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-022")) == 0)		
   336 		{
   337 		return DoPowerOffAfterOpenTestStep();
   338 		}
   339 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-023")) == 0)		
   340 		{
   341 		return DoSetDisabledAfterOpenTestStep();
   342 		}
   343 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-024")) == 0)		
   344 		{
   345 		return DoCancelScanAfterOpenTestStep();
   346 		}
   347 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-025")) == 0)		
   348 		{
   349 		return DoCancelSetPlatformAfterOpenTestStep();
   350 		}
   351 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-026")) == 0)		
   352 		{
   353 		return DoCancelReceiveIpDataAfterOpenTestStep();
   354 		}
   355 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-027")) == 0)		
   356 		{
   357 		return DoCancelUpdateNetworkTimeAfterOpenTestStep();
   358 		}
   359 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-101")) == 0)		
   360 		{
   361 		return DoCreateReceiverInfoTestStep();
   362 		}
   363 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-102")) == 0)		
   364 		{
   365 		return DoCreateReceiverInfoTestStep();
   366 		}
   367 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-103")) == 0)		
   368 		{
   369 		return DoGetStateTestStep();
   370 		}
   371 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-104")) == 0)		
   372 		{
   373 		return DoGetSignalQualityTestStep();
   374 		}
   375 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-105")) == 0)		
   376 		{
   377 		return DoGetPlatformTestStep();
   378 		}
   379 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-106")) == 0)		
   380 		{
   381 		return DoGetNetworkTimeTestStep();
   382 		}
   383 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-107")) == 0)		
   384 		{
   385 		return DoGetPerformanceDataTestStep();
   386 		}
   387 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-108")) == 0)		
   388 		{
   389 		return DoGetFrequencyTestStep();
   390 		}
   391 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-109")) == 0)		
   392 		{
   393 		return DoGetCellIdTestStep();
   394 		}
   395 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-110")) == 0)		
   396 		{
   397 		return DoGetNetworkIdTestStep();
   398 		}
   399 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-202")) == 0)		
   400 		{
   401 		return DoPowerOnBeforeOpenTestStep();
   402 		}
   403 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-203")) == 0)		
   404 		{
   405 		return DoSetScanConfigurationBeforeOpenTestStep();
   406 		}
   407 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-204")) == 0)		
   408 		{
   409 		return DoGetScanConfigurationBeforeOpenTestStep();
   410 		}
   411 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-205")) == 0)		
   412 		{
   413 		return DoGetDvbhVersionBeforeOpenTestStep();
   414 		}
   415 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-206")) == 0)		
   416 		{
   417 		return DoGetHardwareInfoBeforeOpenTestStep();
   418 		}
   419 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-207")) == 0)		
   420 		{
   421 		return DoScanBeforeOpenTestStep();
   422 		}
   423 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-208")) == 0)		
   424 		{
   425 		return DoSetPlatformBeforeOpenTestStep();
   426 		}
   427 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-209")) == 0)		
   428 		{
   429 		return DoCreateFilterBeforeOpenTestStep();
   430 		}
   431 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-210")) == 0)		
   432 		{
   433 		return DoCancelFilterBeforeOpenTestStep();
   434 		}
   435 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-211")) == 0)		
   436 		{
   437 		return DoReceiveIpDataBeforeOpenTestStep();
   438 		}
   439 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-212")) == 0)		
   440 		{
   441 		return DoUpdateNetworkTimeBeforeOpenTestStep();
   442 		}
   443 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-213")) == 0)		
   444 		{
   445 		return DoCustomAsyncBeforeOpenTestStep();
   446 		}
   447 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-214")) == 0)		
   448 		{
   449 		return DoCancelCustomAsyncBeforeOpenTestStep();
   450 		}
   451 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-215")) == 0)		
   452 		{
   453 		return DoCustomBeforeOpenTestStep();
   454 		}
   455 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-216")) == 0)		
   456 		{
   457 		return DoCloseBeforeOpenTestStep();
   458 		}
   459 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-217")) == 0)		
   460 		{
   461 		return DoPowerOffBeforeOpenTestStep();
   462 		}
   463 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-218")) == 0)		
   464 		{
   465 		return DoSetDisabledBeforeOpenTestStep();
   466 		}
   467 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-219")) == 0)		
   468 		{
   469 		return DoCancelScanBeforeOpenTestStep();
   470 		}
   471 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-220")) == 0)		
   472 		{
   473 		return DoCancelSetPlatformBeforeOpenTestStep();
   474 		}
   475 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-221")) == 0)		
   476 		{
   477 		return DoCancelReceiveIpDataBeforeOpenTestStep();
   478 		}
   479 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-222")) == 0)		
   480 		{
   481 		return DoCancelUpdateNetworkTimeBeforeOpenTestStep();
   482 		}
   483 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-301")) == 0)		
   484 		{
   485 		return DoGetStateNoPropertiesTestStep();
   486 		}
   487 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-302")) == 0)		
   488 		{
   489 		return DoGetSignalQualityNoPropertiesTestStep();
   490 		}
   491 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-303")) == 0)		
   492 		{
   493 		return DoGetPlatformNoPropertiesTestStep();
   494 		}
   495 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-304")) == 0)		
   496 		{
   497 		return DoGetNetworkTimeNoPropertiesTestStep();
   498 		}
   499 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-305")) == 0)		
   500 		{
   501 		return DoGetPerformanceDataNoPropertiesTestStep();
   502 		}
   503 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-306")) == 0)		
   504 		{
   505 		return DoGetFrequencyNoPropertiesTestStep();
   506 		}
   507 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-307")) == 0)		
   508 		{
   509 		return DoGetCellIdNoPropertiesTestStep();
   510 		}
   511 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-308")) == 0)		
   512 		{
   513 		return DoGetNetworkIdNoPropertiesTestStep();
   514 		}
   515 	else if	(iTestStepName.Compare(_L("MM-TV-DVBH-U-309")) == 0)		
   516 		{
   517 		return DoGetTestsNoProperties();
   518 		}
   519 		
   520 	return EInconclusive;
   521 	}
   522 
   523 TVerdict RDvbhHaiTest::DoCreateReceiverOnStackTestStep()
   524 	{
   525 	__MM_HEAP_MARK;
   526 		{
   527 		//Create RDvbhReceiver on stack
   528 		RDvbhReceiver receiver;
   529 		}
   530 	//RDvbhReceiver out-of-scope, verify no heap leaks
   531 	__MM_HEAP_MARKEND;
   532 	return EPass;
   533 	}
   534 	
   535 TVerdict RDvbhHaiTest::DoCreateReceiverOnHeapTestStep()
   536 	{
   537 	__MM_HEAP_MARK;
   538 	TVerdict verdict = EPass;
   539 	
   540 	RDvbhReceiver* receiver = new RDvbhReceiver;
   541 	if (receiver == NULL)
   542 		{
   543 		verdict = EInconclusive;
   544 		}
   545 	else
   546 		{
   547 		delete receiver;
   548 		receiver = NULL;
   549 		}
   550 
   551 	__MM_HEAP_MARKEND;
   552 	return verdict;
   553 	}
   554 	
   555 
   556 TVerdict RDvbhHaiTest::DoGetDriverVersion(RDvbhReceiver& aReceiver)
   557 	{
   558 	TVerdict verdict = EPass;
   559 	TVersion version = iDvbhTestDriverVersion;
   560 	
   561 	TInt result = aReceiver.GetDriverVersion(version);
   562 	if (result != KErrNotSupported)
   563 		{
   564 		INFO_PRINTF2(_L("RDvbhReceiver::GetDriverVersion returned %d"), result);
   565 		verdict = EFail;
   566 		}
   567 	else if (!CDvbhTestUtil::CompareVersions(version, iDvbhTestDriverVersion))
   568 		{
   569 		INFO_PRINTF1(_L("RDvbhReceiver::GetDriverVersion modified its arguments."));
   570 		verdict = EFail;
   571 		}
   572 	return verdict;	
   573 	}
   574 	
   575 TVerdict RDvbhHaiTest::DoGetDriverVersionBeforeOpenTestStep()
   576 	{
   577 	__MM_HEAP_MARK;
   578 	TVerdict verdict = EPass;
   579 		{
   580 		RDvbhReceiver receiver;
   581 		verdict = DoGetDriverVersion(receiver);
   582 		} //end of receiver's scope
   583 	__MM_HEAP_MARKEND;
   584 	return verdict;
   585 	}
   586 
   587 /**
   588 * @param aMultiples the number of times to call open on a single RDvbhReceiver instance.  Must be greater than 0.
   589 *
   590 * Creates a RDvbhReceiver instance, calls Open aMultiples of times on it, then Closes it.
   591 */
   592 TVerdict RDvbhHaiTest::DoReceiverOpenAndClose(TUint aMultiples)
   593 	{
   594 	TVerdict verdict = EPass;
   595 	RDvbhReceiver receiver;
   596 	
   597 	if (aMultiples == 0)
   598 		{
   599 		verdict = EInconclusive;
   600 		}
   601 	else
   602 		{
   603 		for (TUint i=0;i < aMultiples;++i)
   604 			{
   605 			TVerdict openVerdict = OpenReceiver(receiver);
   606 			verdict = (openVerdict == EPass) ? verdict : openVerdict;
   607 			}
   608 		}
   609 	receiver.Close();
   610 	return verdict;
   611 	}
   612 
   613 /**
   614 * Helper used to open a receiver before testing other methods.  
   615 * @return EInconclusive if the Open call did not behave as expected so it shouldn't be used to test the Open() method itself.
   616 */	
   617 TVerdict RDvbhHaiTest::OpenReceiver(RDvbhReceiver& aReceiver)
   618 	{
   619 	TVerdict verdict = EPass;
   620 	TInt result = aReceiver.Open(iReceiverType);
   621 	if (result != KErrNotSupported)
   622 		{
   623 		INFO_PRINTF2(_L("RDvbhReceiver::Open returned %d"), result);
   624 		verdict = EInconclusive;
   625 		}
   626 	return verdict;	
   627 	}
   628 
   629 TVerdict RDvbhHaiTest::DoReceiverOpenTestStep()
   630 	{
   631 	__MM_HEAP_MARK;
   632 	TVerdict verdict = DoReceiverOpenAndClose();
   633 	__MM_HEAP_MARKEND;
   634 	return verdict;
   635 	}
   636 
   637 
   638 TVerdict RDvbhHaiTest::DoMultipleReceiverOpenTestStep()
   639 	{
   640 	__MM_HEAP_MARK;
   641 	TVerdict verdict = DoReceiverOpenAndClose(3);
   642 	__MM_HEAP_MARKEND;
   643 	return verdict;
   644 	}
   645 	
   646 TVerdict RDvbhHaiTest::DoGetDriverVersionAfterOpenTestStep()
   647 	{
   648 	__MM_HEAP_MARK;
   649 	TVerdict verdict = EPass;
   650 		{
   651 		RDvbhReceiver receiver;	
   652 		if ((verdict = OpenReceiver(receiver))  == EPass)
   653 			{
   654 			verdict = DoGetDriverVersion(receiver);
   655 			receiver.Close();
   656 			}
   657 		} //end of receiver's scope
   658 	__MM_HEAP_MARKEND;
   659 	return verdict;
   660 	}
   661 
   662 
   663 TVerdict RDvbhHaiTest::DoPowerOnAfterOpenTestStep()
   664 	{
   665 	__MM_HEAP_MARK;
   666 	TVerdict verdict = EPass;
   667 		{
   668 		RDvbhReceiver receiver;	
   669 		if ((verdict = OpenReceiver(receiver))  == EPass)
   670 			{
   671 			TRequestStatus status;
   672 			TInt result = receiver.PowerOn(status);
   673 			if (result != KErrNotSupported)
   674 				{
   675 				INFO_PRINTF2(_L("RDvbhReceiver::PowerOn returned %d"), result);
   676 				verdict = EFail;
   677 				}
   678 			receiver.Close();
   679 			}
   680 		} //end of receiver's scope	
   681 	__MM_HEAP_MARKEND;
   682 	return verdict;
   683 	}
   684 	
   685 TVerdict RDvbhHaiTest::DoSetScanConfigurationAfterOpenTestStep()
   686 	{
   687 	__MM_HEAP_MARK;
   688 	TVerdict verdict = EPass;
   689 		{
   690 		RDvbhReceiver receiver;
   691 		if ((verdict = OpenReceiver(receiver))  == EPass)
   692 			{
   693 			TInt result = receiver.SetScanConfiguration(iDvbhTestScanConfiguration);
   694 			if (result != KErrNotSupported)
   695 				{
   696 				INFO_PRINTF2(_L("RDvbhReceiver::SetScanConfiguration returned %d"), result);
   697 				verdict = EFail;
   698 				}
   699 			receiver.Close();
   700 			}
   701 		} //end of receiver's scope	
   702 	__MM_HEAP_MARKEND;
   703 	return verdict;
   704 	}
   705 	
   706 TVerdict RDvbhHaiTest::DoGetScanConfigurationAfterOpenTestStep()
   707 	{
   708 	__MM_HEAP_MARK;
   709 	TVerdict verdict = EPass;
   710 		{
   711 		RDvbhReceiver receiver;
   712 		if ((verdict = OpenReceiver(receiver))  == EPass)
   713 			{
   714 			TDvbhScanConfiguration scanConfig;
   715 			scanConfig.iScanStartFrequency = iDvbhTestScanConfiguration.iScanStartFrequency;
   716 			scanConfig.iScanEndFrequency = iDvbhTestScanConfiguration.iScanEndFrequency;
   717 			scanConfig.iSignalBandwidth = iDvbhTestScanConfiguration.iSignalBandwidth;
   718 			scanConfig.iScanOptions = iDvbhTestScanConfiguration.iScanOptions;
   719 	
   720 			TInt result = receiver.GetScanConfiguration(scanConfig);
   721 			if (result != KErrNotSupported)
   722 				{
   723 				INFO_PRINTF2(_L("RDvbhReceiver::GetScanConfiguration returned %d"), result);
   724 				verdict = EFail;
   725 				}
   726 			else
   727 				{
   728 				if (!CDvbhTestUtil::CompareScanConfigurations(scanConfig, iDvbhTestScanConfiguration))
   729 					{
   730 					INFO_PRINTF1(_L("RDvbhReceiver::GetScanConfiguration modified its arguments."));
   731 					verdict = EFail;					
   732 					}
   733 				}
   734 			receiver.Close();
   735 			}	
   736 		} //end of receiver's scope
   737 	__MM_HEAP_MARKEND;
   738 	return verdict;
   739 	}
   740 	
   741 TVerdict RDvbhHaiTest::DoGetDvbhVersionAfterOpenTestStep()
   742 	{
   743 	__MM_HEAP_MARK;
   744 	TVerdict verdict = EPass;
   745 		{
   746 		RDvbhReceiver receiver;
   747 		if ((verdict = OpenReceiver(receiver))  == EPass)
   748 			{
   749 			TVersion version = iDvbhTestDriverVersion;
   750 			TInt result = receiver.GetDvbhVersion(version);
   751 			if (result != KErrNotSupported)
   752 				{
   753 				INFO_PRINTF2(_L("RDvbhReceiver::GetDvbhVersion returned %d"), result);
   754 				verdict = EFail;
   755 				}
   756 			else
   757 				{
   758 				if (!CDvbhTestUtil::CompareVersions(version, iDvbhTestDriverVersion))
   759 					{
   760 					INFO_PRINTF1(_L("RDvbhReceiver::GetDvbhVersion modified its arguments."));
   761 					verdict = EFail;					
   762 					}
   763 				}
   764 			receiver.Close();
   765 			}	
   766 		} //end of receiver's scope
   767 	__MM_HEAP_MARKEND;
   768 	return verdict;
   769 	}
   770 	
   771 TVerdict RDvbhHaiTest::DoGetHardwareInfoAfterOpenTestStep()
   772 	{
   773 	__MM_HEAP_MARK;
   774 	TVerdict verdict = EPass;
   775 		{
   776 		RDvbhReceiver receiver;
   777 		if ((verdict = OpenReceiver(receiver))  == EPass)
   778 			{
   779 			TDvbhHardwareInfo info = iDvbhTestHardwareInfo;
   780 			TInt result = receiver.GetHardwareInfo(info);
   781 			if (result != KErrNotSupported)
   782 				{
   783 				INFO_PRINTF2(_L("RDvbhReceiver::GetHardwareInfo returned %d"), result);
   784 				verdict = EFail;
   785 				}
   786 			else
   787 				{
   788 				if (info.Compare(iDvbhTestHardwareInfo) != 0) // Compare returns 0 if they are the same
   789 					{
   790 					INFO_PRINTF1(_L("RDvbhReceiver::GetHardwareInfo modified its arguments."));
   791 					verdict = EFail;					
   792 					}
   793 				}
   794 			receiver.Close();
   795 			}	
   796 		} //end of receiver's scope
   797 	__MM_HEAP_MARKEND;
   798 	return verdict;
   799 	}
   800 	
   801 TVerdict RDvbhHaiTest::DoScanAfterOpenTestStep()
   802 	{
   803 	__MM_HEAP_MARK;
   804 	TVerdict verdict = EPass;
   805 		{
   806 		RDvbhReceiver receiver;
   807 		if ((verdict = OpenReceiver(receiver))  == EPass)
   808 			{
   809 			TRequestStatus status;
   810 			TInt result = receiver.Scan(*this, status);
   811 			if (result != KErrNotSupported)
   812 				{
   813 				INFO_PRINTF2(_L("RDvbhReceiver::Scan returned %d"), result);
   814 				verdict = EFail;
   815 				}
   816 			receiver.Close();
   817 			}	
   818 		} //end of receiver's scope
   819 	__MM_HEAP_MARKEND;
   820 	return verdict;
   821 	}
   822 	
   823 TVerdict RDvbhHaiTest::DoSetPlatformAfterOpenTestStep()
   824 	{
   825 	__MM_HEAP_MARK;
   826 	TVerdict verdict = EPass;
   827 		{
   828 		RDvbhReceiver receiver;
   829 		if ((verdict = OpenReceiver(receiver))  == EPass)
   830 			{
   831 			TRequestStatus status;
   832 			TInt result = receiver.SetPlatform(iDvbhTestNetwork, iDvbhTestPlatform.iPlatform, status);
   833 			if (result != KErrNotSupported)
   834 				{
   835 				INFO_PRINTF2(_L("RDvbhReceiver::SetPlatform returned %d"), result);
   836 				verdict = EFail;
   837 				}
   838 			receiver.Close();
   839 			}
   840 		} //end of receiver's scope	
   841 	__MM_HEAP_MARKEND;
   842 	return verdict;
   843 	}
   844 	
   845 TVerdict RDvbhHaiTest::DoCreateFilterAfterOpenTestStep()
   846 	{
   847 	__MM_HEAP_MARK;
   848 	TVerdict verdict = EPass;
   849 		{
   850 		RDvbhReceiver receiver;
   851 		if ((verdict = OpenReceiver(receiver))  == EPass)
   852 			{
   853 			TInt filterId = KDvbhTestFilterId;
   854 			TRequestStatus status;
   855 			TInt result = receiver.CreateFilter(KDvbhTestIpV6Addr, filterId, status);
   856 			if (result != KErrNotSupported)
   857 				{
   858 				INFO_PRINTF2(_L("RDvbhReceiver::CreateFilter returned %d"), result);
   859 				verdict = EFail;
   860 				}
   861 			else
   862 				{
   863 				if (filterId != KDvbhTestFilterId)
   864 					{
   865 					INFO_PRINTF1(_L("RDvbhReceiver::CreateFilter modified its arguments."));
   866 					verdict = EFail;					
   867 					}
   868 				}
   869 			receiver.Close();
   870 			}	
   871 		} //end of receiver's scope
   872 	__MM_HEAP_MARKEND;
   873 	return verdict;
   874 	}
   875 	
   876 TVerdict RDvbhHaiTest::DoCancelFilterAfterOpenTestStep()
   877 	{
   878 	__MM_HEAP_MARK;
   879 	TVerdict verdict = EPass;
   880 		{
   881 		RDvbhReceiver receiver;
   882 		if ((verdict = OpenReceiver(receiver))  == EPass)
   883 			{
   884 			TInt filterId = KDvbhTestFilterId;
   885 			TInt result = receiver.CancelFilter(filterId);
   886 			if (result != KErrNotSupported)
   887 				{
   888 				INFO_PRINTF2(_L("RDvbhReceiver::CancelFilter returned %d"), result);
   889 				verdict = EFail;
   890 				}
   891 			receiver.Close();
   892 			}	
   893 		} //end of receiver's scope
   894 	__MM_HEAP_MARKEND;
   895 	return verdict;
   896 	}
   897 	
   898 TVerdict RDvbhHaiTest::DoReceiveIpDataAfterOpenTestStep()
   899 	{
   900 	__MM_HEAP_MARK;
   901 	TVerdict verdict = EPass;
   902 		{
   903 		RDvbhReceiver receiver;
   904 		if ((verdict = OpenReceiver(receiver))  == EPass)
   905 			{
   906 			TInt result = receiver.ReceiveIPData(*this);
   907 			if (result != KErrNotSupported)
   908 				{
   909 				INFO_PRINTF2(_L("RDvbhReceiver::ReceiveIPData returned %d"), result);
   910 				verdict = EFail;
   911 				}
   912 			receiver.Close();
   913 			}	
   914 		} //end of receiver's scope
   915 	__MM_HEAP_MARKEND;
   916 	return verdict;
   917 	}
   918 	
   919 TVerdict RDvbhHaiTest::DoUpdateNetworkTimeAfterOpenTestStep()
   920 	{
   921 	__MM_HEAP_MARK;
   922 	TVerdict verdict = EPass;
   923 		{
   924 		RDvbhReceiver receiver;
   925 		if ((verdict = OpenReceiver(receiver))  == EPass)
   926 			{
   927 			TRequestStatus status;
   928 			TInt result = receiver.UpdateNetworkTime(status);
   929 			if (result != KErrNotSupported)
   930 				{
   931 				INFO_PRINTF2(_L("RDvbhReceiver::UpdateNetworkTime returned %d"), result);
   932 				verdict = EFail;
   933 				}
   934 			receiver.Close();
   935 			}	
   936 		} //end of receiver's scope
   937 	__MM_HEAP_MARKEND;
   938 	return verdict;
   939 	}
   940 	
   941 TVerdict RDvbhHaiTest::DoCustomAsyncAfterOpenTestStep()
   942 	{
   943 	__MM_HEAP_MARK;
   944 	TVerdict verdict = EPass;
   945 		{
   946 		RDvbhReceiver receiver;
   947 		
   948 		if ((verdict = OpenReceiver(receiver))  == EPass)
   949 			{
   950 			TBuf8<32> output;
   951 			output = KDvbhTestCustomCommandOutput;
   952 			TRequestStatus status;
   953 			TInt result = receiver.CustomCommand(KDvbhTestCustomCommand, KDvbhTestCustomCommandInput, output, status);
   954 			if (result != KErrNotSupported)
   955 				{
   956 				INFO_PRINTF2(_L("RDvbhReceiver::CustomCommand returned %d"), result);
   957 				verdict = EFail;
   958 				}
   959 			else
   960 				{
   961 				if (output.Compare(KDvbhTestCustomCommandOutput) != 0) // Compare returns 0 if they are the same
   962 					{
   963 					INFO_PRINTF1(_L("RDvbhReceiver::CustomCommand modified its arguments."));
   964 					verdict = EFail;					
   965 					}
   966 				}
   967 			receiver.Close();
   968 			}
   969 		} //end of receiver's scope	
   970 	__MM_HEAP_MARKEND;
   971 	return verdict;
   972 	}
   973 	
   974 TVerdict RDvbhHaiTest::DoCancelCustomAsyncAfterOpenTestStep()
   975 	{
   976 	__MM_HEAP_MARK;
   977 	TVerdict verdict = EPass;
   978 		{
   979 		RDvbhReceiver receiver;
   980 		if ((verdict = OpenReceiver(receiver))  == EPass)
   981 			{
   982 			TRequestStatus status;
   983 			receiver.CancelCustomCommand(status);
   984 			receiver.Close();
   985 			}
   986 		} //end of receiver's scope	
   987 	__MM_HEAP_MARKEND;
   988 	return verdict;
   989 	}
   990 	
   991 TVerdict RDvbhHaiTest::DoCustomAfterOpenTestStep()
   992 	{
   993 	__MM_HEAP_MARK;
   994 	TVerdict verdict = EPass;
   995 		{
   996 		RDvbhReceiver receiver;
   997 		if ((verdict = OpenReceiver(receiver))  == EPass)
   998 			{
   999 			TInt result = receiver.CustomCommand(KDvbhTestCustomCommand, KDvbhTestCustomCommandInput);
  1000 			if (result != KErrNotSupported)
  1001 				{
  1002 				INFO_PRINTF2(_L("RDvbhReceiver::CustomCommand returned %d"), result);
  1003 				verdict = EFail;
  1004 				}
  1005 			receiver.Close();
  1006 			}	
  1007 		} //end of receiver's scope
  1008 	__MM_HEAP_MARKEND;
  1009 	return verdict;
  1010 	}
  1011 		
  1012 TVerdict RDvbhHaiTest::DoPowerOffAfterOpenTestStep()
  1013 	{
  1014 	__MM_HEAP_MARK;
  1015 	TVerdict verdict = EPass;
  1016 		{
  1017 		RDvbhReceiver receiver;
  1018 		if ((verdict = OpenReceiver(receiver))  == EPass)
  1019 			{
  1020             TRequestStatus status;
  1021 			receiver.PowerOff(status);
  1022 			//User::WaitForRequest(status);
  1023 			receiver.Close();
  1024 			}	
  1025 		} //end of receiver's scope
  1026 	__MM_HEAP_MARKEND;
  1027 	return verdict;
  1028 	}
  1029 	
  1030 TVerdict RDvbhHaiTest::DoSetDisabledAfterOpenTestStep()
  1031 	{
  1032 	__MM_HEAP_MARK;
  1033 	TVerdict verdict = EPass;
  1034 		{
  1035 		RDvbhReceiver receiver;
  1036 		if ((verdict = OpenReceiver(receiver))  == EPass)
  1037 			{
  1038             TRequestStatus status;
  1039 			receiver.SetDisabled(ETrue, status);
  1040             //User::WaitForRequest(status);
  1041 			receiver.Close();
  1042 			}	
  1043 		} //end of receiver's scope
  1044 	__MM_HEAP_MARKEND;
  1045 	return verdict;
  1046 	}
  1047 	
  1048 TVerdict RDvbhHaiTest::DoCancelScanAfterOpenTestStep()
  1049 	{
  1050 	__MM_HEAP_MARK;
  1051 	TVerdict verdict = EPass;
  1052 		{
  1053 		RDvbhReceiver receiver;
  1054 		if ((verdict = OpenReceiver(receiver))  == EPass)
  1055 			{
  1056 			receiver.CancelScan();
  1057 			receiver.Close();
  1058 			}	
  1059 		} //end of receiver's scope
  1060 	__MM_HEAP_MARKEND;
  1061 	return verdict;
  1062 	}
  1063 	
  1064 TVerdict RDvbhHaiTest::DoCancelSetPlatformAfterOpenTestStep()
  1065 	{
  1066 	__MM_HEAP_MARK;
  1067 	TVerdict verdict = EPass;
  1068 		{
  1069 		RDvbhReceiver receiver;
  1070 		if ((verdict = OpenReceiver(receiver))  == EPass)
  1071 			{
  1072 			receiver.CancelSetPlatform();
  1073 			receiver.Close();
  1074 			}	
  1075 		} //end of receiver's scope
  1076 	__MM_HEAP_MARKEND;
  1077 	return verdict;
  1078 	}
  1079 	
  1080 TVerdict RDvbhHaiTest::DoCancelReceiveIpDataAfterOpenTestStep()
  1081 	{
  1082 	__MM_HEAP_MARK;
  1083 	TVerdict verdict = EPass;
  1084 		{
  1085 		RDvbhReceiver receiver;
  1086 		if ((verdict = OpenReceiver(receiver))  == EPass)
  1087 			{
  1088 			receiver.CancelReceiveIPData();
  1089 			receiver.Close();
  1090 			}	
  1091 		} //end of receiver's scope
  1092 	__MM_HEAP_MARKEND;
  1093 	return verdict;
  1094 	}
  1095 	
  1096 TVerdict RDvbhHaiTest::DoCancelUpdateNetworkTimeAfterOpenTestStep()
  1097 	{
  1098 	__MM_HEAP_MARK;
  1099 	TVerdict verdict = EPass;
  1100 		{
  1101 		RDvbhReceiver receiver;
  1102 		if ((verdict = OpenReceiver(receiver))  == EPass)
  1103 			{
  1104 			receiver.CancelUpdateNetworkTime();
  1105 			receiver.Close();
  1106 			}	
  1107 		} //end of receiver's scope
  1108 	__MM_HEAP_MARKEND;
  1109 	return verdict;
  1110 	}
  1111 	
  1112 //
  1113 //
  1114 // CDvbhReceiverInfo Positive Tests
  1115 //
  1116 //
  1117 
  1118 // 101 & 102
  1119 TVerdict RDvbhHaiTest::DoCreateReceiverInfoTestStep()
  1120 	{
  1121 	TVerdict verdict = EPass;
  1122 	__MM_HEAP_MARK;
  1123 	delete iRxInfo; 
  1124 	iRxInfo = NULL;
  1125 	TRAPD(result, iRxInfo = CDvbhReceiverInfo::NewL())
  1126 	if (result != KErrNone)
  1127 		{
  1128 		INFO_PRINTF2(_L("Error %d creating CDvbhReceiverInfo"), result);
  1129 		verdict = EFail;
  1130 		}
  1131 	delete iRxInfo; 
  1132 	iRxInfo = NULL;
  1133 	__MM_HEAP_MARKEND;
  1134 	return verdict;
  1135 	}
  1136 	
  1137 // 103
  1138 TVerdict RDvbhHaiTest::DoGetStateTestStep()
  1139 	{
  1140 	TVerdict verdict = EPass;
  1141 	__MM_HEAP_MARK;
  1142  	//First set the state to a known value (expectedState) so that we know 
  1143  	//what we are trying to Get.
  1144  	const TInt expectedState = EDvbhStateInactive;
  1145 	if (iTestUtils->SetStateProperty(expectedState) != KErrNone)
  1146 		{
  1147 		verdict = EInconclusive;			
  1148 		}
  1149 	else
  1150 		{
  1151 		TDvbhState state = EDvbhStateNoHardware;
  1152 		TInt result = iRxInfo->GetState(state);
  1153 		if (result != KErrNone)
  1154 			{
  1155 			INFO_PRINTF2(_L("Error %d getting state"), result);
  1156 			verdict = EFail;				
  1157 			}
  1158 		else
  1159 			{
  1160 			if (state != expectedState)
  1161 				{
  1162 				INFO_PRINTF2(_L("Got unexpected state %d"), state);
  1163 				verdict = EFail;
  1164 				}
  1165 			}
  1166 		}
  1167 	__MM_HEAP_MARKEND;
  1168 	return verdict;
  1169 	}
  1170 	
  1171 // 104
  1172 TVerdict RDvbhHaiTest::DoGetSignalQualityTestStep()
  1173 	{
  1174 	TVerdict verdict = EPass;
  1175 	__MM_HEAP_MARK;
  1176  	//First set the signal quality to a known value (expectedQuality) so that we know 
  1177  	//what we are trying to Get.
  1178 	const TInt expectedQuality = EDvbhSignalQualityFair;
  1179 	TInt result = iTestUtils->SetIntegerProperty(EDvbhPropertyKeySignalQuality, expectedQuality);
  1180 	if (result != KErrNone)
  1181 		{
  1182 		INFO_PRINTF3(_L("Error %d setting signal quality property to %d"), result, expectedQuality);
  1183 		verdict = EInconclusive;			
  1184 		}
  1185 	else
  1186 		{
  1187 		TDvbhSignalQuality quality = EDvbhSignalQualityNoSignal;
  1188 		result = iRxInfo->GetSignalQuality(quality);
  1189 		if (result != KErrNone)
  1190 			{
  1191 			INFO_PRINTF2(_L("Error %d getting signal quality"), result);
  1192 			verdict = EFail;				
  1193 			}
  1194 		else
  1195 			{
  1196 			if (quality != expectedQuality)
  1197 				{
  1198 				INFO_PRINTF2(_L("Got unexpected quality %d"), quality);
  1199 				verdict = EFail;
  1200 				}
  1201 			}				
  1202 		}
  1203 	__MM_HEAP_MARKEND;
  1204 	return verdict;
  1205 	}
  1206 
  1207 // 105	
  1208 TVerdict RDvbhHaiTest::DoGetPlatformTestStep()
  1209 	{
  1210 	TVerdict verdict = EPass;
  1211 	__MM_HEAP_MARK;
  1212  	//First set the platform property to a known value (iDvbhTestPlatform) so that we know 
  1213  	//what we are trying to Get.
  1214 	TPckg<TDvbhPlatformProperty> platformPckg(iDvbhTestPlatform);
  1215 	TInt result = iTestUtils->SetByteArrayProperty(EDvbhPropertyKeyPlatform, platformPckg);
  1216 	if (result != KErrNone)
  1217 		{
  1218 		INFO_PRINTF2(_L("Error %d setting platform property."), result);
  1219 		verdict = EInconclusive;			
  1220 		}
  1221 	else
  1222 		{
  1223 		TDvbhPlatform platform;
  1224 		TIp6Addr esgRoot;
  1225 		result = iRxInfo->GetPlatform(platform, esgRoot);
  1226 		if (result != KErrNone)
  1227 			{
  1228 			INFO_PRINTF2(_L("Error %d getting platform."), result);
  1229 			verdict = EFail;				
  1230 			}
  1231 		else
  1232 			{
  1233 			if (!CDvbhTestUtil::ComparePlatforms(platform, iDvbhTestPlatform.iPlatform))
  1234 				{
  1235 				INFO_PRINTF1(_L("Got unexpected platform."));
  1236 				verdict = EFail;
  1237 				}
  1238 			if (!esgRoot.IsEqual(iDvbhTestPlatform.iEsgRoot))
  1239 				{
  1240 				INFO_PRINTF1(_L("Got unexpected esgRoot."));
  1241 				verdict = EFail;				
  1242 				}
  1243 			}				
  1244 		}
  1245 	__MM_HEAP_MARKEND;
  1246 	return verdict;
  1247 	}
  1248 
  1249 //Helper for test 106
  1250 TVerdict RDvbhHaiTest::DoGetNetworkTime(TBool aExpectedValidity)
  1251 	{
  1252 	TVerdict verdict = EPass;
  1253 
  1254 	//Expected result is based on whether or not the platformId in the network time we
  1255 	//set is valid.
  1256  	TInt expectedResult = KErrNone;
  1257  	if (iDvbhTestNetworkTime.iPlatformId == KDvbhInvalidPlatform)
  1258  		{
  1259  		expectedResult = KErrNotReady;
  1260  		}
  1261  	
  1262  	//Set the time to a known value (iDvbhTestNetworkTime) so that we know 
  1263  	//what we are trying to Get.
  1264 	TPckg<TDvbhNetworkTime> timePckg(iDvbhTestNetworkTime);	
  1265 	TInt result = iTestUtils->SetByteArrayProperty(EDvbhPropertyKeyNetworkTime, timePckg);
  1266 	if (result != KErrNone)
  1267 		{
  1268 		INFO_PRINTF2(_L("Error %d setting network time property."), result);
  1269 		verdict = EInconclusive;			
  1270 		}
  1271 	else
  1272 		{
  1273 		TTime initialTime(TInt64(0));
  1274 		TTime time = initialTime;
  1275 		TBool valid = EFalse;
  1276 		result = iRxInfo->GetNetworkTime(time, valid);
  1277 		if (result != expectedResult)
  1278 			{
  1279 			INFO_PRINTF2(_L("Unexptected result %d getting network time."), result);
  1280 			verdict = EFail;				
  1281 			}
  1282 		else
  1283 			{
  1284 			if (result == KErrNone)
  1285 				{
  1286 				//Check if what we got was as expected
  1287 				if (time != iDvbhTestNetworkTime.iNetworkTime || (valid != aExpectedValidity))
  1288 					{
  1289 					INFO_PRINTF1(_L("Got unexpected network time or validity."));
  1290 					verdict = EFail;
  1291 					}				
  1292 				}
  1293 			else
  1294 				{
  1295 				//Check that the arguments weren't updated
  1296 				if (time != initialTime || (valid != EFalse))
  1297 					{
  1298 					INFO_PRINTF1(_L("GetNetworkTime modified its args on failure."));
  1299 					verdict = EFail;
  1300 					}
  1301 				}
  1302 			}				
  1303 		}
  1304 	return verdict;
  1305 	}
  1306 
  1307 // 106
  1308 TVerdict RDvbhHaiTest::DoGetNetworkTimeTestStep()
  1309 	{
  1310 	TVerdict verdict = EPass;
  1311 	__MM_HEAP_MARK;
  1312 
  1313 	//The 1st two tests are positive tests, so we do not want to get KErrNotReady
  1314 	//so we leave iDvbhTestNetworkTime.iPlatformId != KDvbhInvalidPlatform
  1315 	//(which is how it is set by default).
  1316 	
  1317 	//Test one: Set state to Receiving or Ready so that we expect a valid network time
  1318 	TDvbhState state = EDvbhStateReady;
  1319 	TInt result = iTestUtils->SetStateProperty(state);
  1320 	if (result != KErrNone)
  1321 		{
  1322 		verdict =  EInconclusive;
  1323 		}
  1324 	else
  1325 		{
  1326 		verdict = DoGetNetworkTime((state == EDvbhStateReady) || (state == EDvbhStateReceiving));
  1327 		}
  1328 	
  1329 	if (verdict != EPass)
  1330 		{
  1331 		__MM_HEAP_MARKEND;
  1332 		return verdict;		
  1333 		}
  1334 		
  1335 	//Test two: Set state to something other than Ready or Receiving so we expect
  1336 	//and invalid network time
  1337 	state = EDvbhStateScanning;
  1338 	result = iTestUtils->SetStateProperty(state);
  1339 	if (result != KErrNone)
  1340 		{
  1341 		verdict =  EInconclusive;
  1342 		}
  1343 	else
  1344 		{
  1345 		verdict = DoGetNetworkTime((state == EDvbhStateReady) || (state == EDvbhStateReceiving));
  1346 		}
  1347 	
  1348 	if (verdict != EPass)
  1349 		{
  1350 		__MM_HEAP_MARKEND;
  1351 		return verdict;		
  1352 		}
  1353 		
  1354 	//Test three: Set iDvbhTestNetworkTime.iPlatformId = KDvbhInvalidPlatform
  1355 	//which indicates the receiver is not ready to give network time, regardless
  1356 	//of the state it is in.  Will result in KErrNotReady being returned from
  1357 	//CDvbhReceiverInfo::GetNetworkTime()
  1358 	iDvbhTestNetworkTime.iPlatformId = KDvbhInvalidPlatform;
  1359 	verdict = DoGetNetworkTime((state == EDvbhStateReady) || (state == EDvbhStateReceiving));
  1360 			
  1361 	__MM_HEAP_MARKEND;
  1362 	return verdict;
  1363 	}
  1364 	
  1365 // 107 
  1366 TVerdict RDvbhHaiTest::DoGetPerformanceDataTestStep()
  1367 	{
  1368 	TVerdict verdict = EPass;
  1369 	__MM_HEAP_MARK;
  1370  	//First set the data to a known value (expectedData) so that we know 
  1371  	//what we are trying to Get.
  1372 	TPckg<TDvbhPerformanceData> dataPckg(iDvbhTestPerformanceData);	
  1373 	TInt result = iTestUtils->SetByteArrayProperty(EDvbhPropertyKeyPerformanceData, dataPckg);
  1374 	if (result != KErrNone)
  1375 		{
  1376 		INFO_PRINTF2(_L("Error %d setting performance data property."), result);
  1377 		verdict = EInconclusive;			
  1378 		}
  1379 	else
  1380 		{
  1381 		TDvbhPerformanceData data; //Is initialised to 0s by constructor.
  1382 		result = iRxInfo->GetPerformanceData(data);
  1383 		if (result != KErrNone)
  1384 			{
  1385 			INFO_PRINTF2(_L("Error %d getting performance data."), result);
  1386 			verdict = EFail;				
  1387 			}
  1388 		else
  1389 			{
  1390 			if (!CDvbhTestUtil::ComparePerformanceDatas(data, iDvbhTestPerformanceData))
  1391 				{
  1392 				INFO_PRINTF1(_L("Got unexpected performance data."));
  1393 				verdict = EFail;
  1394 				}
  1395 			}				
  1396 		}
  1397 	__MM_HEAP_MARKEND;
  1398 	return verdict;
  1399 	}
  1400 
  1401 // 108
  1402 TVerdict RDvbhHaiTest::DoGetFrequencyTestStep()
  1403 	{
  1404 	TVerdict verdict = EPass;
  1405 	__MM_HEAP_MARK;
  1406  	//First set the data to a known value (expectedFrequency) so that we know 
  1407  	//what we are trying to Get.
  1408 	const TDvbhFrequency expectedFrequency = 150000;	
  1409 	TInt result = iTestUtils->SetIntegerProperty(EDvbhPropertyKeyFrequency, expectedFrequency);
  1410 	if (result != KErrNone)
  1411 		{
  1412 		INFO_PRINTF2(_L("Error %d setting frequency property."), result);
  1413 		verdict = EInconclusive;			
  1414 		}
  1415 	else
  1416 		{
  1417 		TDvbhFrequency frequency = 0;
  1418 		result = iRxInfo->GetFrequency(frequency);
  1419 		if (result != KErrNone)
  1420 			{
  1421 			INFO_PRINTF2(_L("Error %d getting frequency."), result);
  1422 			verdict = EFail;				
  1423 			}
  1424 		else
  1425 			{
  1426 			if (frequency != expectedFrequency)
  1427 				{
  1428 				INFO_PRINTF2(_L("Got unexpected frequency %d."), frequency);
  1429 				verdict = EFail;
  1430 				}
  1431 			}				
  1432 		}
  1433 	__MM_HEAP_MARKEND;
  1434 	return verdict;
  1435 	}
  1436 
  1437 // 109
  1438 TVerdict RDvbhHaiTest::DoGetCellIdTestStep()
  1439 	{
  1440 	TVerdict verdict = EPass;
  1441 	__MM_HEAP_MARK;
  1442  	//First set the data to a known value (expectedId) so that we know 
  1443  	//what we are trying to Get.
  1444 	const TDvbhCellId expectedId = 1001;	
  1445 	TInt result = iTestUtils->SetIntegerProperty(EDvbhPropertyKeyCellId , expectedId);
  1446 	if (result != KErrNone)
  1447 		{
  1448 		INFO_PRINTF2(_L("Error %d setting cellId property."), result);
  1449 		verdict = EInconclusive;			
  1450 		}
  1451 	else
  1452 		{
  1453 		TDvbhCellId id = 0;
  1454 		result = iRxInfo->GetCellId(id);
  1455 		if (result != KErrNone)
  1456 			{
  1457 			INFO_PRINTF2(_L("Error %d getting cellId."), result);
  1458 			verdict = EFail;				
  1459 			}
  1460 		else
  1461 			{
  1462 			if (id != expectedId)
  1463 				{
  1464 				INFO_PRINTF2(_L("Got unexpected cellId %d."), id);
  1465 				verdict = EFail;
  1466 				}
  1467 			}				
  1468 		}
  1469 	__MM_HEAP_MARKEND;
  1470 	return verdict;
  1471 	}
  1472 
  1473 // 110
  1474 TVerdict RDvbhHaiTest::DoGetNetworkIdTestStep()
  1475 	{
  1476 	TVerdict verdict = EPass;
  1477 	__MM_HEAP_MARK;
  1478  	//First set the data to a known value (expectedId) so that we know 
  1479  	//what we are trying to Get.
  1480 	const TDvbhNetworkId expectedId = 9876;	
  1481 	TInt result = iTestUtils->SetIntegerProperty(EDvbhPropertyKeyNetworkId , expectedId);
  1482 	if (result != KErrNone)
  1483 		{
  1484 		INFO_PRINTF2(_L("Error %d setting networkId property."), result);
  1485 		verdict = EInconclusive;			
  1486 		}
  1487 	else
  1488 		{
  1489 		TDvbhNetworkId id = 0;
  1490 		result = iRxInfo->GetNetworkId(id);
  1491 		if (result != KErrNone)
  1492 			{
  1493 			INFO_PRINTF2(_L("Error %d getting networkId."), result);
  1494 			verdict = EFail;				
  1495 			}
  1496 		else
  1497 			{
  1498 			if (id != expectedId)
  1499 				{
  1500 				INFO_PRINTF2(_L("Got unexpected networkId %d."), id);
  1501 				verdict = EFail;
  1502 				}
  1503 			}				
  1504 		}
  1505 	__MM_HEAP_MARKEND;
  1506 	return verdict;
  1507 	}
  1508 	
  1509 //
  1510 //
  1511 // RDvbhReceiver negative tests
  1512 //
  1513 //
  1514 	
  1515 //202
  1516 TVerdict RDvbhHaiTest::DoPowerOnBeforeOpenTestStep()
  1517 	{
  1518 	__MM_HEAP_MARK;
  1519 	TVerdict verdict = EPass;
  1520 		{
  1521 		RDvbhReceiver receiver;
  1522         TRequestStatus status;
  1523 		TInt result = receiver.PowerOn(status);
  1524 		if (result != KErrNotReady)
  1525 			{
  1526 			INFO_PRINTF2(_L("RDvbhReceiver::PowerOn returned %d"), result);
  1527 			verdict = EFail;
  1528 			}
  1529 		} //end of receiver's scope	
  1530 	__MM_HEAP_MARKEND;
  1531 	return verdict;
  1532 	}
  1533 
  1534 //203
  1535 TVerdict RDvbhHaiTest::DoSetScanConfigurationBeforeOpenTestStep()
  1536 	{
  1537 	__MM_HEAP_MARK;
  1538 	TVerdict verdict = EPass;
  1539 		{
  1540 		RDvbhReceiver receiver;
  1541 		TInt result = receiver.SetScanConfiguration(iDvbhTestScanConfiguration);
  1542 		if (result != KErrNotReady)
  1543 			{
  1544 			INFO_PRINTF2(_L("RDvbhReceiver::SetScanConfiguration returned %d"), result);
  1545 			verdict = EFail;
  1546 			}
  1547 		} //end of receiver's scope	
  1548 	__MM_HEAP_MARKEND;
  1549 	return verdict;	
  1550 	}
  1551 	
  1552 //204
  1553 TVerdict RDvbhHaiTest::DoGetScanConfigurationBeforeOpenTestStep()
  1554 	{
  1555 	__MM_HEAP_MARK;
  1556 	TVerdict verdict = EPass;
  1557 		{
  1558 		RDvbhReceiver receiver;
  1559 		TDvbhScanConfiguration config;
  1560 		config.iScanStartFrequency = iDvbhTestScanConfiguration.iScanStartFrequency;
  1561 		config.iScanEndFrequency = iDvbhTestScanConfiguration.iScanEndFrequency;
  1562 		config.iSignalBandwidth = iDvbhTestScanConfiguration.iSignalBandwidth;
  1563 		config.iScanOptions = iDvbhTestScanConfiguration.iScanOptions;
  1564 		
  1565 		TInt result = receiver.GetScanConfiguration(config);
  1566 		if (result != KErrNotReady)
  1567 			{
  1568 			INFO_PRINTF2(_L("RDvbhReceiver::GetScanConfiguration returned %d"), result);
  1569 			verdict = EFail;
  1570 			}
  1571 		else
  1572 			{
  1573 			if (!iTestUtils->CompareScanConfigurations(iDvbhTestScanConfiguration, config))
  1574 				{
  1575 				INFO_PRINTF1(_L("RDvbhReceiver::GetScanConfiguration modified its arg on failure."));
  1576 				verdict = EFail;			
  1577 				}			
  1578 			}
  1579 		} //end of receiver's scope	
  1580 	__MM_HEAP_MARKEND;
  1581 	return verdict;	
  1582 	}
  1583 
  1584 //205
  1585 TVerdict RDvbhHaiTest::DoGetDvbhVersionBeforeOpenTestStep()
  1586 	{
  1587 	__MM_HEAP_MARK;
  1588 	TVerdict verdict = EPass;
  1589 		{
  1590 		RDvbhReceiver receiver;
  1591 		TVersion version = iDvbhTestDriverVersion;
  1592 		
  1593 		TInt result = receiver.GetDvbhVersion(version);
  1594 		if (result != KErrNotReady)
  1595 			{
  1596 			INFO_PRINTF2(_L("RDvbhReceiver::GetDvbhVersion returned %d"), result);
  1597 			verdict = EFail;
  1598 			}
  1599 		else
  1600 			{
  1601 			if (!iTestUtils->CompareVersions(version, iDvbhTestDriverVersion))
  1602 				{
  1603 				INFO_PRINTF1(_L("RDvbhReceiver::GetDvbhVersion modified its arg on failure."));
  1604 				verdict = EFail;			
  1605 				}			
  1606 			}
  1607 
  1608 		} //end of receiver's scope	
  1609 	__MM_HEAP_MARKEND;
  1610 	return verdict;	
  1611 	}
  1612 	
  1613 //206
  1614 TVerdict RDvbhHaiTest::DoGetHardwareInfoBeforeOpenTestStep()
  1615 	{
  1616 	__MM_HEAP_MARK;
  1617 	TVerdict verdict = EPass;
  1618 		{
  1619 		RDvbhReceiver receiver;
  1620 		TDvbhHardwareInfo info = iDvbhTestHardwareInfo;
  1621 		
  1622 		TInt result = receiver.GetHardwareInfo(info);
  1623 		if (result != KErrNotReady)
  1624 			{
  1625 			INFO_PRINTF2(_L("RDvbhReceiver::GetHardwareInfo returned %d"), result);
  1626 			verdict = EFail;
  1627 			}
  1628 		else
  1629 			{
  1630 			if (info.Compare(iDvbhTestHardwareInfo) != 0) // Compare returns 0 if they are the same
  1631 				{
  1632 				INFO_PRINTF1(_L("RDvbhReceiver::GetHardwareInfo modified its arg on failure."));
  1633 				verdict = EFail;			
  1634 				}			
  1635 			}
  1636 		} //end of receiver's scope	
  1637 	__MM_HEAP_MARKEND;
  1638 	return verdict;
  1639 	}
  1640 
  1641 //207	
  1642 TVerdict RDvbhHaiTest::DoScanBeforeOpenTestStep()
  1643 	{
  1644 	__MM_HEAP_MARK;
  1645 	TVerdict verdict = EPass;
  1646 		{
  1647 		RDvbhReceiver receiver;
  1648 		TRequestStatus status;
  1649 		TInt result = receiver.Scan(*this, status);
  1650 		if (result != KErrNotReady)
  1651 			{
  1652 			INFO_PRINTF2(_L("RDvbhReceiver::Scan returned %d"), result);
  1653 			verdict = EFail;
  1654 			}
  1655 		} //end of receiver's scope	
  1656 	__MM_HEAP_MARKEND;
  1657 	return verdict;	
  1658 	}
  1659 	
  1660 //208
  1661 TVerdict RDvbhHaiTest::DoSetPlatformBeforeOpenTestStep()
  1662 	{
  1663 	__MM_HEAP_MARK;
  1664 	TVerdict verdict = EPass;
  1665 		{
  1666 		RDvbhReceiver receiver;
  1667 		TRequestStatus status;
  1668 		TInt result = receiver.SetPlatform(iDvbhTestNetwork, iDvbhTestPlatform.iPlatform, status);
  1669 		if (result != KErrNotReady)
  1670 			{
  1671 			INFO_PRINTF2(_L("RDvbhReceiver::SetPlatform returned %d"), result);
  1672 			verdict = EFail;
  1673 			}
  1674 		} //end of receiver's scope	
  1675 	__MM_HEAP_MARKEND;
  1676 	return verdict;	
  1677 	}
  1678 	
  1679 //209
  1680 TVerdict RDvbhHaiTest::DoCreateFilterBeforeOpenTestStep()
  1681 	{
  1682 	__MM_HEAP_MARK;
  1683 	TVerdict verdict = EPass;
  1684 		{
  1685 		RDvbhReceiver receiver;
  1686 		TInt filterId = 100;
  1687 		TInt origFilterId = filterId;
  1688 		TRequestStatus status;
  1689 		TInt result = receiver.CreateFilter(KDvbhTestIpV6Addr, filterId, status);
  1690 		if (result != KErrNotReady)
  1691 			{
  1692 			INFO_PRINTF2(_L("RDvbhReceiver::CreateFilter returned %d"), result);
  1693 			verdict = EFail;
  1694 			}
  1695 		else
  1696 			{
  1697 			if (filterId != origFilterId)
  1698 				{
  1699 				INFO_PRINTF1(_L("RDvbhReceiver::CreateFilter modified its arg on failure."));
  1700 				verdict = EFail;			
  1701 				}			
  1702 			}			
  1703 		} //end of receiver's scope	
  1704 	__MM_HEAP_MARKEND;
  1705 	return verdict;	
  1706 	}
  1707 	
  1708 //210
  1709 TVerdict RDvbhHaiTest::DoCancelFilterBeforeOpenTestStep()
  1710 	{
  1711 	__MM_HEAP_MARK;
  1712 	TVerdict verdict = EPass;
  1713 		{
  1714 		RDvbhReceiver receiver;
  1715 		TInt filterId = 7;
  1716 		TInt result = receiver.CancelFilter(filterId);
  1717 		if (result != KErrNotReady)
  1718 			{
  1719 			INFO_PRINTF2(_L("RDvbhReceiver::CancelFilter returned %d"), result);
  1720 			verdict = EFail;
  1721 			}
  1722 		} //end of receiver's scope	
  1723 	__MM_HEAP_MARKEND;
  1724 	return verdict;	
  1725 	}
  1726 	
  1727 //211
  1728 TVerdict RDvbhHaiTest::DoReceiveIpDataBeforeOpenTestStep()
  1729 	{
  1730 	__MM_HEAP_MARK;
  1731 	TVerdict verdict = EPass;
  1732 		{
  1733 		RDvbhReceiver receiver;
  1734 		TInt result = receiver.ReceiveIPData(*this);
  1735 		if (result != KErrNotReady)
  1736 			{
  1737 			INFO_PRINTF2(_L("RDvbhReceiver::ReceiveIPData returned %d"), result);
  1738 			verdict = EFail;
  1739 			}
  1740 		} //end of receiver's scope	
  1741 	__MM_HEAP_MARKEND;
  1742 	return verdict;	
  1743 	}
  1744 	
  1745 //212
  1746 TVerdict RDvbhHaiTest::DoUpdateNetworkTimeBeforeOpenTestStep()
  1747 	{
  1748 	__MM_HEAP_MARK;
  1749 	TVerdict verdict = EPass;
  1750 		{
  1751 		RDvbhReceiver receiver;
  1752 		TRequestStatus status;
  1753 		TInt result = receiver.UpdateNetworkTime(status);
  1754 		if (result != KErrNotReady)
  1755 			{
  1756 			INFO_PRINTF2(_L("RDvbhReceiver::UpdateNetworkTime returned %d"), result);
  1757 			verdict = EFail;
  1758 			}
  1759 		} //end of receiver's scope	
  1760 	__MM_HEAP_MARKEND;
  1761 	return verdict;	
  1762 	}
  1763 	
  1764 //213
  1765 TVerdict RDvbhHaiTest::DoCustomAsyncBeforeOpenTestStep()
  1766 	{
  1767 	__MM_HEAP_MARK;
  1768 	TVerdict verdict = EPass;
  1769 		{
  1770 		RDvbhReceiver receiver;
  1771 		TBuf8<32> output = _L8("Output");
  1772 		TBuf8<32> origOutput = output;
  1773 		TRequestStatus status;
  1774 		TInt result = receiver.CustomCommand(KDvbhTestCustomCommand, KDvbhTestCustomCommandInput, output, status);
  1775 		if (result != KErrNotReady)
  1776 			{
  1777 			INFO_PRINTF2(_L("RDvbhReceiver::CustomCommand returned %d"), result);
  1778 			verdict = EFail;
  1779 			}
  1780 		else
  1781 			{
  1782 			if (output.Compare(origOutput) != 0) //Compare returns 0 if they are the same
  1783 				{
  1784 				INFO_PRINTF1(_L("RDvbhReceiver::CustomCommand modified its arg on failure."));
  1785 				verdict = EFail;			
  1786 				}			
  1787 			}
  1788 		} //end of receiver's scope	
  1789 	__MM_HEAP_MARKEND;
  1790 	return verdict;		
  1791 	}
  1792 	
  1793 //214
  1794 TVerdict RDvbhHaiTest::DoCancelCustomAsyncBeforeOpenTestStep()
  1795 	{
  1796 	__MM_HEAP_MARK;
  1797 	TVerdict verdict = EPass;
  1798 		{
  1799 		RDvbhReceiver receiver;
  1800 		TRequestStatus status;
  1801 		receiver.CancelCustomCommand(status);
  1802 		} //end of receiver's scope	
  1803 	__MM_HEAP_MARKEND;
  1804 	return verdict;	
  1805 	}
  1806 	
  1807 //215
  1808 TVerdict RDvbhHaiTest::DoCustomBeforeOpenTestStep()
  1809 	{
  1810 	__MM_HEAP_MARK;
  1811 	TVerdict verdict = EPass;
  1812 		{
  1813 		RDvbhReceiver receiver;
  1814 		TInt result = receiver.CustomCommand(KDvbhTestCustomCommand, KDvbhTestCustomCommandInput);
  1815 		if (result != KErrNotReady)
  1816 			{
  1817 			INFO_PRINTF2(_L("RDvbhReceiver::CustomCommand returned %d"), result);
  1818 			verdict = EFail;
  1819 			}
  1820 		} //end of receiver's scope	
  1821 	__MM_HEAP_MARKEND;
  1822 	return verdict;	
  1823 	}
  1824 
  1825 //216
  1826 TVerdict RDvbhHaiTest::DoCloseBeforeOpenTestStep()
  1827 	{
  1828 	__MM_HEAP_MARK;
  1829 	TVerdict verdict = EPass;
  1830 		{
  1831 		RDvbhReceiver receiver;
  1832 		receiver.Close();
  1833 		} //end of receiver's scope	
  1834 	__MM_HEAP_MARKEND;
  1835 	return verdict;		
  1836 	}
  1837 
  1838 //217
  1839 TVerdict RDvbhHaiTest::DoPowerOffBeforeOpenTestStep()
  1840 	{
  1841 	__MM_HEAP_MARK;
  1842 	TVerdict verdict = EPass;
  1843 		{
  1844 		RDvbhReceiver receiver;
  1845         TRequestStatus status;
  1846 		receiver.PowerOff(status);
  1847 		} //end of receiver's scope	
  1848 	__MM_HEAP_MARKEND;
  1849 	return verdict;	
  1850 	}
  1851 	
  1852 //218
  1853 TVerdict RDvbhHaiTest::DoSetDisabledBeforeOpenTestStep()
  1854 	{
  1855 	__MM_HEAP_MARK;
  1856 	TVerdict verdict = EPass;
  1857 		{
  1858 		RDvbhReceiver receiver;
  1859         TRequestStatus status;
  1860 		receiver.SetDisabled(ETrue, status);
  1861 		} //end of receiver's scope	
  1862 	__MM_HEAP_MARKEND;
  1863 	return verdict;	
  1864 	}
  1865 
  1866 //219
  1867 TVerdict RDvbhHaiTest::DoCancelScanBeforeOpenTestStep()
  1868 	{
  1869 	__MM_HEAP_MARK;
  1870 	TVerdict verdict = EPass;
  1871 		{
  1872 		RDvbhReceiver receiver;
  1873 		receiver.CancelScan();
  1874 		} //end of receiver's scope	
  1875 	__MM_HEAP_MARKEND;
  1876 	return verdict;	
  1877 	}
  1878 
  1879 //220
  1880 TVerdict RDvbhHaiTest::DoCancelSetPlatformBeforeOpenTestStep()
  1881 	{
  1882 	__MM_HEAP_MARK;
  1883 	TVerdict verdict = EPass;
  1884 		{
  1885 		RDvbhReceiver receiver;
  1886 		receiver.CancelSetPlatform();
  1887 		} //end of receiver's scope	
  1888 	__MM_HEAP_MARKEND;
  1889 	return verdict;	
  1890 	}
  1891 	
  1892 //221
  1893 TVerdict RDvbhHaiTest::DoCancelReceiveIpDataBeforeOpenTestStep()
  1894 	{
  1895 	__MM_HEAP_MARK;
  1896 	TVerdict verdict = EPass;
  1897 		{
  1898 		RDvbhReceiver receiver;
  1899 		receiver.CancelReceiveIPData();
  1900 		} //end of receiver's scope	
  1901 	__MM_HEAP_MARKEND;
  1902 	return verdict;	
  1903 	}
  1904 
  1905 //222
  1906 TVerdict RDvbhHaiTest::DoCancelUpdateNetworkTimeBeforeOpenTestStep()
  1907 	{
  1908 	__MM_HEAP_MARK;
  1909 	TVerdict verdict = EPass;
  1910 		{
  1911 		RDvbhReceiver receiver;
  1912 		receiver.CancelUpdateNetworkTime();
  1913 		} //end of receiver's scope	
  1914 	__MM_HEAP_MARKEND;
  1915 	return verdict;	
  1916 	}
  1917 	
  1918 	
  1919 						
  1920 // 301	
  1921 TVerdict RDvbhHaiTest::DoGetStateNoPropertiesTestStep()
  1922 	{
  1923 	TVerdict verdict = EPass;
  1924 	__MM_HEAP_MARK;
  1925 	TDvbhState state = EDvbhStateReady;
  1926 	TInt result = iRxInfo->GetState(state);
  1927 	if (result != KErrNotFound)
  1928 		{
  1929 		INFO_PRINTF2(_L("Got error %d getting state but expected KErrNotFound"), result);
  1930 		verdict = EFail;				
  1931 		}
  1932 	else
  1933 		{
  1934 		if (state != EDvbhStateReady)
  1935 			{
  1936 			INFO_PRINTF1(_L("RDvbhReceiverInfo::GetState modified its arg on failure."));
  1937 			verdict = EFail;			
  1938 			}			
  1939 		}
  1940 	__MM_HEAP_MARKEND;
  1941 	return verdict;
  1942 	}
  1943 
  1944 //302	
  1945 TVerdict RDvbhHaiTest::DoGetSignalQualityNoPropertiesTestStep()
  1946 	{
  1947 	TVerdict verdict = EPass;
  1948 	__MM_HEAP_MARK;
  1949 	TDvbhSignalQuality quality = EDvbhSignalQualityVeryGood;
  1950 	TInt result = iRxInfo->GetSignalQuality(quality);
  1951 	if (result != KErrNotFound)
  1952 		{
  1953 		INFO_PRINTF2(_L("Got error %d getting signal quality but expected KErrNotFound"), result);
  1954 		verdict = EFail;				
  1955 		}
  1956 	else
  1957 		{
  1958 		if (quality != EDvbhSignalQualityVeryGood)
  1959 			{
  1960 			INFO_PRINTF1(_L("RDvbhReceiverInfo::GetSignalQuality modified its arg on failure."));
  1961 			verdict = EFail;			
  1962 			}			
  1963 		}
  1964 	__MM_HEAP_MARKEND;
  1965 	return verdict;	
  1966 	}
  1967 
  1968 //303	
  1969 TVerdict RDvbhHaiTest::DoGetPlatformNoPropertiesTestStep()
  1970 	{
  1971 	TVerdict verdict = EPass;
  1972 	__MM_HEAP_MARK;
  1973 	TDvbhPlatform platform;
  1974 	platform.iId = iDvbhTestPlatform.iPlatform.iId;
  1975 	platform.iName = iDvbhTestPlatform.iPlatform.iName;
  1976 	
  1977 	TIp6Addr esgRoot = iDvbhTestPlatform.iEsgRoot;
  1978 
  1979 	TInt result = iRxInfo->GetPlatform(platform, esgRoot);
  1980 	if (result != KErrNotFound)
  1981 		{
  1982 		INFO_PRINTF2(_L("Got error %d getting platform but expected KErrNotFound"), result);
  1983 		verdict = EFail;				
  1984 		}
  1985 	else
  1986 		{
  1987 		if (!CDvbhTestUtil::ComparePlatforms(platform, iDvbhTestPlatform.iPlatform)  ||
  1988 			!esgRoot.IsEqual(iDvbhTestPlatform.iEsgRoot) )
  1989 			{
  1990 			INFO_PRINTF1(_L("RDvbhReceiverInfo::GetPlatform modified its arg on failure."));
  1991 			verdict = EFail;			
  1992 			}			
  1993 		}
  1994 	__MM_HEAP_MARKEND;
  1995 	return verdict;	
  1996 	}
  1997 
  1998 //304	
  1999 TVerdict RDvbhHaiTest::DoGetNetworkTimeNoPropertiesTestStep()
  2000 	{
  2001 	TVerdict verdict = EPass;
  2002 	__MM_HEAP_MARK;	
  2003 	TTime time = iDvbhTestTime;
  2004 	TBool valid = ETrue;
  2005 	
  2006 	TInt result = iRxInfo->GetNetworkTime(time, valid);
  2007 	if (result != KErrNotFound)
  2008 		{
  2009 		INFO_PRINTF2(_L("Got error %d getting network time but expected KErrNotFound"), result);
  2010 		verdict = EFail;				
  2011 		}
  2012 	else
  2013 		{
  2014 		if (time != iDvbhTestTime  || !valid )
  2015 			{
  2016 			INFO_PRINTF1(_L("RDvbhReceiverInfo::GetNetworkTime modified its arg on failure."));
  2017 			verdict = EFail;			
  2018 			}			
  2019 		}
  2020 	__MM_HEAP_MARKEND;
  2021 	return verdict;	
  2022 	}
  2023 
  2024 //305	
  2025 TVerdict RDvbhHaiTest::DoGetPerformanceDataNoPropertiesTestStep()
  2026 	{
  2027 	TVerdict verdict = EPass;
  2028 	__MM_HEAP_MARK;
  2029 	TDvbhPerformanceData data;
  2030 	data.iFilterCount = iDvbhTestPerformanceData.iFilterCount;
  2031 	data.iMaxFilters = iDvbhTestPerformanceData. iMaxFilters;
  2032 	data.iDataCount = iDvbhTestPerformanceData.iDataCount;
  2033 	data.iWriteCount = iDvbhTestPerformanceData.iWriteCount;
  2034 	data.iWriteCommandCount = iDvbhTestPerformanceData.iWriteCommandCount;
  2035 	data.iReadCount = iDvbhTestPerformanceData.iReadCount;
  2036 	data.iReadCommandCount = iDvbhTestPerformanceData.iReadCommandCount;
  2037 	
  2038 	TInt result = iRxInfo->GetPerformanceData(data);
  2039 	if (result != KErrNotFound)
  2040 		{
  2041 		INFO_PRINTF2(_L("Got error %d getting performance data but expected KErrNotFound"), result);
  2042 		verdict = EFail;				
  2043 		}
  2044 	else
  2045 		{
  2046 		if (!CDvbhTestUtil::ComparePerformanceDatas(data, iDvbhTestPerformanceData))
  2047 			{
  2048 			INFO_PRINTF1(_L("RDvbhReceiverInfo::GetPerformaceData modified its arg on failure."));
  2049 			verdict = EFail;			
  2050 			}			
  2051 		}
  2052 	__MM_HEAP_MARKEND;
  2053 	return verdict;		
  2054 	}
  2055 
  2056 //306	
  2057 TVerdict RDvbhHaiTest::DoGetFrequencyNoPropertiesTestStep()
  2058 	{
  2059 	TVerdict verdict = EPass;
  2060 	__MM_HEAP_MARK;
  2061 	TDvbhFrequency frequency = KInitialFrequency;
  2062 	
  2063 	TInt result = iRxInfo->GetFrequency(frequency);
  2064 	if (result != KErrNotFound)
  2065 		{
  2066 		INFO_PRINTF2(_L("Got error %d getting frequency but expected KErrNotFound"), result);
  2067 		verdict = EFail;				
  2068 		}
  2069 	else
  2070 		{
  2071 		if (frequency != KInitialFrequency)
  2072 			{
  2073 			INFO_PRINTF1(_L("RDvbhReceiverInfo::GetFrequency modified its arg on failure."));
  2074 			verdict = EFail;			
  2075 			}			
  2076 		}
  2077 	__MM_HEAP_MARKEND;
  2078 	return verdict;		
  2079 	}
  2080 
  2081 //307	
  2082 TVerdict RDvbhHaiTest::DoGetCellIdNoPropertiesTestStep()
  2083 	{
  2084 	TVerdict verdict = EPass;
  2085 	__MM_HEAP_MARK;
  2086 	TDvbhCellId cellId = KInitialCellId;
  2087 	
  2088 	TInt result = iRxInfo->GetCellId(cellId);
  2089 	if (result != KErrNotFound)
  2090 		{
  2091 		INFO_PRINTF2(_L("Got error %d getting cellId but expected KErrNotFound"), result);
  2092 		verdict = EFail;				
  2093 		}
  2094 	else
  2095 		{
  2096 		if (cellId != KInitialCellId)
  2097 			{
  2098 			INFO_PRINTF1(_L("RDvbhReceiverInfo::GetCellId modified its arg on failure."));
  2099 			verdict = EFail;			
  2100 			}			
  2101 		}
  2102 	__MM_HEAP_MARKEND;
  2103 	return verdict;	
  2104 	}
  2105 	
  2106 //308
  2107 TVerdict RDvbhHaiTest::DoGetNetworkIdNoPropertiesTestStep()
  2108 	{
  2109 	TVerdict verdict = EPass;
  2110 	__MM_HEAP_MARK;
  2111 	TDvbhNetworkId networkId = KInitialNetworkId;
  2112 	
  2113 	TInt result = iRxInfo->GetNetworkId(networkId);
  2114 	if (result != KErrNotFound)
  2115 		{
  2116 		INFO_PRINTF2(_L("Got error %d getting networkId but expected KErrNotFound"), result);
  2117 		verdict = EFail;				
  2118 		}
  2119 	else
  2120 		{
  2121 		if (networkId != KInitialNetworkId)
  2122 			{
  2123 			INFO_PRINTF1(_L("RDvbhReceiverInfo::GetNetworkId modified its arg on failure."));
  2124 			verdict = EFail;			
  2125 			}			
  2126 		}
  2127 	__MM_HEAP_MARKEND;
  2128 	return verdict;	
  2129 	}
  2130 	
  2131 
  2132 //309
  2133 /**
  2134 * Test added to improve conditional code coverage.  It tries to get all the properties
  2135 * that depend on state when the state property is defined, but no other properties are
  2136 * defined.
  2137 */
  2138 TVerdict RDvbhHaiTest::DoGetTestsNoProperties()
  2139 	{
  2140 	TVerdict verdict = EPass;
  2141 		
  2142 	//Preamble will have defined the state property and set it to EDvbhStateReceiving.  So
  2143 	//we just have to try to get each (non-defined) property that depends on state.
  2144 
  2145 	//CellId
  2146 	verdict = DoGetCellIdNoPropertiesTestStep();
  2147 	if (verdict != EPass)
  2148 		{
  2149 		return verdict;
  2150 		}
  2151 		
  2152 	//Frequency
  2153 	verdict = DoGetFrequencyNoPropertiesTestStep();
  2154 	if (verdict != EPass)
  2155 		{
  2156 		return verdict;
  2157 		}
  2158 
  2159 	//NetworkId
  2160 	verdict = DoGetNetworkIdNoPropertiesTestStep();
  2161 	if (verdict != EPass)
  2162 		{
  2163 		return verdict;
  2164 		}
  2165 		
  2166 	//Platform
  2167 	verdict = DoGetPlatformNoPropertiesTestStep();
  2168 	if (verdict != EPass)
  2169 		{
  2170 		return verdict;
  2171 		}
  2172 
  2173 	//Signal Quality
  2174 	verdict = DoGetSignalQualityNoPropertiesTestStep();
  2175 	if (verdict != EPass)
  2176 		{
  2177 		return verdict;
  2178 		}
  2179 	
  2180 	return verdict;	
  2181 	}
  2182 	
  2183 //MDvbhScanObserver
  2184 void RDvbhHaiTest::DvbhScanProgress( const TDvbhScanResult& /*aResult*/ )
  2185 	{	
  2186 	//Should never be called
  2187 	ASSERT(EFalse);
  2188 	}
  2189 	
  2190 //MDvbhDataObserver
  2191 void RDvbhHaiTest::DvbhPacketReceived( const TDesC8& /*aPacket*/ )
  2192 	{
  2193 	//Should never be called
  2194 	ASSERT(EFalse);	
  2195 	}
  2196