os/mm/imagingandcamerafws/cameraunittest/src/TSU_ECM_ADV/ECamImageProcessingTest.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
sl@0
     2
// ECamImageProcessingTest.cpp
sl@0
     3
sl@0
     4
// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     5
// All rights reserved.
sl@0
     6
// This component and the accompanying materials are made available
sl@0
     7
// under the terms of "Eclipse Public License v1.0"
sl@0
     8
// which accompanies this distribution, and is available
sl@0
     9
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
    10
//
sl@0
    11
// Initial Contributors:
sl@0
    12
// Nokia Corporation - initial contribution.
sl@0
    13
//
sl@0
    14
// Contributors:
sl@0
    15
//
sl@0
    16
// Description:
sl@0
    17
//
sl@0
    18
sl@0
    19
#include "ECamImageProcessingTest.h"
sl@0
    20
#include <ecamadvsettings.h>
sl@0
    21
#include <ecam/ecamplugin.h>
sl@0
    22
#include <ecamuids.hrh>
sl@0
    23
#include <ecom/ecomresolverparams.h>
sl@0
    24
#include "ECamUnitTestPluginUids.hrh"
sl@0
    25
#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
sl@0
    26
#include <ecamimageprocessingconst.h>
sl@0
    27
#endif
sl@0
    28
sl@0
    29
sl@0
    30
sl@0
    31
//const TRect KRect1(100, 50, 600, 200);
sl@0
    32
const TInt  KValue = 100; 
sl@0
    33
const TInt  KBaselinedEffects = 0x000001FF;
sl@0
    34
//
sl@0
    35
// RECamImageProcessingTest
sl@0
    36
//
sl@0
    37
sl@0
    38
RECamImageProcessingTest* RECamImageProcessingTest::NewL(TBool aAllocTest)
sl@0
    39
	{
sl@0
    40
	RECamImageProcessingTest* self = new (ELeave) RECamImageProcessingTest(aAllocTest);
sl@0
    41
	return self;	
sl@0
    42
	}
sl@0
    43
	
sl@0
    44
RECamImageProcessingTest::RECamImageProcessingTest(TBool /*aAllocTest*/)
sl@0
    45
	{
sl@0
    46
	iTestStepName = _L("MM-ECM-ADV-U-007-HP");
sl@0
    47
	}
sl@0
    48
sl@0
    49
TVerdict RECamImageProcessingTest::DoTestStepL()	
sl@0
    50
	{
sl@0
    51
	TVerdict verdict = EFail;
sl@0
    52
	INFO_PRINTF1(_L("Alloc test"));
sl@0
    53
	TInt i;
sl@0
    54
	TInt err;
sl@0
    55
	for (i = 1 ; ; i++)
sl@0
    56
		{
sl@0
    57
		__MM_HEAP_MARK;
sl@0
    58
		
sl@0
    59
		if (i % 5 == 0)
sl@0
    60
			{
sl@0
    61
			INFO_PRINTF2(_L("Fail count = %d"), i);
sl@0
    62
			}
sl@0
    63
sl@0
    64
		__UHEAP_SETFAIL(RHeap::EFailNext, i);
sl@0
    65
sl@0
    66
		TRAP(err, verdict = DoImageProcessingTestStepL());
sl@0
    67
sl@0
    68
		TAny* testAlloc = User::Alloc(1);
sl@0
    69
		TBool heapTestingComplete = (testAlloc == NULL) && (err==KErrNone);
sl@0
    70
		User::Free(testAlloc);
sl@0
    71
sl@0
    72
		__UHEAP_RESET;
sl@0
    73
		__MM_HEAP_MARKEND;
sl@0
    74
sl@0
    75
		if ((err != KErrNoMemory ) || heapTestingComplete)
sl@0
    76
			{
sl@0
    77
			INFO_PRINTF4(_L("err = %d, verdict = %d, Fail count = %d"), err, verdict, i);
sl@0
    78
			INFO_PRINTF1(_L("Alloc testing completed successfully"));
sl@0
    79
			verdict = EPass;
sl@0
    80
			break;
sl@0
    81
			}
sl@0
    82
		}
sl@0
    83
	return verdict;
sl@0
    84
	}
sl@0
    85
	
sl@0
    86
TVerdict RECamImageProcessingTest::DoImageProcessingTestStepL()
sl@0
    87
	{	
sl@0
    88
	TVerdict result = EPass;
sl@0
    89
	CCamera* camera = NULL;
sl@0
    90
	
sl@0
    91
	TInt error = KErrNone;
sl@0
    92
	CCamera::CCameraImageProcessing* imageprocess = NULL;
sl@0
    93
	
sl@0
    94
	// using observer 2 
sl@0
    95
	MCameraObserver2* observer2 = NULL;
sl@0
    96
	
sl@0
    97
	__MM_HEAP_MARK;
sl@0
    98
	INFO_PRINTF1(_L("Create camera using Camera::New2L() and MCameraObserver2"));
sl@0
    99
	
sl@0
   100
	TRAP(error, camera = CCamera::New2L(*observer2, 0,0));
sl@0
   101
	
sl@0
   102
	if (error==KErrNone)
sl@0
   103
		{
sl@0
   104
		CleanupStack::PushL(camera);
sl@0
   105
		INFO_PRINTF1(_L("KErrNone return from CCamera::New2L()"));
sl@0
   106
		imageprocess = 	static_cast<CCamera::CCameraImageProcessing*> (camera->CustomInterface(KECamImageProcessingUid));
sl@0
   107
	    if (imageprocess!= NULL)
sl@0
   108
	    	{
sl@0
   109
	    	CleanupStack::PushL(imageprocess);
sl@0
   110
	    	INFO_PRINTF1(_L("CCameraImageProcessing object was created")); 
sl@0
   111
	    	CleanupStack::PopAndDestroy(imageprocess);
sl@0
   112
	    	}
sl@0
   113
	    else
sl@0
   114
    		{
sl@0
   115
    		result = EFail;
sl@0
   116
    		User::Leave(KErrNoMemory);
sl@0
   117
    		}	
sl@0
   118
		CleanupStack::PopAndDestroy(camera);
sl@0
   119
		}
sl@0
   120
	else 
sl@0
   121
		{
sl@0
   122
		INFO_PRINTF2(_L("Unexpected %d return from CCamera::New2L(): observer 2"), error);
sl@0
   123
		result = EFail;		
sl@0
   124
		User::Leave(KErrNoMemory);
sl@0
   125
		}
sl@0
   126
	__MM_HEAP_MARKEND;
sl@0
   127
sl@0
   128
	// create a imageprocessing object using New2L
sl@0
   129
	__MM_HEAP_MARK;
sl@0
   130
	INFO_PRINTF1(_L("Create camera using Camera::New2L() and MCameraObserver2"));
sl@0
   131
	
sl@0
   132
	TRAP(error, camera = CCamera::New2L(*observer2, 0,0));
sl@0
   133
sl@0
   134
	if (error==KErrNone)
sl@0
   135
		{
sl@0
   136
		CleanupStack::PushL(camera);
sl@0
   137
		INFO_PRINTF1(_L("KErrNone return from CCamera::New2L()"));
sl@0
   138
		TRAP(error, imageprocess  = CCamera::CCameraImageProcessing::NewL(*camera));
sl@0
   139
		
sl@0
   140
		if (error==KErrNone)	
sl@0
   141
	    	{
sl@0
   142
	    	CleanupStack::PushL(imageprocess);
sl@0
   143
	  		INFO_PRINTF1(_L("CCameraImageProcessing object was created using NewL")); 
sl@0
   144
	    	CleanupStack::PopAndDestroy(imageprocess);
sl@0
   145
	    	}
sl@0
   146
	    else
sl@0
   147
    		{
sl@0
   148
    		INFO_PRINTF1(_L("CCameraImageProcessing object was not created using NewL")); 
sl@0
   149
    		result = EFail;
sl@0
   150
    		User::Leave(KErrNoMemory);
sl@0
   151
    		}	
sl@0
   152
		CleanupStack::PopAndDestroy(camera);
sl@0
   153
		}
sl@0
   154
	else 
sl@0
   155
		{
sl@0
   156
		INFO_PRINTF2(_L("Unexpected %d return from CCamera::New2L(): observer 2"), error);
sl@0
   157
		result = EFail;		
sl@0
   158
		User::Leave(KErrNoMemory);
sl@0
   159
		}
sl@0
   160
	__MM_HEAP_MARKEND;
sl@0
   161
   
sl@0
   162
	return result;
sl@0
   163
	}
sl@0
   164
	
sl@0
   165
//
sl@0
   166
// RECamImageProcDefaultsTest //
sl@0
   167
//
sl@0
   168
sl@0
   169
RECamImageProcDefaultsTest* RECamImageProcDefaultsTest::NewL(TBool aAllocTest)
sl@0
   170
	{
sl@0
   171
	RECamImageProcDefaultsTest* self = new (ELeave) RECamImageProcDefaultsTest(aAllocTest);
sl@0
   172
	return self;	
sl@0
   173
	}
sl@0
   174
	
sl@0
   175
RECamImageProcDefaultsTest::RECamImageProcDefaultsTest(TBool)
sl@0
   176
	{
sl@0
   177
	iTestStepName = _L("MM-ECM-ADV-U-012-HP");
sl@0
   178
	}
sl@0
   179
	
sl@0
   180
TBool RECamImageProcDefaultsTest::CompareUidArrays(RArray<TUid>& firstArray, RArray<TUid>& secondArray)
sl@0
   181
	{
sl@0
   182
	TBool result = ETrue;
sl@0
   183
	
sl@0
   184
	if (firstArray.Count() != secondArray.Count())
sl@0
   185
		{
sl@0
   186
		result = EFalse;
sl@0
   187
		}
sl@0
   188
	else
sl@0
   189
		{
sl@0
   190
		for (TInt expected = 0; expected < firstArray.Count(); expected++)
sl@0
   191
		    {
sl@0
   192
			result = EFalse;
sl@0
   193
			for (TInt actual = 0; actual < secondArray.Count(); actual++)
sl@0
   194
				{
sl@0
   195
				if (secondArray[actual] == firstArray[expected])
sl@0
   196
					{
sl@0
   197
					result = ETrue;
sl@0
   198
					break;
sl@0
   199
					}				
sl@0
   200
				}
sl@0
   201
			}
sl@0
   202
		}
sl@0
   203
	return result;
sl@0
   204
	}	
sl@0
   205
	
sl@0
   206
TVerdict RECamImageProcDefaultsTest::DoTestStepL()
sl@0
   207
	{	
sl@0
   208
	TVerdict result = EPass;
sl@0
   209
	CCamera* camera = NULL;
sl@0
   210
	
sl@0
   211
	TInt error = KErrNone;
sl@0
   212
	CCamera::CCameraImageProcessing* imageprocess = NULL;
sl@0
   213
	
sl@0
   214
	__MM_HEAP_MARK;
sl@0
   215
	INFO_PRINTF1(_L("Create camera using Camera::New2L() and MCameraObserver2"));
sl@0
   216
	
sl@0
   217
	TRAP(error, camera = CCamera::New2L(*this,0,0));
sl@0
   218
	
sl@0
   219
	if (error==KErrNone)
sl@0
   220
		{
sl@0
   221
		CleanupStack::PushL(camera);
sl@0
   222
		INFO_PRINTF1(_L("KErrNone return from CCamera::New2L()"));
sl@0
   223
		imageprocess = 	static_cast<CCamera::CCameraImageProcessing*> (camera->CustomInterface(KECamImageProcessingUid));
sl@0
   224
	    if (imageprocess!= NULL)
sl@0
   225
	    	{
sl@0
   226
	    	CleanupStack::PushL(imageprocess);
sl@0
   227
sl@0
   228
	    	// Supported Transformations
sl@0
   229
			RArray<TUid> expectedTransfUids;	    	
sl@0
   230
			CleanupClosePushL(expectedTransfUids);
sl@0
   231
	    	expectedTransfUids.Reset();	    			
sl@0
   232
	    	// set the expected UIDS
sl@0
   233
			expectedTransfUids.AppendL(KUidECamEventImageProcessingAdjustBrightness);
sl@0
   234
			expectedTransfUids.AppendL(KUidECamEventImageProcessingAdjustContrast);
sl@0
   235
			expectedTransfUids.AppendL(KUidECamEventImageProcessingEffect);	    	
sl@0
   236
	    	RArray<TUid> suppTransfUids; 
sl@0
   237
	    	CleanupClosePushL(suppTransfUids);
sl@0
   238
	    	imageprocess->GetSupportedTransformationsL(suppTransfUids);
sl@0
   239
	    	if (CompareUidArrays(expectedTransfUids, suppTransfUids) == EFalse)
sl@0
   240
				{
sl@0
   241
				INFO_PRINTF1(_L("GetSupportedTransformationsL failed"));
sl@0
   242
				result = EFail;
sl@0
   243
				}
sl@0
   244
	    	expectedTransfUids.Reset();
sl@0
   245
	    	suppTransfUids.Reset();	    		    	
sl@0
   246
			CleanupStack::PopAndDestroy(2, &expectedTransfUids); //suppTransfUids
sl@0
   247
sl@0
   248
		    // Active Transformations
sl@0
   249
	    	RArray<TUid> expectedActTransfUids; 
sl@0
   250
	    	CleanupClosePushL(expectedActTransfUids);
sl@0
   251
	    	expectedActTransfUids.Reset();	    
sl@0
   252
	    	// set the expected UIDS
sl@0
   253
			expectedActTransfUids.AppendL(KUidECamEventImageProcessingAdjustBrightness);
sl@0
   254
			expectedActTransfUids.AppendL(KUidECamEventImageProcessingAdjustContrast);
sl@0
   255
			expectedActTransfUids.AppendL(KUidECamEventImageProcessingEffect);	    	
sl@0
   256
	    	RArray<TUid> actTransfUids; 
sl@0
   257
	    	CleanupClosePushL(actTransfUids);
sl@0
   258
	    	actTransfUids.Reset();	 	    	
sl@0
   259
	    	imageprocess->GetActiveTransformationsL(actTransfUids);
sl@0
   260
 	    	if (CompareUidArrays(expectedActTransfUids, actTransfUids) == EFalse)
sl@0
   261
				{
sl@0
   262
				INFO_PRINTF1(_L("GetActiveTransformationsL failed"));
sl@0
   263
				result = EFail;
sl@0
   264
				}
sl@0
   265
			CleanupStack::PopAndDestroy(2, &expectedActTransfUids); //actTransfUids
sl@0
   266
		    
sl@0
   267
		    // Set & Get Active Transformation Sequence
sl@0
   268
	    	RArray<TUid> expectedTransfSequence; 
sl@0
   269
	    	CleanupClosePushL(expectedTransfSequence);
sl@0
   270
	    	expectedTransfSequence.Reset();	    	
sl@0
   271
			expectedTransfSequence.Append(KUidECamEventImageProcessingAdjustBrightness);	   
sl@0
   272
sl@0
   273
			imageprocess->SetActiveTransformSequenceL(expectedTransfSequence);
sl@0
   274
			
sl@0
   275
	    	RArray<TUid> actTransfSequence; 
sl@0
   276
	    	CleanupClosePushL(actTransfSequence);
sl@0
   277
	    	actTransfSequence.Reset();    		    		    	
sl@0
   278
			imageprocess->GetActiveTransformSequenceL(actTransfSequence);
sl@0
   279
 	    	if (CompareUidArrays(expectedTransfSequence, actTransfSequence) == EFalse)
sl@0
   280
				{
sl@0
   281
				INFO_PRINTF1(_L("GetActiveTransformSequenceL failed"));
sl@0
   282
				result = EFail;
sl@0
   283
				}
sl@0
   284
			CleanupStack::PopAndDestroy(2, &expectedTransfSequence); //actTransfSequence
sl@0
   285
sl@0
   286
		    // Get & Set Transformation
sl@0
   287
	    	TUid iInputEventUid = KUidECamEventImageProcessingAdjustBrightness;
sl@0
   288
	        TInt aSetValue = 4;
sl@0
   289
	    	imageprocess->SetTransformationValue(iInputEventUid, aSetValue);
sl@0
   290
sl@0
   291
	    	CheckNotification(iInputEventUid, result);
sl@0
   292
    			
sl@0
   293
		    // Check that value has actually changed.
sl@0
   294
	    	TInt aGetValue = imageprocess->TransformationValue(iInputEventUid);
sl@0
   295
 	    	if (aSetValue != aGetValue)
sl@0
   296
				{
sl@0
   297
				INFO_PRINTF3(_L("Got wrong TransformationValue set %d, got %d"), aSetValue, aGetValue);
sl@0
   298
				result = EFail;
sl@0
   299
				}
sl@0
   300
			else
sl@0
   301
				{
sl@0
   302
				INFO_PRINTF2(_L("Transformation value set to %d"), aSetValue);					
sl@0
   303
				}	    
sl@0
   304
				
sl@0
   305
			TInt aGetValue1 = 0;
sl@0
   306
			TInt err = imageprocess->GetTransformationValue(iInputEventUid, aGetValue1);
sl@0
   307
			
sl@0
   308
			if(err)
sl@0
   309
				{
sl@0
   310
				INFO_PRINTF2(_L("New method for Getting Transformation value returned error %d"), err);
sl@0
   311
				result = EFail;
sl@0
   312
				}
sl@0
   313
				
sl@0
   314
			if(aGetValue1 != aGetValue)
sl@0
   315
				{
sl@0
   316
				INFO_PRINTF1(_L("New and old method for Getting Transformation value  retrieves wrong/dissimilar values"));
sl@0
   317
				result = EFail;
sl@0
   318
				}
sl@0
   319
				
sl@0
   320
			//Set Effect Transformation with color swap
sl@0
   321
			iInputEventUid = KUidECamEventImageProcessingEffect;
sl@0
   322
			RArray<TInt> supportedEffects;
sl@0
   323
					
sl@0
   324
	    	TValueInfo info = ENotActive;
sl@0
   325
	    	imageprocess->GetTransformationSupportedValuesL(iInputEventUid, supportedEffects, info);
sl@0
   326
	    	
sl@0
   327
	    	TInt effects = supportedEffects[0];
sl@0
   328
			supportedEffects.Close();
sl@0
   329
	    	
sl@0
   330
	    	if(info != EBitField)
sl@0
   331
	    		{
sl@0
   332
	    		INFO_PRINTF1(_L("Incorrect TValueInfo provided"));
sl@0
   333
				result = EFail;
sl@0
   334
	    		}
sl@0
   335
	    		
sl@0
   336
	    	if(effects & CCamera::CCameraImageProcessing::EEffectColorSwap)
sl@0
   337
	        	{	
sl@0
   338
	        	imageprocess->SetTransformationValue(iInputEventUid, CCamera::CCameraImageProcessing::EEffectColorSwap);	
sl@0
   339
	        	
sl@0
   340
	        	CheckNotification(iInputEventUid, result);
sl@0
   341
	        	}
sl@0
   342
	       
sl@0
   343
	        // Check that value has actually changed.
sl@0
   344
	    	aGetValue = imageprocess->TransformationValue(iInputEventUid);
sl@0
   345
 	    	if (aGetValue != static_cast<TInt>(CCamera::CCameraImageProcessing::EEffectColorSwap))
sl@0
   346
				{
sl@0
   347
				INFO_PRINTF1(_L("Got wrong TransformationValue set"));
sl@0
   348
				result = EFail;
sl@0
   349
				}
sl@0
   350
			else
sl@0
   351
				{
sl@0
   352
				INFO_PRINTF1(_L("Transformation value set to EEffectColorSwap"));					
sl@0
   353
				}
sl@0
   354
			
sl@0
   355
			TInt concurrentColorSwappingSupported=0;	
sl@0
   356
			imageprocess->GetConcurrentColorSwappingsSupportedL(concurrentColorSwappingSupported);
sl@0
   357
	        
sl@0
   358
	        if(concurrentColorSwappingSupported > 0)
sl@0
   359
	        	{
sl@0
   360
	        	TestColorSwapL(imageprocess, result);
sl@0
   361
	        	}
sl@0
   362
	        	
sl@0
   363
			//Set Effect Transformation with color accent
sl@0
   364
			iInputEventUid = iInputEventUid = KUidECamEventImageProcessingEffect;
sl@0
   365
			if(effects & CCamera::CCameraImageProcessing::EEffectColorAccent)
sl@0
   366
	        	{	
sl@0
   367
	        	imageprocess->SetTransformationValue(iInputEventUid, CCamera::CCameraImageProcessing::EEffectColorAccent);	
sl@0
   368
	        
sl@0
   369
	        	CheckNotification(iInputEventUid, result);
sl@0
   370
	        	}
sl@0
   371
	        	
sl@0
   372
	        // Check that value has actually changed.
sl@0
   373
	    	aGetValue = imageprocess->TransformationValue(iInputEventUid);
sl@0
   374
 	    	if (aGetValue != static_cast<TInt>(CCamera::CCameraImageProcessing::EEffectColorAccent))
sl@0
   375
				{
sl@0
   376
				INFO_PRINTF1(_L("Got wrong TransformationValue set"));
sl@0
   377
				result = EFail;
sl@0
   378
				}
sl@0
   379
			else
sl@0
   380
				{
sl@0
   381
				INFO_PRINTF1(_L("Transformation value set to EEffectColorAccent"));					
sl@0
   382
				}
sl@0
   383
			
sl@0
   384
			TInt concurrentColorAccentSupported=0;	
sl@0
   385
			imageprocess->GetConcurrentColorAccentSupportedL(concurrentColorAccentSupported);
sl@0
   386
	        
sl@0
   387
	        if(concurrentColorAccentSupported > 0)
sl@0
   388
	        	{
sl@0
   389
	        	TestColorAccentL(imageprocess, result);
sl@0
   390
	        	}
sl@0
   391
	    	
sl@0
   392
		    // Get & Set Source Rect
sl@0
   393
			TRect setRect(100, 50, 600, 200);
sl@0
   394
			TRect getRect;
sl@0
   395
	    	imageprocess->SetSourceRect(setRect);
sl@0
   396
			imageprocess->GetSourceRect(getRect);
sl@0
   397
			if (setRect != getRect)
sl@0
   398
				{
sl@0
   399
				INFO_PRINTF1(_L("Did not get the same rect"));
sl@0
   400
				result = EFail;
sl@0
   401
				}
sl@0
   402
			
sl@0
   403
			CCamera::CCameraImageProcessing::TOrientationReference orientationReference = 
sl@0
   404
						CCamera::CCameraImageProcessing::EOrientationReferenceCameraSensorOrientation;	
sl@0
   405
			TUint supportedRelativeRotation=0;
sl@0
   406
			TUint supportedRelativeMirroring=0;
sl@0
   407
			TUint supportedRelativeFlipping=0;
sl@0
   408
			
sl@0
   409
			INFO_PRINTF1(_L("GetSupportedRelativeOrientationOptionsL method invocation"));
sl@0
   410
sl@0
   411
			TRAP(err,imageprocess->GetSupportedRelativeOrientationOptionsL(orientationReference, 
sl@0
   412
		supportedRelativeRotation, supportedRelativeMirroring, supportedRelativeFlipping));	
sl@0
   413
			
sl@0
   414
			if(err!= KErrNotSupported)
sl@0
   415
				{
sl@0
   416
				INFO_PRINTF1(_L("GetSupportedRelativeOrientationOptionsL did not leave with KErrNotSupported"));
sl@0
   417
				result = EFail;
sl@0
   418
				}
sl@0
   419
			
sl@0
   420
			CCamera::CCameraImageProcessing::TRelativeRotation relativeRotation = 
sl@0
   421
					CCamera::CCameraImageProcessing::ERelativeRotation0Degrees;
sl@0
   422
			
sl@0
   423
			CCamera::CCameraImageProcessing::TRelativeMirror relativeMirror = 
sl@0
   424
					CCamera::CCameraImageProcessing::ERelativeMirrorNone;
sl@0
   425
					
sl@0
   426
			CCamera::CCameraImageProcessing::TRelativeFlipping relativeFlipping = 
sl@0
   427
					CCamera::CCameraImageProcessing::ERelativeFlippingNone;
sl@0
   428
			
sl@0
   429
			INFO_PRINTF1(_L("GetCurrentRelativeOrientationOptionsL method invocation"));
sl@0
   430
			TRAP(err,imageprocess->GetCurrentRelativeOrientationOptionsL(orientationReference, 
sl@0
   431
								relativeRotation, relativeMirror, relativeFlipping));	
sl@0
   432
			
sl@0
   433
			if(err!= KErrNotSupported)
sl@0
   434
				{
sl@0
   435
				INFO_PRINTF1(_L("GetCurrentRelativeOrientationOptionsL did not leave with KErrNotSupported"));
sl@0
   436
				result = EFail;
sl@0
   437
				}
sl@0
   438
			
sl@0
   439
			INFO_PRINTF1(_L("SetRelativeOrientationOptionsL method invocation"));
sl@0
   440
			iInputEventUid = KUidECamEventImageProcessingTransformRelativeOrientation;
sl@0
   441
			imageprocess->SetRelativeOrientationOptionsL(orientationReference, 
sl@0
   442
						relativeRotation, relativeMirror, relativeFlipping);
sl@0
   443
	    	
sl@0
   444
	    	CheckNotificationNeg(iInputEventUid, result);
sl@0
   445
	    	
sl@0
   446
	    	CleanupStack::PopAndDestroy(imageprocess);
sl@0
   447
	    	}
sl@0
   448
	    else
sl@0
   449
    		{
sl@0
   450
    		result = EFail;
sl@0
   451
    		}	
sl@0
   452
		CleanupStack::PopAndDestroy(camera);
sl@0
   453
		}
sl@0
   454
	else 
sl@0
   455
		{
sl@0
   456
		INFO_PRINTF2(_L("Unexpected %d return from CCamera::New2L(): observer 2"), error);
sl@0
   457
		result = EFail;		
sl@0
   458
		}
sl@0
   459
	__MM_HEAP_MARKEND;
sl@0
   460
sl@0
   461
	return result;
sl@0
   462
	}
