|
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". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // The implementation of the transition validation classes upon the CComponentInfo class methods. |
|
15 // |
|
16 // |
|
17 |
|
18 // ______________________________________________________________________________ |
|
19 // |
|
20 inline TComponentInfo_Ctor_TransitionValidator::TComponentInfo_Ctor_TransitionValidator(CUnitTestContext& aUTContext) |
|
21 :TTransitionValidator(aUTContext) |
|
22 { |
|
23 // Do nothing |
|
24 } |
|
25 |
|
26 inline TBool TComponentInfo_Ctor_TransitionValidator::ValidatePreConditions() |
|
27 { |
|
28 return ETrue; |
|
29 } |
|
30 |
|
31 inline TBool TComponentInfo_Ctor_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */) |
|
32 { |
|
33 if((reinterpret_cast <CComponentInfo_UnitTestContext&> (iUTContext)).iEntryFunc != (reinterpret_cast <CComponentInfo_UnitTestContext&> (iUTContext)).iEntryFuncPostCheck) |
|
34 return EFalse; |
|
35 return ETrue; |
|
36 } |
|
37 |
|
38 // ______________________________________________________________________________ |
|
39 // |
|
40 inline TComponentInfo_Dtor_TransitionValidator::TComponentInfo_Dtor_TransitionValidator(CUnitTestContext& aUTContext) |
|
41 :TTransitionValidator(aUTContext) |
|
42 { |
|
43 // Do nothing |
|
44 } |
|
45 |
|
46 inline TBool TComponentInfo_Dtor_TransitionValidator::ValidatePreConditions() |
|
47 { |
|
48 if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CComponentInfo_UnitTestContext&,iUTContext).iComponentInfo)) |
|
49 return EFalse; |
|
50 return ETrue; |
|
51 } |
|
52 |
|
53 inline TBool TComponentInfo_Dtor_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */) |
|
54 { |
|
55 return ETrue; |
|
56 } |
|
57 |
|
58 // ______________________________________________________________________________ |
|
59 // |
|
60 inline TComponentInfo_Entry_TransitionValidator::TComponentInfo_Entry_TransitionValidator(CUnitTestContext& aUTContext) |
|
61 :TTransitionValidator(aUTContext) |
|
62 { |
|
63 // Do nothing |
|
64 } |
|
65 |
|
66 inline TBool TComponentInfo_Entry_TransitionValidator::ValidatePreConditions() |
|
67 { |
|
68 if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CComponentInfo_UnitTestContext&,iUTContext).iComponentInfo)) |
|
69 return EFalse; |
|
70 return ETrue; |
|
71 } |
|
72 |
|
73 inline TBool TComponentInfo_Entry_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */) |
|
74 { |
|
75 if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CComponentInfo_UnitTestContext&,iUTContext).iComponentInfo)) |
|
76 return EFalse; |
|
77 |
|
78 if(REINTERPRET_CAST(CComponentInfo_UnitTestContext&,iUTContext).iEntryFunc != REINTERPRET_CAST(CComponentInfo_UnitTestContext&,iUTContext).iEntryFuncPostCheck) |
|
79 { |
|
80 _LIT(KComponentInfoValidatePostConditions, "***** TComponentInfo_Entry_TransitionValidator::ValidatePostConditions Failed *****"); |
|
81 iUTContext.DataLogger().LogInformation(KComponentInfoValidatePostConditions); |
|
82 return EFalse; |
|
83 } |
|
84 return ETrue; |
|
85 } |
|
86 |
|
87 // ______________________________________________________________________________ |
|
88 // |
|
89 inline TComponentInfo_UnitTestsInfo_TransitionValidator::TComponentInfo_UnitTestsInfo_TransitionValidator(CUnitTestContext& aUTContext) |
|
90 :TTransitionValidator(aUTContext) |
|
91 { |
|
92 // Do nothing |
|
93 } |
|
94 |
|
95 inline TBool TComponentInfo_UnitTestsInfo_TransitionValidator::ValidatePreConditions() |
|
96 { |
|
97 if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CComponentInfo_UnitTestContext&,iUTContext).iComponentInfo)) |
|
98 return EFalse; |
|
99 return ETrue; |
|
100 } |
|
101 |
|
102 inline TBool TComponentInfo_UnitTestsInfo_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */) |
|
103 { |
|
104 if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CComponentInfo_UnitTestContext&,iUTContext).iComponentInfo)) |
|
105 return EFalse; |
|
106 |
|
107 if(REINTERPRET_CAST(CComponentInfo_UnitTestContext&,iUTContext).iTestInfoArray != REINTERPRET_CAST(CComponentInfo_UnitTestContext&,iUTContext).iTestInfoArrayPostCheck) |
|
108 { |
|
109 _LIT(KComponentInfoUTValidatePostConditions, "***** TComponentInfo_UnitTestsInfo_TransitionValidator::ValidatePostConditions Failed *****"); |
|
110 iUTContext.DataLogger().LogInformation(KComponentInfoUTValidatePostConditions); |
|
111 return EFalse; |
|
112 } |
|
113 return ETrue; |
|
114 } |