os/ossrv/lowlevellibsandfws/pluginfw/Framework/ResolverTest/ResolverTransitionValidation.inl
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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // The implementation of the validation classes for the CResolver tests.
18 // ______________________________________________________________________________
20 inline TDefaultResolver_Ctor_TransitionValidator::TDefaultResolver_Ctor_TransitionValidator(CUnitTestContext& aUTContext)
21 :TTransitionValidator(aUTContext)
26 inline TBool TDefaultResolver_Ctor_TransitionValidator::ValidatePreConditions()
31 inline TBool TDefaultResolver_Ctor_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
33 if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CDefaultResolver_UnitTestContext&,iUTContext).iDefaultResolver))
38 // ______________________________________________________________________________
40 inline TDefaultResolver_Dtor_TransitionValidator::TDefaultResolver_Dtor_TransitionValidator(CUnitTestContext& aUTContext)
41 :TTransitionValidator(aUTContext)
46 inline TBool TDefaultResolver_Dtor_TransitionValidator::ValidatePreConditions()
48 if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CDefaultResolver_UnitTestContext&,iUTContext).iDefaultResolver))
53 inline TBool TDefaultResolver_Dtor_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
58 // ______________________________________________________________________________
60 inline TDefaultResolver_Default_TransitionValidator::TDefaultResolver_Default_TransitionValidator(CUnitTestContext& aUTContext)
61 :TTransitionValidator(aUTContext)
66 inline TBool TDefaultResolver_Default_TransitionValidator::ValidatePreConditions()
68 if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CDefaultResolver_UnitTestContext&,iUTContext).iDefaultResolver))
73 inline TBool TDefaultResolver_Default_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
75 if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CDefaultResolver_UnitTestContext&,iUTContext).iDefaultResolver))
80 // ______________________________________________________________________________
82 inline TDefaultResolver_IdentifyImplementationL_TransitionValidator::TDefaultResolver_IdentifyImplementationL_TransitionValidator(CUnitTestContext& aUTContext)
83 :TTransitionValidator(aUTContext)
88 inline TBool TDefaultResolver_IdentifyImplementationL_TransitionValidator::ValidatePreConditions()
90 if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CDefaultResolver_UnitTestContext&,iUTContext).iDefaultResolver))
95 inline TBool TDefaultResolver_IdentifyImplementationL_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
97 CDefaultResolver_UnitTestContext& context =
98 REINTERPRET_CAST(CDefaultResolver_UnitTestContext&,iUTContext);
100 _LIT(KIdentifiedUidMessage, "IdentifyImplmentationL() returned uid 0x%x");
101 context.DataLogger().LogInformationWithParameters(KIdentifiedUidMessage,
102 context.iResolvedImpUid.iUid);
104 if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CDefaultResolver_UnitTestContext&,iUTContext).iDefaultResolver))
109 // ______________________________________________________________________________
111 inline TDefaultResolver_Match_TransitionValidator::TDefaultResolver_Match_TransitionValidator(CUnitTestContext& aUTContext)
112 :TTransitionValidator(aUTContext)
117 inline TBool TDefaultResolver_Match_TransitionValidator::ValidatePreConditions()
119 if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CDefaultResolver_UnitTestContext&,iUTContext).iDefaultResolver))
124 inline TBool TDefaultResolver_Match_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
126 CDefaultResolver_UnitTestContext& context =
127 REINTERPRET_CAST(CDefaultResolver_UnitTestContext&,iUTContext);
128 if(context.iMatchResult != context.iExpectedMatchResult)
130 // Log that we got the wrong result but carry on because we don't want the test to end
131 _LIT(KIncorrectMatchResult, "CDefaultResolver::Match returned incorrect result");
132 context.DataLogger().LogInformation(KIncorrectMatchResult);
135 if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CDefaultResolver_UnitTestContext&,iUTContext).iDefaultResolver))