sl@0: // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // Implementation of the CDiscoverer transition validation classes. sl@0: // sl@0: // sl@0: sl@0: // ______________________________________________________________________________ sl@0: // sl@0: inline TDiscoverer_Ctor_TransitionValidator::TDiscoverer_Ctor_TransitionValidator(CUnitTestContext& aUTContext) sl@0: :TTransitionValidator(aUTContext) sl@0: { sl@0: // Do nothing sl@0: } sl@0: sl@0: inline TBool TDiscoverer_Ctor_TransitionValidator::ValidatePreConditions() sl@0: { sl@0: // Always true sl@0: return ETrue; sl@0: } sl@0: sl@0: inline TBool TDiscoverer_Ctor_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */) sl@0: { sl@0: if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer)) sl@0: return EFalse; sl@0: return ETrue; sl@0: } sl@0: sl@0: // ______________________________________________________________________________ sl@0: // sl@0: inline TDiscoverer_Dtor_TransitionValidator::TDiscoverer_Dtor_TransitionValidator(CUnitTestContext& aUTContext) sl@0: :TTransitionValidator(aUTContext) sl@0: { sl@0: // Do nothing sl@0: } sl@0: sl@0: inline TBool TDiscoverer_Dtor_TransitionValidator::ValidatePreConditions() sl@0: { sl@0: if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer)) sl@0: return EFalse; sl@0: return ETrue; sl@0: } sl@0: sl@0: inline TBool TDiscoverer_Dtor_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */) sl@0: { sl@0: return ETrue; sl@0: } sl@0: sl@0: // ______________________________________________________________________________ sl@0: // sl@0: inline TDiscoverer_MountDriveL_TransitionValidator::TDiscoverer_MountDriveL_TransitionValidator(CUnitTestContext& aUTContext) sl@0: :TTransitionValidator(aUTContext) sl@0: { sl@0: // Do nothing sl@0: } sl@0: sl@0: inline TBool TDiscoverer_MountDriveL_TransitionValidator::ValidatePreConditions() sl@0: { sl@0: // For mount drive all that is required is that the invariant test is done. sl@0: if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer)) sl@0: return EFalse; sl@0: return ETrue; sl@0: } sl@0: sl@0: inline TBool TDiscoverer_MountDriveL_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */) sl@0: { sl@0: // For mount drive. sl@0: // mount has been signalled to the observer sl@0: // all that is required is that the invariant test is done. sl@0: if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer)) sl@0: return EFalse; sl@0: return ETrue; sl@0: } sl@0: sl@0: // ______________________________________________________________________________ sl@0: // sl@0: inline TDiscoverer_UnmountDrive_TransitionValidator::TDiscoverer_UnmountDrive_TransitionValidator(CUnitTestContext& aUTContext) sl@0: :TTransitionValidator(aUTContext) sl@0: { sl@0: // Do nothing sl@0: } sl@0: sl@0: inline TBool TDiscoverer_UnmountDrive_TransitionValidator::ValidatePreConditions() sl@0: { sl@0: // For unmount drive all that is required is that the invariant test is done. sl@0: if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer)) sl@0: return EFalse; sl@0: return ETrue; sl@0: } sl@0: sl@0: inline TBool TDiscoverer_UnmountDrive_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */) sl@0: { sl@0: // For unmount drive sl@0: // unmount has been signalled to the observer sl@0: // all that is required is that the invariant test is done. sl@0: if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer)) sl@0: return EFalse; sl@0: return ETrue; sl@0: } sl@0: sl@0: // ______________________________________________________________________________ sl@0: // sl@0: inline TDiscoverer_IsValidEntry_TransitionValidator::TDiscoverer_IsValidEntry_TransitionValidator(CUnitTestContext& aUTContext) sl@0: :TTransitionValidator(aUTContext) sl@0: { sl@0: // Do nothing sl@0: } sl@0: sl@0: inline TBool TDiscoverer_IsValidEntry_TransitionValidator::ValidatePreConditions() sl@0: { sl@0: TDiscoverer_StateAccessor& accessor = REINTERPRET_CAST(TDiscoverer_StateAccessor&,iUTContext.StateAccessor()); sl@0: if(accessor.InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer)) sl@0: return EFalse; sl@0: return ETrue; sl@0: } sl@0: sl@0: inline TBool TDiscoverer_IsValidEntry_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */) sl@0: { sl@0: TDiscoverer_StateAccessor& accessor = REINTERPRET_CAST(TDiscoverer_StateAccessor&,iUTContext.StateAccessor()); sl@0: if(accessor.InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer)) sl@0: return EFalse; sl@0: return ETrue; sl@0: } sl@0: sl@0: // ______________________________________________________________________________ sl@0: // sl@0: inline TDiscoverer_ProcessEntryL_TransitionValidator::TDiscoverer_ProcessEntryL_TransitionValidator(CUnitTestContext& aUTContext) sl@0: :TTransitionValidator(aUTContext) sl@0: { sl@0: // Do nothing sl@0: } sl@0: sl@0: inline TBool TDiscoverer_ProcessEntryL_TransitionValidator::ValidatePreConditions() sl@0: { sl@0: TDiscoverer_StateAccessor& accessor = REINTERPRET_CAST(TDiscoverer_StateAccessor&,iUTContext.StateAccessor()); sl@0: if(accessor.InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer)) sl@0: return EFalse; sl@0: return ETrue; sl@0: } sl@0: sl@0: inline TBool TDiscoverer_ProcessEntryL_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */) sl@0: { sl@0: TDiscoverer_StateAccessor& accessor = REINTERPRET_CAST(TDiscoverer_StateAccessor&,iUTContext.StateAccessor()); sl@0: if(accessor.InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer)) sl@0: return EFalse; sl@0: return ETrue; sl@0: } sl@0: sl@0: // ______________________________________________________________________________ sl@0: // sl@0: inline TDiscoverer_CompleteNotificationProcessing_TransitionValidator::TDiscoverer_CompleteNotificationProcessing_TransitionValidator(CUnitTestContext& aUTContext) sl@0: :TTransitionValidator(aUTContext) sl@0: { sl@0: // Do nothing sl@0: } sl@0: sl@0: inline TBool TDiscoverer_CompleteNotificationProcessing_TransitionValidator::ValidatePreConditions() sl@0: { sl@0: TDiscoverer_StateAccessor& accessor = REINTERPRET_CAST(TDiscoverer_StateAccessor&,iUTContext.StateAccessor()); sl@0: if(accessor.InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer)) sl@0: return EFalse; sl@0: return ETrue; sl@0: } sl@0: sl@0: inline TBool TDiscoverer_CompleteNotificationProcessing_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */) sl@0: { sl@0: TDiscoverer_StateAccessor& accessor = REINTERPRET_CAST(TDiscoverer_StateAccessor&,iUTContext.StateAccessor()); sl@0: if(accessor.InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer)) sl@0: return EFalse; sl@0: return ETrue; sl@0: } sl@0: sl@0: // ______________________________________________________________________________ sl@0: // sl@0: inline TDiscoverer_Notification_TransitionValidator::TDiscoverer_Notification_TransitionValidator(CUnitTestContext& aUTContext) sl@0: :TTransitionValidator(aUTContext) sl@0: { sl@0: // Do nothing sl@0: } sl@0: sl@0: inline TBool TDiscoverer_Notification_TransitionValidator::ValidatePreConditions() sl@0: { sl@0: TDiscoverer_StateAccessor& accessor = REINTERPRET_CAST(TDiscoverer_StateAccessor&,iUTContext.StateAccessor()); sl@0: if(accessor.InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer)) sl@0: return EFalse; sl@0: return ETrue; sl@0: } sl@0: sl@0: inline TBool TDiscoverer_Notification_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */) sl@0: { sl@0: TDiscoverer_StateAccessor& accessor = REINTERPRET_CAST(TDiscoverer_StateAccessor&,iUTContext.StateAccessor()); sl@0: if(accessor.InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer)) sl@0: return EFalse; sl@0: return ETrue; sl@0: } sl@0: sl@0: // ______________________________________________________________________________ sl@0: // sl@0: inline TDiscoverer_Suspend_TransitionValidator::TDiscoverer_Suspend_TransitionValidator(CUnitTestContext& aUTContext) sl@0: :TTransitionValidator(aUTContext) sl@0: { sl@0: // Do nothing sl@0: } sl@0: sl@0: inline TBool TDiscoverer_Suspend_TransitionValidator::ValidatePreConditions() sl@0: { sl@0: TDiscoverer_StateAccessor& accessor = REINTERPRET_CAST(TDiscoverer_StateAccessor&,iUTContext.StateAccessor()); sl@0: if(accessor.InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer)) sl@0: return EFalse; sl@0: return ETrue; sl@0: } sl@0: sl@0: inline TBool TDiscoverer_Suspend_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */) sl@0: { sl@0: TDiscoverer_StateAccessor& accessor = REINTERPRET_CAST(TDiscoverer_StateAccessor&,iUTContext.StateAccessor()); sl@0: if(accessor.InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer)) sl@0: return EFalse; sl@0: return ETrue; sl@0: } sl@0: sl@0: // ______________________________________________________________________________ sl@0: // sl@0: inline TDiscoverer_Resume_TransitionValidator::TDiscoverer_Resume_TransitionValidator(CUnitTestContext& aUTContext) sl@0: :TTransitionValidator(aUTContext) sl@0: { sl@0: // Do nothing sl@0: } sl@0: sl@0: inline TBool TDiscoverer_Resume_TransitionValidator::ValidatePreConditions() sl@0: { sl@0: TDiscoverer_StateAccessor& accessor = REINTERPRET_CAST(TDiscoverer_StateAccessor&,iUTContext.StateAccessor()); sl@0: if(accessor.InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer)) sl@0: return EFalse; sl@0: return ETrue; sl@0: } sl@0: sl@0: inline TBool TDiscoverer_Resume_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */) sl@0: { sl@0: TDiscoverer_StateAccessor& accessor = REINTERPRET_CAST(TDiscoverer_StateAccessor&,iUTContext.StateAccessor()); sl@0: if(accessor.InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer)) sl@0: return EFalse; sl@0: return ETrue; sl@0: } sl@0: sl@0: // ______________________________________________________________________________ sl@0: // sl@0: inline TDiscoverer_ScanDirectory_TransitionValidator::TDiscoverer_ScanDirectory_TransitionValidator(CUnitTestContext& aUTContext) sl@0: :TTransitionValidator(aUTContext) sl@0: { sl@0: // Do nothing sl@0: } sl@0: sl@0: inline TBool TDiscoverer_ScanDirectory_TransitionValidator::ValidatePreConditions() sl@0: { sl@0: TDiscoverer_StateAccessor& accessor = REINTERPRET_CAST(TDiscoverer_StateAccessor&,iUTContext.StateAccessor()); sl@0: if(accessor.InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer)) sl@0: return EFalse; sl@0: return ETrue; sl@0: } sl@0: sl@0: inline TBool TDiscoverer_ScanDirectory_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */) sl@0: { sl@0: TDiscoverer_StateAccessor& accessor = REINTERPRET_CAST(TDiscoverer_StateAccessor&,iUTContext.StateAccessor()); sl@0: if(accessor.InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer)) sl@0: return EFalse; sl@0: return ETrue; sl@0: } sl@0: sl@0: sl@0: // ______________________________________________________________________________ sl@0: // sl@0: inline TDiscoverer_ScanDirectoryCancel_TransitionValidator::TDiscoverer_ScanDirectoryCancel_TransitionValidator(CUnitTestContext& aUTContext) sl@0: :TTransitionValidator(aUTContext) sl@0: { sl@0: // Do nothing sl@0: } sl@0: sl@0: inline TBool TDiscoverer_ScanDirectoryCancel_TransitionValidator::ValidatePreConditions() sl@0: { sl@0: TDiscoverer_StateAccessor& accessor = REINTERPRET_CAST(TDiscoverer_StateAccessor&,iUTContext.StateAccessor()); sl@0: if(accessor.InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer)) sl@0: return EFalse; sl@0: return ETrue; sl@0: } sl@0: sl@0: inline TBool TDiscoverer_ScanDirectoryCancel_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */) sl@0: { sl@0: TDiscoverer_StateAccessor& accessor = REINTERPRET_CAST(TDiscoverer_StateAccessor&,iUTContext.StateAccessor()); sl@0: if(accessor.InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer)) sl@0: return EFalse; sl@0: return ETrue; sl@0: } sl@0: sl@0: sl@0: // ______________________________________________________________________________ sl@0: // sl@0: inline TDiscoverer_ScanDirectoryIncrement_TransitionValidator::TDiscoverer_ScanDirectoryIncrement_TransitionValidator(CUnitTestContext& aUTContext) sl@0: :TTransitionValidator(aUTContext) sl@0: { sl@0: // Do nothing sl@0: } sl@0: sl@0: inline TBool TDiscoverer_ScanDirectoryIncrement_TransitionValidator::ValidatePreConditions() sl@0: { sl@0: TDiscoverer_StateAccessor& accessor = REINTERPRET_CAST(TDiscoverer_StateAccessor&,iUTContext.StateAccessor()); sl@0: if(accessor.InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer)) sl@0: return EFalse; sl@0: return ETrue; sl@0: } sl@0: sl@0: inline TBool TDiscoverer_ScanDirectoryIncrement_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */) sl@0: { sl@0: TDiscoverer_StateAccessor& accessor = REINTERPRET_CAST(TDiscoverer_StateAccessor&,iUTContext.StateAccessor()); sl@0: if(accessor.InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer)) sl@0: return EFalse; sl@0: return ETrue; sl@0: } sl@0: sl@0: