imagingext_pub/exif_api/tsrc/inc/ExifLibTestInc.h
changeset 0 469c91dae73b
equal deleted inserted replaced
-1:000000000000 0:469c91dae73b
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: ExifLibTest
       
    15 *
       
    16 */
       
    17 #include "ExifRead.h"
       
    18 #include "ExifModify.h"
       
    19 #include "ExifTag.h"
       
    20 #include "ExifValueTable.h"
       
    21 #include <fbs.h>
       
    22 #include "ExifCommon.h"
       
    23 
       
    24 
       
    25 #ifdef _USE_CPPUNIT_
       
    26 #include <CppUnit/Test.h>
       
    27 #include <CppUnit/TestCase.h>
       
    28 #include <CppUnit/TestCaller.h>
       
    29 #include <CppUnit/TestSuite.h>
       
    30 #else
       
    31 #include "TestFrameWork/test.h"
       
    32 #include "TestFrameWork/testCase.h"
       
    33 #include "TestFrameWork/testCaller.h"
       
    34 #include "TestFrameWork/testSuite.h"
       
    35 #endif
       
    36 _LIT( KRootC, "C:\\ExifLibTest\\" );
       
    37 _LIT( KRootE, "F:\\testing\\data\\ExifLibTest\\" );
       
    38 _LIT( KRootData, "C:\\data\\ExifLibTest\\" );
       
    39 
       
    40 #if ( ( defined __WINS__ ) || ( defined __WINSCW__) )
       
    41 _LIT(KIopDir, "C:\\ExifLibTest\\IOP\\");
       
    42 _LIT( KRootOut, "C:\\ExifLibTest\\" );
       
    43 #else
       
    44 _LIT(KIopDir, "F:\\testing\\data\\ExifLibTest\\IOP\\");
       
    45 _LIT( KRootOut, "F:\\testing\\data\\ExifLibTest\\" );
       
    46 #endif
       
    47 
       
    48 _LIT(KValidExif, "ValidExif.jpg");
       
    49 _LIT(KInvalidExif1, "InvalidExif1.jpg");
       
    50 _LIT(KInvalidExif2, "InvalidExif2.jpg");
       
    51 _LIT(KInvalidExif3, "InvalidExif3.jpg");
       
    52 _LIT(KInvalidExif4, "InvalidExif4.jpg");
       
    53 _LIT(KInvalidExif5, "InvalidExif5.jpg");
       
    54 _LIT(KInvalidExif6, "InvalidExif6.jpg");
       
    55 _LIT(KInvalidExif7, "InvalidExif7.jpg");
       
    56 _LIT(KInvalidExif8, "InvalidExif8.jpg");
       
    57 _LIT(KInvalidExif9, "InvalidExif9.jpg");
       
    58 _LIT(KInvalidExif10, "InvalidExif10.jpg");
       
    59 _LIT(KInvalidExif11, "InvalidExif11.jpg");
       
    60 _LIT(KInvalidExif12, "InvalidExif12.jpg");
       
    61 _LIT(KInvalidExif13, "InvalidExif13.jpg");
       
    62 _LIT(KInvalidExif14, "InvalidExif14.jpg");
       
    63 _LIT(KNotSupportedExif1, "NotSupportedExif1.jpg");
       
    64 _LIT(KNotSupportedExif2, "NotSupportedExif2.jpg");
       
    65 _LIT(KFullExif, "FullExif.jpg");
       
    66 _LIT(KFullExif3mpix, "FullExif3mpix.jpg");
       
    67 _LIT(KValidJpeg, "ValidJpeg.jpg");
       
    68 _LIT(KInvalidJpeg1, "InvalidJpeg1.jpg");
       
    69 _LIT(KInvalidJpeg2, "InvalidJpeg2.jpg");
       
    70 _LIT(KInvalidJpeg3, "InvalidJpeg3.jpg");
       
    71 _LIT(KValidThumbnail, "Thumbnail.jpg");
       
    72 _LIT(KNoThumbnail, "NoThumbnail.jpg");
       
    73 _LIT(KCameraAPIJpeg, "CameraApi.jpg");
       
    74 _LIT(KNoTagChk_IMG_AN19, "NoTagChk_IMG_AN19.jpeg");
       
    75 _LIT(KNoTagChk_IMG_AN19_out, "NoTagChk_IMG_AN19_out.jpeg");
       
    76 _LIT(KNoTagChk_Original, "NoTagChk_Original.jpg");
       
    77 _LIT(KtagInWrongIfd, "tagInWrongIfd.jpg");
       
    78 _LIT(KtagInWrongIfd_out, "tagInWrongIfd_out.jpg");
       
    79 _LIT(KUnknown_tags, "DSCN1011_unknown_tags.jpg");
       
    80 _LIT(KUnknown_tags_out, "DSCN1011_unknown_tags_out.jpg");
       
    81 
       
    82 
       
    83 class CExifLibTestInc;
       
    84 
       
    85 class TUtils
       
    86 	{
       
    87 	public:
       
    88 		
       
    89 		static HBufC8* ReadFileL(RFs aFs, const TDesC& aFileName) 
       
    90 			{
       
    91             HBufC* fileName = HBufC::NewL( 128 );
       
    92             CleanupStack::PushL( fileName );
       
    93             fileName->Des().Append( KRootC );
       
    94             fileName->Des().Append( aFileName );
       
    95 			RFile file;
       
    96       LOGTEXT2( _L( "ExifLib: TUtils::ReadFileL %s" ), fileName->Ptr());
       
    97 			TInt error = file.Open(aFs,fileName->Des(),EFileShareExclusive|EFileRead);
       
    98             if ( error != KErrNone )
       
    99                 {
       
   100                 fileName->Des().Copy( KRootE );
       
   101                 fileName->Des().Append( aFileName );
       
   102                 error = file.Open(aFs,fileName->Des(),EFileShareExclusive|EFileRead);
       
   103                 if ( error != KErrNone )
       
   104                     {
       
   105                     fileName->Des().Copy( KRootData );
       
   106                     fileName->Des().Append( aFileName );
       
   107                     error = file.Open(aFs,fileName->Des(),EFileShareExclusive|EFileRead);
       
   108                     if ( error != KErrNone )
       
   109                         {
       
   110                         User::LeaveIfError( file.Open(aFs,aFileName,EFileShareExclusive|EFileRead) );
       
   111                         }
       
   112                     }
       
   113                 }
       
   114 			CleanupClosePushL(file);
       
   115 			TInt size = 0;
       
   116 			file.Size(size);
       
   117 			
       
   118 			HBufC8* buffer = HBufC8::NewL(size);
       
   119 			CleanupStack::PushL(buffer);
       
   120 			TPtr8 bufferDes(buffer->Des());
       
   121 			User::LeaveIfError(file.Read(bufferDes));
       
   122 			CleanupStack::Pop(buffer);
       
   123 			CleanupStack::PopAndDestroy();
       
   124             CleanupStack::PopAndDestroy();
       
   125 			return buffer;
       
   126 			};
       
   127 
       
   128 		static HBufC8* ReadFileL(RFs aFs, const TDesC& aFileName, TUint32 aMaxRead) 
       
   129 			{
       
   130             HBufC* fileName = HBufC::NewL( 128 );
       
   131             CleanupStack::PushL( fileName );
       
   132             fileName->Des().Append( KRootC );
       
   133             fileName->Des().Append( aFileName );
       
   134 			RFile file;
       
   135       LOGTEXT2( _L( "ExifLib: TUtils::ReadFileL %s" ), fileName->Ptr());
       
   136 			TInt error = file.Open(aFs,fileName->Des(),EFileShareExclusive|EFileRead);
       
   137             if ( error != KErrNone )
       
   138                 {
       
   139                 fileName->Des().Copy( KRootE );
       
   140                 fileName->Des().Append( aFileName );
       
   141                 error = file.Open(aFs,fileName->Des(),EFileShareExclusive|EFileRead);
       
   142                 if ( error != KErrNone )
       
   143                     {
       
   144                     fileName->Des().Copy( KRootData );
       
   145                     fileName->Des().Append( aFileName );
       
   146                     error = file.Open(aFs,fileName->Des(),EFileShareExclusive|EFileRead);
       
   147                     if ( error != KErrNone )
       
   148                         {
       
   149                         User::LeaveIfError( file.Open(aFs,aFileName,EFileShareExclusive|EFileRead) );
       
   150                         }
       
   151                     }
       
   152                 }
       
   153 			CleanupClosePushL(file);
       
   154 			TInt size = 0;
       
   155 			file.Size(size);
       
   156 			// read up to max size parameter
       
   157 			if ( size > aMaxRead )
       
   158 				size = aMaxRead;
       
   159 			
       
   160 			HBufC8* buffer = HBufC8::NewL(size);
       
   161 			CleanupStack::PushL(buffer);
       
   162 			TPtr8 bufferDes(buffer->Des());
       
   163 			User::LeaveIfError(file.Read(bufferDes, size));
       
   164 			CleanupStack::Pop(buffer);
       
   165 			CleanupStack::PopAndDestroy();
       
   166             CleanupStack::PopAndDestroy();
       
   167 			return buffer;
       
   168 			};
       
   169 
       
   170 		static HBufC8* CreateDummyBufL(TInt aSize)
       
   171 			{
       
   172 			HBufC8* buf = HBufC8::NewL(aSize);
       
   173 			CleanupStack::PushL(buf);
       
   174 			TUint8* tmp = new(ELeave) TUint8[aSize];
       
   175 			CleanupStack::PushL(tmp);
       
   176 			TInt i = 0;
       
   177 			for(i = 0; i < aSize - (aSize % 5); i+=5)
       
   178 				{
       
   179 				tmp[i] = 'D';
       
   180 				tmp[i+1] = 'U';
       
   181 				tmp[i+2] = 'M';
       
   182 				tmp[i+3] = 'M';
       
   183 				tmp[i+4] = 'Y';
       
   184 				}
       
   185 			for(TInt j = 0; j < aSize % 5; j++)
       
   186 				tmp[i + j] = 'D';
       
   187 			buf->Des().Copy(tmp, aSize);
       
   188 			buf->Des().SetLength(aSize);
       
   189 			CleanupStack::PopAndDestroy(tmp);
       
   190 			CleanupStack::Pop(buf);
       
   191 			return buf;
       
   192 			};
       
   193 
       
   194 		static void GetAllTagsTestL(CExifRead* read, const TDesC& aFileName)
       
   195 			{
       
   196 			TInt error = 0;
       
   197 	        RDebug::Print(_L("GetAllTagsTestL starts for %s"), aFileName.Ptr());
       
   198             if ( !read )
       
   199                 {
       
   200                 return;
       
   201                 }
       
   202             HBufC8* thumbnail = NULL;
       
   203             TRAP( error, thumbnail = read->GetThumbnailL());
       
   204 	        CleanupStack::PushL(thumbnail);
       
   205 	        if(!error && thumbnail)
       
   206 		        RDebug::Print(_L("thumbnail ok, size %d ..."), thumbnail->Des().Size());
       
   207 	        else
       
   208 		        RDebug::Print(_L("no thumbnail %d..."), error);
       
   209 	        CleanupStack::PopAndDestroy(thumbnail);
       
   210 
       
   211             HBufC8* datetime  = NULL;
       
   212             TRAP( error, datetime  = read->GetDateTimeL());
       
   213 	        CleanupStack::PushL(datetime);
       
   214 	        if( !error && datetime)
       
   215 		        RDebug::Print(_L("datetime ok, size %d ..."), datetime->Des().Size());
       
   216 	        else
       
   217 		        RDebug::Print(_L("no datetime %d..."), error);
       
   218 	        CleanupStack::PopAndDestroy(datetime);
       
   219 
       
   220             HBufC8* imagedescription  = NULL;
       
   221             TRAP( error, imagedescription  = read->GetImageDescriptionL() );
       
   222 	        CleanupStack::PushL(imagedescription);
       
   223 	        if(!error && imagedescription)
       
   224 		        RDebug::Print(_L("imagedescription ok, size %d ..."), imagedescription->Des().Size());
       
   225     	    else
       
   226 	    	    RDebug::Print(_L("no imagedescription %d..."), error);
       
   227 	        CleanupStack::PopAndDestroy(imagedescription);
       
   228 
       
   229             HBufC8* make  = NULL;
       
   230             TRAP( error, make  = read->GetMakeL() );
       
   231 	        CleanupStack::PushL(make);
       
   232     	    if(!error && make)
       
   233 	    	    RDebug::Print(_L("make ok, size %d ..."), make->Des().Size());
       
   234 	        else
       
   235 		        RDebug::Print(_L("no make %d..."), error);
       
   236     	    CleanupStack::PopAndDestroy(make);
       
   237 
       
   238             HBufC8* model  = NULL;
       
   239             TRAP( error, model  = read->GetModelL() );
       
   240     	    CleanupStack::PushL(model);
       
   241 	        if(!error && model)
       
   242 		        RDebug::Print(_L("model ok, size %d ..."), model->Des().Size());
       
   243     	    else
       
   244 	    	    RDebug::Print(_L("no model %d..."), error);
       
   245 	        CleanupStack::PopAndDestroy(model);
       
   246 
       
   247             HBufC8* software  = NULL;
       
   248             TRAP( error, software  = read->GetSoftwareL() );
       
   249 	        CleanupStack::PushL(software);
       
   250     	    if(!error && software)
       
   251 	    	    RDebug::Print(_L("software ok, size %d ..."), software->Des().Size());
       
   252 	        else
       
   253 		        RDebug::Print(_L("no software %d..."), error);
       
   254     	    CleanupStack::PopAndDestroy(software);
       
   255 
       
   256             HBufC8* copyright  = NULL;
       
   257             TRAP( error, copyright  = read->GetCopyrightL() );
       
   258     	    CleanupStack::PushL(copyright);
       
   259 	        if(!error && copyright)
       
   260 		        RDebug::Print(_L("copyright ok, size %d ..."), copyright->Des().Size());
       
   261     	    else
       
   262 	    	    RDebug::Print(_L("no copyright %d..."), error);
       
   263 	        CleanupStack::PopAndDestroy(copyright);
       
   264 
       
   265             TUint16 orientation = 0;
       
   266             TInt err = read->GetOrientation( orientation);
       
   267     	    if(!err)
       
   268 	            RDebug::Print(_L("orientation ok %d ..."), orientation);
       
   269 	        else
       
   270 		        RDebug::Print(_L("no orientation %d..."), err);
       
   271 	        
       
   272 	        TUint32 gpsversion = 0;
       
   273             err = read->GetGpsVersion( gpsversion );
       
   274     	    if(!err)
       
   275 	            RDebug::Print(_L("gpsversion ok 0x%x ..."), gpsversion);
       
   276 	        else
       
   277 		        RDebug::Print(_L("no gpsversion %d..."), err);
       
   278 	        
       
   279 	        TUint32 exifversion = 0;
       
   280             err = read->GetExifVersion( exifversion );
       
   281     	    if(!err)
       
   282 	            RDebug::Print(_L("exifversion ok 0x%x ..."), exifversion);
       
   283 	        else
       
   284 		        RDebug::Print(_L("no exifversion %d..."), err);
       
   285 	        
       
   286 	        TUint32 flashpixversion = 0;
       
   287             err = read->GetFlashPixVersion( flashpixversion );
       
   288     	    if(!err)
       
   289 	            RDebug::Print(_L("flashpixversion ok 0x%x ..."), flashpixversion);
       
   290 	        else
       
   291 		        RDebug::Print(_L("no flashpixversion %d..."), err);
       
   292 
       
   293             HBufC8* datetimeoriginal  = NULL;
       
   294             TRAP( error, datetimeoriginal  = read->GetDateTimeOriginalL() );
       
   295     	    CleanupStack::PushL(datetimeoriginal);
       
   296 	        if(!error && datetimeoriginal)
       
   297 		        RDebug::Print(_L("datetimeoriginal ok, size %d ..."), datetimeoriginal->Des().Size());
       
   298     	    else
       
   299 	    	    RDebug::Print(_L("no datetimeoriginal %d..."), error);
       
   300 	        CleanupStack::PopAndDestroy(datetimeoriginal);
       
   301 
       
   302             HBufC8* datetimedigitized  = NULL;
       
   303             TRAP( error, datetimedigitized  = read->GetDateTimeDigitizedL() );
       
   304     	    CleanupStack::PushL(datetimedigitized);
       
   305 	        if(!error && datetimedigitized)
       
   306 		        RDebug::Print(_L("datetimedigitized ok, size %d ..."), datetimedigitized->Des().Size());
       
   307     	    else
       
   308 	    	    RDebug::Print(_L("no datetimedigitized %d..."), error);
       
   309 	        CleanupStack::PopAndDestroy(datetimedigitized);
       
   310 	        
       
   311             HBufC8* usercomment  = NULL;
       
   312             TRAP( error, usercomment  = read->GetUserCommentL() );
       
   313     	    CleanupStack::PushL(usercomment);
       
   314 	        if(!error && usercomment)
       
   315 		        RDebug::Print(_L("usercomment ok, size %d ..."), usercomment->Des().Size());
       
   316     	    else
       
   317 	    	    RDebug::Print(_L("no usercomment %d..."), error);
       
   318 	        CleanupStack::PopAndDestroy(usercomment);
       
   319 	        
       
   320             HBufC8* relatedsoundfile  = NULL;
       
   321             TRAP( error, relatedsoundfile  = read->GetRelatedSoundFileL() );
       
   322     	    CleanupStack::PushL(relatedsoundfile);
       
   323 	        if(!error && relatedsoundfile)
       
   324 		        RDebug::Print(_L("relatedsoundfile ok, size %d ..."), relatedsoundfile->Des().Size());
       
   325     	    else
       
   326 	    	    RDebug::Print(_L("no relatedsoundfile %d..."), error);
       
   327 	        CleanupStack::PopAndDestroy(relatedsoundfile);
       
   328 	        
       
   329 
       
   330 /*-------------- missing test cases---------
       
   331 
       
   332         TInt GetXResolution( 
       
   333             TUint32& aXResolution1, 
       
   334             TUint32& aXResolution2 ) const;
       
   335     	
       
   336         TInt GetYResolution( 
       
   337             TUint32& aYResolution1, 
       
   338             TUint32& aYResolution2 ) const;
       
   339     	
       
   340         TInt GetResolutionUnit( TUint16& aResolutionUnit ) const; 
       
   341     	
       
   342         TInt GetYCbCrPositioning( TUint16& aYCbCrPositioning ) const; 
       
   343     	
       
   344         TInt GetExifIfdPointer( TUint32& aExifIfdPointer ) const; 
       
   345     	
       
   346         TInt GetGpsInfoIfdPointer( TUint32& aGpsInfoIfdPointer ) const; 
       
   347 
       
   348     	HBufC8* GetIsoSpeedRatingsL() const; 
       
   349     	
       
   350         HBufC8* GetMakerNoteL() const; 
       
   351     	
       
   352 
       
   353     	TInt GetExposureTime( 
       
   354             TUint32& aExposureTime1, 
       
   355             TUint32& aExposureTime2 ) const; 
       
   356     	
       
   357         TInt GetComponentsConfiguration( 
       
   358             TUint8& aFirstComponent, TUint8& aSecondComponent,
       
   359             TUint8& aThirdComponent, TUint8& aFourthComponent) const; 
       
   360 
       
   361         TInt GetFlash( TUint16& aFlash ) const; 
       
   362     	
       
   363         TInt GetColorSpace( TUint16& aColorSpace ) const; 
       
   364     	
       
   365         TInt GetPixelXDimension( TUint32& aPixelXDimension ) const; 
       
   366     	
       
   367         TInt GetPixelYDimension( TUint32& aPixelYDimension ) const; 
       
   368     	
       
   369         TInt GetExposureMode( TUint16& aExposureMode ) const; 
       
   370     	
       
   371         TInt GetWhiteBalance( TUint16& aWhiteBalance ) const; 
       
   372     	
       
   373         TInt GetSceneCaptureType( TUint16& aSceneCaptureType ) const; 
       
   374     	
       
   375         TInt GetExposureProgram( TUint16& aExposureProgram ) const;
       
   376     	
       
   377         TInt GetApertureValue( 
       
   378             TUint32& aApertureValue1, 
       
   379             TUint32& aApertureValue2 ) const; 
       
   380     	
       
   381         TInt GetExposureBiasValue( 
       
   382             TInt32& aExposureBiasValue1, 
       
   383             TInt32& aExposureBiasValue2 ) const; 
       
   384     	
       
   385         TInt GetMeteringMode( TUint16& aMeteringMode ) const; 
       
   386     	
       
   387         TInt GetLightSource( TUint16& aLightSource ) const; 
       
   388     	
       
   389         TInt GetFileSource( TInt8& aFileSource ) const; 
       
   390     	
       
   391         TInt GetDigitalZoomRatio( 
       
   392             TUint32& aDigitalZoomRatio1, 
       
   393             TUint32& aDigitalZoomRatio2 ) const; 
       
   394     	
       
   395         TInt GetContrast( TUint16& aContrast ) const; 
       
   396     	
       
   397         TInt GetSaturation( TUint16& aSaturation ) const; 
       
   398     	
       
   399         TInt GetSharpness( TUint16& aSharpness ) const; 
       
   400     	
       
   401     	
       
   402     	
       
   403         TInt GetInteroperabilityIfdPointer( 
       
   404             TUint32& aInteroperabilityIfdPointer ) const; 
       
   405 
       
   406     	TInt GetThumbnailXResolution( 
       
   407             TUint32& aXResolution1, 
       
   408             TUint32& aXResolution2 ) const;
       
   409     	
       
   410         TInt GetThumbnailYResolution( 
       
   411             TUint32& aYResolution1, 
       
   412             TUint32& aYResolution2 ) const;
       
   413     	
       
   414         TInt GetThumbnailResolutionUnit( TUint16& aResolutionUnit ) const;
       
   415     	
       
   416         TInt GetThumbnailCompression( TUint16& aCompression ) const; 
       
   417     	
       
   418         TInt GetJpegInterchangeFormat( TUint32& aJpegInterchangeFormat ) const; 
       
   419     	
       
   420         TInt GetJpegInterchangeFormatLength( 
       
   421             TUint32& aJpegInterchangeFormatLength ) const;
       
   422 
       
   423         HBufC8* GetExifAppSegmentL() const;
       
   424 
       
   425         TInt GetShutterSpeedValue( TInt32& aShutterSpeedValue1, 
       
   426             TInt32& aShutterSpeedValue2 ) const;
       
   427 
       
   428         TInt GetBrightnessValue( TInt32& aBrightnessValue1, 
       
   429             TInt32& aBrightnessValue2 ) const;
       
   430 
       
   431         TInt GetCustomRendered( TUint16& aCustomRendered ) const;
       
   432 
       
   433         TInt GetGainControl( TUint16& aGainControl ) const;
       
   434 
       
   435 
       
   436 
       
   437 --------------*/
       
   438 			return;
       
   439 			};
       
   440 	};
       
   441 
       
   442 class CExifTagTest : public CTestCase
       
   443 	{
       
   444 	friend class CExifLibTestInc;
       
   445 
       
   446 	RFs iFs;
       
   447 	public:
       
   448 		CExifTagTest(){};
       
   449 		~CExifTagTest(){};
       
   450 		void ExifTag001L();
       
   451 		void ExifTag002L();
       
   452         // Allocate the resources for one test function
       
   453         void setUpL ()
       
   454 			{
       
   455 			User::LeaveIfError(iFs.Connect());
       
   456 			};
       
   457         
       
   458         // Free the resources reserved in setUpL()
       
   459         void tearDown ()
       
   460 			{
       
   461 			iFs.Close();
       
   462 			};
       
   463 	};
       
   464 
       
   465 class CExifReadTest : public CTestCase
       
   466 	{
       
   467 	friend class CExifLibTestInc;
       
   468 	RFs iFs;
       
   469 
       
   470 	public:
       
   471 		CExifReadTest(){};
       
   472 		~CExifReadTest(){};
       
   473 		void ExifRead001L();
       
   474 		void ExifRead002L();
       
   475 		void ExifRead003L();
       
   476 		void ExifRead004L();
       
   477 		void ExifRead005L();
       
   478 		void ExifRead006L();
       
   479 		void ExifRead007L();
       
   480 		void ExifRead008L();
       
   481 		void ExifRead009L();
       
   482 		void ExifRead010L();
       
   483 		void ExifRead011L();
       
   484 		void ExifRead012L();
       
   485 		void ExifRead013L();
       
   486 		void ExifRead014L();
       
   487 		void ExifRead015L();
       
   488         void ExifRead016L();
       
   489 		void ExifRead017L();
       
   490 		void ExifRead018L();
       
   491 		// For fast reader
       
   492 		void ExifRead101L();
       
   493 		void ExifRead102L();
       
   494 		void ExifRead103L();
       
   495 		void ExifRead104L();
       
   496 		void ExifRead105L();
       
   497 		void ExifRead106L();
       
   498 		void ExifRead107L();
       
   499 		void ExifRead108L();
       
   500 		void ExifRead109L();
       
   501 		void ExifRead110L();
       
   502 		void ExifRead111L();
       
   503 		void ExifRead112L();
       
   504 		void ExifRead113L();
       
   505 		void ExifRead114L();
       
   506 		void ExifRead115L();
       
   507         void ExifRead116L();
       
   508 		// For no tag validity checking
       
   509 		void ExifRead201L();
       
   510 		void ExifRead202L();
       
   511 		void ExifRead203L();
       
   512 		void ExifRead204L();
       
   513 		void ExifRead205L();
       
   514 		void ExifRead206L();
       
   515 		void ExifRead207L();
       
   516 		void ExifRead208L();
       
   517 		void ExifRead209L();
       
   518 		void ExifRead210L();
       
   519 		void ExifRead211L();
       
   520 		void ExifRead212L();
       
   521 		void ExifRead213L();
       
   522 		void ExifRead214L();
       
   523 		void ExifRead215L();
       
   524         void ExifRead216L();
       
   525 		
       
   526         // Allocate the resources for one test function
       
   527         void setUpL ()
       
   528 			{
       
   529 			User::LeaveIfError(iFs.Connect());
       
   530 			};
       
   531 
       
   532         
       
   533         // Free the resources reserved in setUpL()
       
   534         void tearDown ()
       
   535 			{
       
   536 			iFs.Close();
       
   537 			};
       
   538 	};
       
   539 
       
   540 class CExifCreateTest : public CTestCase
       
   541 	{
       
   542 	friend class CExifLibTestInc;
       
   543 	RFs iFs;
       
   544 
       
   545 	public:
       
   546 		CExifCreateTest(){};
       
   547 		~CExifCreateTest(){};
       
   548 		void ExifCreate001L();
       
   549 		void ExifCreate002L();
       
   550 		void ExifCreate003L();
       
   551 		void ExifCreate004L();
       
   552 		void ExifCreate005L();
       
   553 		void ExifCreate006L();
       
   554 		void ExifCreate007L();
       
   555 		void ExifCreate008L();
       
   556 		void ExifCreate009L();
       
   557 		void ExifCreate010L();
       
   558 		void ExifCreate011L();
       
   559 		void ExifCreate012L();
       
   560 		void ExifCreate013L();
       
   561 		//For fast test
       
   562 		void ExifCreate101L();
       
   563 		void ExifCreate102L();
       
   564 		void ExifCreate103L();
       
   565 		void ExifCreate104L();
       
   566 		void ExifCreate105L();
       
   567 		void ExifCreate106L();
       
   568 		void ExifCreate107L();
       
   569 		void ExifCreate108L();
       
   570 		void ExifCreate109L();
       
   571 		void ExifCreate110L();
       
   572 		void ExifCreate111L();
       
   573 		void ExifCreate112L();
       
   574 		void ExifCreate113L();
       
   575 		
       
   576         // Allocate the resources for one test function
       
   577         void setUpL ()
       
   578 			{
       
   579 			User::LeaveIfError(iFs.Connect());
       
   580 			};
       
   581         
       
   582         // Free the resources reserved in setUpL()
       
   583         void tearDown ()
       
   584 			{
       
   585 			iFs.Close();
       
   586 			};
       
   587 	};
       
   588 
       
   589 class CExifModifyTest : public CTestCase
       
   590 	{
       
   591 	friend class CExifLibTestInc;
       
   592 	RFs iFs;
       
   593 
       
   594 	public:
       
   595 		CExifModifyTest(){};
       
   596 		~CExifModifyTest(){};
       
   597 		void ExifModify001L();
       
   598 		void ExifModify002L();
       
   599 		void ExifModify003L();
       
   600 		void ExifModify004L();
       
   601 		void ExifModify005L();
       
   602 		void ExifModify006L();
       
   603 		void ExifModify007L();
       
   604 		void ExifModify008L();
       
   605 		void ExifModify009L();
       
   606 		void ExifModify010L();
       
   607 		void ExifModify011L();
       
   608 		void ExifModify012L();
       
   609 		void ExifModify013L();
       
   610 		void ExifModify014L();
       
   611 		void ExifModify015L();
       
   612 		void ExifModify016L();
       
   613 		void ExifModify017L();
       
   614         void ExifModify018L();
       
   615         void ExifModify019L();
       
   616         void ExifModify020L();
       
   617         void ExifModify021L();
       
   618         void ExifModify022L();
       
   619         void ExifModify023L();
       
   620         // For fast modifier
       
   621 		void ExifModify101L();
       
   622 		void ExifModify102L();
       
   623 		void ExifModify103L();
       
   624 		void ExifModify104L();
       
   625 		void ExifModify105L();
       
   626 		void ExifModify106L();
       
   627 		void ExifModify107L();
       
   628 		void ExifModify108L();
       
   629 		void ExifModify109L();
       
   630 		void ExifModify110L();
       
   631 		void ExifModify111L();
       
   632 		void ExifModify112L();
       
   633 		void ExifModify113L();
       
   634 		void ExifModify114L();
       
   635 		void ExifModify115L();
       
   636 		void ExifModify116L();
       
   637 		void ExifModify117L();
       
   638         void ExifModify118L();
       
   639         void ExifModify119L();
       
   640         
       
   641 
       
   642         // Allocate the resources for one test function
       
   643         void setUpL ()
       
   644 			{
       
   645 			User::LeaveIfError(iFs.Connect());
       
   646 			};
       
   647         
       
   648         // Free the resources reserved in setUpL()
       
   649         void tearDown ()
       
   650 			{
       
   651 			iFs.Close();
       
   652 			};
       
   653 	};
       
   654 
       
   655 class CExifModifyTest2 : public CTestCase
       
   656 	{
       
   657 	friend class CExifLibTestInc;
       
   658 	RFs iFs;
       
   659 
       
   660 	public:
       
   661 		CExifModifyTest2(){};
       
   662 		~CExifModifyTest2(){};
       
   663 		void ExifModify001L();
       
   664 		void ExifModify002L();
       
   665 		void ExifModify003L();
       
   666 		void ExifModify004L();
       
   667 		void ExifModify005L();
       
   668 		void ExifModify006L();
       
   669 		void ExifModify007L();
       
   670 		void ExifModify008L();
       
   671 		void ExifModify009L();
       
   672 		void ExifModify010L();
       
   673 		void ExifModify011L();
       
   674 		void ExifModify012L();
       
   675 		void ExifModify013L();
       
   676 		void ExifModify014L();
       
   677 		void ExifModify015L();
       
   678 		void ExifModify016L();
       
   679 		void ExifModify017L();
       
   680         void ExifModify018L();
       
   681         void ExifModify019L();
       
   682 
       
   683         // Allocate the resources for one test function
       
   684         void setUpL ()
       
   685 			{
       
   686 			User::LeaveIfError(iFs.Connect());
       
   687 			};
       
   688         
       
   689         // Free the resources reserved in setUpL()
       
   690         void tearDown ()
       
   691 			{
       
   692 			iFs.Close();
       
   693 			};
       
   694 	};
       
   695 
       
   696 class CExifIopTest : public CTestCase
       
   697 	{
       
   698 	friend class CExifLibTestInc;
       
   699 	RFs iFs;
       
   700 
       
   701 	public:
       
   702 		CExifIopTest(){};
       
   703 		~CExifIopTest(){};
       
   704 		void ExifIop001L();
       
   705 		void ExifIop002L();
       
   706 		void ExifIop003L();
       
   707 		void ExifIop004L();
       
   708         void ExifIop005L();
       
   709         // Allocate the resources for one test function
       
   710         void setUpL ()
       
   711 			{
       
   712 			User::LeaveIfError(iFs.Connect());
       
   713 			iWrite = ETrue;
       
   714 			};
       
   715         
       
   716         // Free the resources reserved in setUpL()
       
   717         void tearDown ()
       
   718 			{
       
   719 			iFs.Close();
       
   720 			};
       
   721 	private:
       
   722 		void ExifIop1L(const TDesC& aFileName);
       
   723 		void ExifIop2L(const TDesC& aFileName);
       
   724 		void ExifIop3L(CExifRead* aExifRead, const TDesC& aFileName);
       
   725 		HBufC8* CreateDummyBufL(TInt aSize);
       
   726 		void InsertGpsTagsL(CExifModify* aModify);	
       
   727 
       
   728 		TBool iWrite;
       
   729 	};
       
   730 
       
   731 class CExifLibTestInc : public CTestCase
       
   732     {
       
   733     friend class CExifTagTest;
       
   734 	friend class CExifReadTest;
       
   735 	friend class CExifCreateTest;
       
   736     public:
       
   737         
       
   738         CExifLibTestInc();
       
   739         ~CExifLibTestInc();
       
   740         
       
   741         // Allocate the resources for one test function
       
   742         void setUpL ();
       
   743         
       
   744         // Free the resources reserved in setUpL()
       
   745         void tearDown ();
       
   746         
       
   747         // A function to collect and return a suite of tests
       
   748         static MTest* suiteL ();
       
   749 	};