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 validation classes for the CResolver tests. sl@0: // sl@0: // sl@0: sl@0: // ______________________________________________________________________________ sl@0: // sl@0: inline TDefaultResolver_Ctor_TransitionValidator::TDefaultResolver_Ctor_TransitionValidator(CUnitTestContext& aUTContext) sl@0: :TTransitionValidator(aUTContext) sl@0: { sl@0: // Do nothing sl@0: } sl@0: sl@0: inline TBool TDefaultResolver_Ctor_TransitionValidator::ValidatePreConditions() sl@0: { sl@0: return ETrue; sl@0: } sl@0: sl@0: inline TBool TDefaultResolver_Ctor_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */) sl@0: { sl@0: if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CDefaultResolver_UnitTestContext&,iUTContext).iDefaultResolver)) sl@0: return EFalse; sl@0: return ETrue; sl@0: } sl@0: sl@0: // ______________________________________________________________________________ sl@0: // sl@0: inline TDefaultResolver_Dtor_TransitionValidator::TDefaultResolver_Dtor_TransitionValidator(CUnitTestContext& aUTContext) sl@0: :TTransitionValidator(aUTContext) sl@0: { sl@0: // Do nothing sl@0: } sl@0: sl@0: inline TBool TDefaultResolver_Dtor_TransitionValidator::ValidatePreConditions() sl@0: { sl@0: if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CDefaultResolver_UnitTestContext&,iUTContext).iDefaultResolver)) sl@0: return EFalse; sl@0: return ETrue; sl@0: } sl@0: sl@0: inline TBool TDefaultResolver_Dtor_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */) sl@0: { sl@0: return ETrue; sl@0: } sl@0: sl@0: // ______________________________________________________________________________ sl@0: // sl@0: inline TDefaultResolver_Default_TransitionValidator::TDefaultResolver_Default_TransitionValidator(CUnitTestContext& aUTContext) sl@0: :TTransitionValidator(aUTContext) sl@0: { sl@0: // Do nothing sl@0: } sl@0: sl@0: inline TBool TDefaultResolver_Default_TransitionValidator::ValidatePreConditions() sl@0: { sl@0: if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CDefaultResolver_UnitTestContext&,iUTContext).iDefaultResolver)) sl@0: return EFalse; sl@0: return ETrue; sl@0: } sl@0: sl@0: inline TBool TDefaultResolver_Default_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */) sl@0: { sl@0: if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CDefaultResolver_UnitTestContext&,iUTContext).iDefaultResolver)) sl@0: return EFalse; sl@0: return ETrue; sl@0: } sl@0: sl@0: // ______________________________________________________________________________ sl@0: // sl@0: inline TDefaultResolver_IdentifyImplementationL_TransitionValidator::TDefaultResolver_IdentifyImplementationL_TransitionValidator(CUnitTestContext& aUTContext) sl@0: :TTransitionValidator(aUTContext) sl@0: { sl@0: // Do nothing sl@0: } sl@0: sl@0: inline TBool TDefaultResolver_IdentifyImplementationL_TransitionValidator::ValidatePreConditions() sl@0: { sl@0: if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CDefaultResolver_UnitTestContext&,iUTContext).iDefaultResolver)) sl@0: return EFalse; sl@0: return ETrue; sl@0: } sl@0: sl@0: inline TBool TDefaultResolver_IdentifyImplementationL_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */) sl@0: { sl@0: CDefaultResolver_UnitTestContext& context = sl@0: REINTERPRET_CAST(CDefaultResolver_UnitTestContext&,iUTContext); sl@0: sl@0: _LIT(KIdentifiedUidMessage, "IdentifyImplmentationL() returned uid 0x%x"); sl@0: context.DataLogger().LogInformationWithParameters(KIdentifiedUidMessage, sl@0: context.iResolvedImpUid.iUid); sl@0: sl@0: if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CDefaultResolver_UnitTestContext&,iUTContext).iDefaultResolver)) sl@0: return EFalse; sl@0: return ETrue; sl@0: } sl@0: sl@0: // ______________________________________________________________________________ sl@0: // sl@0: inline TDefaultResolver_Match_TransitionValidator::TDefaultResolver_Match_TransitionValidator(CUnitTestContext& aUTContext) sl@0: :TTransitionValidator(aUTContext) sl@0: { sl@0: // Do nothing sl@0: } sl@0: sl@0: inline TBool TDefaultResolver_Match_TransitionValidator::ValidatePreConditions() sl@0: { sl@0: if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CDefaultResolver_UnitTestContext&,iUTContext).iDefaultResolver)) sl@0: return EFalse; sl@0: return ETrue; sl@0: } sl@0: sl@0: inline TBool TDefaultResolver_Match_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */) sl@0: { sl@0: CDefaultResolver_UnitTestContext& context = sl@0: REINTERPRET_CAST(CDefaultResolver_UnitTestContext&,iUTContext); sl@0: if(context.iMatchResult != context.iExpectedMatchResult) sl@0: { sl@0: // Log that we got the wrong result but carry on because we don't want the test to end sl@0: _LIT(KIncorrectMatchResult, "CDefaultResolver::Match returned incorrect result"); sl@0: context.DataLogger().LogInformation(KIncorrectMatchResult); sl@0: } sl@0: sl@0: if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CDefaultResolver_UnitTestContext&,iUTContext).iDefaultResolver)) sl@0: return EFalse; sl@0: return ETrue; sl@0: } sl@0: