sl@0: // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // The implementation of the transition validation classes upon the CUnitTest class methods. sl@0: // sl@0: // sl@0: sl@0: // ______________________________________________________________________________ sl@0: // sl@0: inline TUnitTest_Ctor_TransitionValidator::TUnitTest_Ctor_TransitionValidator(CUnitTestContext& aUTContext) sl@0: :TTransitionValidator(aUTContext) sl@0: { sl@0: // Do nothing sl@0: } sl@0: sl@0: inline TBool TUnitTest_Ctor_TransitionValidator::ValidatePreConditions() sl@0: { sl@0: return ETrue; sl@0: } sl@0: sl@0: inline TBool TUnitTest_Ctor_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */) sl@0: { sl@0: if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext).iUnitTest)) sl@0: return EFalse; sl@0: return ETrue; sl@0: } sl@0: sl@0: // ______________________________________________________________________________ sl@0: // sl@0: inline TUnitTest_Dtor_TransitionValidator::TUnitTest_Dtor_TransitionValidator(CUnitTestContext& aUTContext) sl@0: :TTransitionValidator(aUTContext) sl@0: { sl@0: // Do nothing sl@0: } sl@0: sl@0: inline TBool TUnitTest_Dtor_TransitionValidator::ValidatePreConditions() sl@0: { sl@0: if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext).iUnitTest)) sl@0: return EFalse; sl@0: return ETrue; sl@0: } sl@0: sl@0: inline TBool TUnitTest_Dtor_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */) sl@0: { sl@0: return ETrue; sl@0: } sl@0: sl@0: // ______________________________________________________________________________ sl@0: // sl@0: inline TUnitTest_TransitionSet_TransitionValidator::TUnitTest_TransitionSet_TransitionValidator(CUnitTestContext& aUTContext) sl@0: :TTransitionValidator(aUTContext) sl@0: { sl@0: // Do nothing sl@0: } sl@0: sl@0: inline TBool TUnitTest_TransitionSet_TransitionValidator::ValidatePreConditions() sl@0: { sl@0: return ETrue; sl@0: } sl@0: sl@0: inline TBool TUnitTest_TransitionSet_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */) sl@0: { sl@0: // Implement the correct post-condition test for this unit test transition. sl@0: //#pragma message( __FILE__LINE__ "TO DO : Implement the correct post-condition test for this unit test transition.") sl@0: // For a d'tor this should be empty. sl@0: if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext).iUnitTest)) sl@0: return EFalse; sl@0: return ETrue; sl@0: } sl@0: sl@0: // ______________________________________________________________________________ sl@0: // sl@0: inline TUnitTest_GetCurrentTransition_TransitionValidator::TUnitTest_GetCurrentTransition_TransitionValidator(CUnitTestContext& aUTContext) sl@0: :TTransitionValidator(aUTContext) sl@0: { sl@0: // Do nothing sl@0: } sl@0: sl@0: inline TBool TUnitTest_GetCurrentTransition_TransitionValidator::ValidatePreConditions() sl@0: { sl@0: return ETrue; sl@0: } sl@0: sl@0: inline TBool TUnitTest_GetCurrentTransition_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */) sl@0: { sl@0: // Implement the correct post-condition test for this unit test transition. sl@0: //#pragma message( __FILE__LINE__ "TO DO : Implement the correct post-condition test for this unit test transition.") sl@0: // For a d'tor this should be empty. sl@0: if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext).iUnitTest)) sl@0: return EFalse; sl@0: return ETrue; sl@0: } sl@0: sl@0: // ______________________________________________________________________________ sl@0: // sl@0: inline TUnitTest_SetCurrentTransition_TransitionValidator::TUnitTest_SetCurrentTransition_TransitionValidator(CUnitTestContext& aUTContext) sl@0: :TTransitionValidator(aUTContext) sl@0: { sl@0: // Do nothing sl@0: } sl@0: sl@0: inline TBool TUnitTest_SetCurrentTransition_TransitionValidator::ValidatePreConditions() sl@0: { sl@0: // Implement the correct pre-condition test for this unit test transition. sl@0: //#pragma message( __FILE__LINE__ "TO DO : Implement the correct pre-condition test for this unit test transition.") sl@0: // For a c'tor this should be empty. sl@0: if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext).iUnitTest)) sl@0: return EFalse; sl@0: return ETrue; sl@0: } sl@0: sl@0: inline TBool TUnitTest_SetCurrentTransition_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */) sl@0: { sl@0: // Implement the correct post-condition test for this unit test transition. sl@0: //#pragma message( __FILE__LINE__ "TO DO : Implement the correct post-condition test for this unit test transition.") sl@0: // For a d'tor this should be empty. sl@0: if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext).iUnitTest)) sl@0: return EFalse; sl@0: return ETrue; sl@0: } sl@0: sl@0: // ______________________________________________________________________________ sl@0: // sl@0: inline TUnitTest_SetParameters_TransitionValidator::TUnitTest_SetParameters_TransitionValidator(CUnitTestContext& aUTContext) sl@0: :TTransitionValidator(aUTContext) sl@0: { sl@0: // Do nothing sl@0: } sl@0: sl@0: inline TBool TUnitTest_SetParameters_TransitionValidator::ValidatePreConditions() sl@0: { sl@0: // Implement the correct pre-condition test for this unit test transition. sl@0: //#pragma message( __FILE__LINE__ "TO DO : Implement the correct pre-condition test for this unit test transition.") sl@0: // For a c'tor this should be empty. sl@0: if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext).iUnitTest)) sl@0: return EFalse; sl@0: return ETrue; sl@0: } sl@0: sl@0: inline TBool TUnitTest_SetParameters_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */) sl@0: { sl@0: // Implement the correct post-condition test for this unit test transition. sl@0: //#pragma message( __FILE__LINE__ "TO DO : Implement the correct post-condition test for this unit test transition.") sl@0: // For a d'tor this should be empty. sl@0: if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext).iUnitTest)) sl@0: return EFalse; sl@0: return ETrue; sl@0: } sl@0: sl@0: // ______________________________________________________________________________ sl@0: // sl@0: inline TUnitTest_PrepareUnitTest_TransitionValidator::TUnitTest_PrepareUnitTest_TransitionValidator(CUnitTestContext& aUTContext) sl@0: :TTransitionValidator(aUTContext) sl@0: { sl@0: // Do nothing sl@0: } sl@0: sl@0: _LIT(KPrepareUnitTestFailedInvariant, sl@0: "CUnitTest_PrepareUnitTest_Transition invariant failure"); sl@0: sl@0: inline TBool TUnitTest_PrepareUnitTest_TransitionValidator::ValidatePreConditions() sl@0: { sl@0: // Implement the correct pre-condition test for this unit test transition. sl@0: //#pragma message( __FILE__LINE__ "TO DO : Implement the correct pre-condition test for this unit test transition.") sl@0: // For a c'tor this should be empty. sl@0: if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext).iUnitTest)) sl@0: { sl@0: iUTContext.DataLogger().LogInformation(KPrepareUnitTestFailedInvariant); sl@0: return EFalse; sl@0: } sl@0: return ETrue; sl@0: } sl@0: sl@0: inline TBool TUnitTest_PrepareUnitTest_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */) sl@0: { sl@0: // Implement the correct post-condition test for this unit test transition. sl@0: //#pragma message( __FILE__LINE__ "TO DO : Implement the correct post-condition test for this unit test transition.") sl@0: // For a d'tor this should be empty. sl@0: if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext).iUnitTest)) sl@0: { sl@0: iUTContext.DataLogger().LogInformation(KPrepareUnitTestFailedInvariant); sl@0: return EFalse; sl@0: } sl@0: return ETrue; sl@0: } sl@0: sl@0: // ______________________________________________________________________________ sl@0: // sl@0: inline TUnitTest_RunTest_TransitionValidator::TUnitTest_RunTest_TransitionValidator(CUnitTestContext& aUTContext) sl@0: :TTransitionValidator(aUTContext) sl@0: { sl@0: // Do nothing sl@0: } sl@0: sl@0: inline TBool TUnitTest_RunTest_TransitionValidator::ValidatePreConditions() sl@0: { sl@0: return ETrue; sl@0: } sl@0: sl@0: inline TBool TUnitTest_RunTest_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */) sl@0: { sl@0: // Implement the correct post-condition test for this unit test transition. sl@0: //#pragma message( __FILE__LINE__ "TO DO : Implement the correct post-condition test for this unit test transition.") sl@0: // For a d'tor this should be empty. sl@0: if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext).iUnitTest)) sl@0: return EFalse; sl@0: return ETrue; sl@0: } sl@0: sl@0: // ______________________________________________________________________________ sl@0: // sl@0: inline TUnitTest_AddTransition_TransitionValidator::TUnitTest_AddTransition_TransitionValidator(CUnitTestContext& aUTContext) sl@0: :TTransitionValidator(aUTContext) sl@0: { sl@0: // Do nothing sl@0: } sl@0: sl@0: inline TBool TUnitTest_AddTransition_TransitionValidator::ValidatePreConditions() sl@0: { sl@0: // Implement the correct pre-condition test for this unit test transition. sl@0: //#pragma message( __FILE__LINE__ "TO DO : Implement the correct pre-condition test for this unit test transition.") sl@0: // For a c'tor this should be empty. sl@0: if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext).iUnitTest)) sl@0: return EFalse; sl@0: return ETrue; sl@0: } sl@0: sl@0: inline TBool TUnitTest_AddTransition_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */) sl@0: { sl@0: // Implement the correct post-condition test for this unit test transition. sl@0: //#pragma message( __FILE__LINE__ "TO DO : Implement the correct post-condition test for this unit test transition.") sl@0: // For a d'tor this should be empty. sl@0: if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext).iUnitTest)) sl@0: return EFalse; sl@0: return ETrue; sl@0: } sl@0: sl@0: // ______________________________________________________________________________ sl@0: // sl@0: inline TUnitTest_AddBlockingTransition_TransitionValidator::TUnitTest_AddBlockingTransition_TransitionValidator(CUnitTestContext& aUTContext) sl@0: :TTransitionValidator(aUTContext) sl@0: { sl@0: // Do nothing sl@0: } sl@0: sl@0: inline TBool TUnitTest_AddBlockingTransition_TransitionValidator::ValidatePreConditions() sl@0: { sl@0: // Implement the correct pre-condition test for this unit test transition. sl@0: //#pragma message( __FILE__LINE__ "TO DO : Implement the correct pre-condition test for this unit test transition.") sl@0: // For a c'tor this should be empty. sl@0: if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext).iUnitTest)) sl@0: return EFalse; sl@0: return ETrue; sl@0: } sl@0: sl@0: inline TBool TUnitTest_AddBlockingTransition_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */) sl@0: { sl@0: // Implement the correct post-condition test for this unit test transition. sl@0: //#pragma message( __FILE__LINE__ "TO DO : Implement the correct post-condition test for this unit test transition.") sl@0: // For a d'tor this should be empty. sl@0: if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext).iUnitTest)) sl@0: return EFalse; sl@0: return ETrue; sl@0: } sl@0: sl@0: // ______________________________________________________________________________ sl@0: // sl@0: inline TUnitTest_AddLeaveErrorCode_TransitionValidator::TUnitTest_AddLeaveErrorCode_TransitionValidator(CUnitTestContext& aUTContext) sl@0: :TTransitionValidator(aUTContext) sl@0: { sl@0: // Do nothing sl@0: } sl@0: sl@0: _LIT(KAddLeaveErrorCodeFailedInvariant, sl@0: "CUnitTest_AddLeaveErrorCode_Transition invariant failure"); sl@0: sl@0: inline TBool TUnitTest_AddLeaveErrorCode_TransitionValidator::ValidatePreConditions() sl@0: { sl@0: // Implement the correct pre-condition test for this unit test transition. sl@0: //#pragma message( __FILE__LINE__ "TO DO : Implement the correct pre-condition test for this unit test transition.") sl@0: // For a c'tor this should be empty. sl@0: if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext).iUnitTest)) sl@0: { sl@0: iUTContext.DataLogger().LogInformation(KAddLeaveErrorCodeFailedInvariant); sl@0: return EFalse; sl@0: } sl@0: return ETrue; sl@0: } sl@0: sl@0: inline TBool TUnitTest_AddLeaveErrorCode_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */) sl@0: { sl@0: // Implement the correct post-condition test for this unit test transition. sl@0: //#pragma message( __FILE__LINE__ "TO DO : Implement the correct post-condition test for this unit test transition.") sl@0: // For a d'tor this should be empty. sl@0: if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext).iUnitTest)) sl@0: { sl@0: iUTContext.DataLogger().LogInformation(KAddLeaveErrorCodeFailedInvariant); sl@0: return EFalse; sl@0: } sl@0: return ETrue; sl@0: } sl@0: sl@0: // ______________________________________________________________________________ sl@0: // sl@0: inline TUnitTest_UnitTestName_TransitionValidator::TUnitTest_UnitTestName_TransitionValidator(CUnitTestContext& aUTContext) sl@0: :TTransitionValidator(aUTContext) sl@0: { sl@0: // Do nothing sl@0: } sl@0: sl@0: inline TBool TUnitTest_UnitTestName_TransitionValidator::ValidatePreConditions() sl@0: { sl@0: return ETrue; sl@0: } sl@0: sl@0: inline TBool TUnitTest_UnitTestName_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */) sl@0: { sl@0: // Implement the correct post-condition test for this unit test transition. sl@0: //#pragma message( __FILE__LINE__ "TO DO : Implement the correct post-condition test for this unit test transition.") sl@0: // For a d'tor this should be empty. sl@0: if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CUnitTest_UnitTestContext&,iUTContext).iUnitTest)) sl@0: return EFalse; sl@0: return ETrue; sl@0: }