videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideoscollectionutiltest/src/VcxMyVideosCollectionUtilTestBlocks.cpp
branchRCL_3
changeset 23 8f0df5c82986
child 26 67eb01668b0e
equal deleted inserted replaced
21:55fa1ec415c6 23:8f0df5c82986
       
     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: This file contains testclass implementation.
       
    15 *
       
    16 */
       
    17 
       
    18 // [INCLUDE FILES] - do not remove
       
    19 #include <e32svr.h>
       
    20 #include <StifParser.h>
       
    21 #include <StifTestInterface.h>
       
    22 #include <vcxmyvideosdefs.h>
       
    23 #include <mpxmedia.h>
       
    24 #include <mpxattribute.h>
       
    25 #include <mpxmediageneraldefs.h>
       
    26 #include <mpxmediavideodefs.h>
       
    27 #include "VcxMyVideosCollectionUtilTest.h"
       
    28 #include "vcxmyvideoscollectionutil.h"
       
    29 
       
    30 // EXTERNAL DATA STRUCTURES
       
    31 //extern  ?external_data;
       
    32 
       
    33 // EXTERNAL FUNCTION PROTOTYPES  
       
    34 //extern ?external_function( ?arg_type,?arg_type );
       
    35 
       
    36 // CONSTANTS
       
    37 //const ?type ?constant_var = ?constant;
       
    38 
       
    39 // MACROS
       
    40 //#define ?macro ?macro_def
       
    41 
       
    42 // LOCAL CONSTANTS AND MACROS
       
    43 //const ?type ?constant_var = ?constant;
       
    44 //#define ?macro_name ?macro_def
       
    45 
       
    46 // MODULE DATA STRUCTURES
       
    47 //enum ?declaration
       
    48 //typedef ?declaration
       
    49 
       
    50 // LOCAL FUNCTION PROTOTYPES
       
    51 //?type ?function_name( ?arg_type, ?arg_type );
       
    52 
       
    53 // FORWARD DECLARATIONS
       
    54 //class ?FORWARD_CLASSNAME;
       
    55 
       
    56 // ============================= LOCAL FUNCTIONS ===============================
       
    57 
       
    58 // -----------------------------------------------------------------------------
       
    59 // ?function_name ?description.
       
    60 // ?description
       
    61 // Returns: ?value_1: ?description
       
    62 //          ?value_n: ?description_line1
       
    63 //                    ?description_line2
       
    64 // -----------------------------------------------------------------------------
       
    65 //
       
    66 /*
       
    67 ?type ?function_name(
       
    68     ?arg_type arg,  // ?description
       
    69     ?arg_type arg)  // ?description
       
    70     {
       
    71 
       
    72     ?code  // ?comment
       
    73 
       
    74     // ?comment
       
    75     ?code
       
    76     }
       
    77 */
       
    78 
       
    79 // ============================ MEMBER FUNCTIONS ===============================
       
    80 
       
    81 // -----------------------------------------------------------------------------
       
    82 // CVcxMyVideosCollectionUtilTest::Delete
       
    83 // Delete here all resources allocated and opened from test methods. 
       
    84 // Called from destructor. 
       
    85 // -----------------------------------------------------------------------------
       
    86 //
       
    87 void CVcxMyVideosCollectionUtilTest::Delete() 
       
    88     {
       
    89 
       
    90     }
       
    91 
       
    92 // -----------------------------------------------------------------------------
       
    93 // CVcxMyVideosCollectionUtilTest::RunMethodL
       
    94 // Run specified method. Contains also table of test mothods and their names.
       
    95 // -----------------------------------------------------------------------------
       
    96 //
       
    97 TInt CVcxMyVideosCollectionUtilTest::RunMethodL( 
       
    98     CStifItemParser& aItem ) 
       
    99     {
       
   100 
       
   101     static TStifFunctionInfo const KFunctions[] =
       
   102         {  
       
   103         // Copy this line for every implemented function.
       
   104         // First string is the function name used in TestScripter script file.
       
   105         // Second is the actual implementation member function.        
       
   106         ENTRY( "CreateEmptyMediaList", CVcxMyVideosCollectionUtilTest::CreateEmptyMediaListL ),
       
   107         ENTRY( "CreateEmptyMessageList", CVcxMyVideosCollectionUtilTest::CreateEmptyMessageListL ),
       
   108         ENTRY( "CopyFromListToList", CVcxMyVideosCollectionUtilTest::CopyFromListToListL ),
       
   109         ENTRY( "DriveLetter2DriveNumber", CVcxMyVideosCollectionUtilTest::DriveLetter2DriveNumberL ),
       
   110         ENTRY( "MakeUniqueFileName", CVcxMyVideosCollectionUtilTest::MakeUniqueFileNameL ),
       
   111         ENTRY( "Origin", CVcxMyVideosCollectionUtilTest::OriginL ),
       
   112         ENTRY( "Flags", CVcxMyVideosCollectionUtilTest::FlagsL ),
       
   113         ENTRY( "DownloadId", CVcxMyVideosCollectionUtilTest::DownloadIdL ),
       
   114         ENTRY( "DownloadState", CVcxMyVideosCollectionUtilTest::DownloadStateL ),
       
   115         ENTRY( "Id", CVcxMyVideosCollectionUtilTest::IdL ),
       
   116         ENTRY( "Duration", CVcxMyVideosCollectionUtilTest::DurationL ),
       
   117         ENTRY( "Title", CVcxMyVideosCollectionUtilTest::TitleL ),
       
   118         ENTRY( "Rating", CVcxMyVideosCollectionUtilTest::RatingL ),
       
   119         ENTRY( "AudioFourCc", CVcxMyVideosCollectionUtilTest::AudioFourCcL ),
       
   120         ENTRY( "AreSupported", CVcxMyVideosCollectionUtilTest::AreSupportedL ), 
       
   121         ENTRY( "AttrBelongsToFullSet", CVcxMyVideosCollectionUtilTest::AttrBelongsToFullSetL ),
       
   122         ENTRY( "Origin2", CVcxMyVideosCollectionUtilTest::Origin ),
       
   123         ENTRY( "PrintOpenFileHandles", CVcxMyVideosCollectionUtilTest::PrintOpenFileHandlesL ),
       
   124         ENTRY( "GetProcessName", CVcxMyVideosCollectionUtilTest::GetProcessNameL ),
       
   125         //ADD NEW ENTRY HERE
       
   126         // [test cases entries] - Do not remove
       
   127 
       
   128         };
       
   129 
       
   130     const TInt count = sizeof( KFunctions ) / 
       
   131                         sizeof( TStifFunctionInfo );
       
   132 
       
   133     return RunInternalL( KFunctions, count, aItem );
       
   134 
       
   135     }
       
   136 
       
   137 // ----------------------------------------------------------------------------
       
   138 // CVcxMyVideosCollectionUtil::CreateEmptyMediaListL
       
   139 // ----------------------------------------------------------------------------
       
   140 //
       
   141 TInt CVcxMyVideosCollectionUtilTest::CreateEmptyMediaListL( CStifItemParser& /*aItem*/ )
       
   142     {
       
   143     CMPXMedia* media = TVcxMyVideosCollectionUtil::CreateEmptyMediaListL();
       
   144     delete media;
       
   145     return KErrNone;
       
   146     }
       
   147 
       
   148 // ----------------------------------------------------------------------------
       
   149 // CVcxMyVideosCollectionUtilTest::CreateEmptyMessageListL
       
   150 // ----------------------------------------------------------------------------
       
   151 //
       
   152 TInt CVcxMyVideosCollectionUtilTest::CreateEmptyMessageListL( CStifItemParser& /*aItem*/ )
       
   153     {
       
   154     CMPXMedia* media = TVcxMyVideosCollectionUtil::CreateEmptyMessageListL();
       
   155     delete media;
       
   156     return KErrNone;
       
   157     }
       
   158 
       
   159 // ---------------------------------------------------------------------------
       
   160 // CVcxMyVideosCollectionUtilTest::CopyFromListToListL
       
   161 // ---------------------------------------------------------------------------
       
   162 //
       
   163 TInt CVcxMyVideosCollectionUtilTest::CopyFromListToListL( CStifItemParser& aItem )
       
   164     {
       
   165     CMPXMedia* from = TVcxMyVideosCollectionUtil::CreateEmptyMediaListL();
       
   166     CMPXMedia* to = TVcxMyVideosCollectionUtil::CreateEmptyMediaListL();
       
   167     RArray<TUint32> ids;
       
   168     
       
   169     TInt numberOfMedia;
       
   170     TInt wantedId;
       
   171     
       
   172     aItem.GetNextInt( numberOfMedia );
       
   173     aItem.GetNextInt( wantedId );
       
   174     
       
   175     ids.Append( wantedId );
       
   176     
       
   177     // add stuff to be copied to "from" -list
       
   178     
       
   179     
       
   180     TVcxMyVideosCollectionUtil::CopyFromListToListL( *from, *to, ids );
       
   181     
       
   182     // check that the "to" -list have the items it should have
       
   183     
       
   184     delete from;
       
   185     delete to;
       
   186     
       
   187     return KErrNone;
       
   188     }
       
   189     
       
   190 // ---------------------------------------------------------------------------
       
   191 // This helper function converts drive letter to drive number
       
   192 // ---------------------------------------------------------------------------
       
   193 //
       
   194 TInt CVcxMyVideosCollectionUtilTest::DriveLetter2DriveNumberL( CStifItemParser& /*aItem*/ )
       
   195     {
       
   196     TVcxMyVideosCollectionUtil::DriveLetter2DriveNumber( _L("E:") );
       
   197     return KErrNone;
       
   198     }
       
   199 
       
   200 // ---------------------------------------------------------------------------
       
   201 // CVcxMyVideosCollectionUtilTest::MakeUniqueFileNameL
       
   202 // ---------------------------------------------------------------------------
       
   203 //
       
   204 TInt CVcxMyVideosCollectionUtilTest::MakeUniqueFileNameL( CStifItemParser& /*aItem*/ )
       
   205     {
       
   206     RFs fs;
       
   207     fs.Connect();
       
   208     TBuf<KMaxPath> path;
       
   209     TVcxMyVideosCollectionUtil::MakeUniqueFileNameL( fs, _L("c://testframework//testframework.ini"), path );
       
   210     fs.Close();
       
   211     return KErrNone;
       
   212     }
       
   213 
       
   214 // ----------------------------------------------------------------------------
       
   215 // CVcxMyVideosCollectionUtilTest::OriginL
       
   216 // ----------------------------------------------------------------------------
       
   217 //
       
   218 TInt CVcxMyVideosCollectionUtilTest::OriginL( CStifItemParser& /*aItem*/ )
       
   219     {
       
   220     CMPXMedia* media = CMPXMedia::NewL();
       
   221     TInt retVal( KErrNone );
       
   222     TUint8 valueSet = EVcxMyVideosOriginCapturedWithCamera;
       
   223     media->SetTObjectValueL<TUint8>( KVcxMediaMyVideosOrigin, valueSet );
       
   224     TUint8 valueGet = TVcxMyVideosCollectionUtil::OriginL( *media );
       
   225     if( valueSet != valueGet )
       
   226         {
       
   227         retVal = KErrGeneral;
       
   228         delete media;
       
   229         return retVal;
       
   230         }    
       
   231     valueSet = EVcxMyVideosOriginTvRecording;
       
   232     media->SetTObjectValueL<TUint8>( KVcxMediaMyVideosOrigin, valueSet );
       
   233     valueGet = TVcxMyVideosCollectionUtil::OriginL( *media );
       
   234     if( EVcxMyVideosOriginOther != valueGet )
       
   235         {
       
   236         retVal = KErrGeneral;
       
   237         }
       
   238     delete media;
       
   239     return retVal;
       
   240     }
       
   241 
       
   242 // ----------------------------------------------------------------------------
       
   243 // CVcxMyVideosCollectionUtilTest::FlagsL
       
   244 // ----------------------------------------------------------------------------
       
   245 //
       
   246 TInt CVcxMyVideosCollectionUtilTest::FlagsL( CStifItemParser& /*aItem*/ )
       
   247     {
       
   248     CMPXMedia* media = CMPXMedia::NewL();
       
   249     TInt retVal( KErrNone );
       
   250     TUint32 flagsSet( 0xBEEF );
       
   251     media->SetTObjectValueL<TUint32>( KMPXMediaGeneralFlags, flagsSet );
       
   252     TUint32 flagsGet( TVcxMyVideosCollectionUtil::FlagsL( *media ) );
       
   253     if( flagsSet != flagsGet )
       
   254         {
       
   255         retVal = KErrGeneral;
       
   256         }
       
   257     delete media;
       
   258     return retVal;
       
   259     }
       
   260 
       
   261 // ----------------------------------------------------------------------------
       
   262 // CVcxMyVideosCollectionUtilTest::DownloadIdL
       
   263 // ----------------------------------------------------------------------------
       
   264 //
       
   265 TInt CVcxMyVideosCollectionUtilTest::DownloadIdL( CStifItemParser& /*aItem*/ )
       
   266     {
       
   267     CMPXMedia* media = CMPXMedia::NewL();
       
   268     TInt retVal( KErrNone );
       
   269     TUint32 idSet( 0xBEEF );
       
   270     media->SetTObjectValueL<TUint32>( KVcxMediaMyVideosDownloadId, idSet );
       
   271     TUint32 idGet( TVcxMyVideosCollectionUtil::DownloadIdL( *media ) );
       
   272     if( idSet != idGet )
       
   273         {
       
   274         retVal = KErrGeneral;
       
   275         }
       
   276     delete media;
       
   277     return retVal;
       
   278     }
       
   279 
       
   280 // ----------------------------------------------------------------------------
       
   281 // CVcxMyVideosCollectionUtilTest::DownloadStateL
       
   282 // ----------------------------------------------------------------------------
       
   283 //
       
   284 TInt CVcxMyVideosCollectionUtilTest::DownloadStateL( CStifItemParser& /*aItem*/ )
       
   285     {
       
   286     CMPXMedia* media = CMPXMedia::NewL();    
       
   287     TInt retVal( KErrNone );
       
   288     TVcxMyVideosDownloadState stateSet = EVcxMyVideosDlStateFailed;
       
   289     media->SetTObjectValueL<TUint32>( KVcxMediaMyVideosDownloadState, stateSet );
       
   290     TVcxMyVideosDownloadState stateGet = TVcxMyVideosCollectionUtil::DownloadStateL( *media );    
       
   291     if( stateSet != stateGet )
       
   292         {
       
   293         retVal = KErrGeneral;
       
   294         }
       
   295     delete media;
       
   296     return retVal;
       
   297     }
       
   298 
       
   299 // ----------------------------------------------------------------------------
       
   300 // CVcxMyVideosCollectionUtilTest::IdL
       
   301 // ----------------------------------------------------------------------------
       
   302 //
       
   303 TInt CVcxMyVideosCollectionUtilTest::IdL( CStifItemParser& /*aItem*/ )
       
   304     {
       
   305     CMPXMedia* media = CMPXMedia::NewL();
       
   306     TInt retVal( KErrNone );
       
   307     TMPXItemId idSet( 2, 7 );
       
   308     media->SetTObjectValueL<TMPXItemId>( KMPXMediaGeneralId, idSet );
       
   309     TMPXItemId idGet = TVcxMyVideosCollectionUtil::IdL( *media );;
       
   310     if( idSet != idGet )
       
   311         {
       
   312         retVal = KErrGeneral;
       
   313         }
       
   314     delete media;
       
   315     return retVal;
       
   316     }
       
   317 
       
   318 // ----------------------------------------------------------------------------
       
   319 // CVcxMyVideosCollectionUtilTest::DurationL
       
   320 // ----------------------------------------------------------------------------
       
   321 //
       
   322 TInt CVcxMyVideosCollectionUtilTest::DurationL( CStifItemParser& /*aItem*/ )
       
   323     {
       
   324     CMPXMedia* media = CMPXMedia::NewL();
       
   325     TInt retVal( KErrNone );
       
   326     TReal32 durationSet( 150 );
       
   327     media->SetTObjectValueL<TReal32>( KVcxMediaMyVideosDuration, durationSet );
       
   328     TReal32 durationGet = TVcxMyVideosCollectionUtil::DurationL( *media );;
       
   329     if( durationSet != durationGet )
       
   330         {
       
   331         retVal = KErrGeneral;
       
   332         }
       
   333     delete media;
       
   334     return retVal;
       
   335     }
       
   336 
       
   337 // ----------------------------------------------------------------------------
       
   338 // TVcxMyVideosCollectionUtil::Title
       
   339 // ----------------------------------------------------------------------------
       
   340 //
       
   341 TInt CVcxMyVideosCollectionUtilTest::TitleL( CStifItemParser& /*aItem*/ )
       
   342     {
       
   343     CMPXMedia* media = CMPXMedia::NewL();
       
   344     TInt retVal( KErrNone );
       
   345     _LIT( valueSet, "TeamNinja" );
       
   346     media->SetTextValueL( KMPXMediaGeneralTitle, valueSet );
       
   347     HBufC* valueGet = TVcxMyVideosCollectionUtil::Title( *media ).AllocL();
       
   348     if( valueGet->CompareF( valueSet ) )
       
   349         {
       
   350         retVal = KErrGeneral;
       
   351         }
       
   352     delete media;
       
   353     delete valueGet;
       
   354     return retVal;       
       
   355     }
       
   356 
       
   357 // ----------------------------------------------------------------------------
       
   358 // CVcxMyVideosCollectionUtilTest::RatingL
       
   359 // ----------------------------------------------------------------------------
       
   360 //
       
   361 TInt CVcxMyVideosCollectionUtilTest::RatingL( CStifItemParser& /*aItem*/ )
       
   362     {
       
   363     CMPXMedia* media = CMPXMedia::NewL();
       
   364     TInt retVal( KErrNone );
       
   365     TUint8 valueSet( 21 );
       
   366     media->SetTObjectValueL<TUint8>( KVcxMediaMyVideosRating, valueSet );
       
   367     TUint8 valueGet = TVcxMyVideosCollectionUtil::RatingL( *media );;
       
   368     if( valueSet != valueGet )
       
   369         {
       
   370         retVal = KErrGeneral;
       
   371         }
       
   372     delete media;
       
   373     return retVal;
       
   374     }
       
   375 
       
   376 // ----------------------------------------------------------------------------
       
   377 // CVcxMyVideosCollectionUtilTest::AudioFourCcL
       
   378 // ----------------------------------------------------------------------------
       
   379 //
       
   380 TInt CVcxMyVideosCollectionUtilTest::AudioFourCcL( CStifItemParser& /*aItem*/ )
       
   381     {
       
   382     CMPXMedia* media = CMPXMedia::NewL();
       
   383     TInt retVal( KErrNone );
       
   384     TUint32 valueSet( 21 );
       
   385     media->SetTObjectValueL<TUint32>( KVcxMediaMyVideosAudioFourCc, valueSet );
       
   386     TUint32 valueGet = TVcxMyVideosCollectionUtil::AudioFourCcL( *media );;
       
   387     if( valueSet != valueGet )
       
   388         {
       
   389         retVal = KErrGeneral;
       
   390         }
       
   391     delete media;
       
   392     return retVal;
       
   393     }
       
   394 
       
   395 // ----------------------------------------------------------------------------
       
   396 // CVcxMyVideosCollectionUtilTest::AreSupported
       
   397 // ----------------------------------------------------------------------------
       
   398 //
       
   399 TInt CVcxMyVideosCollectionUtilTest::AreSupportedL( CStifItemParser& /*aItem*/ )
       
   400     {
       
   401     TInt retVal( KErrNone );
       
   402     CMPXMedia* media = CMPXMedia::NewL();
       
   403     RArray<TMPXAttribute> attrs;
       
   404     attrs.Append( KMPXMediaGeneralMimeType );
       
   405     TBool inMds( EFalse );
       
   406     TVcxMyVideosCollectionUtil::AreSupported( *media, attrs.Array(), inMds );
       
   407     delete media;
       
   408     return retVal;
       
   409     }
       
   410 
       
   411 // ----------------------------------------------------------------------------
       
   412 // CVcxMyVideosCollectionUtilTest::AttrBelongsToFullSet
       
   413 // ----------------------------------------------------------------------------
       
   414 //
       
   415 TInt CVcxMyVideosCollectionUtilTest::AttrBelongsToFullSetL( CStifItemParser& /*aItem*/ )
       
   416     {
       
   417     TInt retVal( KErrNone );
       
   418     // TMPXAttribute attr;
       
   419     // attr = KMPXMediaGeneralMimeType;
       
   420     if ( !( TVcxMyVideosCollectionUtil::AttrBelongsToFullSet( KMPXMediaGeneralComment ) &&
       
   421          TVcxMyVideosCollectionUtil::AttrBelongsToFullSet( KMPXMediaGeneralCopyright ) &&
       
   422          TVcxMyVideosCollectionUtil::AttrBelongsToFullSet( KMPXMediaGeneralMimeType ) &&
       
   423          TVcxMyVideosCollectionUtil::AttrBelongsToFullSet( KMPXMediaGeneralLastPlaybackPosition ) &&
       
   424          TVcxMyVideosCollectionUtil::AttrBelongsToFullSet( KVcxMediaMyVideosModifiedDate ) &&
       
   425          TVcxMyVideosCollectionUtil::AttrBelongsToFullSet( KVcxMediaMyVideosAudioLanguage ) &&
       
   426          TVcxMyVideosCollectionUtil::AttrBelongsToFullSet( KVcxMediaMyVideosAuthor ) &&
       
   427          TVcxMyVideosCollectionUtil::AttrBelongsToFullSet( KMPXMediaVideoBitRate ) &&
       
   428          TVcxMyVideosCollectionUtil::AttrBelongsToFullSet( KMPXMediaVideoHeight ) &&
       
   429          TVcxMyVideosCollectionUtil::AttrBelongsToFullSet( KMPXMediaVideoWidth ) &&
       
   430          TVcxMyVideosCollectionUtil::AttrBelongsToFullSet( KMPXMediaVideoArtist ) ) )
       
   431         {
       
   432         retVal = KErrGeneral;
       
   433         }
       
   434         
       
   435     return retVal;
       
   436     }
       
   437 
       
   438 // ----------------------------------------------------------------------------
       
   439 // CVcxMyVideosCollectionUtilTest::Origin
       
   440 // ----------------------------------------------------------------------------
       
   441 //
       
   442 TInt CVcxMyVideosCollectionUtilTest::Origin( CStifItemParser& /*aItem*/ )
       
   443     {
       
   444     TInt retVal( KErrNone );
       
   445     
       
   446     if ( ( TVcxMyVideosCollectionUtil::Origin( KVcxMvcCategoryIdDownloads ) 
       
   447             != EVcxMyVideosOriginDownloaded ) ||
       
   448          ( TVcxMyVideosCollectionUtil::Origin( KVcxMvcCategoryIdTvRecordings ) 
       
   449             != EVcxMyVideosOriginTvRecording ) ||
       
   450          ( TVcxMyVideosCollectionUtil::Origin( KVcxMvcCategoryIdCaptured ) 
       
   451             != EVcxMyVideosOriginCapturedWithCamera ) ||
       
   452          ( TVcxMyVideosCollectionUtil::Origin( KVcxMvcCategoryIdOther ) 
       
   453             != EVcxMyVideosOriginOther ) ||
       
   454          ( TVcxMyVideosCollectionUtil::Origin( KVcxMvcCategoryIdAll ) 
       
   455             != KErrNotFound ) )
       
   456         {
       
   457         retVal = KErrGeneral;
       
   458         }
       
   459     
       
   460     return retVal;
       
   461     }   
       
   462 
       
   463 // ----------------------------------------------------------------------------
       
   464 // CVcxMyVideosCollectionUtilTest::PrintOpenFileHandlesL
       
   465 // ----------------------------------------------------------------------------
       
   466 //
       
   467 TInt CVcxMyVideosCollectionUtilTest::PrintOpenFileHandlesL( CStifItemParser& /*aItem*/ )
       
   468     {
       
   469     TInt retVal( KErrNone );
       
   470     
       
   471 #ifdef _DEBUG
       
   472     RFs fs;
       
   473     RFile file;
       
   474     _LIT( KFileName,        "c:\\data\\vcxmyvideoscollectionutiltest_file.txt" );
       
   475     _LIT( KInvalidFileName, "c:\\data\\vcxmyvideoscollectionutiltest_fail.txt" );    
       
   476     User::LeaveIfError( fs.Connect() );
       
   477     User::LeaveIfError( file.Open( fs, KFileName, EFileShareAny | EFileRead ) );
       
   478     
       
   479     TVcxMyVideosCollectionUtil::PrintOpenFileHandlesL( KFileName, fs );
       
   480     TVcxMyVideosCollectionUtil::PrintOpenFileHandlesL( KInvalidFileName, fs );
       
   481     
       
   482     file.Close();
       
   483     fs.Close();    
       
   484 #endif // _DEBUG
       
   485     
       
   486     return retVal;
       
   487     }   
       
   488 
       
   489 // ----------------------------------------------------------------------------
       
   490 // CVcxMyVideosCollectionUtilTest::GetProcessName
       
   491 // ----------------------------------------------------------------------------
       
   492 //
       
   493 TInt CVcxMyVideosCollectionUtilTest::GetProcessNameL( CStifItemParser& aItem )
       
   494     {
       
   495     TInt retVal( KErrNone );
       
   496     TPtrC testProcessName;
       
   497     TUint64 threadId = RThread().Id().Id();
       
   498     TFullName processName;
       
   499     //_LIT( KTestProcessName, "testscripter_vcxmyvideoscollectionutiltest" );
       
   500 
       
   501     retVal = aItem.GetNextString( testProcessName );
       
   502     
       
   503 #ifdef _DEBUG    
       
   504     if ( retVal == KErrNone )
       
   505         {
       
   506         TVcxMyVideosCollectionUtil::GetProcessName( threadId, processName );
       
   507         if ( processName.Find( testProcessName ) == KErrNotFound )
       
   508             {
       
   509             retVal = KErrNotFound;
       
   510             }
       
   511         }
       
   512 #endif // _DEBUG    
       
   513     return retVal;
       
   514     }
       
   515 
       
   516 // -----------------------------------------------------------------------------
       
   517 // CVcxMyVideosCollectionUtilTest::?member_function
       
   518 // ?implementation_description
       
   519 // (other items were commented in a header).
       
   520 // -----------------------------------------------------------------------------
       
   521 //
       
   522 /*
       
   523 TInt CVcxMyVideosCollectionUtilTest::?member_function(
       
   524    CItemParser& aItem )
       
   525    {
       
   526 
       
   527    ?code
       
   528 
       
   529    }
       
   530 */
       
   531 
       
   532 // ========================== OTHER EXPORTED FUNCTIONS =========================
       
   533 // None
       
   534 
       
   535 //  [End of File] - Do not remove