resourcemgmt/hwresourcesmgr/test/te_hwrm/hwrmtestbase.h
changeset 0 4e1aa6a622a0
child 21 ccb4f6b3db21
equal deleted inserted replaced
-1:000000000000 0:4e1aa6a622a0
       
     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 #ifndef hwrmtestbase_h
       
    17 #define hwrmtestbase_h
       
    18 
       
    19 #include <tefunit.h>
       
    20 #include <hwrmvibra.h>
       
    21 #include <hwrmlight.h>
       
    22 #include <hwrmextendedlight.h>
       
    23 #include <hwrmenhancedlight.h>
       
    24 #include <hwrmpower.h>
       
    25 #include <hwrmfmtx.h>
       
    26 #include <rmocklight.h>
       
    27 #include <rmockpowerstate.h>
       
    28 #include <rmockvibra.h>
       
    29 #include <rmockpower.h>
       
    30 #include <rmockfmtx.h>
       
    31 #include <e32property.h>
       
    32 #include <hwrmpowerstatesdkpskeys.h>
       
    33 #include "endstatetimer.h"
       
    34 #include "pspropertyobserver.h"
       
    35 
       
    36 const TInt KMaxNoOpenSessionsForResource = 3;
       
    37 const TInt KMaxNoStateTransitions = 5;
       
    38 
       
    39 const TInt KDefaultVibraMinOffTime = 0;
       
    40 
       
    41 // temp, may need to move but in original test was in main.cpp
       
    42 const TUint32 KHWRMTestLightIntensityValue      = 0x10000007;
       
    43 const TUint32 KHWRMTestLightSensitivityValue    = 0x10000008;
       
    44 
       
    45 
       
    46 class CHWRMTestBase : 	public CTestFixture , 
       
    47 						public MHWRMVibraObserver, 
       
    48 						public MHWRMLightObserver, 
       
    49 						public MHWRMExtendedLightObserver,
       
    50 						public MHWRMBatteryPowerObserver,
       
    51 						public MHWRMFmTxObserver,
       
    52 						public MTimerExpired, 
       
    53 						public MPsPropertyObserver,
       
    54 						public MHWRMVibraFeedbackObserver
       
    55 #ifdef SYMBIAN_HWRM_EXTPOWERINFO
       
    56 						,
       
    57 						public MHWRMBatteryChargingStatusObserver,
       
    58 						public MHWRMBatteryFullChargingTimeObserver,
       
    59 						public MHWRMBatteryChargingCurrentObserver
       
    60 #endif //SYMBIAN_HWRM_EXTPOWERINFO
       
    61 	{
       
    62 public:// from MHWRMVibraObserver
       
    63     virtual void VibraModeChanged(CHWRMVibra::TVibraModeState aStatus);
       
    64     virtual void VibraStatusChanged(CHWRMVibra::TVibraStatus aStatus);
       
    65     // from MHWRMVibraFeedbackObserver
       
    66     virtual void VibraFeedbackModeChanged(CHWRMVibra::TVibraFeedbackModeState aMode);
       
    67 
       
    68 public: // from MHWRMLightObserver
       
    69     virtual void LightStatusChanged(TInt aTarget, CHWRMLight::TLightStatus aStatus);
       
    70 
       
    71 public: //from MHWRMExtendedLightObserver
       
    72 	virtual void LightStatusChanged(TInt aTarget, CHWRMExtendedLight::TLightStatus aStatus);
       
    73 
       
    74 public: //from MHWRMBatteryPowerObserver
       
    75 
       
    76 	virtual void PowerMeasurement(TInt aErrorCode, CHWRMPower::TBatteryPowerMeasurementData& aMeasurement);
       
    77 public: //from MHWRMFmTxObserver
       
    78 	virtual void FmTxStatusChanged(TFmTxState aState);
       
    79 	virtual void FmTxFrequencyChanged(TInt aFrequency);
       
    80 	
       
    81 public: // from MPsPropertyObserver
       
    82 	virtual void PsPropertyChanged(TInt aKey, TInt aValue);
       
    83 	
       
    84 public: //from MTimerExpired
       
    85 	void EndStateTimerExpired(TInt aError);
       
    86 
       
    87 #ifdef SYMBIAN_HWRM_EXTPOWERINFO
       
    88 public:
       
    89 	//from MHWRMBatteryChargingStatusObserver
       
    90     void ChargingStatusChange(TInt aErrorCode, CHWRMPower::TBatteryChargingStatus aChrgStatus);
       
    91 	//from MHWRMBatteryFullChargingTimeObserver
       
    92 	void BatteryFullChargingTimeChange(TInt aErrorCode, TUint aTime);
       
    93 	//from MHWRMBatteryChargingCurrentObserver
       
    94 	void AverageChargingCurrentChange(TInt aErrorCode, TInt aMeasurement);
       
    95 #endif //SYMBIAN_HWRM_EXTPOWERINFO
       
    96 
       
    97 public:
       
    98 	// SetUp and TearDown code
       
    99 	void SetupL();
       
   100 	void TearDownL();
       
   101 	inline void SetTestFail();
       
   102 	
       
   103 protected: //useful functions
       
   104 	template <class T>
       
   105 	void AddTestStateL(T* aObject, void (T::*aTestStateFptr)(),TReal aMaxDurationIsSecs);
       
   106 	
       
   107 	void OpenSessionsL(TInt aNoLightSessionsToOpen, TInt aNoVibraSessionsToOpen, TInt aNoExtLightSessionsToOpen = 0, TInt aNoFmTxSessionsToOpen = 0, TInt aNoPowerSessionsToOpen = 0);
       
   108 	void OpenPowerStateSessionL();
       
   109 	void OpenLightSessionEnhancedL(TInt aNoEnhancedLightSessionsToOpen);
       
   110 	inline CHWRMVibra& GetVibraSessionL(TInt aIndex);
       
   111 	inline CHWRMLight& GetLightSessionL(TInt aIndex);
       
   112 	inline CHWRMExtendedLight& GetExtLightSessionL(TInt aIndex);
       
   113 	inline CHWRMEnhancedLight& GetEnhancedLightSessionL(TInt aIndex);
       
   114 	inline CHWRMPower& GetPowerSessionL(TInt aIndex);
       
   115 	inline CHWRMFmTx& GetFmTxSessionL(TInt aIndex);
       
   116 	inline CHWRMVibra& GetVibraSessionWithCallbackRegisteredL();
       
   117 	inline CHWRMLight& GetLightSessionWithCallbackRegisteredL();
       
   118 	inline CHWRMExtendedLight& GetExtLightSessionWithCallbackRegisteredL();
       
   119 	inline CHWRMEnhancedLight& GetEnhancedLightSessionWithCallbackRegisteredL();
       
   120 	inline CHWRMPower& GetPowerSessionWithCallbackRegisteredL();
       
   121 	inline CHWRMFmTx& GetFmTxSessionWithCallbackRegisteredL();
       
   122 	
       
   123 	void SetCRVibraAttributeL(TUint32 aVibraKey, TInt aValue);
       
   124 	TInt SetCRVibraAttribute(TUint32 aVibraKey, TInt aValue);
       
   125 	void GetCRVibraAttributeL(TUint32 aVibraKey, TInt& aValue);
       
   126 	void GetVibraTimeAttributesL();
       
   127 	
       
   128 	void SetCRLightAttributes(TUint32 aLightKey, TInt aValue);
       
   129 	void GetCRLightAttributes(TUint32 aLightKey, TInt &aValue);
       
   130 	void SetLightControlAttributes(TInt aIntensity, TInt aSensitivity, TInt aInUse);
       
   131 	void GetLightControlAttributes();
       
   132 	
       
   133 	void SetCRPowerAttributeL(TUint32 aVibraKey, TInt aValue);
       
   134 	void GetCRPowerAttributeL(TUint32 aVibraKey, TInt &aValue);
       
   135 	void GetPowerAttributesL();
       
   136 	void SetPowerAttributesMeasurementProcessingTime(TUint aMeasurementProcessingTime);
       
   137 	
       
   138 	void SetCRFmTxAttributeL(TUint32 aVibraKey, TInt aValue);
       
   139 	void GetCRFmTxAttributeL(TUint32 aVibraKey, TInt &aValue);
       
   140 	void GetFmTxFrequencyStepSizeL();
       
   141 	void SetFmTxFrequencyRangeJapanL();
       
   142 	void SetFmTxFrequencyRangeEuropeL();
       
   143 	void SetFmTxInactivityTimeOutL(TUint aInactivityTimeOut);
       
   144 	
       
   145 	void ResetDefaultsL();
       
   146 		
       
   147 	inline RMockLight& GetMockLight();
       
   148 	inline RMockVibra& GetMockVibra();
       
   149 
       
   150 	inline RMockFmTx& GetMockFmTx();
       
   151 
       
   152 	inline RMockPowerState& GetMockPowerState();	
       
   153 	inline RMockPower& GetMockPower();
       
   154 	
       
   155 	void ExpectVibraStatusNotificationL(CHWRMVibra::TVibraStatus aStatus);
       
   156 	void ExpectVibraModeNotificationL(CHWRMVibra::TVibraModeState aState);
       
   157 	void ExpectVibraModeNotificationL();
       
   158 	
       
   159 	void ExpectVibraFeedbackModeNotificationL(CHWRMVibra::TVibraFeedbackModeState aStatus);
       
   160 
       
   161 	void ExpectLightStatusNotificationL(TInt aTarget, CHWRMLight::TLightStatus aStatus);
       
   162 	void ExpectExtLightStatusNotificationL(TInt aTarget, CHWRMExtendedLight::TLightStatus aStatus);
       
   163 	
       
   164 	void ExpectFmTxStatusNotificationL(TFmTxState aStatus);
       
   165 	void ExpectFmTxStatusNotificationL(TFmTxState aStatus1, TFmTxState aStatus2);
       
   166 	void ExpectFmTxFrequencyNotificationL(TInt aFrequency);	
       
   167 	
       
   168 	void ExpectBatteryLevelNotificationL(EPSHWRMBatteryLevel aBatteryLevel);
       
   169 	void ExpectBatteryStatusNotificationL(EPSHWRMBatteryStatus aStatus);
       
   170 	void ExpectedChargingStatusNotificationsL(EPSHWRMChargingStatus aStatus);
       
   171 	
       
   172 	void ExpectBatteryPowerMeasurementsErrorL(TInt aErrorCode);
       
   173 	
       
   174 	// TO DO: temp solution, need to add counters
       
   175 	void CheckPluginInsensitivity();
       
   176 	
       
   177 	void ExpectLeave(TInt aError);
       
   178 	void EndExpectLeaveL(TInt aErr, const TText8* aFile,TInt aLine);
       
   179 	void CheckMockSYResultL();
       
   180 	void CheckAllExpectedNotificationsReceived();
       
   181 	
       
   182 	void ExecuteTestL();
       
   183 	void CheckForEndOfTransition();
       
   184 	
       
   185 	void CleanupPropertyObservers();
       
   186 	void BatteryLevelChanged(TInt aBatteryLevel);
       
   187 	void BatteryStatusChanged(TInt aBatteryStatus);
       
   188 	void ChargingStatusChanged(TInt aChargingStatus);
       
   189 	
       
   190 	const TDesC& MapVibraModeState(CHWRMVibra::TVibraModeState aState);
       
   191 	const TDesC& MapVibraModeStatus(CHWRMVibra::TVibraStatus aStatus);
       
   192 	const TDesC& MapLightStatus(CHWRMLight::TLightStatus aStatus);
       
   193 	const TDesC& MapFmTxStatus(TFmTxState aStatus);
       
   194 	
       
   195 	void SetIgnoreStatusNotifications(TBool aIgnore);
       
   196 	TBool IgnoringStatusNotifications() const;
       
   197 	
       
   198 	void GetTargetsOn(TInt& aTargetsOnMask) const;
       
   199 
       
   200 #ifdef SYMBIAN_HWRM_EXTPOWERINFO
       
   201 	void OpenPowerStateSessionforChrgStatusL();
       
   202 	void SetPowerChargingCurrentMeasurementProcessingTime(TUint aCallbackProcessingTime);
       
   203 	void ExpectBatteryChargingStatusErrorL(TInt aErrorCode);
       
   204 	void ExpectBatteryChargingTimeMeasurementsErrorL(TInt aErrorCode);
       
   205 	void ExpectBatteryChargingCurrentMeasurementsErrorL(TInt aErrorCode);
       
   206 #endif
       
   207 	
       
   208 protected:
       
   209 	TFixedArray<CHWRMVibra*,KMaxNoOpenSessionsForResource> iVibraSessions;
       
   210 	TFixedArray<CHWRMLight*,KMaxNoOpenSessionsForResource> iLightSessions;
       
   211 	TFixedArray<CHWRMExtendedLight*,KMaxNoOpenSessionsForResource> iExtLightSessions;
       
   212 	TFixedArray<CHWRMPower*,KMaxNoOpenSessionsForResource> iPowerSessions;
       
   213 	TFixedArray<CHWRMFmTx*,KMaxNoOpenSessionsForResource> iFmTxSessions;
       
   214 	TFixedArray<CHWRMEnhancedLight*,KMaxNoOpenSessionsForResource> iEnhancedLightSessions;
       
   215 	
       
   216 	RMockLight iMockLight;
       
   217 	TBool iIsMockLightSessionOpen;
       
   218 	RMockVibra iMockVibra;
       
   219 	TBool iIsMockVibraSessionOpen;
       
   220 	RMockPowerState iMockPowerState;
       
   221 	TBool iIsMockPowerStateSessionOpen;
       
   222 	RMockPower iMockPower;
       
   223 	TBool iIsMockPowerSessionOpen;
       
   224 	RMockFmTx iMockFmTx;
       
   225 	TBool iIsMockFmTxSessionOpen;
       
   226 	
       
   227 	struct TStepStateBase
       
   228 		{
       
   229 		virtual void ExecuteTestState() =0;
       
   230 		TReal iMaxDurationInSecs;
       
   231 		};
       
   232 
       
   233 	template <class T>
       
   234 	struct TStepState : public TStepStateBase
       
   235 		{
       
   236 		typedef void (T::*TTestStateFptr)();
       
   237 		T* iObject;
       
   238 		TTestStateFptr iStateFptr;
       
   239 		virtual void ExecuteTestState();
       
   240 		};
       
   241 	
       
   242 	RPointerArray<TStepStateBase> iStepStates;
       
   243 	CActiveScheduler* iScheduler;
       
   244 	CEndStateTimer* iEndStateTimer;
       
   245 	TInt iTestResult;
       
   246 	TInt iCurrentState;
       
   247 	TInt iExpectedLeaveCode;
       
   248 	
       
   249 	RArray<CHWRMVibra::TVibraStatus> 	iExpectedVibraStatusNotifications;
       
   250 	RArray<CHWRMVibra::TVibraModeState> iExpectedVibraModeNotifications;
       
   251     RArray<CHWRMVibra::TVibraFeedbackModeState>	iExpectedVibraFeedbackModeNotifications;
       
   252 	RArray<EPSHWRMBatteryLevel> iExpectedBatteryLevelNotifications;
       
   253 	RArray<EPSHWRMBatteryStatus> iExpectedBatteryStatusNotifications;
       
   254 	RArray<EPSHWRMChargingStatus> iExpectedChargingStatusNotifications;
       
   255 	RArray<TInt> iExpectedBatteryPowerMeasurementsError;
       
   256 #ifdef SYMBIAN_HWRM_EXTPOWERINFO
       
   257 	RArray<TInt> iExpectedBatteryChargingTimeMeasurementsError;
       
   258 	RArray<TInt> iExpectedBatteryChargingCurrentMeasurementsError;
       
   259 #endif //SYMBIAN_HWRM_EXTPOWERINFO
       
   260 	
       
   261 	struct TLightNotification
       
   262 		{
       
   263 		TInt iTarget;
       
   264 		CHWRMLight::TLightStatus iStatus;
       
   265 		};
       
   266 	RArray<TLightNotification> iExpectedLightNotifications;
       
   267 
       
   268 	struct TExtLightNotification
       
   269 		{
       
   270 		TInt iTarget;
       
   271 		CHWRMExtendedLight::TLightStatus iStatus;
       
   272 		};
       
   273 	RArray<TExtLightNotification> iExpectedExtLightNotifications;
       
   274 	
       
   275 	struct TFmTxNotification
       
   276 		{
       
   277 		TFmTxState iState1;
       
   278 		TFmTxState iState2;
       
   279 		};
       
   280 	RArray<TFmTxNotification> iExpectedFmTxStatusNotifications;
       
   281 	
       
   282 	RArray<TInt> iExpectedFmTxFrequencyNotifications;
       
   283 	
       
   284 	//vibra control attributes
       
   285 	TInt iVibraMinOffTime;
       
   286 	TInt iVibraMaxOnTime;
       
   287 	TInt iPulseMaxDuration;
       
   288 	TInt iPulseMaxIntensity;
       
   289 
       
   290 	//light control attributes
       
   291 	TInt iLightDefaultIntensity;
       
   292 	TInt iLightDefaultSensitivity;
       
   293 	TInt iLightSensorEnabled;
       
   294 	
       
   295 	RProperty iLightIntensityProperty;
       
   296 	RProperty iLightSensitivityProperty;
       
   297 	
       
   298 	TInt iPowerMaxReportingPeriodMicroSeconds;
       
   299 	TInt iPowerBaseIntervalMicroSeconds;
       
   300 	
       
   301 	TUint iPowerAttributesMeasurementProcessingTime;// milliseconds
       
   302 #ifdef SYMBIAN_HWRM_EXTPOWERINFO
       
   303 	TUint iPowerChargingCurrentMeasurementProcessingTime; //milliseconds
       
   304 #endif //SYMBIAN_HWRM_EXTPOWERINFO
       
   305 	
       
   306 	TInt iFmTxFrequencyStepSize; // KHz
       
   307 	
       
   308 	TBool iSensorSupported;
       
   309 	
       
   310 #ifdef INSECURE_AUDIO_POLICY_KEYS
       
   311 	//fmtx control attributes
       
   312 	// Used to mimic Audio Policy behaviour
       
   313 	RProperty iAudioRoutedProperty;
       
   314 #endif // INSECURE_AUDIO_POLICY_KEYS  	
       
   315 	
       
   316 	// P&S property observers
       
   317 	CPsPropertyObserver* iBatteryLevelObserver;
       
   318 	CPsPropertyObserver* iBatteryStatusObserver;
       
   319 	CPsPropertyObserver* iChargingStatusObserver;
       
   320 	
       
   321 	TBool iTearingDown;
       
   322 	TBool iIgnoreStatusNotifications;
       
   323 	};
       
   324 	
       
   325 //inlines
       
   326 
       
   327 template <class T>
       
   328 void CHWRMTestBase::AddTestStateL(T* aObject, void (T::*aTestStateFptr)(),TReal aMaxDurationIsSecs)
       
   329 	{
       
   330 	TStepState<T>* testState = new (ELeave)TStepState<T>;
       
   331 	CleanupStack::PushL(testState);
       
   332 	testState->iStateFptr = aTestStateFptr;
       
   333 	testState->iObject = aObject;
       
   334 	testState->iMaxDurationInSecs = aMaxDurationIsSecs;
       
   335 	iStepStates.AppendL(testState);
       
   336 	CleanupStack::Pop(testState);
       
   337 	}
       
   338 
       
   339 template <class T>
       
   340 void CHWRMTestBase::TStepState<T>::ExecuteTestState()
       
   341 	{
       
   342 	(iObject->*iStateFptr)();
       
   343 	}
       
   344 
       
   345 inline CHWRMVibra& CHWRMTestBase::GetVibraSessionL(TInt aIndex)
       
   346 	{
       
   347 	if(!iVibraSessions[aIndex])
       
   348 		User::Leave(KErrNotFound);
       
   349 	
       
   350 	return *iVibraSessions[aIndex];
       
   351 	}
       
   352 inline CHWRMLight& CHWRMTestBase::GetLightSessionL(TInt aIndex)
       
   353 	{
       
   354 	if(!iLightSessions[aIndex])
       
   355 		User::Leave(KErrNotFound);
       
   356 	
       
   357 	return *iLightSessions[aIndex];
       
   358 	}
       
   359 
       
   360 inline CHWRMFmTx& CHWRMTestBase::GetFmTxSessionL(TInt aIndex)
       
   361 	{
       
   362 	if(!iFmTxSessions[aIndex])
       
   363 		User::Leave(KErrNotFound);
       
   364 	
       
   365 	return *iFmTxSessions[aIndex];
       
   366 	}
       
   367 
       
   368 inline CHWRMExtendedLight& CHWRMTestBase::GetExtLightSessionL(TInt aIndex)
       
   369 	{
       
   370 	if(!iExtLightSessions[aIndex])
       
   371 		User::Leave(KErrNotFound);
       
   372 	
       
   373 	return *iExtLightSessions[aIndex];
       
   374 	}
       
   375 
       
   376 inline CHWRMEnhancedLight& CHWRMTestBase::GetEnhancedLightSessionL(TInt aIndex)
       
   377 	{
       
   378 	if(!iEnhancedLightSessions[aIndex])
       
   379 		User::Leave(KErrNotFound);
       
   380 	
       
   381 	return *iEnhancedLightSessions[aIndex];
       
   382 	}
       
   383 
       
   384 inline CHWRMPower& CHWRMTestBase::GetPowerSessionL(TInt aIndex)
       
   385 {
       
   386 	if(!iPowerSessions[aIndex])
       
   387 		User::Leave(KErrNotFound);
       
   388 
       
   389 	return *iPowerSessions[aIndex];
       
   390 }
       
   391 
       
   392 inline CHWRMVibra& CHWRMTestBase::GetVibraSessionWithCallbackRegisteredL()
       
   393 	{
       
   394 	if(!iVibraSessions[0]) //its always @ idx = 0
       
   395 		User::Leave(KErrNotFound);
       
   396 	
       
   397 	return *iVibraSessions[0];
       
   398 	}
       
   399 
       
   400 inline CHWRMLight& CHWRMTestBase::GetLightSessionWithCallbackRegisteredL()
       
   401 	{
       
   402 	if(!iLightSessions[0]) //its always @ idx = 0
       
   403 		User::Leave(KErrNotFound);
       
   404 
       
   405 	return *iLightSessions[0];
       
   406 	}
       
   407 
       
   408 inline CHWRMExtendedLight& CHWRMTestBase::GetExtLightSessionWithCallbackRegisteredL()
       
   409 	{
       
   410 	if(!iExtLightSessions[0]) //its always @ idx = 0
       
   411 		User::Leave(KErrNotFound);
       
   412 
       
   413 	return *iExtLightSessions[0];	
       
   414 	}
       
   415 
       
   416 inline CHWRMEnhancedLight& CHWRMTestBase::GetEnhancedLightSessionWithCallbackRegisteredL()
       
   417 	{
       
   418 	if(!iEnhancedLightSessions[0]) //its always @ idx = 0
       
   419 		User::Leave(KErrNotFound);
       
   420 
       
   421 	return *iEnhancedLightSessions[0];	
       
   422 	}
       
   423 
       
   424 inline CHWRMPower& CHWRMTestBase::GetPowerSessionWithCallbackRegisteredL()
       
   425 	{
       
   426 	if(!iPowerSessions[0]) //its always @ idx = 0
       
   427 		User::Leave(KErrNotFound);
       
   428 	
       
   429 	return *iPowerSessions[0];
       
   430 	}
       
   431 
       
   432 inline CHWRMFmTx& CHWRMTestBase::GetFmTxSessionWithCallbackRegisteredL()
       
   433 	{
       
   434 	if(!iFmTxSessions[0]) //its always @ idx = 0
       
   435 		User::Leave(KErrNotFound);
       
   436 
       
   437 	return *iFmTxSessions[0];
       
   438 	}
       
   439 
       
   440 inline RMockLight& CHWRMTestBase::GetMockLight()
       
   441 	{
       
   442 	return iMockLight;
       
   443 	}
       
   444 
       
   445 inline RMockVibra& CHWRMTestBase::GetMockVibra()
       
   446 	{
       
   447 	return iMockVibra;
       
   448 	}
       
   449 
       
   450 inline RMockPowerState& CHWRMTestBase::GetMockPowerState()
       
   451 	{
       
   452 	return iMockPowerState;
       
   453 	}
       
   454 
       
   455 inline RMockPower& CHWRMTestBase::GetMockPower()
       
   456 	{
       
   457 	return iMockPower;
       
   458 	}
       
   459 
       
   460 inline RMockFmTx& CHWRMTestBase::GetMockFmTx()
       
   461 	{
       
   462 	return iMockFmTx;
       
   463 	}
       
   464 
       
   465 inline void CHWRMTestBase::SetTestFail()
       
   466 	{
       
   467 	if(!iTestResult)
       
   468 		{
       
   469 		iTestResult = KErrTEFUnitFail;
       
   470 		}
       
   471 	}
       
   472 
       
   473 inline void CHWRMTestBase::ExpectLeave(TInt aError)
       
   474 	{
       
   475 	iExpectedLeaveCode = aError;
       
   476 	}
       
   477 
       
   478 inline void CHWRMTestBase::SetIgnoreStatusNotifications(TBool aIgnore)
       
   479 	{
       
   480 	iIgnoreStatusNotifications = aIgnore;
       
   481 	}
       
   482 
       
   483 inline TBool CHWRMTestBase::IgnoringStatusNotifications() const
       
   484 	{
       
   485 	return iIgnoreStatusNotifications;
       
   486 	}
       
   487 
       
   488 #endif // hwrmtest_h