sl@0
   463
	
sl@0
   464
void RECamImageProcDefaultsTest::TestColorSwapL(CCamera::CCameraImageProcessing* aImageProcess, TVerdict& aResult)
sl@0
   465
	{
sl@0
   466
	CCamera::CCameraImageProcessing::TColorOperationCapabilities colorSwapCapabilities;
sl@0
   467
	aImageProcess->GetColorSwapCapabilitiesL(0, colorSwapCapabilities);
sl@0
   468
	
sl@0
   469
	if(!colorSwapCapabilities.iIsCapabilityUniform)
sl@0
   470
		{
sl@0
   471
		INFO_PRINTF1(_L("Non Uniform entries for color swap"));
sl@0
   472
		}
sl@0
   473
		        	
sl@0
   474
	//fill the parameters for color swap entry 
sl@0
   475
	CCamera::CCameraImageProcessing::TColorOperationEntry colorSwapParameters;
sl@0
   476
	
sl@0
   477
	colorSwapParameters.iSourceColor.SetGreen(KValue);
sl@0
   478
	colorSwapParameters.iTargetColor.SetBlue(KValue);
sl@0
   479
sl@0
   480
	colorSwapParameters.iSourceColorRepresentation = CCamera::CCameraImageProcessing::ERepresentationSingle;
sl@0
   481
	colorSwapParameters.iTargetColorRepresentation = CCamera::CCameraImageProcessing::ERepresentationSingle;
sl@0
   482
	
sl@0
   483
	colorSwapParameters.iColorOperationSourceRgbGroupingMode = CCamera::CCameraImageProcessing::ERgbGroupingFixed;
sl@0
   484
	colorSwapParameters.iColorOperationTargetRgbGroupingMode = CCamera::CCameraImageProcessing::ERgbGroupingFixed;
sl@0
   485
	
sl@0
   486
	//set the entry
sl@0
   487
	iInputEventUid = KUidECamEvent2CIPSetColorSwapEntry;
sl@0
   488
	aImageProcess->SetColorSwapEntryL(0, colorSwapParameters);
sl@0
   489
	
sl@0
   490
	CheckNotificationImgProc(iInputEventUid, 0, aResult);
sl@0
   491
	
sl@0
   492
	//check the entry status
sl@0
   493
	CCamera::CCameraImageProcessing::TColorOperationEntry getColorSwapParameters;
sl@0
   494
	aImageProcess->GetColorSwapEntryL(0, getColorSwapParameters);
sl@0
   495
	
sl@0
   496
	if(getColorSwapParameters.iEntryStatus != EDiscreteSteps)
sl@0
   497
		{
sl@0
   498
		INFO_PRINTF1(_L("Entry status set incorrectly"));
sl@0
   499
		aResult = EFail;
sl@0
   500
		}
sl@0
   501
	else
sl@0
   502
		{
sl@0
   503
		INFO_PRINTF1(_L("Entry status set correctly"));	
sl@0
   504
		}
sl@0
   505
	
sl@0
   506
	//start the color swap process
sl@0
   507
	iInputEventUid = KUidECamEventCIPStartColorSwap;
sl@0
   508
	aImageProcess->StartColorSwappingL();
sl@0
   509
	
sl@0
   510
	//try to cancel it
sl@0
   511
	aImageProcess->CancelColorSwappingL();
sl@0
   512
	
sl@0
   513
	CheckNotification(iInputEventUid, aResult);
sl@0
   514
	
sl@0
   515
	//remove the entry
sl@0
   516
	iInputEventUid = KUidECamEventCIPRemoveColorSwapEntry;
sl@0
   517
	aImageProcess->RemoveColorSwapEntryL(0);
sl@0
   518
	CheckNotificationImgProc(iInputEventUid, 0, aResult);
sl@0
   519
	
sl@0
   520
	//check the entry status
sl@0
   521
	aImageProcess->GetColorSwapEntryL(0, getColorSwapParameters);
sl@0
   522
	
sl@0
   523
	if(getColorSwapParameters.iEntryStatus != ENotActive)
sl@0
   524
		{
sl@0
   525
		INFO_PRINTF1(_L("Entry status set incorrectly"));
sl@0
   526
		aResult = EFail;
sl@0
   527
		}
sl@0
   528
	else
sl@0
   529
		{
sl@0
   530
		INFO_PRINTF1(_L("Entry status set correctly"));	
sl@0
   531
		}
sl@0
   532
	}
sl@0
   533
	
sl@0
   534
void RECamImageProcDefaultsTest::TestColorAccentL(CCamera::CCameraImageProcessing* aImageProcess, TVerdict& aResult)
sl@0
   535
	{
sl@0
   536
	CCamera::CCameraImageProcessing::TColorOperationCapabilities colorAccentCapabilities;
sl@0
   537
	aImageProcess->GetColorAccentCapabilitiesL(0, colorAccentCapabilities);
sl@0
   538
	
sl@0
   539
	if(!colorAccentCapabilities.iIsCapabilityUniform)
sl@0
   540
		{
sl@0
   541
		INFO_PRINTF1(_L("Non Uniform entries for color accent"));
sl@0
   542
		}
sl@0
   543
	
sl@0
   544
	//fill the parameters for color swap entry 
sl@0
   545
	CCamera::CCameraImageProcessing::TColorOperationEntry colorAccentParameters;
sl@0
   546
	
sl@0
   547
	colorAccentParameters.iSourceColor.SetGreen(KValue);
sl@0
   548
	colorAccentParameters.iSourceColorRepresentation = CCamera::CCameraImageProcessing::ERepresentationSingle;
sl@0
   549
	colorAccentParameters.iColorOperationSourceRgbGroupingMode = CCamera::CCameraImageProcessing::ERgbGroupingFixed;
sl@0
   550
	
sl@0
   551
	//set the entry
sl@0
   552
	iInputEventUid = KUidECamEventCIPSetColorAccentEntry;
sl@0
   553
	aImageProcess->SetColorAccentEntryL(0, colorAccentParameters);
sl@0
   554
	
sl@0
   555
	CheckNotificationImgProc(iInputEventUid, 0, aResult);
sl@0
   556
	
sl@0
   557
	//check the entry status
sl@0
   558
	CCamera::CCameraImageProcessing::TColorOperationEntry getColorAccentParameters;
sl@0
   559
	aImageProcess->GetColorAccentEntryL(0, getColorAccentParameters);
sl@0
   560
	
sl@0
   561
	if(getColorAccentParameters.iEntryStatus != EDiscreteSteps)
sl@0
   562
		{
sl@0
   563
		INFO_PRINTF1(_L("Entry status set incorrectly"));
sl@0
   564
		aResult = EFail;
sl@0
   565
		}
sl@0
   566
	else
sl@0
   567
		{
sl@0
   568
		INFO_PRINTF1(_L("Entry status set correctly"));	
sl@0
   569
		}
sl@0
   570
	
sl@0
   571
	//start the color accent process
sl@0
   572
	iInputEventUid = KUidECamEventCIPStartColorAccent;
sl@0
   573
	aImageProcess->StartColorAccentL();
sl@0
   574
	
sl@0
   575
	//try to cancel it
sl@0
   576
	aImageProcess->CancelColorAccentL();
sl@0
   577
	
sl@0
   578
	CheckNotification(iInputEventUid, aResult);
sl@0
   579
	
sl@0
   580
	//remove the entry
sl@0
   581
	iInputEventUid = KUidECamEventCIPRemoveColorAccentEntry;
sl@0
   582
	aImageProcess->RemoveColorAccentEntryL(0);
sl@0
   583
	CheckNotificationImgProc(iInputEventUid, 0, aResult);
sl@0
   584
	
sl@0
   585
	//check the entry status
sl@0
   586
	aImageProcess->GetColorAccentEntryL(0, getColorAccentParameters);
sl@0
   587
	
sl@0
   588
	if(getColorAccentParameters.iEntryStatus != ENotActive)
sl@0
   589
		{
sl@0
   590
		INFO_PRINTF1(_L("Entry status set incorrectly"));
sl@0
   591
		aResult = EFail;
sl@0
   592
		}
sl@0
   593
	else
sl@0
   594
		{
sl@0
   595
		INFO_PRINTF1(_L("Entry status set correctly"));	
sl@0
   596
		}
sl@0
   597
	}
