os/ossrv/lowlevellibsandfws/pluginfw/Framework/DiscovererTest/DiscovererTransitionValidation.inl
First public contribution.
1 // Copyright (c) 1997-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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Implementation of the CDiscoverer transition validation classes.
18 // ______________________________________________________________________________
20 inline TDiscoverer_Ctor_TransitionValidator::TDiscoverer_Ctor_TransitionValidator(CUnitTestContext& aUTContext)
21 :TTransitionValidator(aUTContext)
26 inline TBool TDiscoverer_Ctor_TransitionValidator::ValidatePreConditions()
32 inline TBool TDiscoverer_Ctor_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
34 if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer))
39 // ______________________________________________________________________________
41 inline TDiscoverer_Dtor_TransitionValidator::TDiscoverer_Dtor_TransitionValidator(CUnitTestContext& aUTContext)
42 :TTransitionValidator(aUTContext)
47 inline TBool TDiscoverer_Dtor_TransitionValidator::ValidatePreConditions()
49 if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer))
54 inline TBool TDiscoverer_Dtor_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
59 // ______________________________________________________________________________
61 inline TDiscoverer_MountDriveL_TransitionValidator::TDiscoverer_MountDriveL_TransitionValidator(CUnitTestContext& aUTContext)
62 :TTransitionValidator(aUTContext)
67 inline TBool TDiscoverer_MountDriveL_TransitionValidator::ValidatePreConditions()
69 // For mount drive all that is required is that the invariant test is done.
70 if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer))
75 inline TBool TDiscoverer_MountDriveL_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
78 // mount has been signalled to the observer
79 // all that is required is that the invariant test is done.
80 if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer))
85 // ______________________________________________________________________________
87 inline TDiscoverer_UnmountDrive_TransitionValidator::TDiscoverer_UnmountDrive_TransitionValidator(CUnitTestContext& aUTContext)
88 :TTransitionValidator(aUTContext)
93 inline TBool TDiscoverer_UnmountDrive_TransitionValidator::ValidatePreConditions()
95 // For unmount drive all that is required is that the invariant test is done.
96 if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer))
101 inline TBool TDiscoverer_UnmountDrive_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
104 // unmount has been signalled to the observer
105 // all that is required is that the invariant test is done.
106 if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer))
111 // ______________________________________________________________________________
113 inline TDiscoverer_IsValidEntry_TransitionValidator::TDiscoverer_IsValidEntry_TransitionValidator(CUnitTestContext& aUTContext)
114 :TTransitionValidator(aUTContext)
119 inline TBool TDiscoverer_IsValidEntry_TransitionValidator::ValidatePreConditions()
121 TDiscoverer_StateAccessor& accessor = REINTERPRET_CAST(TDiscoverer_StateAccessor&,iUTContext.StateAccessor());
122 if(accessor.InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer))
127 inline TBool TDiscoverer_IsValidEntry_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
129 TDiscoverer_StateAccessor& accessor = REINTERPRET_CAST(TDiscoverer_StateAccessor&,iUTContext.StateAccessor());
130 if(accessor.InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer))
135 // ______________________________________________________________________________
137 inline TDiscoverer_ProcessEntryL_TransitionValidator::TDiscoverer_ProcessEntryL_TransitionValidator(CUnitTestContext& aUTContext)
138 :TTransitionValidator(aUTContext)
143 inline TBool TDiscoverer_ProcessEntryL_TransitionValidator::ValidatePreConditions()
145 TDiscoverer_StateAccessor& accessor = REINTERPRET_CAST(TDiscoverer_StateAccessor&,iUTContext.StateAccessor());
146 if(accessor.InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer))
151 inline TBool TDiscoverer_ProcessEntryL_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
153 TDiscoverer_StateAccessor& accessor = REINTERPRET_CAST(TDiscoverer_StateAccessor&,iUTContext.StateAccessor());
154 if(accessor.InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer))
159 // ______________________________________________________________________________
161 inline TDiscoverer_CompleteNotificationProcessing_TransitionValidator::TDiscoverer_CompleteNotificationProcessing_TransitionValidator(CUnitTestContext& aUTContext)
162 :TTransitionValidator(aUTContext)
167 inline TBool TDiscoverer_CompleteNotificationProcessing_TransitionValidator::ValidatePreConditions()
169 TDiscoverer_StateAccessor& accessor = REINTERPRET_CAST(TDiscoverer_StateAccessor&,iUTContext.StateAccessor());
170 if(accessor.InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer))
175 inline TBool TDiscoverer_CompleteNotificationProcessing_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
177 TDiscoverer_StateAccessor& accessor = REINTERPRET_CAST(TDiscoverer_StateAccessor&,iUTContext.StateAccessor());
178 if(accessor.InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer))
183 // ______________________________________________________________________________
185 inline TDiscoverer_Notification_TransitionValidator::TDiscoverer_Notification_TransitionValidator(CUnitTestContext& aUTContext)
186 :TTransitionValidator(aUTContext)
191 inline TBool TDiscoverer_Notification_TransitionValidator::ValidatePreConditions()
193 TDiscoverer_StateAccessor& accessor = REINTERPRET_CAST(TDiscoverer_StateAccessor&,iUTContext.StateAccessor());
194 if(accessor.InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer))
199 inline TBool TDiscoverer_Notification_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
201 TDiscoverer_StateAccessor& accessor = REINTERPRET_CAST(TDiscoverer_StateAccessor&,iUTContext.StateAccessor());
202 if(accessor.InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer))
207 // ______________________________________________________________________________
209 inline TDiscoverer_Suspend_TransitionValidator::TDiscoverer_Suspend_TransitionValidator(CUnitTestContext& aUTContext)
210 :TTransitionValidator(aUTContext)
215 inline TBool TDiscoverer_Suspend_TransitionValidator::ValidatePreConditions()
217 TDiscoverer_StateAccessor& accessor = REINTERPRET_CAST(TDiscoverer_StateAccessor&,iUTContext.StateAccessor());
218 if(accessor.InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer))
223 inline TBool TDiscoverer_Suspend_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
225 TDiscoverer_StateAccessor& accessor = REINTERPRET_CAST(TDiscoverer_StateAccessor&,iUTContext.StateAccessor());
226 if(accessor.InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer))
231 // ______________________________________________________________________________
233 inline TDiscoverer_Resume_TransitionValidator::TDiscoverer_Resume_TransitionValidator(CUnitTestContext& aUTContext)
234 :TTransitionValidator(aUTContext)
239 inline TBool TDiscoverer_Resume_TransitionValidator::ValidatePreConditions()
241 TDiscoverer_StateAccessor& accessor = REINTERPRET_CAST(TDiscoverer_StateAccessor&,iUTContext.StateAccessor());
242 if(accessor.InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer))
247 inline TBool TDiscoverer_Resume_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
249 TDiscoverer_StateAccessor& accessor = REINTERPRET_CAST(TDiscoverer_StateAccessor&,iUTContext.StateAccessor());
250 if(accessor.InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer))
255 // ______________________________________________________________________________
257 inline TDiscoverer_ScanDirectory_TransitionValidator::TDiscoverer_ScanDirectory_TransitionValidator(CUnitTestContext& aUTContext)
258 :TTransitionValidator(aUTContext)
263 inline TBool TDiscoverer_ScanDirectory_TransitionValidator::ValidatePreConditions()
265 TDiscoverer_StateAccessor& accessor = REINTERPRET_CAST(TDiscoverer_StateAccessor&,iUTContext.StateAccessor());
266 if(accessor.InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer))
271 inline TBool TDiscoverer_ScanDirectory_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
273 TDiscoverer_StateAccessor& accessor = REINTERPRET_CAST(TDiscoverer_StateAccessor&,iUTContext.StateAccessor());
274 if(accessor.InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer))
280 // ______________________________________________________________________________
282 inline TDiscoverer_ScanDirectoryCancel_TransitionValidator::TDiscoverer_ScanDirectoryCancel_TransitionValidator(CUnitTestContext& aUTContext)
283 :TTransitionValidator(aUTContext)
288 inline TBool TDiscoverer_ScanDirectoryCancel_TransitionValidator::ValidatePreConditions()
290 TDiscoverer_StateAccessor& accessor = REINTERPRET_CAST(TDiscoverer_StateAccessor&,iUTContext.StateAccessor());
291 if(accessor.InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer))
296 inline TBool TDiscoverer_ScanDirectoryCancel_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
298 TDiscoverer_StateAccessor& accessor = REINTERPRET_CAST(TDiscoverer_StateAccessor&,iUTContext.StateAccessor());
299 if(accessor.InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer))
305 // ______________________________________________________________________________
307 inline TDiscoverer_ScanDirectoryIncrement_TransitionValidator::TDiscoverer_ScanDirectoryIncrement_TransitionValidator(CUnitTestContext& aUTContext)
308 :TTransitionValidator(aUTContext)
313 inline TBool TDiscoverer_ScanDirectoryIncrement_TransitionValidator::ValidatePreConditions()
315 TDiscoverer_StateAccessor& accessor = REINTERPRET_CAST(TDiscoverer_StateAccessor&,iUTContext.StateAccessor());
316 if(accessor.InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer))
321 inline TBool TDiscoverer_ScanDirectoryIncrement_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
323 TDiscoverer_StateAccessor& accessor = REINTERPRET_CAST(TDiscoverer_StateAccessor&,iUTContext.StateAccessor());
324 if(accessor.InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer))