os/ossrv/lowlevellibsandfws/pluginfw/Test_Bed/UnitTestTest/UnitTestTransitionValidation.inl
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
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
// The implementation of the transition validation classes upon the CUnitTest class methods.
sl@0
    15
// 
sl@0
    16
//
sl@0
    17
sl@0
    18
// ______________________________________________________________________________
sl@0
    19
//
sl@0
    20
inline TUnitTest_Ctor_TransitionValidator::TUnitTest_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 TUnitTest_Ctor_TransitionValidator::ValidatePreConditions()
sl@0
    27
	{
sl@0
    28
	return ETrue;
sl@0
    29
	}
sl@0
    30
sl@0
    31
inline TBool TUnitTest_Ctor_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
sl@0
    32
	{
sl@0
    33
	if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext).iUnitTest))
sl@0
    34
		return EFalse;
sl@0
    35
	return ETrue;
sl@0
    36
	}
sl@0
    37
sl@0
    38
// ______________________________________________________________________________
sl@0
    39
//
sl@0
    40
inline TUnitTest_Dtor_TransitionValidator::TUnitTest_Dtor_TransitionValidator(CUnitTestContext& aUTContext)
sl@0
    41
:TTransitionValidator(aUTContext)
sl@0
    42
	{
sl@0
    43
	// Do nothing
sl@0
    44
	}
sl@0
    45
sl@0
    46
inline TBool TUnitTest_Dtor_TransitionValidator::ValidatePreConditions()
sl@0
    47
	{
sl@0
    48
	if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext).iUnitTest))
sl@0
    49
		return EFalse;
sl@0
    50
	return ETrue;
sl@0
    51
	}
sl@0
    52
sl@0
    53
inline TBool TUnitTest_Dtor_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
sl@0
    54
	{
sl@0
    55
	return ETrue;
sl@0
    56
	}
sl@0
    57
sl@0
    58
// ______________________________________________________________________________
sl@0
    59
//
sl@0
    60
inline TUnitTest_TransitionSet_TransitionValidator::TUnitTest_TransitionSet_TransitionValidator(CUnitTestContext& aUTContext)
sl@0
    61
:TTransitionValidator(aUTContext)
sl@0
    62
	{
sl@0
    63
	// Do nothing
sl@0
    64
	}
sl@0
    65
sl@0
    66
inline TBool TUnitTest_TransitionSet_TransitionValidator::ValidatePreConditions()
sl@0
    67
	{
sl@0
    68
	return ETrue;
sl@0
    69
	}
sl@0
    70
sl@0
    71
inline TBool TUnitTest_TransitionSet_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
sl@0
    72
	{
sl@0
    73
	// Implement the correct post-condition test for this unit test transition. 
sl@0
    74
//#pragma message( __FILE__LINE__ "TO DO : Implement the correct post-condition test for this unit test transition.")
sl@0
    75
	// For a d'tor this should be empty.
sl@0
    76
	if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext).iUnitTest))
sl@0
    77
		return EFalse;
sl@0
    78
	return ETrue;
sl@0
    79
	}
sl@0
    80
sl@0
    81
// ______________________________________________________________________________
sl@0
    82
//
sl@0
    83
inline TUnitTest_GetCurrentTransition_TransitionValidator::TUnitTest_GetCurrentTransition_TransitionValidator(CUnitTestContext& aUTContext)
sl@0
    84
:TTransitionValidator(aUTContext)
sl@0
    85
	{
sl@0
    86
	// Do nothing
sl@0
    87
	}
sl@0
    88
sl@0
    89
inline TBool TUnitTest_GetCurrentTransition_TransitionValidator::ValidatePreConditions()
sl@0
    90
	{
sl@0
    91
	return ETrue;
sl@0
    92
	}
sl@0
    93
sl@0
    94
inline TBool TUnitTest_GetCurrentTransition_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
sl@0
    95
	{
sl@0
    96
	// Implement the correct post-condition test for this unit test transition. 
sl@0
    97
//#pragma message( __FILE__LINE__ "TO DO : Implement the correct post-condition test for this unit test transition.")
sl@0
    98
	// For a d'tor this should be empty.
sl@0
    99
	if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext).iUnitTest))
sl@0
   100
		return EFalse;
sl@0
   101
	return ETrue;
sl@0
   102
	}
sl@0
   103
sl@0
   104