sl@0
   598
	
sl@0
   599
//
sl@0
   600
// RECamImageProcRangesTest //
sl@0
   601
//
sl@0
   602
sl@0
   603
RECamImageProcRangesTest* RECamImageProcRangesTest::NewL(TBool aAllocTest)
sl@0
   604
	{
sl@0
   605
	RECamImageProcRangesTest* self = new (ELeave) RECamImageProcRangesTest(aAllocTest);
sl@0
   606
	return self;	
sl@0
   607
	}
sl@0
   608
	
sl@0
   609
RECamImageProcRangesTest::RECamImageProcRangesTest(TBool)
sl@0
   610
	{
sl@0
   611
	iTestStepName = _L("MM-ECM-ADV-U-013-HP");
sl@0
   612
	}
sl@0
   613
	
sl@0
   614
TVerdict RECamImageProcRangesTest::DoTestStepL()
sl@0
   615
	{	
sl@0
   616
	TVerdict result = EPass;
sl@0
   617
	CCamera* camera = NULL;
sl@0
   618
	
sl@0
   619
	TInt error = KErrNone;
sl@0
   620
	CCamera::CCameraImageProcessing* imageprocess = NULL;
sl@0
   621
	
sl@0
   622
	__MM_HEAP_MARK;
sl@0
   623
	INFO_PRINTF1(_L("Create camera using Camera::New2L() and MCameraObserver2"));
sl@0
   624
	
sl@0
   625
	TRAP(error, camera = CCamera::New2L(*this,0,0));
sl@0
   626
	
sl@0
   627
	if (error==KErrNone)
sl@0
   628
		{
sl@0
   629
		CleanupStack::PushL(camera);
sl@0
   630
		INFO_PRINTF1(_L("KErrNone return from CCamera::New2L()"));
sl@0
   631
		imageprocess = 	static_cast<CCamera::CCameraImageProcessing*> (camera->CustomInterface(KECamImageProcessingUid));
sl@0
   632
	    if (imageprocess!= NULL)
sl@0
   633
	    	{
sl@0
   634
	    	CleanupStack::PushL(imageprocess);
sl@0
   635
	    
sl@0
   636
		    // Get Transformation Supported Values for brightness
sl@0
   637
	    	iInputEventUid = KUidECamEventImageProcessingAdjustBrightness;
sl@0
   638
	    	RArray<TInt> transfSuppValues; 
sl@0
   639
	    	CleanupClosePushL(transfSuppValues);
sl@0
   640
	    	transfSuppValues.Reset();	 	    	
sl@0
   641
			TValueInfo valueInfo;
sl@0
   642
			imageprocess->GetTransformationSupportedValuesL(iInputEventUid, transfSuppValues, valueInfo);
sl@0
   643
sl@0
   644
		    // Set a non supported Transformation value
sl@0
   645
	        TInt aSetValue = 0;
sl@0
   646
	    	imageprocess->SetTransformationValue(iInputEventUid, aSetValue);
sl@0
   647
sl@0
   648
	        CheckNotification(iInputEventUid, result);
sl@0
   649
    				    	
sl@0
   650
	    	TInt aGetValue =imageprocess->TransformationValue(iInputEventUid);
sl@0
   651
 	    	if (aSetValue != aGetValue)
sl@0
   652
				{
sl@0
   653
				INFO_PRINTF3(_L("Set unsupported TransformationValue set %d, get %d"), aSetValue, aGetValue);
sl@0
   654
				result = EFail;
sl@0
   655
				}	    
sl@0
   656
			CleanupStack::PopAndDestroy(&transfSuppValues); 
sl@0
   657
				
sl@0
   658
	    	CleanupStack::PopAndDestroy(imageprocess);
sl@0
   659
		  	}
sl@0
   660
	    else
sl@0
   661
    		{
sl@0
   662
    		result = EFail;
sl@0
   663
    		}	
sl@0
   664
		CleanupStack::PopAndDestroy(camera);
sl@0
   665
		}
sl@0
   666
	else 
sl@0
   667
		{
sl@0
   668
		INFO_PRINTF2(_L("Unexpected %d return from CCamera::New2L(): observer 2"), error);
sl@0
   669
		result = EFail;		
sl@0
   670
		}
sl@0
   671
	__MM_HEAP_MARKEND;
sl@0
   672
sl@0
   673
	return result;
sl@0
   674
	}
sl@0
   675
	
sl@0
   676
//
sl@0
   677
// RECamPresetsNegTest //
sl@0
   678
//
sl@0
   679
RECamImageProcNegTest* RECamImageProcNegTest::NewL(TBool aAllocTest)
sl@0
   680
	{
sl@0
   681
	RECamImageProcNegTest* self = new (ELeave) RECamImageProcNegTest(aAllocTest);
sl@0
   682
	return self;	
sl@0
   683
	}
sl@0
   684
	
sl@0
   685
RECamImageProcNegTest::RECamImageProcNegTest(TBool /*aAllocTest*/)
sl@0
   686
	{
sl@0
   687
	iTestStepName = _L("MM-ECM-ADV-U-0103-HP");
sl@0
   688
	}
sl@0
   689
	
sl@0
   690
