os/ossrv/lowlevellibsandfws/pluginfw/Framework/RegistryDataTest/RegistryDataTransitionValidation.inl
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/lowlevellibsandfws/pluginfw/Framework/RegistryDataTest/RegistryDataTransitionValidation.inl Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,542 @@
1.4 +// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +// The implementation of the validation classes for the CRegistryData tests
1.18 +//
1.19 +//
1.20 +
1.21 +// ______________________________________________________________________________
1.22 +//
1.23 +inline TRegistryData_Ctor_TransitionValidator::TRegistryData_Ctor_TransitionValidator(CUnitTestContext& aUTContext)
1.24 +:TTransitionValidator(aUTContext)
1.25 + {
1.26 + // Do nothing
1.27 + }
1.28 +
1.29 +inline TBool TRegistryData_Ctor_TransitionValidator::ValidatePreConditions()
1.30 + {
1.31 + // Always true
1.32 + return ETrue;
1.33 + }
1.34 +
1.35 +inline TBool TRegistryData_Ctor_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
1.36 + {
1.37 + if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext).iRegistryData))
1.38 + return EFalse;
1.39 + return ETrue;
1.40 + }
1.41 +
1.42 +// ______________________________________________________________________________
1.43 +//
1.44 +inline TRegistryData_Dtor_TransitionValidator::TRegistryData_Dtor_TransitionValidator(CUnitTestContext& aUTContext)
1.45 +:TTransitionValidator(aUTContext)
1.46 + {
1.47 + // Do nothing
1.48 + }
1.49 +
1.50 +inline TBool TRegistryData_Dtor_TransitionValidator::ValidatePreConditions()
1.51 + {
1.52 + if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext).iRegistryData))
1.53 + return EFalse;
1.54 + return ETrue;
1.55 + }
1.56 +
1.57 +inline TBool TRegistryData_Dtor_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
1.58 + {
1.59 + return ETrue;
1.60 + }
1.61 +
1.62 +// ______________________________________________________________________________
1.63 +//
1.64 +inline TRegistryData_AddDllDataL_TransitionValidator::TRegistryData_AddDllDataL_TransitionValidator(CUnitTestContext& aUTContext)
1.65 +:TTransitionValidator(aUTContext)
1.66 + {
1.67 + // Do nothing
1.68 + }
1.69 +
1.70 +inline TBool TRegistryData_AddDllDataL_TransitionValidator::ValidatePreConditions()
1.71 + {
1.72 + CRegistryData_UnitTestContext& context = REINTERPRET_CAST(CRegistryData_UnitTestContext&,
1.73 + iUTContext);
1.74 + TRegistryData_StateAccessor& accessor = REINTERPRET_CAST(TRegistryData_StateAccessor&,
1.75 + iUTContext.StateAccessor());
1.76 +
1.77 + // Check that the drive we are trying to add to is valid
1.78 + if(!(accessor.IsRegisteredDrive(*context.iRegistryData, context.iDriveUnit)))
1.79 + {
1.80 + _LIT(KAddDllFailedPreConditions,
1.81 + "CRegistryData_AddDllDataL_Transition failed pre-conditions");
1.82 + iUTContext.DataLogger().LogInformation(KAddDllFailedPreConditions);
1.83 + return EFalse;
1.84 + }
1.85 +
1.86 + if(accessor.InvariantTest(context.iRegistryData))
1.87 + return EFalse;
1.88 + return ETrue;
1.89 + }
1.90 +
1.91 +inline TBool TRegistryData_AddDllDataL_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
1.92 + {
1.93 + if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext).iRegistryData))
1.94 + return EFalse;
1.95 + return ETrue;
1.96 + }
1.97 +
1.98 +// ______________________________________________________________________________
1.99 +//
1.100 +inline TRegistryData_ListImplementations_TransitionValidator::TRegistryData_ListImplementations_TransitionValidator(CUnitTestContext& aUTContext)
1.101 +:TTransitionValidator(aUTContext)
1.102 + {
1.103 + // Do nothing
1.104 + }
1.105 +
1.106 +inline TBool TRegistryData_ListImplementations_TransitionValidator::ValidatePreConditions()
1.107 + {
1.108 + // Just do an invariant test because we should be able to call this function any time
1.109 + // after CRegistryData has been constructed.
1.110 + if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext).iRegistryData))
1.111 + return EFalse;
1.112 + return ETrue;
1.113 + }
1.114 +
1.115 +inline TBool TRegistryData_ListImplementations_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
1.116 + {
1.117 + // This post validation checking assumes the use of the CExample plugin implementation
1.118 + // It has to because ListImplementationsL takes an interface uid and we give it the
1.119 + // CExampleInterface uid.
1.120 +
1.121 + CRegistryData_UnitTestContext& context = REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext);
1.122 +
1.123 + const TUid KImplementationClassOne = {0x10009DC3};
1.124 + const TUid KImplementationClassTwo = {0x10009DC4};
1.125 +
1.126 + TBool foundOne = EFalse;
1.127 + TBool foundTwo = EFalse;
1.128 + TInt impCount = context.iUidList->Count();
1.129 + for(TInt index = 0; index < impCount; ++index)
1.130 + {
1.131 + TUid uid = (*(context.iUidList))[index]->ImplementationUid();
1.132 + if(uid == KImplementationClassOne)
1.133 + foundOne = ETrue;
1.134 + else if(uid == KImplementationClassTwo)
1.135 + foundTwo = ETrue;
1.136 + }
1.137 + if(foundOne == EFalse || foundTwo == EFalse)
1.138 + return EFalse;
1.139 +
1.140 + if(iUTContext.StateAccessor().InvariantTest(context.iRegistryData))
1.141 + return EFalse;
1.142 + return ETrue;
1.143 + }
1.144 +
1.145 +// ______________________________________________________________________________
1.146 +//
1.147 +inline TRegistryData_GetImplementationInformation_TransitionValidator::TRegistryData_GetImplementationInformation_TransitionValidator(CUnitTestContext& aUTContext)
1.148 +:TTransitionValidator(aUTContext)
1.149 + {
1.150 + // Do nothing
1.151 + }
1.152 +
1.153 +inline TBool TRegistryData_GetImplementationInformation_TransitionValidator::ValidatePreConditions()
1.154 + {
1.155 + // Just do an invariant test because we should be able to call this any time after
1.156 + // CRegistryData has been constructed.
1.157 + if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext).iRegistryData))
1.158 + return EFalse;
1.159 + return ETrue;
1.160 + }
1.161 +
1.162 +inline TBool TRegistryData_GetImplementationInformation_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
1.163 + {
1.164 + // Check that the return from GetImplementationInformationL is what we expect
1.165 + _LIT8(KTestDataType, "text/wml");
1.166 + CRegistryData_UnitTestContext& context = REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext);
1.167 + if(context.iImplementationRef == 0 ||
1.168 + context.iImplementationRef->DataType().Find(KTestDataType) == KErrNotFound)
1.169 + return EFalse;
1.170 +
1.171 + if(iUTContext.StateAccessor().InvariantTest(context.iRegistryData))
1.172 + return EFalse;
1.173 + return ETrue;
1.174 + }
1.175 +
1.176 +// ______________________________________________________________________________
1.177 +//
1.178 +inline TRegistryData_IsRegisteredWithDate_TransitionValidator::TRegistryData_IsRegisteredWithDate_TransitionValidator(CUnitTestContext& aUTContext)
1.179 +:TTransitionValidator(aUTContext)
1.180 + {
1.181 + // Do nothing
1.182 + }
1.183 +
1.184 +inline TBool TRegistryData_IsRegisteredWithDate_TransitionValidator::ValidatePreConditions()
1.185 + {
1.186 + // No pre condition checking required other than that the object is constructed.
1.187 + if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext).iRegistryData))
1.188 + return EFalse;
1.189 + return ETrue;
1.190 + }
1.191 +
1.192 +inline TBool TRegistryData_IsRegisteredWithDate_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
1.193 + {
1.194 + // No post condition checking other than that this object's state is OK
1.195 + if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext).iRegistryData))
1.196 + return EFalse;
1.197 + return ETrue;
1.198 + }
1.199 +
1.200 +// ______________________________________________________________________________
1.201 +//
1.202 +inline TRegistryData_PersistNow_TransitionValidator::TRegistryData_PersistNow_TransitionValidator(CUnitTestContext& aUTContext)
1.203 +:TTransitionValidator(aUTContext)
1.204 + {
1.205 + // Do nothing
1.206 + }
1.207 +
1.208 +inline TBool TRegistryData_PersistNow_TransitionValidator::ValidatePreConditions()
1.209 + {
1.210 + // No pre condition checking required other than that the object is correctly constructed
1.211 + if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext).iRegistryData))
1.212 + return EFalse;
1.213 + return ETrue;
1.214 + }
1.215 +
1.216 +inline TBool TRegistryData_PersistNow_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
1.217 + {
1.218 + if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext).iRegistryData))
1.219 + return EFalse;
1.220 + return ETrue;
1.221 + }
1.222 +
1.223 +// ______________________________________________________________________________
1.224 +//
1.225 +inline TRegistryData_TemporaryUninstall_TransitionValidator::TRegistryData_TemporaryUninstall_TransitionValidator(CUnitTestContext& aUTContext)
1.226 +:TTransitionValidator(aUTContext)
1.227 + {
1.228 + // Do nothing
1.229 + }
1.230 +
1.231 +inline TBool TRegistryData_TemporaryUninstall_TransitionValidator::ValidatePreConditions()
1.232 + {
1.233 + // Only pre condition is that object is fully constructed
1.234 + if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext).iRegistryData))
1.235 + return EFalse;
1.236 + return ETrue;
1.237 + }
1.238 +
1.239 +inline TBool TRegistryData_TemporaryUninstall_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
1.240 + {
1.241 + CRegistryData_UnitTestContext& context = REINTERPRET_CAST(CRegistryData_UnitTestContext&,
1.242 + iUTContext);
1.243 + TRegistryData_StateAccessor& accessor = REINTERPRET_CAST(TRegistryData_StateAccessor&,
1.244 + iUTContext.StateAccessor());
1.245 +
1.246 + // Check that the drive we have uninstalled is not valid
1.247 + if(accessor.IsRegisteredDrive(*context.iRegistryData, context.iDriveUnit))
1.248 + {
1.249 + _LIT(KUninstallFailedPostConditions,
1.250 + "CRegistryData_TemporaryUninstallL_Transition failed post-conditions");
1.251 + iUTContext.DataLogger().LogInformation(KUninstallFailedPostConditions);
1.252 + return EFalse;
1.253 + }
1.254 +
1.255 + if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext).iRegistryData))
1.256 + return EFalse;
1.257 + return ETrue;
1.258 + }
1.259 +
1.260 +// ______________________________________________________________________________
1.261 +//
1.262 +inline TRegistryData_UndoTemporaryUninstall_TransitionValidator::TRegistryData_UndoTemporaryUninstall_TransitionValidator(CUnitTestContext& aUTContext)
1.263 +:TTransitionValidator(aUTContext)
1.264 + {
1.265 + // Do nothing
1.266 + }
1.267 +
1.268 +inline TBool TRegistryData_UndoTemporaryUninstall_TransitionValidator::ValidatePreConditions()
1.269 + {
1.270 + // Only pre condition is that object is fully constructed
1.271 + if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext).iRegistryData))
1.272 + return EFalse;
1.273 + return ETrue;
1.274 + }
1.275 +
1.276 +inline TBool TRegistryData_UndoTemporaryUninstall_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
1.277 + {
1.278 + CRegistryData_UnitTestContext& context = REINTERPRET_CAST(CRegistryData_UnitTestContext&,
1.279 + iUTContext);
1.280 + TRegistryData_StateAccessor& accessor = REINTERPRET_CAST(TRegistryData_StateAccessor&,
1.281 + iUTContext.StateAccessor());
1.282 +
1.283 + // Check that the drive we have uninstalled is not valid
1.284 + if(!(accessor.IsRegisteredDrive(*context.iRegistryData, context.iDriveUnit)))
1.285 + {
1.286 + _LIT(KUndoUninstallFailedPostConditions,
1.287 + "CRegistryData_UndoTemporaryUninstallL_Transition failed post-conditions");
1.288 + iUTContext.DataLogger().LogInformation(KUndoUninstallFailedPostConditions);
1.289 + return EFalse;
1.290 + }
1.291 +
1.292 + if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext).iRegistryData))
1.293 + return EFalse;
1.294 + return ETrue;
1.295 + }
1.296 +
1.297 +// ______________________________________________________________________________
1.298 +//
1.299 +inline TRegistryData_UpdateDllData_TransitionValidator::TRegistryData_UpdateDllData_TransitionValidator(CUnitTestContext& aUTContext)
1.300 +:TTransitionValidator(aUTContext)
1.301 + {
1.302 + // Do nothing
1.303 + }
1.304 +
1.305 +inline TBool TRegistryData_UpdateDllData_TransitionValidator::ValidatePreConditions()
1.306 + {
1.307 + if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext).iRegistryData))
1.308 + return EFalse;
1.309 + return ETrue;
1.310 + }
1.311 +
1.312 +inline TBool TRegistryData_UpdateDllData_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
1.313 + {
1.314 + if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext).iRegistryData))
1.315 + return EFalse;
1.316 + return ETrue;
1.317 + }
1.318 +
1.319 +// ______________________________________________________________________________
1.320 +//
1.321 +inline TRegistryData_BuildIndexes_TransitionValidator::TRegistryData_BuildIndexes_TransitionValidator(CUnitTestContext& aUTContext)
1.322 +:TTransitionValidator(aUTContext)
1.323 + {
1.324 + // Do nothing
1.325 + }
1.326 +
1.327 +inline TBool TRegistryData_BuildIndexes_TransitionValidator::ValidatePreConditions()
1.328 + {
1.329 + // Only pre condition is that object is fully constructed (BuildIndexes is actually
1.330 + // called from ConstructL anyway)
1.331 + if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext).iRegistryData))
1.332 + return EFalse;
1.333 + return ETrue;
1.334 + }
1.335 +
1.336 +inline TBool TRegistryData_BuildIndexes_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
1.337 + {
1.338 + if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext).iRegistryData))
1.339 + return EFalse;
1.340 + return ETrue;
1.341 + }
1.342 +
1.343 +// ______________________________________________________________________________
1.344 +//
1.345 +inline TRegistryData_IndexedFind_TransitionValidator::TRegistryData_IndexedFind_TransitionValidator(CUnitTestContext& aUTContext)
1.346 +:TTransitionValidator(aUTContext)
1.347 + {
1.348 + // Do nothing
1.349 + }
1.350 +
1.351 +inline TBool TRegistryData_IndexedFind_TransitionValidator::ValidatePreConditions()
1.352 + {
1.353 + // Only pre condition is that object is fully constructed.
1.354 + if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext).iRegistryData))
1.355 + return EFalse;
1.356 + return ETrue;
1.357 + }
1.358 +
1.359 +inline TBool TRegistryData_IndexedFind_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
1.360 + {
1.361 + // No post condition (function is const)
1.362 + if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext).iRegistryData))
1.363 + return EFalse;
1.364 + return ETrue;
1.365 + }
1.366 +
1.367 +// ______________________________________________________________________________
1.368 +//
1.369 +inline TRegistryData_Restore_TransitionValidator::TRegistryData_Restore_TransitionValidator(CUnitTestContext& aUTContext)
1.370 +:TTransitionValidator(aUTContext)
1.371 + {
1.372 + // Do nothing
1.373 + }
1.374 +
1.375 +inline TBool TRegistryData_Restore_TransitionValidator::ValidatePreConditions()
1.376 + {
1.377 + // Only pre condition is that object is fully constructed.
1.378 + if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext).iRegistryData))
1.379 + return EFalse;
1.380 + return ETrue;
1.381 + }
1.382 +
1.383 +inline TBool TRegistryData_Restore_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
1.384 + {
1.385 + // The object has been restored from file so just check that it is a valid object
1.386 + if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext).iRegistryData))
1.387 + return EFalse;
1.388 + return ETrue;
1.389 + }
1.390 +
1.391 +// ______________________________________________________________________________
1.392 +//
1.393 +inline TRegistryData_Store_TransitionValidator::TRegistryData_Store_TransitionValidator(CUnitTestContext& aUTContext)
1.394 +:TTransitionValidator(aUTContext)
1.395 + {
1.396 + // Do nothing
1.397 + }
1.398 +
1.399 +inline TBool TRegistryData_Store_TransitionValidator::ValidatePreConditions()
1.400 + {
1.401 + // Only pre condition is that object is fully constructed
1.402 + if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext).iRegistryData))
1.403 + return EFalse;
1.404 + return ETrue;
1.405 + }
1.406 +
1.407 +inline TBool TRegistryData_Store_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
1.408 + {
1.409 + // No post condition as function is const
1.410 + if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext).iRegistryData))
1.411 + return EFalse;
1.412 + return ETrue;
1.413 + }
1.414 +
1.415 +// ______________________________________________________________________________
1.416 +//
1.417 +inline TRegistryData_MatchOnUid_TransitionValidator::TRegistryData_MatchOnUid_TransitionValidator(CUnitTestContext& aUTContext)
1.418 +:TTransitionValidator(aUTContext)
1.419 + {
1.420 + // Do nothing
1.421 + }
1.422 +
1.423 +inline TBool TRegistryData_MatchOnUid_TransitionValidator::ValidatePreConditions()
1.424 + {
1.425 + // No pre condition checking because this function is static
1.426 + return ETrue;
1.427 + }
1.428 +
1.429 +inline TBool TRegistryData_MatchOnUid_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
1.430 + {
1.431 + // No post condition checking because this function is static
1.432 + return ETrue;
1.433 + }
1.434 +
1.435 +// ______________________________________________________________________________
1.436 +//
1.437 +inline TRegistryData_ConstructPolicyIndexL_TransitionValidator::TRegistryData_ConstructPolicyIndexL_TransitionValidator(CUnitTestContext& aUTContext)
1.438 +:TTransitionValidator(aUTContext)
1.439 + {
1.440 + // Do nothing
1.441 + }
1.442 +
1.443 +inline TBool TRegistryData_ConstructPolicyIndexL_TransitionValidator::ValidatePreConditions()
1.444 + {
1.445 + // Only pre condition is object is fully constructed
1.446 + if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext).iRegistryData))
1.447 + return EFalse;
1.448 + return ETrue;
1.449 + }
1.450 +
1.451 +inline TBool TRegistryData_ConstructPolicyIndexL_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
1.452 + {
1.453 + // No post condition because function is const
1.454 + if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext).iRegistryData))
1.455 + return EFalse;
1.456 + return ETrue;
1.457 + }
1.458 +
1.459 +// ______________________________________________________________________________
1.460 +//
1.461 +inline TRegistryData_SetPolicyObserver_TransitionValidator::TRegistryData_SetPolicyObserver_TransitionValidator(CUnitTestContext& aUTContext)
1.462 +:TTransitionValidator(aUTContext)
1.463 + {
1.464 + // Do nothing
1.465 + }
1.466 +
1.467 +inline TBool TRegistryData_SetPolicyObserver_TransitionValidator::ValidatePreConditions()
1.468 + {
1.469 + // Only pre condition is object is fully constructed
1.470 + if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext).iRegistryData))
1.471 + return EFalse;
1.472 + return ETrue;
1.473 + }
1.474 +
1.475 +inline TBool TRegistryData_SetPolicyObserver_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
1.476 + {
1.477 + CRegistryData_UnitTestContext& context = REINTERPRET_CAST(CRegistryData_UnitTestContext&,
1.478 + iUTContext);
1.479 + if(iUTContext.StateAccessor().InvariantTest(context.iRegistryData))
1.480 + return EFalse;
1.481 + return ETrue;
1.482 + }
1.483 +
1.484 +// ______________________________________________________________________________
1.485 +//
1.486 +inline TRegistryData_GetSecondImplInfo_TransitionValidator::TRegistryData_GetSecondImplInfo_TransitionValidator(CUnitTestContext& aUTContext)
1.487 +:TTransitionValidator(aUTContext)
1.488 + {
1.489 + // Do nothing
1.490 + }
1.491 +
1.492 +inline TBool TRegistryData_GetSecondImplInfo_TransitionValidator::ValidatePreConditions()
1.493 + {
1.494 + CRegistryData_UnitTestContext& context = REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext);
1.495 +
1.496 + // Copy the result of the earlier GetImplementationInformation so we
1.497 + // can compare later
1.498 + context.iSecondImplementationRef = context.iImplementationRef;
1.499 +
1.500 + if(iUTContext.StateAccessor().InvariantTest(context.iRegistryData))
1.501 + return EFalse;
1.502 + return ETrue;
1.503 + }
1.504 +
1.505 +inline TBool TRegistryData_GetSecondImplInfo_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
1.506 + {
1.507 + CRegistryData_UnitTestContext& context = REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext);
1.508 +
1.509 + // if the second call to GetImplementationInformation does not return the same thing
1.510 + // as the first then this test has failed
1.511 + if(context.iImplementationRef != context.iSecondImplementationRef)
1.512 + return EFalse;
1.513 +
1.514 + if(iUTContext.StateAccessor().InvariantTest(context.iRegistryData))
1.515 + return EFalse;
1.516 + return ETrue;
1.517 + }
1.518 +
1.519 +// ______________________________________________________________________________
1.520 +//
1.521 +inline TRegistryData_DiscoveriesBeginning_TransitionValidator::TRegistryData_DiscoveriesBeginning_TransitionValidator(CUnitTestContext& aUTContext)
1.522 +:TTransitionValidator(aUTContext)
1.523 + {
1.524 + // Do nothing
1.525 + }
1.526 +
1.527 +inline TBool TRegistryData_DiscoveriesBeginning_TransitionValidator::ValidatePreConditions()
1.528 + {
1.529 + if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext).iRegistryData))
1.530 + return EFalse;
1.531 + return ETrue;
1.532 + }
1.533 +
1.534 +inline TBool TRegistryData_DiscoveriesBeginning_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
1.535 + {
1.536 + CRegistryData_UnitTestContext& context = REINTERPRET_CAST(CRegistryData_UnitTestContext&,iUTContext);
1.537 +
1.538 + if(context.iRegistryData->IndexValid())
1.539 + return EFalse;
1.540 +
1.541 + if(iUTContext.StateAccessor().InvariantTest(context.iRegistryData))
1.542 + return EFalse;
1.543 + return ETrue;
1.544 + }
1.545 +