// ______________________________________________________________________________
sl@0
   105
//
sl@0
   106
inline TUnitTest_SetCurrentTransition_TransitionValidator::TUnitTest_SetCurrentTransition_TransitionValidator(CUnitTestContext& aUTContext)
sl@0
   107
:TTransitionValidator(aUTContext)
sl@0
   108
	{
sl@0
   109
	// Do nothing
sl@0
   110
	}
sl@0
   111
sl@0
   112
inline TBool TUnitTest_SetCurrentTransition_TransitionValidator::ValidatePreConditions()
sl@0
   113
	{
sl@0
   114
	// Implement the correct pre-condition test for this unit test transition.
sl@0
   115
//#pragma message( __FILE__LINE__ "TO DO : Implement the correct pre-condition test for this unit test transition.")
sl@0
   116
	// For a c'tor this should be empty.
sl@0
   117
	if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext).iUnitTest))
sl@0
   118
		return EFalse;
sl@0
   119
	return ETrue;
sl@0
   120
	}
sl@0
   121
sl@0
   122
inline TBool TUnitTest_SetCurrentTransition_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
sl@0
   123
	{
sl@0
   124
	// Implement the correct post-condition test for this unit test transition.
sl@0
   125
//#pragma message( __FILE__LINE__ "TO DO : Implement the correct post-condition test for this unit test transition.")
sl@0
   126
	// For a d'tor this should be empty.
sl@0
   127
	if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext).iUnitTest))
sl@0
   128
		return EFalse;
sl@0
   129
	return ETrue;
sl@0
   130
	}
sl@0
   131
sl@0
   132
// ______________________________________________________________________________
sl@0
   133
//
sl@0
   134
inline TUnitTest_SetParameters_TransitionValidator::TUnitTest_SetParameters_TransitionValidator(CUnitTestContext& aUTContext)
sl@0
   135
:TTransitionValidator(aUTContext)
sl@0
   136
	{
sl@0
   137
	// Do nothing
sl@0
   138
	}
sl@0
   139
sl@0
   140
inline TBool TUnitTest_SetParameters_TransitionValidator::ValidatePreConditions()
sl@0
   141
	{
sl@0
   142
	// Implement the correct pre-condition test for this unit test transition.
sl@0
   143
//#pragma message( __FILE__LINE__ "TO DO : Implement the correct pre-condition test for this unit test transition.")
sl@0
   144
	// For a c'tor this should be empty.
sl@0
   145
	if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext).iUnitTest))
sl@0
   146
		return EFalse;
sl@0
   147
	return ETrue;
sl@0
   148
	}
sl@0
   149
sl@0
   150
inline TBool TUnitTest_SetParameters_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
sl@0
   151
	{
sl@0
   152
	// Implement the correct post-condition test for this unit test transition.
sl@0
   153
//#pragma message( __FILE__LINE__ "TO DO : Implement the correct post-condition test for this unit test transition.")
sl@0
   154
	// For a d'tor this should be empty.
sl@0
   155
	if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext).iUnitTest))
sl@0
   156
		return EFalse;
sl@0
   157
	return ETrue;
sl@0
   158
	}
sl@0
   159
sl@0
   160
// ______________________________________________________________________________
sl@0
   161
//
sl@0
   162
inline TUnitTest_PrepareUnitTest_TransitionValidator::TUnitTest_PrepareUnitTest_TransitionValidator(CUnitTestContext& aUTContext)
sl@0
   163
:TTransitionValidator(aUTContext)
sl@0
   164
	{
sl@0
   165
	// Do nothing
sl@0
   166
	}
sl@0
   167
sl@0
   168
_LIT(KPrepareUnitTestFailedInvariant,
sl@0
   169
	"CUnitTest_PrepareUnitTest_Transition invariant failure");
sl@0
   170
sl@0
   171
inline TBool TUnitTest_PrepareUnitTest_TransitionValidator::ValidatePreConditions()
sl@0
   172
	{
sl@0
   173
	// Implement the correct pre-condition test for this unit test transition.
sl@0
   174
//#pragma message( __FILE__LINE__ "TO DO : Implement the correct pre-condition test for this unit test transition.")
sl@0
   175
	// For a c'tor this should be empty.
sl@0
   176
	if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext).iUnitTest))