TVerdict RECamImageProcNegTest::DoTestStepL()
sl@0
   691
	{	
sl@0
   692
	TVerdict result = EPass;
sl@0
   693
	CCamera* camera = NULL;
sl@0
   694
	
sl@0
   695
	TInt error = KErrNone;
sl@0
   696
	CCamera::CCameraImageProcessing* imageprocess = NULL;
sl@0
   697
	
sl@0
   698
	
sl@0
   699
	__MM_HEAP_MARK;
sl@0
   700
	INFO_PRINTF1(_L("Create camera using Camera::New2L() and MCameraObserver2"));
sl@0
   701
	
sl@0
   702
	TRAP(error, camera = CCamera::New2L(*this,0,0));
sl@0
   703
	
sl@0
   704
	if (error==KErrNone)
sl@0
   705
		{
sl@0
   706
		CleanupStack::PushL(camera);
sl@0
   707
		INFO_PRINTF1(_L("KErrNone return from CCamera::New2L()"));
sl@0
   708
		imageprocess = 	static_cast<CCamera::CCameraImageProcessing*> (camera->CustomInterface(KECamImageProcessingUid));
sl@0
   709
	    if (imageprocess!= NULL)
sl@0
   710
	    	{
sl@0
   711
	    	CleanupStack::PushL(imageprocess);
sl@0
   712
sl@0
   713
	    	// Supported Transformations
sl@0
   714
	    	RArray<TUid> suppTransfUids; 
sl@0
   715
	    	CleanupClosePushL(suppTransfUids);
sl@0
   716
	    	suppTransfUids.Reset();
sl@0
   717
	    	imageprocess->GetSupportedTransformationsL(suppTransfUids);
sl@0
   718
		    // Get Supported Values for chosen transformation
sl@0
   719
	 	    iInputEventUid = KUidECamEventImageProcessingAdjustBrightness;
sl@0
   720
	    	RArray<TInt> transfSuppValues; 
sl@0
   721
	    	CleanupClosePushL(transfSuppValues);
sl@0
   722
	    	transfSuppValues.Reset();	    	
sl@0
   723
			TValueInfo valueInfo;
sl@0
   724
			imageprocess->GetTransformationSupportedValuesL(iInputEventUid, transfSuppValues, valueInfo);
sl@0
   725
		    // Set a non supported Transformation value.
sl@0
   726
	        TInt aSetValue = KValue;
sl@0
   727
	    	imageprocess->SetTransformationValue(iInputEventUid, aSetValue);
sl@0
   728
				
sl@0
   729
	        CheckNotificationNeg(iInputEventUid, result);
sl@0
   730
    			
sl@0
   731
		    // Check that value has not changed.
sl@0
   732
   	    	TInt aGetValue =imageprocess->TransformationValue(iInputEventUid);
sl@0
   733
 	    	if (aSetValue == aGetValue)
sl@0
   734
				{
sl@0
   735
				INFO_PRINTF2(_L("Set unsupported TransformationValue set %d"), aSetValue);
sl@0
   736
				result = EFail;
sl@0
   737
				} 
sl@0
   738
			
sl@0
   739
			CCamera::CCameraImageProcessing::TOrientationReference orientationReference = 
sl@0
   740
						CCamera::CCameraImageProcessing::EOrientationReferenceCameraSensorOrientation;	
sl@0
   741
sl@0
   742
			CCamera::CCameraImageProcessing::TRelativeRotation relativeRotation = 
sl@0
   743
					CCamera::CCameraImageProcessing::ERelativeRotation0Degrees;
sl@0
   744
			
sl@0
   745
			CCamera::CCameraImageProcessing::TRelativeMirror relativeMirror = 
sl@0
   746
					CCamera::CCameraImageProcessing::ERelativeMirrorNone;
sl@0
   747
					
sl@0
   748
			CCamera::CCameraImageProcessing::TRelativeFlipping relativeFlipping = 
sl@0
   749
					CCamera::CCameraImageProcessing::ERelativeFlippingNone;
sl@0
   750
	
sl@0
   751
			INFO_PRINTF1(_L("SetRelativeOrientationOptionsL method invocation"));
sl@0
   752
			iInputEventUid = KUidECamEventImageProcessingTransformRelativeOrientation;
sl@0
   753
			imageprocess->SetRelativeOrientationOptionsL(orientationReference, 
sl@0
   754
						relativeRotation, relativeMirror, relativeFlipping);
sl@0
   755
	    	
sl@0
   756
	    	CheckNotificationNeg(iInputEventUid, result);
sl@0
   757
 								    	    
sl@0
   758
			CleanupStack::PopAndDestroy(2, &suppTransfUids); //transfSuppValues
sl@0
   759
sl@0
   760
	    	CleanupStack::PopAndDestroy(imageprocess);
sl@0
   761
	    	}
sl@0
   762
	    else
sl@0
   763
    		{
sl@0
   764
    		result = EFail;
sl@0
   765
    		}	
sl@0
   766
		CleanupStack::PopAndDestroy(camera);
sl@0
   767
		}
sl@0
   768
	else 
sl@0
   769
		{
sl@0
   770
		INFO_PRINTF2(_L("Unexpected %d return from CCamera::New2L(): observer 2"), error);
sl@0
   771
		result = EFail;		
sl@0
   772
		}
sl@0
   773
	__MM_HEAP_MARKEND;
sl@0
   774
sl@0
   775
	return result;
sl@0
   776
	}
sl@0
   777
	
sl@0
   778
//
sl@0
   779
// RECamImageProcBaselineTest //
sl@0
   780
//
sl@0
   781
sl@0
   782
RECamImageProcBaselineTest* RECamImageProcBaselineTest::NewL(TBool aAllocTest)
sl@0
   783
	{
sl@0
   784
	RECamImageProcBaselineTest* self = new (ELeave) RECamImageProcBaselineTest(aAllocTest);
sl@0
   785
	return self;	
sl@0
   786
	}
sl@0
   787
	
sl@0
   788
RECamImageProcBaselineTest::RECamImageProcBaselineTest(TBool)
sl@0
   789
	{
sl@0
   790
	iTestStepName = _L("MM-ECM-ADV-U-047-HP");
sl@0
   791
	}
sl@0
   792
	
sl@0
   793
TBool RECamImageProcBaselineTest::CompareUidArrays(RArray<TUid>& firstArray, RArray<TUid>& secondArray)
sl@0
   794
	{
sl@0
   795
	TBool result = ETrue;
sl@0
   796
	
sl@0
   797
	if (firstArray.Count() != secondArray.Count())
sl@0
   798
		{
sl@0
   799
		result = EFalse;
sl@0
   800
		}
sl@0
   801
	else
sl@0
   802
		{
sl@0
   803
		for (TInt expected = 0; expected < firstArray.Count(); expected++)
sl@0
   804
		    {
sl@0
   805
			result = EFalse;
sl@0
   806
			for (TInt actual = 0; actual < secondArray.Count(); actual++)
sl@0
   807
				{
sl@0
   808
				if (secondArray[actual] == firstArray[expected])
sl@0
   809
					{
sl@0
   810
					result = ETrue;
sl@0
   811
					break;
sl@0
   812
					}				
sl@0
   813
				}
sl@0
   814
			}
sl@0
   815
		}
sl@0
   816
	return result;
sl@0
   817
	}	
sl@0
   818
	
sl@0
   819
