|
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 validation classes for CLoadManager transitions. |
|
15 // |
|
16 // |
|
17 |
|
18 // ______________________________________________________________________________ |
|
19 // |
|
20 inline TLoadManager_Ctor_TransitionValidator::TLoadManager_Ctor_TransitionValidator(CUnitTestContext& aUTContext) |
|
21 :TTransitionValidator(aUTContext) |
|
22 { |
|
23 // Do nothing |
|
24 } |
|
25 |
|
26 inline TBool TLoadManager_Ctor_TransitionValidator::ValidatePreConditions() |
|
27 { |
|
28 return ETrue; |
|
29 } |
|
30 |
|
31 inline TBool TLoadManager_Ctor_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */) |
|
32 { |
|
33 if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CLoadManager_UnitTestContext&,iUTContext).iLoadManager)) |
|
34 return EFalse; |
|
35 return ETrue; |
|
36 } |
|
37 |
|
38 // ______________________________________________________________________________ |
|
39 // |
|
40 inline TLoadManager_Dtor_TransitionValidator::TLoadManager_Dtor_TransitionValidator(CUnitTestContext& aUTContext) |
|
41 :TTransitionValidator(aUTContext) |
|
42 { |
|
43 // Do nothing |
|
44 } |
|
45 |
|
46 inline TBool TLoadManager_Dtor_TransitionValidator::ValidatePreConditions() |
|
47 { |
|
48 if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CLoadManager_UnitTestContext&,iUTContext).iLoadManager)) |
|
49 return EFalse; |
|
50 return ETrue; |
|
51 } |
|
52 |
|
53 inline TBool TLoadManager_Dtor_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */) |
|
54 { |
|
55 return ETrue; |
|
56 } |
|
57 |
|
58 // ______________________________________________________________________________ |
|
59 // |
|
60 inline TLoadManager_InstantiationMethod_TransitionValidator::TLoadManager_InstantiationMethod_TransitionValidator(CUnitTestContext& aUTContext) |
|
61 :TTransitionValidator(aUTContext) |
|
62 { |
|
63 // Do nothing |
|
64 } |
|
65 |
|
66 inline TBool TLoadManager_InstantiationMethod_TransitionValidator::ValidatePreConditions() |
|
67 { |
|
68 CLoadManager_UnitTestContext& context = REINTERPRET_CAST(CLoadManager_UnitTestContext&,iUTContext); |
|
69 if(context.StateAccessor().InvariantTest(context.iLoadManager)) |
|
70 return EFalse; |
|
71 return context.iLoadMethod == NULL; |
|
72 } |
|
73 |
|
74 inline TBool TLoadManager_InstantiationMethod_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */) |
|
75 { |
|
76 CLoadManager_UnitTestContext& context = REINTERPRET_CAST(CLoadManager_UnitTestContext&,iUTContext); |
|
77 if(context.StateAccessor().InvariantTest(context.iLoadManager)) |
|
78 return EFalse; |
|
79 return (context.iLoadMethod != NULL); |
|
80 } |
|
81 |
|
82 // ______________________________________________________________________________ |
|
83 // |
|
84 inline TLoadManager_InstantiationFailure_TransitionValidator::TLoadManager_InstantiationFailure_TransitionValidator(CUnitTestContext& aUTContext) |
|
85 :TTransitionValidator(aUTContext) |
|
86 { |
|
87 // Do nothing |
|
88 } |
|
89 |
|
90 inline TBool TLoadManager_InstantiationFailure_TransitionValidator::ValidatePreConditions() |
|
91 { |
|
92 CLoadManager_UnitTestContext& context = REINTERPRET_CAST(CLoadManager_UnitTestContext&,iUTContext); |
|
93 if(context.StateAccessor().InvariantTest(context.iLoadManager)) |
|
94 return EFalse; |
|
95 return context.iLoadMethod == NULL; |
|
96 } |
|
97 |
|
98 inline TBool TLoadManager_InstantiationFailure_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */) |
|
99 { |
|
100 CLoadManager_UnitTestContext& context = REINTERPRET_CAST(CLoadManager_UnitTestContext&,iUTContext); |
|
101 if(context.StateAccessor().InvariantTest(context.iLoadManager)) |
|
102 return EFalse; |
|
103 return (context.iLoadMethod == NULL); |
|
104 } |
|
105 |
|
106 // ______________________________________________________________________________ |
|
107 // |
|
108 inline TLoadManager_DestroyThis_TransitionValidator::TLoadManager_DestroyThis_TransitionValidator(CUnitTestContext& aUTContext) |
|
109 :TTransitionValidator(aUTContext) |
|
110 { |
|
111 // Do nothing |
|
112 } |
|
113 |
|
114 inline TBool TLoadManager_DestroyThis_TransitionValidator::ValidatePreConditions() |
|
115 { |
|
116 if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CLoadManager_UnitTestContext&,iUTContext).iLoadManager)) |
|
117 return EFalse; |
|
118 return ETrue; |
|
119 } |
|
120 |
|
121 inline TBool TLoadManager_DestroyThis_TransitionValidator::ValidatePostConditions(TTestBedAsyncState /* aAsyncState */) |
|
122 { |
|
123 if(iUTContext.StateAccessor().InvariantTest(REINTERPRET_CAST(CLoadManager_UnitTestContext&,iUTContext).iLoadManager)) |
|
124 return EFalse; |
|
125 return ETrue; |
|
126 } |
|
127 |