sl@0
   177
		{
sl@0
   178
		iUTContext.DataLogger().LogInformation(KPrepareUnitTestFailedInvariant);
sl@0
   179
		return EFalse;
sl@0
   180
		}
sl@0
   181
	return ETrue;
sl@0
   182
	}
sl@0
   183
sl@0
   184
inline TBool TUnitTest_PrepareUnitTest_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
sl@0
   185
	{
sl@0
   186
	// Implement the correct post-condition test for this unit test transition.
sl@0
   187
//#pragma message( __FILE__LINE__ "TO DO : Implement the correct post-condition test for this unit test transition.")
sl@0
   188
	// For a d'tor this should be empty.
sl@0
   189
	if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext).iUnitTest))
sl@0
   190
		{
sl@0
   191
		iUTContext.DataLogger().LogInformation(KPrepareUnitTestFailedInvariant);
sl@0
   192
		return EFalse;
sl@0
   193
		}
sl@0
   194
	return ETrue;
sl@0
   195
	}
sl@0
   196
sl@0
   197
// ______________________________________________________________________________
sl@0
   198
//
sl@0
   199
inline TUnitTest_RunTest_TransitionValidator::TUnitTest_RunTest_TransitionValidator(CUnitTestContext& aUTContext)
sl@0
   200
:TTransitionValidator(aUTContext)
sl@0
   201
	{
sl@0
   202
	// Do nothing
sl@0
   203
	}
sl@0
   204
sl@0
   205
inline TBool TUnitTest_RunTest_TransitionValidator::ValidatePreConditions()
sl@0
   206
	{
sl@0
   207
	return ETrue;
sl@0
   208
	}
sl@0
   209
sl@0
   210
inline TBool TUnitTest_RunTest_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
sl@0
   211
	{
sl@0
   212
	// Implement the correct post-condition test for this unit test transition.
sl@0
   213
//#pragma message( __FILE__LINE__ "TO DO : Implement the correct post-condition test for this unit test transition.")
sl@0
   214
	// For a d'tor this should be empty.
sl@0
   215
	if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext).iUnitTest))
sl@0
   216
		return EFalse;
sl@0
   217
	return ETrue;
sl@0
   218
	}
sl@0
   219
sl@0
   220
// ______________________________________________________________________________
sl@0
   221
//
sl@0
   222
inline TUnitTest_AddTransition_TransitionValidator::TUnitTest_AddTransition_TransitionValidator(CUnitTestContext& aUTContext)
sl@0
   223
:TTransitionValidator(aUTContext)
sl@0
   224
	{
sl@0
   225
	// Do nothing
sl@0
   226
	}
sl@0
   227
sl@0
   228
inline TBool TUnitTest_AddTransition_TransitionValidator::ValidatePreConditions()
sl@0
   229
	{
sl@0
   230
	// Implement the correct pre-condition test for this unit test transition.
sl@0
   231
//#pragma message( __FILE__LINE__ "TO DO : Implement the correct pre-condition test for this unit test transition.")
sl@0
   232
	// For a c'tor this should be empty.
sl@0
   233
	if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext).iUnitTest))
sl@0
   234
		return EFalse;
sl@0
   235
	return ETrue;
sl@0
   236
	}
sl@0
   237
sl@0
   238
inline TBool TUnitTest_AddTransition_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
sl@0
   239
	{
sl@0
   240
	// Implement the correct post-condition test for this unit test transition.
sl@0
   241
//#pragma message( __FILE__LINE__ "TO DO : Implement the correct post-condition test for this unit test transition.")
sl@0
   242
	// For a d'tor this should be empty.
sl@0
   243
	if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext).iUnitTest))
sl@0
   244
		return EFalse;
sl@0
   245
	return ETrue;
sl@0
   246
	}
sl@0
   247
sl@0
   248
// ______________________________________________________________________________
sl@0
   249
//
sl@0
   250
inline TUnitTest_AddBlockingTransition_TransitionValidator::TUnitTest_AddBlockingTransition_TransitionValidator(CUnitTestContext& aUTContext)
sl@0
   251
:TTransitionValidator(aUTContext)
sl@0
   252
	{
sl@0
   253
	// Do nothing
sl@0
   254
	}
sl@0
   255
sl@0
   256
