os/ossrv/lowlevellibsandfws/pluginfw/Framework/FrameTests/MagicTransitionValidation.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 // Implementations for the transition validation classes for ECom
18 // ______________________________________________________________________________
20 inline TExampleInterface_Ctor_TransitionValidator::TExampleInterface_Ctor_TransitionValidator(CUnitTestContext& aUTContext)
21 :TTransitionValidator(aUTContext)
26 inline TBool TExampleInterface_Ctor_TransitionValidator::ValidatePreConditions()
31 inline TBool TExampleInterface_Ctor_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
33 CExampleInterface_UnitTestContext& context =
34 REINTERPRET_CAST(CExampleInterface_UnitTestContext&,iUTContext);
35 TExampleInterface_StateAccessor& accessor =
36 REINTERPRET_CAST(TExampleInterface_StateAccessor&, iUTContext.StateAccessor());
38 _LIT(KTUidMessage, "Created an implementation with uid = 0x%x");
39 TUid implUid = accessor.GetDtorKey(context.iExampleInterface);
40 context.DataLogger().LogInformationWithParameters(KTUidMessage, implUid.iUid);
41 if(accessor.InvariantTest(context.iExampleInterface))
46 // ______________________________________________________________________________
48 inline TExampleInterface_Dtor_TransitionValidator::TExampleInterface_Dtor_TransitionValidator(CUnitTestContext& aUTContext)
49 :TTransitionValidator(aUTContext)
54 inline TBool TExampleInterface_Dtor_TransitionValidator::ValidatePreConditions()
56 if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CExampleInterface_UnitTestContext&,iUTContext).iExampleInterface))
61 inline TBool TExampleInterface_Dtor_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
66 // ______________________________________________________________________________
68 inline TExampleInterface_ListImplementations_TransitionValidator::TExampleInterface_ListImplementations_TransitionValidator(CUnitTestContext& aUTContext)
69 :TTransitionValidator(aUTContext)
74 inline TBool TExampleInterface_ListImplementations_TransitionValidator::ValidatePreConditions()
76 // static function so there are no preconditions
80 inline TBool TExampleInterface_ListImplementations_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
82 CExampleInterface_UnitTestContext& context = REINTERPRET_CAST(CExampleInterface_UnitTestContext&,
84 const TInt count = context.iImplementations.Count();
85 _LIT(KImplementationsReturned,"List Implementations transition returned %d implementations");
86 context.DataLogger().LogInformationWithParameters(KImplementationsReturned,count);
87 for(TInt i = 0; i < count; ++i)
89 CImplementationInformation* info = (context.iImplementations)[i];
90 context.DataLogger().LogInformation(info->DisplayName());
91 context.DataLogger().LogInformation(info->DataType());
92 _LIT(KVersionLogLine,"Version number = %d");
93 context.DataLogger().LogInformationWithParameters(KVersionLogLine,info->Version());
98 // ______________________________________________________________________________
100 inline TExampleInterface_Default_TransitionValidator::TExampleInterface_Default_TransitionValidator(CUnitTestContext& aUTContext)
101 :TTransitionValidator(aUTContext)
106 inline TBool TExampleInterface_Default_TransitionValidator::ValidatePreConditions()
108 if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CExampleInterface_UnitTestContext&,iUTContext).iExampleInterface))
113 inline TBool TExampleInterface_Default_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */)
115 if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CExampleInterface_UnitTestContext&,iUTContext).iExampleInterface))