os/ossrv/lowlevellibsandfws/pluginfw/Test_Bed/UnitTestTest/UnitTestTransitionValidation.inl
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/ossrv/lowlevellibsandfws/pluginfw/Test_Bed/UnitTestTest/UnitTestTransitionValidation.inl	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,334 @@
     1.4 +// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +// The implementation of the transition validation classes upon the CUnitTest class methods.
    1.18 +// 
    1.19 +//
    1.20 +
    1.21 +// ______________________________________________________________________________
    1.22 +//
    1.23 +inline TUnitTest_Ctor_TransitionValidator::TUnitTest_Ctor_TransitionValidator(CUnitTestContext& aUTContext)
    1.24 +:TTransitionValidator(aUTContext)
    1.25 +	{
    1.26 +	// Do nothing
    1.27 +	}
    1.28 +
    1.29 +inline TBool TUnitTest_Ctor_TransitionValidator::ValidatePreConditions()
    1.30 +	{
    1.31 +	return ETrue;
    1.32 +	}
    1.33 +
    1.34 +inline TBool TUnitTest_Ctor_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
    1.35 +	{
    1.36 +	if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext).iUnitTest))
    1.37 +		return EFalse;
    1.38 +	return ETrue;
    1.39 +	}
    1.40 +
    1.41 +// ______________________________________________________________________________
    1.42 +//
    1.43 +inline TUnitTest_Dtor_TransitionValidator::TUnitTest_Dtor_TransitionValidator(CUnitTestContext& aUTContext)
    1.44 +:TTransitionValidator(aUTContext)
    1.45 +	{
    1.46 +	// Do nothing
    1.47 +	}
    1.48 +
    1.49 +inline TBool TUnitTest_Dtor_TransitionValidator::ValidatePreConditions()
    1.50 +	{
    1.51 +	if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext).iUnitTest))
    1.52 +		return EFalse;
    1.53 +	return ETrue;
    1.54 +	}
    1.55 +
    1.56 +inline TBool TUnitTest_Dtor_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
    1.57 +	{
    1.58 +	return ETrue;
    1.59 +	}
    1.60 +
    1.61 +// ______________________________________________________________________________
    1.62 +//
    1.63 +inline TUnitTest_TransitionSet_TransitionValidator::TUnitTest_TransitionSet_TransitionValidator(CUnitTestContext& aUTContext)
    1.64 +:TTransitionValidator(aUTContext)
    1.65 +	{
    1.66 +	// Do nothing
    1.67 +	}
    1.68 +
    1.69 +inline TBool TUnitTest_TransitionSet_TransitionValidator::ValidatePreConditions()
    1.70 +	{
    1.71 +	return ETrue;
    1.72 +	}
    1.73 +
    1.74 +inline TBool TUnitTest_TransitionSet_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
    1.75 +	{
    1.76 +	// Implement the correct post-condition test for this unit test transition. 
    1.77 +//#pragma message( __FILE__LINE__ "TO DO : Implement the correct post-condition test for this unit test transition.")
    1.78 +	// For a d'tor this should be empty.
    1.79 +	if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext).iUnitTest))
    1.80 +		return EFalse;
    1.81 +	return ETrue;
    1.82 +	}
    1.83 +
    1.84 +// ______________________________________________________________________________
    1.85 +//
    1.86 +inline TUnitTest_GetCurrentTransition_TransitionValidator::TUnitTest_GetCurrentTransition_TransitionValidator(CUnitTestContext& aUTContext)
    1.87 +:TTransitionValidator(aUTContext)
    1.88 +	{
    1.89 +	// Do nothing
    1.90 +	}
    1.91 +
    1.92 +inline TBool TUnitTest_GetCurrentTransition_TransitionValidator::ValidatePreConditions()
    1.93 +	{
    1.94 +	return ETrue;
    1.95 +	}
    1.96 +
    1.97 +inline TBool TUnitTest_GetCurrentTransition_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
    1.98 +	{
    1.99 +	// Implement the correct post-condition test for this unit test transition. 
   1.100 +//#pragma message( __FILE__LINE__ "TO DO : Implement the correct post-condition test for this unit test transition.")
   1.101 +	// For a d'tor this should be empty.
   1.102 +	if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext).iUnitTest))
   1.103 +		return EFalse;
   1.104 +	return ETrue;
   1.105 +	}
   1.106 +
   1.107 +// ______________________________________________________________________________
   1.108 +//
   1.109 +inline TUnitTest_SetCurrentTransition_TransitionValidator::TUnitTest_SetCurrentTransition_TransitionValidator(CUnitTestContext& aUTContext)
   1.110 +:TTransitionValidator(aUTContext)
   1.111 +	{
   1.112 +	// Do nothing
   1.113 +	}
   1.114 +
   1.115 +inline TBool TUnitTest_SetCurrentTransition_TransitionValidator::ValidatePreConditions()
   1.116 +	{
   1.117 +	// Implement the correct pre-condition test for this unit test transition.
   1.118 +//#pragma message( __FILE__LINE__ "TO DO : Implement the correct pre-condition test for this unit test transition.")
   1.119 +	// For a c'tor this should be empty.
   1.120 +	if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext).iUnitTest))
   1.121 +		return EFalse;
   1.122 +	return ETrue;
   1.123 +	}
   1.124 +
   1.125 +inline TBool TUnitTest_SetCurrentTransition_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
   1.126 +	{
   1.127 +	// Implement the correct post-condition test for this unit test transition.
   1.128 +//#pragma message( __FILE__LINE__ "TO DO : Implement the correct post-condition test for this unit test transition.")
   1.129 +	// For a d'tor this should be empty.
   1.130 +	if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext).iUnitTest))
   1.131 +		return EFalse;
   1.132 +	return ETrue;
   1.133 +	}
   1.134 +
   1.135 +// ______________________________________________________________________________
   1.136 +//
   1.137 +inline TUnitTest_SetParameters_TransitionValidator::TUnitTest_SetParameters_TransitionValidator(CUnitTestContext& aUTContext)
   1.138 +:TTransitionValidator(aUTContext)
   1.139 +	{
   1.140 +	// Do nothing
   1.141 +	}
   1.142 +
   1.143 +inline TBool TUnitTest_SetParameters_TransitionValidator::ValidatePreConditions()
   1.144 +	{
   1.145 +	// Implement the correct pre-condition test for this unit test transition.
   1.146 +//#pragma message( __FILE__LINE__ "TO DO : Implement the correct pre-condition test for this unit test transition.")
   1.147 +	// For a c'tor this should be empty.
   1.148 +	if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext).iUnitTest))
   1.149 +		return EFalse;
   1.150 +	return ETrue;
   1.151 +	}
   1.152 +
   1.153 +inline TBool TUnitTest_SetParameters_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
   1.154 +	{
   1.155 +	// Implement the correct post-condition test for this unit test transition.
   1.156 +//#pragma message( __FILE__LINE__ "TO DO : Implement the correct post-condition test for this unit test transition.")
   1.157 +	// For a d'tor this should be empty.
   1.158 +	if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext).iUnitTest))
   1.159 +		return EFalse;
   1.160 +	return ETrue;
   1.161 +	}
   1.162 +
   1.163 +// ______________________________________________________________________________
   1.164 +//
   1.165 +inline TUnitTest_PrepareUnitTest_TransitionValidator::TUnitTest_PrepareUnitTest_TransitionValidator(CUnitTestContext& aUTContext)
   1.166 +:TTransitionValidator(aUTContext)
   1.167 +	{
   1.168 +	// Do nothing
   1.169 +	}
   1.170 +
   1.171 +_LIT(KPrepareUnitTestFailedInvariant,
   1.172 +	"CUnitTest_PrepareUnitTest_Transition invariant failure");
   1.173 +
   1.174 +inline TBool TUnitTest_PrepareUnitTest_TransitionValidator::ValidatePreConditions()
   1.175 +	{
   1.176 +	// Implement the correct pre-condition test for this unit test transition.
   1.177 +//#pragma message( __FILE__LINE__ "TO DO : Implement the correct pre-condition test for this unit test transition.")
   1.178 +	// For a c'tor this should be empty.
   1.179 +	if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext).iUnitTest))
   1.180 +		{
   1.181 +		iUTContext.DataLogger().LogInformation(KPrepareUnitTestFailedInvariant);
   1.182 +		return EFalse;
   1.183 +		}
   1.184 +	return ETrue;
   1.185 +	}
   1.186 +
   1.187 +inline TBool TUnitTest_PrepareUnitTest_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
   1.188 +	{
   1.189 +	// Implement the correct post-condition test for this unit test transition.
   1.190 +//#pragma message( __FILE__LINE__ "TO DO : Implement the correct post-condition test for this unit test transition.")
   1.191 +	// For a d'tor this should be empty.
   1.192 +	if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext).iUnitTest))
   1.193 +		{
   1.194 +		iUTContext.DataLogger().LogInformation(KPrepareUnitTestFailedInvariant);
   1.195 +		return EFalse;
   1.196 +		}
   1.197 +	return ETrue;
   1.198 +	}
   1.199 +
   1.200 +// ______________________________________________________________________________
   1.201 +//
   1.202 +inline TUnitTest_RunTest_TransitionValidator::TUnitTest_RunTest_TransitionValidator(CUnitTestContext& aUTContext)
   1.203 +:TTransitionValidator(aUTContext)
   1.204 +	{
   1.205 +	// Do nothing
   1.206 +	}
   1.207 +
   1.208 +inline TBool TUnitTest_RunTest_TransitionValidator::ValidatePreConditions()
   1.209 +	{
   1.210 +	return ETrue;
   1.211 +	}
   1.212 +
   1.213 +inline TBool TUnitTest_RunTest_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
   1.214 +	{
   1.215 +	// Implement the correct post-condition test for this unit test transition.
   1.216 +//#pragma message( __FILE__LINE__ "TO DO : Implement the correct post-condition test for this unit test transition.")
   1.217 +	// For a d'tor this should be empty.
   1.218 +	if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext).iUnitTest))
   1.219 +		return EFalse;
   1.220 +	return ETrue;
   1.221 +	}
   1.222 +
   1.223 +// ______________________________________________________________________________
   1.224 +//
   1.225 +inline TUnitTest_AddTransition_TransitionValidator::TUnitTest_AddTransition_TransitionValidator(CUnitTestContext& aUTContext)
   1.226 +:TTransitionValidator(aUTContext)
   1.227 +	{
   1.228 +	// Do nothing
   1.229 +	}
   1.230 +
   1.231 +inline TBool TUnitTest_AddTransition_TransitionValidator::ValidatePreConditions()
   1.232 +	{
   1.233 +	// Implement the correct pre-condition test for this unit test transition.
   1.234 +//#pragma message( __FILE__LINE__ "TO DO : Implement the correct pre-condition test for this unit test transition.")
   1.235 +	// For a c'tor this should be empty.
   1.236 +	if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext).iUnitTest))
   1.237 +		return EFalse;
   1.238 +	return ETrue;
   1.239 +	}
   1.240 +
   1.241 +inline TBool TUnitTest_AddTransition_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
   1.242 +	{
   1.243 +	// Implement the correct post-condition test for this unit test transition.
   1.244 +//#pragma message( __FILE__LINE__ "TO DO : Implement the correct post-condition test for this unit test transition.")
   1.245 +	// For a d'tor this should be empty.
   1.246 +	if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext).iUnitTest))
   1.247 +		return EFalse;
   1.248 +	return ETrue;
   1.249 +	}
   1.250 +
   1.251 +// ______________________________________________________________________________
   1.252 +//
   1.253 +inline TUnitTest_AddBlockingTransition_TransitionValidator::TUnitTest_AddBlockingTransition_TransitionValidator(CUnitTestContext& aUTContext)
   1.254 +:TTransitionValidator(aUTContext)
   1.255 +	{
   1.256 +	// Do nothing
   1.257 +	}
   1.258 +
   1.259 +inline TBool TUnitTest_AddBlockingTransition_TransitionValidator::ValidatePreConditions()
   1.260 +	{
   1.261 +	// Implement the correct pre-condition test for this unit test transition.
   1.262 +//#pragma message( __FILE__LINE__ "TO DO : Implement the correct pre-condition test for this unit test transition.")
   1.263 +	// For a c'tor this should be empty.
   1.264 +	if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext).iUnitTest))
   1.265 +		return EFalse;
   1.266 +	return ETrue;
   1.267 +	}
   1.268 +
   1.269 +inline TBool TUnitTest_AddBlockingTransition_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
   1.270 +	{
   1.271 +	// Implement the correct post-condition test for this unit test transition.
   1.272 +//#pragma message( __FILE__LINE__ "TO DO : Implement the correct post-condition test for this unit test transition.")
   1.273 +	// For a d'tor this should be empty.
   1.274 +	if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext).iUnitTest))
   1.275 +		return EFalse;
   1.276 +	return ETrue;
   1.277 +	}
   1.278 +
   1.279 +// ______________________________________________________________________________
   1.280 +//
   1.281 +inline TUnitTest_AddLeaveErrorCode_TransitionValidator::TUnitTest_AddLeaveErrorCode_TransitionValidator(CUnitTestContext& aUTContext)
   1.282 +:TTransitionValidator(aUTContext)
   1.283 +	{
   1.284 +	// Do nothing
   1.285 +	}
   1.286 +
   1.287 +_LIT(KAddLeaveErrorCodeFailedInvariant,
   1.288 +	"CUnitTest_AddLeaveErrorCode_Transition invariant failure");
   1.289 +
   1.290 +inline TBool TUnitTest_AddLeaveErrorCode_TransitionValidator::ValidatePreConditions()
   1.291 +	{
   1.292 +	// Implement the correct pre-condition test for this unit test transition.
   1.293 +//#pragma message( __FILE__LINE__ "TO DO : Implement the correct pre-condition test for this unit test transition.")
   1.294 +	// For a c'tor this should be empty.
   1.295 +	if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext).iUnitTest))
   1.296 +		{
   1.297 +		iUTContext.DataLogger().LogInformation(KAddLeaveErrorCodeFailedInvariant);
   1.298 +		return EFalse;
   1.299 +		}
   1.300 +	return ETrue;
   1.301 +	}
   1.302 +
   1.303 +inline TBool TUnitTest_AddLeaveErrorCode_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
   1.304 +	{
   1.305 +	// Implement the correct post-condition test for this unit test transition.
   1.306 +//#pragma message( __FILE__LINE__ "TO DO : Implement the correct post-condition test for this unit test transition.")
   1.307 +	// For a d'tor this should be empty.
   1.308 +	if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext).iUnitTest))
   1.309 +		{
   1.310 +		iUTContext.DataLogger().LogInformation(KAddLeaveErrorCodeFailedInvariant);
   1.311 +		return EFalse;
   1.312 +		}
   1.313 +	return ETrue;
   1.314 +	}
   1.315 +
   1.316 +// ______________________________________________________________________________
   1.317 +//
   1.318 +inline TUnitTest_UnitTestName_TransitionValidator::TUnitTest_UnitTestName_TransitionValidator(CUnitTestContext& aUTContext)
   1.319 +:TTransitionValidator(aUTContext)
   1.320 +	{
   1.321 +	// Do nothing
   1.322 +	}
   1.323 +
   1.324 +inline TBool TUnitTest_UnitTestName_TransitionValidator::ValidatePreConditions()
   1.325 +	{
   1.326 +	return ETrue;
   1.327 +	}
   1.328 +
   1.329 +inline TBool TUnitTest_UnitTestName_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
   1.330 +	{
   1.331 +	// Implement the correct post-condition test for this unit test transition.
   1.332 +//#pragma message( __FILE__LINE__ "TO DO : Implement the correct post-condition test for this unit test transition.")
   1.333 +	// For a d'tor this should be empty.
   1.334 +	if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext).iUnitTest))
   1.335 +		return EFalse;
   1.336 +	return ETrue;
   1.337 +	}