inline TBool TUnitTest_AddBlockingTransition_TransitionValidator::ValidatePreConditions()
sl@0
   257
	{
sl@0
   258
	// Implement the correct pre-condition test for this unit test transition.
sl@0
   259
//#pragma message( __FILE__LINE__ "TO DO : Implement the correct pre-condition test for this unit test transition.")
sl@0
   260
	// For a c'tor this should be empty.
sl@0
   261
	if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext).iUnitTest))
sl@0
   262
		return EFalse;
sl@0
   263
	return ETrue;
sl@0
   264
	}
sl@0
   265
sl@0
   266
inline TBool TUnitTest_AddBlockingTransition_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
sl@0
   267
	{
sl@0
   268
	// Implement the correct post-condition test for this unit test transition.
sl@0
   269
//#pragma message( __FILE__LINE__ "TO DO : Implement the correct post-condition test for this unit test transition.")
sl@0
   270
	// For a d'tor this should be empty.
sl@0
   271
	if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext).iUnitTest))
sl@0
   272
		return EFalse;
sl@0
   273
	return ETrue;
sl@0
   274
	}
sl@0
   275
sl@0
   276
// ______________________________________________________________________________
sl@0
   277
//
sl@0
   278
inline TUnitTest_AddLeaveErrorCode_TransitionValidator::TUnitTest_AddLeaveErrorCode_TransitionValidator(CUnitTestContext& aUTContext)
sl@0
   279
:TTransitionValidator(aUTContext)
sl@0
   280
	{
sl@0
   281
	// Do nothing
sl@0
   282
	}
sl@0
   283
sl@0
   284
_LIT(KAddLeaveErrorCodeFailedInvariant,
sl@0
   285
	"CUnitTest_AddLeaveErrorCode_Transition invariant failure");
sl@0
   286
sl@0
   287
inline TBool TUnitTest_AddLeaveErrorCode_TransitionValidator::ValidatePreConditions()
sl@0
   288
	{
sl@0
   289
	// Implement the correct pre-condition test for this unit test transition.
sl@0
   290
//#pragma message( __FILE__LINE__ "TO DO : Implement the correct pre-condition test for this unit test transition.")
sl@0
   291
	// For a c'tor this should be empty.
sl@0
   292
	if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext).iUnitTest))
sl@0
   293
		{
sl@0
   294
		iUTContext.DataLogger().LogInformation(KAddLeaveErrorCodeFailedInvariant);
sl@0
   295
		return EFalse;
sl@0
   296
		}
sl@0
   297
	return ETrue;
sl@0
   298
	}
sl@0
   299
sl@0
   300
inline TBool TUnitTest_AddLeaveErrorCode_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
sl@0
   301
	{
sl@0
   302
	// Implement the correct post-condition test for this unit test transition.
sl@0
   303
//#pragma message( __FILE__LINE__ "TO DO : Implement the correct post-condition test for this unit test transition.")
sl@0
   304
	// For a d'tor this should be empty.
sl@0
   305
	if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext).iUnitTest))
sl@0
   306
		{
sl@0
   307
		iUTContext.DataLogger().LogInformation(KAddLeaveErrorCodeFailedInvariant);
sl@0
   308
		return EFalse;
sl@0
   309
		}
sl@0
   310
	return ETrue;
sl@0
   311
	}
sl@0
   312
sl@0
   313
// ______________________________________________________________________________
sl@0
   314
//
sl@0
   315
inline TUnitTest_UnitTestName_TransitionValidator::TUnitTest_UnitTestName_TransitionValidator(CUnitTestContext& aUTContext)
sl@0
   316
:TTransitionValidator(aUTContext)
sl@0
   317
	{
sl@0
   318
	// Do nothing
sl@0
   319
	}
sl@0
   320
sl@0
   321
inline TBool TUnitTest_UnitTestName_TransitionValidator::ValidatePreConditions()
sl@0
   322
	{
sl@0
   323
	return ETrue;
sl@0
   324
	}
sl@0
   325
sl@0
   326
inline TBool TUnitTest_UnitTestName_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
sl@0
   327
	{
sl@0
   328
	// Implement the correct post-condition test for this unit test transition.
sl@0
   329
//#pragma message( __FILE__LINE__ "TO DO : Implement the correct post-condition test for this unit test transition.")
sl@0
   330
	// For a d'tor this should be empty.
sl@0
   331
	if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext).iUnitTest))
sl@0
   332
		return EFalse;
sl@0
   333
	return ETrue;
sl@0
   334
	}