TVerdict RECamImageProcBaselineTest::DoTestStepL()
sl@0
   820
	{	
sl@0
   821
	TVerdict result = EPass;
sl@0
   822
	CCamera* camera = NULL;
sl@0
   823
	
sl@0
   824
	TInt error = KErrNone;
sl@0
   825
	CCamera::CCameraImageProcessing* imageprocess = NULL;
sl@0
   826
	
sl@0
   827
	__MM_HEAP_MARK;
sl@0
   828
	INFO_PRINTF1(_L("Create camera using Camera::NewL() and MCameraObserver2"));
sl@0
   829
	
sl@0
   830
	TRAP(error, camera = CCamera::NewL(*this,0,0));
sl@0
   831
	
sl@0
   832
	if (error==KErrNone)
sl@0
   833
		{
sl@0
   834
		CleanupStack::PushL(camera);
sl@0
   835
		INFO_PRINTF1(_L("KErrNone return from CCamera::NewL()"));
sl@0
   836
		imageprocess = 	static_cast<CCamera::CCameraImageProcessing*> (camera->CustomInterface(KECamImageProcessingUid));
sl@0
   837
	    if (imageprocess!= NULL)
sl@0
   838
	    	{
sl@0
   839
	    	CleanupStack::PushL(imageprocess);
sl@0
   840
sl@0
   841
	    	// Supported Transformations
sl@0
   842
			RArray<TUid> expectedTransfUids;	    	
sl@0
   843
			CleanupClosePushL(expectedTransfUids);
sl@0
   844
	    	expectedTransfUids.Reset();	    			
sl@0
   845
	    	// set the expected UIDS
sl@0
   846
			expectedTransfUids.AppendL(KUidECamEventImageProcessingAdjustBrightness);
sl@0
   847
			expectedTransfUids.AppendL(KUidECamEventImageProcessingAdjustContrast);
sl@0
   848
			expectedTransfUids.AppendL(KUidECamEventImageProcessingEffect);	    	
sl@0
   849
	    	RArray<TUid> suppTransfUids; 
sl@0
   850
	    	CleanupClosePushL(suppTransfUids);
sl@0
   851
	    	imageprocess->GetSupportedTransformationsL(suppTransfUids);
sl@0
   852
	    	if (CompareUidArrays(expectedTransfUids, suppTransfUids) == EFalse)
sl@0
   853
				{
sl@0
   854
				INFO_PRINTF1(_L("GetSupportedTransformationsL failed"));
sl@0
   855
				result = EFail;
sl@0
   856
				}
sl@0
   857
	    	expectedTransfUids.Reset();
sl@0
   858
	    	suppTransfUids.Reset();	    		    	
sl@0
   859
			CleanupStack::PopAndDestroy(2, &expectedTransfUids); //suppTransfUids
sl@0
   860
sl@0
   861
		    // Active Transformations
sl@0
   862
	    	RArray<TUid> expectedActTransfUids; 
sl@0
   863
	    	CleanupClosePushL(expectedActTransfUids);
sl@0
   864
	    	expectedActTransfUids.Reset();	    
sl@0
   865
	    	// set the expected UIDS
sl@0
   866
			expectedActTransfUids.AppendL(KUidECamEventImageProcessingAdjustBrightness);
sl@0
   867
			expectedActTransfUids.AppendL(KUidECamEventImageProcessingAdjustContrast);
sl@0
   868
			expectedActTransfUids.AppendL(KUidECamEventImageProcessingEffect);	    	
sl@0
   869
	    	RArray<TUid> actTransfUids; 
sl@0
   870
	    	CleanupClosePushL(actTransfUids);
sl@0
   871
	    	actTransfUids.Reset();	 	    	
sl@0
   872
	    	imageprocess->GetActiveTransformationsL(actTransfUids);
sl@0
   873
 	    	if (CompareUidArrays(expectedActTransfUids, actTransfUids) == EFalse)
sl@0
   874
				{
sl@0
   875
				INFO_PRINTF1(_L("GetActiveTransformationsL failed"));
sl@0
   876
				result = EFail;
sl@0
   877
				}
sl@0
   878
			CleanupStack::PopAndDestroy(2, &expectedActTransfUids); //actTransfUids
sl@0
   879
		    
sl@0
   880
		    // check baseline
sl@0
   881
	    	RArray<TUid> expectedTransfSequence; 
sl@0
   882
	    	CleanupClosePushL(expectedTransfSequence);
sl@0
   883
	    	expectedTransfSequence.Reset();	    	
sl@0
   884
			expectedTransfSequence.Append(KUidECamEventImageProcessingEffect);	   
sl@0
   885
sl@0
   886
			imageprocess->SetActiveTransformSequenceL(expectedTransfSequence);
sl@0
   887
			
sl@0
   888
	    	RArray<TUid> actTransfSequence; 
sl@0
   889
	    	CleanupClosePushL(actTransfSequence);
sl@0
   890
	    	actTransfSequence.Reset();    		    		    	
sl@0
   891
			imageprocess->GetActiveTransformSequenceL(actTransfSequence);
sl@0
   892
 	    	if (CompareUidArrays(expectedTransfSequence, actTransfSequence) == EFalse)
sl@0
   893
				{
sl@0
   894
				INFO_PRINTF1(_L("GetActiveTransformSequenceL failed"));
sl@0
   895
				result = EFail;
sl@0
   896
				}
sl@0
   897
			CleanupStack::PopAndDestroy(2, &expectedTransfSequence); //actTransfSequence
sl@0
   898
sl@0
   899
		    				
sl@0
   900
			//Set Effect Transformation with color swap
sl@0
   901
			iInputEventUid = KUidECamEventImageProcessingEffect;
sl@0
   902
			RArray<TInt> supportedEffects;
sl@0
   903
					
sl@0
   904
	    	TValueInfo info = ENotActive;
sl@0
   905
	    	imageprocess->GetTransformationSupportedValuesL(iInputEventUid, supportedEffects, info);
sl@0
   906
	    	
sl@0
   907
	    	TInt effects = supportedEffects[0];
sl@0
   908
			supportedEffects.Close();
sl@0
   909
	    	
sl@0
   910
	    	if(info != EBitField)
sl@0
   911
	    		{
sl@0
   912
	    		INFO_PRINTF1(_L("Incorrect TValueInfo provided"));
sl@0
   913
				result = EFail;
sl@0
   914
	    		}
sl@0
   915
	    		
sl@0
   916
	    	if(effects > KBaselinedEffects)
sl@0
   917
	        	{	
sl@0
   918
	        	INFO_PRINTF1(_L("Unfamiliar enum value returned"));
sl@0
   919
				result = EFail;
sl@0
   920
	        	}
sl@0
   921
	        	
sl@0
   922
	        imageprocess->SetTransformationValue(iInputEventUid, CCamera::CCameraImageProcessing::EEffectColorSwap);	
sl@0
   923
	        CheckNotification(iInputEventUid, result);
sl@0
   924
	       
sl@0
   925
	        // Check that value has actually changed to EEffectNone due to baselining.
sl@0
   926
	    	TInt getValue = imageprocess->TransformationValue(iInputEventUid);
sl@0
   927
 	    	if (getValue != static_cast<TInt>(CCamera::CCameraImageProcessing::EEffectNone))
sl@0
   928
				{
sl@0
   929
				INFO_PRINTF1(_L("Got unfamiliar TransformationValue"));
sl@0
   930
				result = EFail;
sl@0
   931
				}
sl@0
   932
			else
sl@0
   933
				{
sl@0
   934
				INFO_PRINTF1(_L("Transformation value set to EEffectNone due to baselining"));					
sl@0
   935
				}
sl@0
   936
			
sl@0
   937
	    	CleanupStack::PopAndDestroy(imageprocess);
sl@0
   938
	    	}
sl@0
   939
	    else
sl@0
   940
    		{
sl@0
   941
    		result = EFail;
sl@0
   942
    		}	
sl@0
   943
		CleanupStack::PopAndDestroy(camera);
sl@0
   944
		}
sl@0
   945
	else 
sl@0
   946
		{
sl@0
   947
		INFO_PRINTF2(_L("Unexpected %d return from CCamera::NewL(): observer 2"), error);
sl@0
   948
		result = EFail;		
sl@0
   949
		}
sl@0
   950
	__MM_HEAP_MARKEND;
sl@0
   951
sl@0
   952
	return result;
sl@0
   953
	}