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