os/ossrv/lowlevellibsandfws/pluginfw/Framework/DiscovererTest/DiscovererTransitionValidation.inl
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     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".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 // Implementation of the CDiscoverer transition validation classes.
    15 // 
    16 //
    17 
    18 // ______________________________________________________________________________
    19 //
    20 inline TDiscoverer_Ctor_TransitionValidator::TDiscoverer_Ctor_TransitionValidator(CUnitTestContext& aUTContext)
    21 :TTransitionValidator(aUTContext)
    22 	{
    23 	// Do nothing
    24 	}
    25 
    26 inline TBool TDiscoverer_Ctor_TransitionValidator::ValidatePreConditions()
    27 	{
    28 	// Always true
    29 	return ETrue;
    30 	}
    31 
    32 inline TBool TDiscoverer_Ctor_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
    33 	{
    34 	if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer))
    35 		return EFalse;
    36 	return ETrue;
    37 	}
    38 
    39 // ______________________________________________________________________________
    40 //
    41 inline TDiscoverer_Dtor_TransitionValidator::TDiscoverer_Dtor_TransitionValidator(CUnitTestContext& aUTContext)
    42 :TTransitionValidator(aUTContext)
    43 	{
    44 	// Do nothing
    45 	}
    46 
    47 inline TBool TDiscoverer_Dtor_TransitionValidator::ValidatePreConditions()
    48 	{
    49 	if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer))
    50 		return EFalse;
    51 	return ETrue;
    52 	}
    53 
    54 inline TBool TDiscoverer_Dtor_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
    55 	{
    56 	return ETrue;
    57 	}
    58 
    59 // ______________________________________________________________________________
    60 //
    61 inline TDiscoverer_MountDriveL_TransitionValidator::TDiscoverer_MountDriveL_TransitionValidator(CUnitTestContext& aUTContext)
    62 :TTransitionValidator(aUTContext)
    63 	{
    64 	// Do nothing
    65 	}
    66 
    67 inline TBool TDiscoverer_MountDriveL_TransitionValidator::ValidatePreConditions()
    68 	{
    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))
    71 		return EFalse;
    72 	return ETrue;
    73 	}
    74 
    75 inline TBool TDiscoverer_MountDriveL_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
    76 	{
    77 	// For mount drive.
    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))
    81 		return EFalse;
    82 	return ETrue;
    83 	}
    84 
    85 // ______________________________________________________________________________
    86 //
    87 inline TDiscoverer_UnmountDrive_TransitionValidator::TDiscoverer_UnmountDrive_TransitionValidator(CUnitTestContext& aUTContext)
    88 :TTransitionValidator(aUTContext)
    89 	{
    90 	// Do nothing
    91 	}
    92 
    93 inline TBool TDiscoverer_UnmountDrive_TransitionValidator::ValidatePreConditions()
    94 	{
    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))
    97 		return EFalse;
    98 	return ETrue;
    99 	}
   100 
   101 inline TBool TDiscoverer_UnmountDrive_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
   102 	{
   103 	// For unmount drive 
   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))
   107 		return EFalse;
   108 	return ETrue;
   109 	}
   110 
   111 // ______________________________________________________________________________
   112 //
   113 inline TDiscoverer_IsValidEntry_TransitionValidator::TDiscoverer_IsValidEntry_TransitionValidator(CUnitTestContext& aUTContext)
   114 :TTransitionValidator(aUTContext)
   115 	{
   116 	// Do nothing
   117 	}
   118 
   119 inline TBool TDiscoverer_IsValidEntry_TransitionValidator::ValidatePreConditions()
   120 	{
   121 	TDiscoverer_StateAccessor& accessor = REINTERPRET_CAST(TDiscoverer_StateAccessor&,iUTContext.StateAccessor());
   122 	if(accessor.InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer))
   123 		return EFalse;
   124 	return ETrue;
   125 	}
   126 
   127 inline TBool TDiscoverer_IsValidEntry_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
   128 	{
   129 	TDiscoverer_StateAccessor& accessor = REINTERPRET_CAST(TDiscoverer_StateAccessor&,iUTContext.StateAccessor());
   130 	if(accessor.InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer))
   131 		return EFalse;
   132 	return ETrue;
   133 	}
   134 
   135 // ______________________________________________________________________________
   136 //
   137 inline TDiscoverer_ProcessEntryL_TransitionValidator::TDiscoverer_ProcessEntryL_TransitionValidator(CUnitTestContext& aUTContext)
   138 :TTransitionValidator(aUTContext)
   139 	{
   140 	// Do nothing
   141 	}
   142 
   143 inline TBool TDiscoverer_ProcessEntryL_TransitionValidator::ValidatePreConditions()
   144 	{
   145 	TDiscoverer_StateAccessor& accessor = REINTERPRET_CAST(TDiscoverer_StateAccessor&,iUTContext.StateAccessor());
   146 	if(accessor.InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer))
   147 		return EFalse;
   148 	return ETrue;
   149 	}
   150 
   151 inline TBool TDiscoverer_ProcessEntryL_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
   152 	{
   153 	TDiscoverer_StateAccessor& accessor = REINTERPRET_CAST(TDiscoverer_StateAccessor&,iUTContext.StateAccessor());
   154 	if(accessor.InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer))
   155 		return EFalse;
   156 	return ETrue;
   157 	}
   158 
   159 // ______________________________________________________________________________
   160 //
   161 inline TDiscoverer_CompleteNotificationProcessing_TransitionValidator::TDiscoverer_CompleteNotificationProcessing_TransitionValidator(CUnitTestContext& aUTContext)
   162 :TTransitionValidator(aUTContext)
   163 	{
   164 	// Do nothing
   165 	}
   166 
   167 inline TBool TDiscoverer_CompleteNotificationProcessing_TransitionValidator::ValidatePreConditions()
   168 	{
   169 	TDiscoverer_StateAccessor& accessor = REINTERPRET_CAST(TDiscoverer_StateAccessor&,iUTContext.StateAccessor());
   170 	if(accessor.InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer))
   171 		return EFalse;
   172 	return ETrue;
   173 	}
   174 
   175 inline TBool TDiscoverer_CompleteNotificationProcessing_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
   176 	{
   177 	TDiscoverer_StateAccessor& accessor = REINTERPRET_CAST(TDiscoverer_StateAccessor&,iUTContext.StateAccessor());
   178 	if(accessor.InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer))
   179 		return EFalse;
   180 	return ETrue;
   181 	}
   182 
   183 // ______________________________________________________________________________
   184 //
   185 inline TDiscoverer_Notification_TransitionValidator::TDiscoverer_Notification_TransitionValidator(CUnitTestContext& aUTContext)
   186 :TTransitionValidator(aUTContext)
   187 	{
   188 	// Do nothing
   189 	}
   190 
   191 inline TBool TDiscoverer_Notification_TransitionValidator::ValidatePreConditions()
   192 	{
   193 	TDiscoverer_StateAccessor& accessor = REINTERPRET_CAST(TDiscoverer_StateAccessor&,iUTContext.StateAccessor());
   194 	if(accessor.InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer))
   195 		return EFalse;
   196 	return ETrue;
   197 	}
   198 
   199 inline TBool TDiscoverer_Notification_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
   200 	{
   201 	TDiscoverer_StateAccessor& accessor = REINTERPRET_CAST(TDiscoverer_StateAccessor&,iUTContext.StateAccessor());
   202 	if(accessor.InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer))
   203 		return EFalse;
   204 	return ETrue;
   205 	}
   206 
   207 // ______________________________________________________________________________
   208 //
   209 inline TDiscoverer_Suspend_TransitionValidator::TDiscoverer_Suspend_TransitionValidator(CUnitTestContext& aUTContext)
   210 :TTransitionValidator(aUTContext)
   211 	{
   212 	// Do nothing
   213 	}
   214 
   215 inline TBool TDiscoverer_Suspend_TransitionValidator::ValidatePreConditions()
   216 	{
   217 	TDiscoverer_StateAccessor& accessor = REINTERPRET_CAST(TDiscoverer_StateAccessor&,iUTContext.StateAccessor());
   218 	if(accessor.InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer))
   219 		return EFalse;
   220 	return ETrue;
   221 	}
   222 
   223 inline TBool TDiscoverer_Suspend_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
   224 	{
   225 	TDiscoverer_StateAccessor& accessor = REINTERPRET_CAST(TDiscoverer_StateAccessor&,iUTContext.StateAccessor());
   226 	if(accessor.InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer))
   227 		return EFalse;
   228 	return ETrue;
   229 	}
   230 
   231 // ______________________________________________________________________________
   232 //
   233 inline TDiscoverer_Resume_TransitionValidator::TDiscoverer_Resume_TransitionValidator(CUnitTestContext& aUTContext)
   234 :TTransitionValidator(aUTContext)
   235 	{
   236 	// Do nothing
   237 	}
   238 
   239 inline TBool TDiscoverer_Resume_TransitionValidator::ValidatePreConditions()
   240 	{
   241 	TDiscoverer_StateAccessor& accessor = REINTERPRET_CAST(TDiscoverer_StateAccessor&,iUTContext.StateAccessor());
   242 	if(accessor.InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer))
   243 		return EFalse;
   244 	return ETrue;
   245 	}
   246 
   247 inline TBool TDiscoverer_Resume_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
   248 	{
   249 	TDiscoverer_StateAccessor& accessor = REINTERPRET_CAST(TDiscoverer_StateAccessor&,iUTContext.StateAccessor());
   250 	if(accessor.InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer))
   251 		return EFalse;
   252 	return ETrue;
   253 	}
   254 
   255 // ______________________________________________________________________________
   256 //
   257 inline TDiscoverer_ScanDirectory_TransitionValidator::TDiscoverer_ScanDirectory_TransitionValidator(CUnitTestContext& aUTContext)
   258 :TTransitionValidator(aUTContext)
   259 	{
   260 	// Do nothing
   261 	}
   262 
   263 inline TBool TDiscoverer_ScanDirectory_TransitionValidator::ValidatePreConditions()
   264 	{
   265 	TDiscoverer_StateAccessor& accessor = REINTERPRET_CAST(TDiscoverer_StateAccessor&,iUTContext.StateAccessor());
   266 	if(accessor.InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer))
   267 		return EFalse;
   268 	return ETrue;
   269 	}
   270 
   271 inline TBool TDiscoverer_ScanDirectory_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
   272 	{
   273 	TDiscoverer_StateAccessor& accessor = REINTERPRET_CAST(TDiscoverer_StateAccessor&,iUTContext.StateAccessor());
   274 	if(accessor.InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer))
   275 		return EFalse;
   276 	return ETrue;
   277 	}
   278 
   279 
   280 // ______________________________________________________________________________
   281 //
   282 inline TDiscoverer_ScanDirectoryCancel_TransitionValidator::TDiscoverer_ScanDirectoryCancel_TransitionValidator(CUnitTestContext& aUTContext)
   283 :TTransitionValidator(aUTContext)
   284 	{
   285 	// Do nothing
   286 	}
   287 
   288 inline TBool TDiscoverer_ScanDirectoryCancel_TransitionValidator::ValidatePreConditions()
   289 	{
   290 	TDiscoverer_StateAccessor& accessor = REINTERPRET_CAST(TDiscoverer_StateAccessor&,iUTContext.StateAccessor());
   291 	if(accessor.InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer))
   292 		return EFalse;
   293 	return ETrue;
   294 	}
   295 
   296 inline TBool TDiscoverer_ScanDirectoryCancel_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
   297 	{
   298 	TDiscoverer_StateAccessor& accessor = REINTERPRET_CAST(TDiscoverer_StateAccessor&,iUTContext.StateAccessor());
   299 	if(accessor.InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer))
   300 		return EFalse;
   301 	return ETrue;
   302 	}
   303 
   304 
   305 // ______________________________________________________________________________
   306 //
   307 inline TDiscoverer_ScanDirectoryIncrement_TransitionValidator::TDiscoverer_ScanDirectoryIncrement_TransitionValidator(CUnitTestContext& aUTContext)
   308 :TTransitionValidator(aUTContext)
   309 	{
   310 	// Do nothing
   311 	}
   312 
   313 inline TBool TDiscoverer_ScanDirectoryIncrement_TransitionValidator::ValidatePreConditions()
   314 	{
   315 	TDiscoverer_StateAccessor& accessor = REINTERPRET_CAST(TDiscoverer_StateAccessor&,iUTContext.StateAccessor());
   316 	if(accessor.InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer))
   317 		return EFalse;
   318 	return ETrue;
   319 	}
   320 
   321 inline TBool TDiscoverer_ScanDirectoryIncrement_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
   322 	{
   323 	TDiscoverer_StateAccessor& accessor = REINTERPRET_CAST(TDiscoverer_StateAccessor&,iUTContext.StateAccessor());
   324 	if(accessor.InvariantTest(REINTERPRET_CAST(CDiscoverer_UnitTestContext&,iUTContext).iDiscoverer))
   325 		return EFalse;
   326 	return ETrue;
   327 	}
   328 
   329