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