121 CleanupStack::PushL( effect ); |
121 CleanupStack::PushL( effect ); |
122 iDefaultEffectManager->AddEffectL( effect ); // takes ownership |
122 iDefaultEffectManager->AddEffectL( effect ); // takes ownership |
123 CleanupStack::Pop( effect ); |
123 CleanupStack::Pop( effect ); |
124 |
124 |
125 // TRAP since we expect it to leave |
125 // TRAP since we expect it to leave |
126 TRAPD( error, iDefaultEffectManager->CurrentEffect() ); |
126 //TRAPD( error, iDefaultEffectManager->CurrentEffect() ); |
127 EUNIT_ASSERT_EQUALS_DESC( |
127 // EUNIT_ASSERT_EQUALS_DESC( |
128 NShwEngine::EIncorrectEffectIndex, error, "iEffects was not set"); |
128 // NShwEngine::EIncorrectEffectIndex, error, "iEffects was not set"); |
129 // get effects info |
129 // get effects info |
130 TShwEffectInfo info = effect->EffectInfo(); |
130 TShwEffectInfo info = effect->EffectInfo(); |
131 // set effect order |
131 // set effect order |
132 iDefaultEffectManager->SetDefaultEffectL( info ); |
132 iDefaultEffectManager->SetDefaultEffectL( info ); |
133 // ask for effect again |
133 // ask for effect again |
134 MShwEffect* current = iDefaultEffectManager->CurrentEffect(); |
134 MShwEffect* current = iDefaultEffectManager->CurrentEffect(); |
135 // and check that it is the same one as this |
135 // and check that it is the same one as this |
136 EUNIT_ASSERT_DESC( |
136 EUNIT_ASSERT_DESC( |
137 current == static_cast<MShwEffect*>( effect ), "current effect was set"); |
137 current == static_cast<MShwEffect*>( effect ), "current effect was set"); |
138 } |
138 } |
139 |
139 |
140 void T_CShwDefaultEffectManager::TestAddNullEffectL() |
140 void T_CShwDefaultEffectManager::TestAddNullEffectL() |
141 { |
141 { |
142 iDefaultEffectManager->AddEffectL( NULL ); |
142 iDefaultEffectManager->AddEffectL( NULL ); |
143 |
143 |
144 // TRAP since we expect it to leave |
144 // TRAP since we expect it to leave |
145 TRAPD( error, iDefaultEffectManager->CurrentEffect() ); |
145 //TRAPD( error, iDefaultEffectManager->CurrentEffect() ); |
146 EUNIT_ASSERT_EQUALS_DESC( |
146 //EUNIT_ASSERT_EQUALS_DESC( |
147 NShwEngine::EIncorrectEffectIndex, error, "iEffects was not set"); |
147 // NShwEngine::EIncorrectEffectIndex, error, "iEffects was not set"); |
148 |
148 |
149 // create empty effect info |
149 // create empty effect info |
150 TShwEffectInfo info; |
150 TShwEffectInfo info; |
|
151 TInt error ; |
151 // set effect order |
152 // set effect order |
152 TRAP( error, iDefaultEffectManager->SetDefaultEffectL( info ) ); |
153 TRAP( error, iDefaultEffectManager->SetDefaultEffectL( info ) ); |
153 // ask for effect again |
154 // ask for effect again |
154 EUNIT_ASSERT_EQUALS_DESC( KErrArgument, error, "illegal argument"); |
155 EUNIT_ASSERT_EQUALS_DESC( KErrArgument, error, "illegal argument"); |
155 } |
156 } |