videoutils_plat/videoscheduler_api/tsrc/src/videoscheduler_apitestblocks.cpp
branchRCL_3
changeset 22 826cea16efd9
parent 21 798ee5f1972c
child 23 13a33d82ad98
equal deleted inserted replaced
21:798ee5f1972c 22:826cea16efd9
     1 /*
       
     2 * Copyright (c) 2002 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 the License "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:   ?Description*
       
    15 */
       
    16 
       
    17 
       
    18 
       
    19 
       
    20 // [INCLUDE FILES] - do not remove
       
    21 #include <e32svr.h>
       
    22 #include <StifParser.h>
       
    23 #include <Stiftestinterface.h>
       
    24 #include "videoscheduler_apitest.h"
       
    25 #include <S32MEM.H>
       
    26 
       
    27 #include <ipvideo/CCseSchedulerAPI.h>
       
    28 #include <ipvideo/CCseScheduledProgram.h>
       
    29 
       
    30 #include "vcxtestlog.h"
       
    31 
       
    32 // EXTERNAL DATA STRUCTURES
       
    33 //extern  ?external_data;
       
    34 
       
    35 // EXTERNAL FUNCTION PROTOTYPES
       
    36 //extern ?external_function( ?arg_type,?arg_type );
       
    37 
       
    38 // CONSTANTS
       
    39 //const ?type ?constant_var = ?constant;
       
    40 
       
    41 // MACROS
       
    42 //#define ?macro ?macro_def
       
    43 
       
    44 // LOCAL CONSTANTS AND MACROS
       
    45 //const ?type ?constant_var = ?constant;
       
    46 //#define ?macro_name ?macro_def
       
    47 
       
    48 // MODULE DATA STRUCTURES
       
    49 //enum ?declaration
       
    50 //typedef ?declaration
       
    51 
       
    52 // LOCAL FUNCTION PROTOTYPES
       
    53 //?type ?function_name( ?arg_type, ?arg_type );
       
    54 
       
    55 // FORWARD DECLARATIONS
       
    56 //class ?FORWARD_CLASSNAME;
       
    57 
       
    58 // ============================= LOCAL FUNCTIONS ===============================
       
    59 
       
    60 // -----------------------------------------------------------------------------
       
    61 // ?function_name ?description.
       
    62 // ?description
       
    63 // Returns: ?value_1: ?description
       
    64 //          ?value_n: ?description_line1
       
    65 //                    ?description_line2
       
    66 // -----------------------------------------------------------------------------
       
    67 //
       
    68 /*
       
    69 ?type ?function_name(
       
    70     ?arg_type arg,  // ?description
       
    71     ?arg_type arg)  // ?description
       
    72     {
       
    73 
       
    74     ?code  // ?comment
       
    75 
       
    76     // ?comment
       
    77     ?code
       
    78     }
       
    79 */
       
    80 
       
    81 // ============================ MEMBER FUNCTIONS ===============================
       
    82 
       
    83 // -----------------------------------------------------------------------------
       
    84 // CVideoScheduler_ApiTest::Delete
       
    85 // Delete here all resources allocated and opened from test methods.
       
    86 // Called from destructor.
       
    87 // -----------------------------------------------------------------------------
       
    88 //
       
    89 void CVideoScheduler_ApiTest::Delete()
       
    90     {
       
    91     if( iApi )
       
    92         {
       
    93         for( TInt i=0; i<iAddedProgramIds.Count(); i++ )
       
    94             {
       
    95             iApi->RemoveSchedule( iAddedProgramIds[i] );
       
    96             }
       
    97         }
       
    98     
       
    99     delete iApi;
       
   100     iApi = NULL;
       
   101     
       
   102     delete iProgram;
       
   103     iProgram = NULL;
       
   104     
       
   105     delete iExternalizeBuff;
       
   106     iExternalizeBuff = NULL;
       
   107     
       
   108     iAddedProgramIds.Close();
       
   109     }
       
   110 
       
   111 // -----------------------------------------------------------------------------
       
   112 // CVideoScheduler_ApiTest::RunMethodL
       
   113 // Run specified method. Contains also table of test mothods and their names.
       
   114 // -----------------------------------------------------------------------------
       
   115 //
       
   116 TInt CVideoScheduler_ApiTest::RunMethodL(
       
   117     CStifItemParser& aItem )
       
   118     {
       
   119 
       
   120     static TStifFunctionInfo const KFunctions[] =
       
   121         {
       
   122         // Copy this line for every implemented function.
       
   123         // First string is the function name used in TestScripter script file.
       
   124         // Second is the actual implementation member function.
       
   125         ENTRY( "API_NewL", CVideoScheduler_ApiTest::API_NewL ),
       
   126         ENTRY( "API_AddSchedule", CVideoScheduler_ApiTest::API_AddScheduleL ),
       
   127         ENTRY( "API_RemoveSchedule", CVideoScheduler_ApiTest::API_RemoveScheduleL ),
       
   128         ENTRY( "RemoveAllSchedules", CVideoScheduler_ApiTest::RemoveAllSchedulesL ),
       
   129         ENTRY( "API_GetSchedule", CVideoScheduler_ApiTest::API_GetScheduleL ),
       
   130         ENTRY( "API_GetSchedulesByAppUid", CVideoScheduler_ApiTest::API_GetSchedulesByAppUidL ),
       
   131         ENTRY( "API_GetOverlappingSchedules", CVideoScheduler_ApiTest::API_GetOverlappingSchedulesL ),
       
   132         ENTRY( "API_GetSchedulesByPluginUid", CVideoScheduler_ApiTest::API_GetSchedulesByPluginUidL ),
       
   133         ENTRY( "API_GetSchedulesByType", CVideoScheduler_ApiTest::API_GetSchedulesByTypeL ),
       
   134         ENTRY( "API_GetSchedulesByTime", CVideoScheduler_ApiTest::API_GetSchedulesByTimeL ),
       
   135 
       
   136         ENTRY( "Program_NewL", CVideoScheduler_ApiTest::Program_NewL ),
       
   137         ENTRY( "Program_NewLFromProgram", CVideoScheduler_ApiTest::Program_NewLFromProgramL ),
       
   138         ENTRY( "Program_Externalize", CVideoScheduler_ApiTest::Program_ExternalizeLL ),
       
   139         ENTRY( "Program_Internalize", CVideoScheduler_ApiTest::Program_InternalizeLL ),
       
   140         ENTRY( "Program_ExternalizeLength", CVideoScheduler_ApiTest::Program_ExternalizeLengthL ),
       
   141         ENTRY( "Program_SetPluginType", CVideoScheduler_ApiTest::Program_SetPluginTypeL ),
       
   142         ENTRY( "Program_SetName", CVideoScheduler_ApiTest::Program_SetNameL ),
       
   143         ENTRY( "Program_SetStartTime", CVideoScheduler_ApiTest::Program_SetStartTimeL ),
       
   144         ENTRY( "Program_SetEndTime", CVideoScheduler_ApiTest::Program_SetEndTimeL ),
       
   145         ENTRY( "Program_SetAppUid", CVideoScheduler_ApiTest::Program_SetAppUidL ),
       
   146         ENTRY( "Program_SetPluginUid", CVideoScheduler_ApiTest::Program_SetPluginUidL ),
       
   147         ENTRY( "Program_SetApplicationData", CVideoScheduler_ApiTest::Program_SetApplicationDataLL ),
       
   148         ENTRY( "Program_SetDbIdentifier", CVideoScheduler_ApiTest::Program_SetDbIdentifierL ),
       
   149         ENTRY( "Program_SetScheduleType", CVideoScheduler_ApiTest::Program_SetScheduleTypeL ),
       
   150         ENTRY( "Program_PluginType", CVideoScheduler_ApiTest::Program_PluginTypeL ),
       
   151         ENTRY( "Program_Name", CVideoScheduler_ApiTest::Program_NameL ),
       
   152         ENTRY( "Program_StartTime", CVideoScheduler_ApiTest::Program_StartTimeL ),
       
   153         ENTRY( "Program_EndTime", CVideoScheduler_ApiTest::Program_EndTimeL ),
       
   154         ENTRY( "Program_AppUid", CVideoScheduler_ApiTest::Program_AppUidL ),
       
   155         ENTRY( "Program_PluginUid", CVideoScheduler_ApiTest::Program_PluginUidL ),
       
   156         ENTRY( "Program_ApplicationData", CVideoScheduler_ApiTest::Program_ApplicationDataL ),
       
   157         ENTRY( "Program_DbIdentifier", CVideoScheduler_ApiTest::Program_DbIdentifierL ),
       
   158         ENTRY( "Program_ScheduleType", CVideoScheduler_ApiTest::Program_ScheduleTypeL ),
       
   159         ENTRY( "Program_DebugDump", CVideoScheduler_ApiTest::Program_DebugDumpL ),
       
   160 
       
   161         ENTRY( "Program_SetToFuture", CVideoScheduler_ApiTest::Program_SetToFutureL ),
       
   162         // [test cases entries] - Do not remove
       
   163 
       
   164         };
       
   165 
       
   166     const TInt count = sizeof( KFunctions ) /
       
   167                         sizeof( TStifFunctionInfo );
       
   168 
       
   169     return RunInternalL( KFunctions, count, aItem );
       
   170 
       
   171     }
       
   172 
       
   173 // -----------------------------------------------------------------------------
       
   174 // CVideoScheduler_ApiTest::LogMethod
       
   175 // Generate log from current method
       
   176 // -----------------------------------------------------------------------------
       
   177 //
       
   178 void CVideoScheduler_ApiTest::LogMethod( TPtrC aMethod )
       
   179     {
       
   180     // Print to UI
       
   181     TBuf< 64 > buffer;
       
   182     buffer.Format( KLogLocation, &aMethod );
       
   183     TestModuleIf().Printf( 0, KTestModuleName, buffer );
       
   184     // Print to log file
       
   185     iLog->Log( buffer );
       
   186     }
       
   187 
       
   188 // -----------------------------------------------------------------------------
       
   189 // CVideoScheduler_ApiTest::API_NewL
       
   190 // -----------------------------------------------------------------------------
       
   191 //
       
   192 TInt CVideoScheduler_ApiTest::API_NewL( CStifItemParser& aItem )
       
   193     {
       
   194     LogMethod(_L("API_NewL"));
       
   195 
       
   196     TInt err( KErrNone );
       
   197     
       
   198     iApi = CCseSchedulerApi::NewL();
       
   199     
       
   200     TInt createProgram( 1 );
       
   201     if( aItem.GetNextInt( createProgram ) != KErrNone )
       
   202         {
       
   203         createProgram = 1;
       
   204         }
       
   205     
       
   206     if( createProgram == 1 )
       
   207         {
       
   208         iProgram = CCseScheduledProgram::NewL();
       
   209 
       
   210         RPointerArray<CCseScheduledProgram> programs;    
       
   211         err = iApi->GetSchedulesByAppUid( 0x020202, programs );
       
   212         if( err == KErrNone )
       
   213             {
       
   214             for( TInt i=0; i < programs.Count(); i++ )
       
   215                 {
       
   216                 iApi->RemoveSchedule( programs[i]->DbIdentifier() );
       
   217                 }
       
   218             }
       
   219         programs.ResetAndDestroy();
       
   220         }
       
   221     
       
   222     return err;
       
   223     }
       
   224 
       
   225 // -----------------------------------------------------------------------------
       
   226 // CVideoScheduler_ApiTest::API_AddScheduleL
       
   227 // -----------------------------------------------------------------------------
       
   228 //
       
   229 TInt CVideoScheduler_ApiTest::API_AddScheduleL( CStifItemParser& /*aItem*/ )
       
   230     {
       
   231     LogMethod(_L("API_AddSchedule"));
       
   232     VCXLOGLO1("CVideoScheduler_ApiTest::API_AddScheduleL ------>");
       
   233     
       
   234     TInt err( KErrNone );
       
   235 
       
   236     err = iApi->AddSchedule( *iProgram );
       
   237     VCXLOGLO2("CVideoScheduler_ApiTest::API_AddScheduleL: DBID after: %d", iProgram->DbIdentifier() );
       
   238     iAddedProgramIds.Append( iProgram->DbIdentifier() );
       
   239     
       
   240     return err;
       
   241     }
       
   242 
       
   243 // -----------------------------------------------------------------------------
       
   244 // CVideoScheduler_ApiTest::API_RemoveScheduleL
       
   245 // -----------------------------------------------------------------------------
       
   246 //
       
   247 TInt CVideoScheduler_ApiTest::API_RemoveScheduleL( CStifItemParser& aItem )
       
   248     {
       
   249     VCXLOGLO1("CVideoScheduler_ApiTest::API_RemoveScheduleL ------>");
       
   250     LogMethod(_L("API_RemoveScheduleL"));
       
   251 
       
   252     TInt err( KErrNone );
       
   253     
       
   254     VCXLOGLO2("CVideoScheduler_ApiTest::API_RemoveScheduleL: DBID: %d", iProgram->DbIdentifier() );
       
   255     
       
   256     TUint32 id = iProgram->DbIdentifier();
       
   257     err = iApi->RemoveSchedule( id );
       
   258     
       
   259     for( TInt i=0; i<iAddedProgramIds.Count(); i++ )
       
   260         {
       
   261         if( iAddedProgramIds[i] == id )
       
   262             {
       
   263             iAddedProgramIds.Remove( i );
       
   264             break;
       
   265             }
       
   266         }    
       
   267 
       
   268     return err;
       
   269     }
       
   270 
       
   271 // -----------------------------------------------------------------------------
       
   272 // CVideoScheduler_ApiTest::RemoveAllSchedulesL
       
   273 // -----------------------------------------------------------------------------
       
   274 //
       
   275 TInt CVideoScheduler_ApiTest::RemoveAllSchedulesL( CStifItemParser& /*aItem*/ )
       
   276     {
       
   277     VCXLOGLO1("CVideoScheduler_ApiTest::RemoveAllSchedulesL ------>");
       
   278     LogMethod(_L("RemoveAllSchedulesL"));
       
   279 
       
   280     TInt err( KErrNone );
       
   281     
       
   282     while( iAddedProgramIds.Count() )
       
   283         {
       
   284         VCXLOGLO2("CVideoScheduler_ApiTest::RemoveAllSchedulesL -- remove ID %d", iAddedProgramIds[0]);
       
   285         err = iApi->RemoveSchedule( iAddedProgramIds[0] );
       
   286 
       
   287         iAddedProgramIds.Remove( 0 );
       
   288         
       
   289         if( err != KErrNone )
       
   290             {
       
   291             VCXLOGLO2("CVideoScheduler_ApiTest::RemoveAllSchedulesL -- Failed: %d", err);
       
   292             }
       
   293         }
       
   294     
       
   295     VCXLOGLO2("CVideoScheduler_ApiTest::RemoveAllSchedulesL <------ %d", err);
       
   296     return err;
       
   297     }
       
   298 
       
   299 // -----------------------------------------------------------------------------
       
   300 // CVideoScheduler_ApiTest::API_GetScheduleL
       
   301 // -----------------------------------------------------------------------------
       
   302 //
       
   303 TInt CVideoScheduler_ApiTest::API_GetScheduleL( CStifItemParser& /*aItem*/ )
       
   304     {
       
   305     VCXLOGLO1("CVideoScheduler_ApiTest::API_GetScheduleL ------>");
       
   306     LogMethod(_L("API_GetScheduleL"));
       
   307 
       
   308     TInt err( KErrNone );
       
   309 
       
   310     CCseScheduledProgram* program = CCseScheduledProgram::NewL();
       
   311     CleanupStack::PushL( program );
       
   312     
       
   313     err = iApi->GetSchedule( iProgram->DbIdentifier(), program );
       
   314     
       
   315     if( err == KErrNone )
       
   316         {
       
   317         if( !program )
       
   318             {
       
   319             VCXLOGLO1("CVideoScheduler_ApiTest::API_GetScheduleL: Error, program is NULL.");
       
   320             err = KErrCorrupt;
       
   321             }
       
   322         else
       
   323             {
       
   324             err = ComparePrograms( *program, *iProgram );
       
   325             }
       
   326         }
       
   327     
       
   328     CleanupStack::PopAndDestroy( program );
       
   329     
       
   330     return err;
       
   331     }
       
   332 
       
   333 // -----------------------------------------------------------------------------
       
   334 // CVideoScheduler_ApiTest::API_GetSchedulesByAppUidL
       
   335 // -----------------------------------------------------------------------------
       
   336 //
       
   337 TInt CVideoScheduler_ApiTest::API_GetSchedulesByAppUidL( CStifItemParser& aItem )
       
   338     {
       
   339     VCXLOGLO1("CVideoScheduler_ApiTest::API_GetSchedulesByAppUidL ------>");
       
   340     LogMethod(_L("API_GetSchedulesByAppUidL"));
       
   341 
       
   342     TInt err( KErrNone );
       
   343     
       
   344     TInt appUid( 0 );
       
   345     User::LeaveIfError( aItem.GetNextInt( appUid ) );
       
   346     
       
   347     TInt expectedCount(0);
       
   348     User::LeaveIfError( aItem.GetNextInt( expectedCount ) );
       
   349 
       
   350     RPointerArray<CCseScheduledProgram> programs;    
       
   351     
       
   352     err = iApi->GetSchedulesByAppUid( appUid, programs );
       
   353 
       
   354     if( err == KErrNone )
       
   355         {
       
   356         if( programs.Count() != expectedCount )
       
   357             {
       
   358             err = KErrCorrupt;
       
   359             }
       
   360         else 
       
   361         if( programs.Count() > 0 )
       
   362             {
       
   363             delete iProgram;
       
   364             iProgram = NULL;
       
   365             
       
   366             iProgram = programs[0];
       
   367             programs.Remove( 0 );
       
   368             }
       
   369         }
       
   370 
       
   371     programs.ResetAndDestroy();
       
   372     
       
   373     return err;
       
   374     }
       
   375 
       
   376 // -----------------------------------------------------------------------------
       
   377 // CVideoScheduler_ApiTest::API_GetOverlappingSchedulesL
       
   378 // -----------------------------------------------------------------------------
       
   379 //
       
   380 TInt CVideoScheduler_ApiTest::API_GetOverlappingSchedulesL( CStifItemParser& aItem )
       
   381     {
       
   382     VCXLOGLO1("CVideoScheduler_ApiTest::API_GetOverlappingSchedulesL ------>");
       
   383     LogMethod(_L("API_GetOverlappingSchedulesL"));
       
   384 
       
   385     TInt err( KErrNone );
       
   386 
       
   387     TInt expectedCount(0);
       
   388     User::LeaveIfError( aItem.GetNextInt( expectedCount ) );
       
   389     
       
   390     RPointerArray<CCseScheduledProgram> programs;
       
   391     
       
   392     err = iApi->GetOverlappingSchedules( *iProgram, programs );
       
   393 
       
   394     if( err == KErrNone )
       
   395         {
       
   396         if( programs.Count() != expectedCount )
       
   397             {
       
   398             err = KErrCorrupt;
       
   399             }
       
   400         else 
       
   401         if( programs.Count() > 0 )
       
   402             {
       
   403             delete iProgram;
       
   404             iProgram = NULL;
       
   405             
       
   406             iProgram = programs[0];
       
   407             programs.Remove( 0 );
       
   408             }
       
   409         }
       
   410     
       
   411     programs.ResetAndDestroy();
       
   412     
       
   413     return err;
       
   414     }
       
   415 
       
   416 // -----------------------------------------------------------------------------
       
   417 // CVideoScheduler_ApiTest::API_GetSchedulesByPluginUidL
       
   418 // -----------------------------------------------------------------------------
       
   419 //
       
   420 TInt CVideoScheduler_ApiTest::API_GetSchedulesByPluginUidL( CStifItemParser& aItem )
       
   421     {
       
   422     VCXLOGLO1("CVideoScheduler_ApiTest::API_GetSchedulesByPluginUidL ------>");
       
   423     LogMethod(_L("API_GetSchedulesByPluginUidL"));
       
   424 
       
   425     TInt err( KErrNone );
       
   426 
       
   427     TInt pluginUid( 0 );
       
   428     User::LeaveIfError( aItem.GetNextInt( pluginUid ) ); 
       
   429     
       
   430     TInt expectedCount(0);
       
   431     User::LeaveIfError( aItem.GetNextInt( expectedCount ) );
       
   432     
       
   433     RPointerArray<CCseScheduledProgram> programs;
       
   434     
       
   435     err = iApi->GetSchedulesByPluginUid( pluginUid, programs );
       
   436 
       
   437     if( err == KErrNone )
       
   438         {
       
   439         if( programs.Count() != expectedCount )
       
   440             {
       
   441             err = KErrCorrupt;
       
   442             }
       
   443         else 
       
   444         if( programs.Count() > 0 )
       
   445             {
       
   446             delete iProgram;
       
   447             iProgram = NULL;
       
   448             
       
   449             iProgram = programs[0];
       
   450             programs.Remove( 0 );
       
   451             }
       
   452         }    
       
   453     
       
   454     programs.ResetAndDestroy();
       
   455     
       
   456     return err;
       
   457     }
       
   458 
       
   459 
       
   460 // -----------------------------------------------------------------------------
       
   461 // CVideoScheduler_ApiTest::API_GetSchedulesByTypeL
       
   462 // -----------------------------------------------------------------------------
       
   463 //
       
   464 TInt CVideoScheduler_ApiTest::API_GetSchedulesByTypeL( CStifItemParser& aItem )
       
   465     {
       
   466     VCXLOGLO1("CVideoScheduler_ApiTest::API_GetSchedulesByTypeL ------>");
       
   467     LogMethod(_L("API_GetSchedulesByTypeL"));
       
   468 
       
   469     TInt err( KErrNone );
       
   470 
       
   471     TInt type(0);
       
   472     User::LeaveIfError( aItem.GetNextInt( type ) );
       
   473 
       
   474     TInt expectedCount(0);
       
   475     User::LeaveIfError( aItem.GetNextInt( expectedCount ) );
       
   476     
       
   477     RPointerArray<CCseScheduledProgram> programs;
       
   478     
       
   479     err = iApi->GetSchedulesByType( type, programs );
       
   480 
       
   481     if( err == KErrNone )
       
   482         {
       
   483         VCXLOGLO2("CVideoScheduler_ApiTest::API_GetSchedulesByTypeL count:    %d", programs.Count());
       
   484         VCXLOGLO2("CVideoScheduler_ApiTest::API_GetSchedulesByTypeL expected: %d", expectedCount);
       
   485         if( programs.Count() != expectedCount )
       
   486             {
       
   487             err = KErrCorrupt;
       
   488             }
       
   489         else 
       
   490         if( programs.Count() > 0 )
       
   491             {
       
   492             delete iProgram;
       
   493             iProgram = NULL;
       
   494             
       
   495             iProgram = programs[0];
       
   496             programs.Remove( 0 );
       
   497             }        
       
   498         }
       
   499     
       
   500     programs.ResetAndDestroy();
       
   501     
       
   502     return err;
       
   503     }
       
   504 
       
   505 
       
   506 // -----------------------------------------------------------------------------
       
   507 // CVideoScheduler_ApiTest::API_GetSchedulesByTimeL
       
   508 // -----------------------------------------------------------------------------
       
   509 //
       
   510 TInt CVideoScheduler_ApiTest::API_GetSchedulesByTimeL( CStifItemParser& aItem )
       
   511     {
       
   512     VCXLOGLO1("CVideoScheduler_ApiTest::API_GetSchedulesByTimeL ------>");
       
   513     LogMethod(_L("API_GetSchedulesByTimeL"));
       
   514 
       
   515     TInt err( KErrNone );
       
   516     TInt intervalStart( 0 );
       
   517     TInt intervalEnd( 0 );
       
   518     
       
   519     User::LeaveIfError( aItem.GetNextInt( intervalStart ) );
       
   520     User::LeaveIfError( aItem.GetNextInt( intervalEnd ) );
       
   521     
       
   522     TTime startTime( 0 );
       
   523     TTime endTime( 0 );
       
   524     
       
   525     startTime.UniversalTime();
       
   526     endTime.UniversalTime();
       
   527     
       
   528     startTime += TTimeIntervalSeconds( intervalStart );
       
   529     endTime += TTimeIntervalSeconds( intervalEnd );
       
   530     
       
   531     TInt expectedCount(0);
       
   532     User::LeaveIfError( aItem.GetNextInt( expectedCount ) );
       
   533     
       
   534     RPointerArray<CCseScheduledProgram> programs;
       
   535     
       
   536     err = iApi->GetSchedulesByTime( startTime, endTime, programs );
       
   537 
       
   538     if( err == KErrNone )
       
   539         {
       
   540         if( programs.Count() != expectedCount )
       
   541             {
       
   542             err = KErrCorrupt;
       
   543             }
       
   544         else 
       
   545         if( programs.Count() > 0 )
       
   546             {
       
   547             delete iProgram;
       
   548             iProgram = NULL;
       
   549             
       
   550             iProgram = programs[0];
       
   551             programs.Remove( 0 );
       
   552             }  
       
   553         }    
       
   554     
       
   555     programs.ResetAndDestroy();
       
   556     
       
   557     return err;
       
   558     }
       
   559 
       
   560 
       
   561 // -----------------------------------------------------------------------------
       
   562 // CVideoScheduler_ApiTest::Program_NewL
       
   563 // -----------------------------------------------------------------------------
       
   564 //
       
   565 TInt CVideoScheduler_ApiTest::Program_NewL( CStifItemParser& /*aItem*/ )
       
   566     {
       
   567     VCXLOGLO1("CVideoScheduler_ApiTest::Program_NewL ------>");
       
   568     LogMethod(_L("Program_NewL"));
       
   569 
       
   570     TInt err( KErrNone );
       
   571     
       
   572     iProgram = CCseScheduledProgram::NewL();
       
   573     iProgram->SetAppUid( 0x020202 );
       
   574 
       
   575     return err;
       
   576     }
       
   577 
       
   578 // -----------------------------------------------------------------------------
       
   579 // CVideoScheduler_ApiTest::Program_NewLFromProgramL
       
   580 // -----------------------------------------------------------------------------
       
   581 //
       
   582 TInt CVideoScheduler_ApiTest::Program_NewLFromProgramL( CStifItemParser& /*aItem*/ )
       
   583     {
       
   584     VCXLOGLO1("CVideoScheduler_ApiTest::Program_NewLFromProgramL ------>");
       
   585     LogMethod(_L("Program_NewLFromProgramL"));
       
   586 
       
   587     TInt err( KErrNone );
       
   588     
       
   589     CCseScheduledProgram* program = iProgram;
       
   590     iProgram = NULL;
       
   591     
       
   592     CleanupStack::PushL( program );
       
   593     iProgram = CCseScheduledProgram::NewL( *program );    
       
   594     CleanupStack::PopAndDestroy( program );
       
   595     
       
   596     return err;
       
   597     }
       
   598 
       
   599 // -----------------------------------------------------------------------------
       
   600 // CVideoScheduler_ApiTest::Program_ExternalizeLL
       
   601 // -----------------------------------------------------------------------------
       
   602 //
       
   603 TInt CVideoScheduler_ApiTest::Program_ExternalizeLL( CStifItemParser& /*aItem*/ )
       
   604     {
       
   605     VCXLOGLO1("CVideoScheduler_ApiTest::Program_ExternalizeLL ------>");
       
   606     LogMethod(_L("Program_ExternalizeLL"));
       
   607 
       
   608     TInt err( KErrNone );
       
   609     
       
   610     TUint32 dataSize = iProgram->ExternalizeLength();
       
   611     
       
   612     delete iExternalizeBuff;
       
   613     iExternalizeBuff = NULL;
       
   614     iExternalizeBuff = HBufC8::NewL( dataSize );
       
   615     TPtr8 buffPtr( iExternalizeBuff->Des() );
       
   616     
       
   617     RDesWriteStream stream;
       
   618     stream.Open( buffPtr );
       
   619     iProgram->ExternalizeL( stream );
       
   620     stream.CommitL();
       
   621     stream.Close();
       
   622 
       
   623     return err;
       
   624     }
       
   625 
       
   626 // -----------------------------------------------------------------------------
       
   627 // CVideoScheduler_ApiTest::Program_InternalizeLL
       
   628 // -----------------------------------------------------------------------------
       
   629 //
       
   630 TInt CVideoScheduler_ApiTest::Program_InternalizeLL( CStifItemParser& /*aItem*/ )
       
   631     {
       
   632     VCXLOGLO1("CVideoScheduler_ApiTest::Program_InternalizeLL ------>");
       
   633     LogMethod(_L("Program_InternalizeLL"));
       
   634 
       
   635     TInt err( KErrNone );
       
   636     
       
   637     CCseScheduledProgram* program = CCseScheduledProgram::NewL();
       
   638     CleanupStack::PushL( program );
       
   639     
       
   640     RDesReadStream stream;
       
   641     TPtr8 buffPtr( iExternalizeBuff->Des() );
       
   642     stream.Open( buffPtr );
       
   643     program->InternalizeL( stream );
       
   644     stream.Close();
       
   645     
       
   646     err = ComparePrograms( *program, *iProgram );
       
   647     
       
   648     CleanupStack::PopAndDestroy( program );
       
   649 
       
   650     return err;
       
   651     }
       
   652 
       
   653 // -----------------------------------------------------------------------------
       
   654 // CVideoScheduler_ApiTest::Program_ExternalizeLengthL
       
   655 // -----------------------------------------------------------------------------
       
   656 //
       
   657 TInt CVideoScheduler_ApiTest::Program_ExternalizeLengthL( CStifItemParser& /*aItem*/ )
       
   658     {
       
   659     VCXLOGLO1("CVideoScheduler_ApiTest::Program_ExternalizeLengthL ------>");
       
   660     LogMethod(_L("Program_ExternalizeLengthL"));
       
   661 
       
   662     TInt err( KErrNone );
       
   663     
       
   664     iProgram->ExternalizeLength();
       
   665 
       
   666     return err;
       
   667     }
       
   668 
       
   669 // -----------------------------------------------------------------------------
       
   670 // CVideoScheduler_ApiTest::Program_SetPluginTypeL
       
   671 // -----------------------------------------------------------------------------
       
   672 //
       
   673 TInt CVideoScheduler_ApiTest::Program_SetPluginTypeL( CStifItemParser& aItem )
       
   674     {
       
   675     VCXLOGLO1("CVideoScheduler_ApiTest::Program_SetPluginTypeL ------>");
       
   676     LogMethod(_L("Program_SetPluginTypeL"));
       
   677 
       
   678     TInt err( KErrNone );
       
   679     
       
   680     TInt pluginType;
       
   681     User::LeaveIfError( aItem.GetNextInt( pluginType ) );
       
   682     
       
   683     iProgram->SetPluginType( pluginType );
       
   684 
       
   685     return err;
       
   686     }
       
   687 
       
   688 // -----------------------------------------------------------------------------
       
   689 // CVideoScheduler_ApiTest::Program_SetNameL
       
   690 // -----------------------------------------------------------------------------
       
   691 //
       
   692 TInt CVideoScheduler_ApiTest::Program_SetNameL( CStifItemParser& aItem )
       
   693     {
       
   694     VCXLOGLO1("CVideoScheduler_ApiTest::Program_SetNameL ------>");
       
   695     LogMethod(_L("Program_SetNameL"));
       
   696 
       
   697     TInt err( KErrNone );
       
   698     
       
   699     aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing );
       
   700     
       
   701     TPtrC name;
       
   702     User::LeaveIfError( aItem.GetNextString( name ) );
       
   703     
       
   704     TBuf8<1024> name8;
       
   705     name8.Copy( name );
       
   706     
       
   707     iProgram->SetName( name8 );
       
   708 
       
   709     return err;
       
   710     }
       
   711 
       
   712 // -----------------------------------------------------------------------------
       
   713 // CVideoScheduler_ApiTest::Program_SetStartTimeL
       
   714 // -----------------------------------------------------------------------------
       
   715 //
       
   716 TInt CVideoScheduler_ApiTest::Program_SetStartTimeL( CStifItemParser& aItem )
       
   717     {
       
   718     VCXLOGLO1("CVideoScheduler_ApiTest::Program_SetStartTimeL ------>");
       
   719     LogMethod(_L("Program_SetStartTimeL"));
       
   720 
       
   721     TInt err( KErrNone );
       
   722     
       
   723     aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing );
       
   724     
       
   725     TPtrC dayString;
       
   726     User::LeaveIfError( aItem.GetNextString( dayString ) );
       
   727 
       
   728     TTime time( dayString );
       
   729     
       
   730     iProgram->SetStartTime( time );
       
   731     
       
   732     return err;
       
   733     }
       
   734 
       
   735 // -----------------------------------------------------------------------------
       
   736 // CVideoScheduler_ApiTest::Program_SetEndTimeL
       
   737 // -----------------------------------------------------------------------------
       
   738 //
       
   739 TInt CVideoScheduler_ApiTest::Program_SetEndTimeL( CStifItemParser& aItem )
       
   740     {
       
   741     VCXLOGLO1("CVideoScheduler_ApiTest::Program_SetEndTimeL ------>");
       
   742     LogMethod(_L("Program_SetEndTimeL"));
       
   743 
       
   744     TInt err( KErrNone );
       
   745     
       
   746     aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing );
       
   747     
       
   748     TPtrC dayString;
       
   749     User::LeaveIfError( aItem.GetNextString( dayString ) );
       
   750 
       
   751     TTime time( dayString );
       
   752     
       
   753     iProgram->SetEndTime( time );    
       
   754 
       
   755     return err;
       
   756     }
       
   757 
       
   758 // -----------------------------------------------------------------------------
       
   759 // CVideoScheduler_ApiTest::Program_SetAppUidL
       
   760 // -----------------------------------------------------------------------------
       
   761 //
       
   762 TInt CVideoScheduler_ApiTest::Program_SetAppUidL( CStifItemParser& aItem )
       
   763     {
       
   764     VCXLOGLO1("CVideoScheduler_ApiTest::Program_SetAppUidL ------>");
       
   765     LogMethod(_L("Program_SetAppUidL"));
       
   766 
       
   767     TInt err( KErrNone );
       
   768     
       
   769     TInt uid( 0 );
       
   770     User::LeaveIfError( aItem.GetNextInt( uid ) );
       
   771     
       
   772     iProgram->SetAppUid( uid );
       
   773 
       
   774     return err;
       
   775     }
       
   776 
       
   777 // -----------------------------------------------------------------------------
       
   778 // CVideoScheduler_ApiTest::Program_SetPluginUidL
       
   779 // -----------------------------------------------------------------------------
       
   780 //
       
   781 TInt CVideoScheduler_ApiTest::Program_SetPluginUidL( CStifItemParser& aItem )
       
   782     {
       
   783     VCXLOGLO1("CVideoScheduler_ApiTest::Program_SetPluginUidL ------>");
       
   784     LogMethod(_L("Program_SetPluginUidL"));
       
   785 
       
   786     TInt err( KErrNone );
       
   787     
       
   788     TInt uid( 0 );
       
   789     User::LeaveIfError( aItem.GetNextInt( uid ) );
       
   790     
       
   791     iProgram->SetPluginUid( uid );
       
   792     
       
   793     return err;
       
   794     }
       
   795 
       
   796 // -----------------------------------------------------------------------------
       
   797 // CVideoScheduler_ApiTest::Program_SetApplicationDataLL
       
   798 // -----------------------------------------------------------------------------
       
   799 //
       
   800 TInt CVideoScheduler_ApiTest::Program_SetApplicationDataLL( CStifItemParser& aItem )
       
   801     {
       
   802     VCXLOGLO1("CVideoScheduler_ApiTest::Program_SetApplicationDataLL ------>");
       
   803     LogMethod(_L("Program_SetApplicationDataLL"));
       
   804 
       
   805     TInt err( KErrNone );
       
   806     
       
   807     aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing );
       
   808     
       
   809     TPtrC data;
       
   810     User::LeaveIfError( aItem.GetNextString( data ) );
       
   811     
       
   812     TBuf8<1024> data8;
       
   813     data8.Copy( data );
       
   814     
       
   815     iProgram->SetApplicationDataL( data8 );
       
   816     
       
   817     return err;
       
   818     }
       
   819 
       
   820 // -----------------------------------------------------------------------------
       
   821 // CVideoScheduler_ApiTest::Program_SetDbIdentifierL
       
   822 // -----------------------------------------------------------------------------
       
   823 //
       
   824 TInt CVideoScheduler_ApiTest::Program_SetDbIdentifierL( CStifItemParser& aItem )
       
   825     {
       
   826     VCXLOGLO1("CVideoScheduler_ApiTest::Program_SetDbIdentifierL ------>");
       
   827     LogMethod(_L("Program_SetDbIdentifierL"));
       
   828 
       
   829     TInt err( KErrNone );
       
   830     
       
   831     TInt id;
       
   832     User::LeaveIfError( aItem.GetNextInt( id ) );
       
   833     
       
   834     iProgram->SetDbIdentifier( id );
       
   835 
       
   836     return err;
       
   837     }
       
   838 
       
   839 // -----------------------------------------------------------------------------
       
   840 // CVideoScheduler_ApiTest::Program_SetScheduleTypeL
       
   841 // -----------------------------------------------------------------------------
       
   842 //
       
   843 TInt CVideoScheduler_ApiTest::Program_SetScheduleTypeL( CStifItemParser& aItem )
       
   844     {
       
   845     VCXLOGLO1("CVideoScheduler_ApiTest::Program_SetScheduleTypeL ------>");
       
   846     LogMethod(_L("Program_SetScheduleTypeL"));
       
   847 
       
   848     TInt err( KErrNone );
       
   849 
       
   850     TInt type;
       
   851     User::LeaveIfError( aItem.GetNextInt( type ) );
       
   852     
       
   853     iProgram->SetScheduleType( type );
       
   854     
       
   855     return err;
       
   856     }
       
   857 
       
   858 // -----------------------------------------------------------------------------
       
   859 // CVideoScheduler_ApiTest::Program_PluginTypeL
       
   860 // -----------------------------------------------------------------------------
       
   861 //
       
   862 TInt CVideoScheduler_ApiTest::Program_PluginTypeL( CStifItemParser& aItem )
       
   863     {
       
   864     VCXLOGLO1("CVideoScheduler_ApiTest::Program_PluginTypeL ------>");
       
   865     LogMethod(_L("Program_PluginTypeL"));
       
   866 
       
   867     TInt err( KErrNone );
       
   868     
       
   869     TInt pluginType;
       
   870     TInt expectedPluginType;
       
   871     User::LeaveIfError( aItem.GetNextInt( expectedPluginType ) );
       
   872     
       
   873     pluginType = iProgram->PluginType();
       
   874     
       
   875     if( pluginType != expectedPluginType )
       
   876         {
       
   877         err = KErrCorrupt;
       
   878         }
       
   879 
       
   880     return err;
       
   881     }
       
   882 
       
   883 // -----------------------------------------------------------------------------
       
   884 // CVideoScheduler_ApiTest::Program_NameL
       
   885 // -----------------------------------------------------------------------------
       
   886 //
       
   887 TInt CVideoScheduler_ApiTest::Program_NameL( CStifItemParser& aItem )
       
   888     {
       
   889     VCXLOGLO1("CVideoScheduler_ApiTest::Program_NameL ------>");
       
   890     LogMethod(_L("Program_NameL"));
       
   891 
       
   892     TInt err( KErrNone );
       
   893     
       
   894     aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing );
       
   895 
       
   896     TPtrC expectedName;
       
   897     User::LeaveIfError( aItem.GetNextString( expectedName ) );
       
   898     
       
   899     const TPtrC8 name8 = iProgram->Name(); 
       
   900     
       
   901     TBuf<1024> name;
       
   902     name.Copy( name8 );
       
   903     
       
   904     if( name != expectedName )
       
   905         {
       
   906         err = KErrCorrupt;
       
   907         }
       
   908     
       
   909     return err;
       
   910     }
       
   911 
       
   912 // -----------------------------------------------------------------------------
       
   913 // CVideoScheduler_ApiTest::Program_StartTimeL
       
   914 // -----------------------------------------------------------------------------
       
   915 //
       
   916 TInt CVideoScheduler_ApiTest::Program_StartTimeL( CStifItemParser& aItem )
       
   917     {
       
   918     VCXLOGLO1("CVideoScheduler_ApiTest::Program_StartTimeL ------>");
       
   919     LogMethod(_L("Program_StartTimeL"));
       
   920 
       
   921     TInt err( KErrNone );
       
   922 
       
   923     aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing );
       
   924     
       
   925     TPtrC dayString;
       
   926     User::LeaveIfError( aItem.GetNextString( dayString ) );
       
   927 
       
   928     TTime expectedTime( dayString );
       
   929     
       
   930     TTime time = iProgram->StartTime();
       
   931     
       
   932     if( time != expectedTime )
       
   933         {
       
   934         err = KErrCorrupt;
       
   935         }
       
   936         
       
   937     return err;
       
   938     }
       
   939 
       
   940 // -----------------------------------------------------------------------------
       
   941 // CVideoScheduler_ApiTest::Program_EndTimeL
       
   942 // -----------------------------------------------------------------------------
       
   943 //
       
   944 TInt CVideoScheduler_ApiTest::Program_EndTimeL( CStifItemParser& aItem )
       
   945     {
       
   946     VCXLOGLO1("CVideoScheduler_ApiTest::Program_EndTimeL ------>");
       
   947     LogMethod(_L("Program_EndTimeL"));
       
   948 
       
   949     TInt err( KErrNone );
       
   950     
       
   951     aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing );
       
   952     
       
   953     TPtrC dayString;
       
   954     User::LeaveIfError( aItem.GetNextString( dayString ) );
       
   955 
       
   956     TTime expectedTime( dayString );
       
   957     
       
   958     TTime time = iProgram->EndTime();
       
   959     
       
   960     if( time != expectedTime )
       
   961         {
       
   962         err = KErrCorrupt;
       
   963         }
       
   964     
       
   965     return err;
       
   966     }
       
   967 
       
   968 
       
   969 // -----------------------------------------------------------------------------
       
   970 // CVideoScheduler_ApiTest::Program_SetToFutureL
       
   971 // -----------------------------------------------------------------------------
       
   972 //
       
   973 TInt CVideoScheduler_ApiTest::Program_SetToFutureL( CStifItemParser& aItem )
       
   974     {
       
   975     VCXLOGLO1("CVideoScheduler_ApiTest::Program_SetToFutureL ------>");
       
   976     LogMethod(_L("Program_SetToFutureL"));
       
   977 
       
   978     TInt err( KErrNone );
       
   979     TInt intervalStart( 0 );
       
   980     TInt intervalEnd( 0 );
       
   981     
       
   982     User::LeaveIfError( aItem.GetNextInt( intervalStart ) );
       
   983     User::LeaveIfError( aItem.GetNextInt( intervalEnd ) );
       
   984     
       
   985     TTime startTime( 0 );
       
   986     TTime endTime( 0 );
       
   987     
       
   988     startTime.UniversalTime();
       
   989     endTime.UniversalTime();
       
   990     
       
   991     startTime += TTimeIntervalSeconds( intervalStart );
       
   992     endTime += TTimeIntervalSeconds( intervalEnd );
       
   993     
       
   994     iProgram->SetStartTime( startTime );
       
   995     iProgram->SetEndTime( endTime );
       
   996     
       
   997     VCXLOGLO3("CVideoScheduler_ApiTest::Program_SetToFutureL -- start %d end %d", startTime, endTime);
       
   998 
       
   999     return err;
       
  1000     }
       
  1001 
       
  1002 // -----------------------------------------------------------------------------
       
  1003 // CVideoScheduler_ApiTest::Program_AppUidL
       
  1004 // -----------------------------------------------------------------------------
       
  1005 //
       
  1006 TInt CVideoScheduler_ApiTest::Program_AppUidL( CStifItemParser& aItem )
       
  1007     {
       
  1008     VCXLOGLO1("CVideoScheduler_ApiTest::Program_AppUidL ------>");
       
  1009     LogMethod(_L("Program_AppUidL"));
       
  1010 
       
  1011     TInt err( KErrNone );
       
  1012 
       
  1013     TInt expectedUid;
       
  1014     User::LeaveIfError( aItem.GetNextInt( expectedUid ) );    
       
  1015     
       
  1016     TInt32 uid = iProgram->AppUid();
       
  1017     
       
  1018     if( uid != expectedUid )
       
  1019         {
       
  1020         err = KErrCorrupt;
       
  1021         }
       
  1022     
       
  1023     return err;
       
  1024     }
       
  1025 
       
  1026 // -----------------------------------------------------------------------------
       
  1027 // CVideoScheduler_ApiTest::Program_PluginUidL
       
  1028 // -----------------------------------------------------------------------------
       
  1029 //
       
  1030 TInt CVideoScheduler_ApiTest::Program_PluginUidL( CStifItemParser& aItem )
       
  1031     {
       
  1032     VCXLOGLO1("CVideoScheduler_ApiTest::Program_PluginUidL ------>");
       
  1033     LogMethod(_L("Program_PluginUidL"));
       
  1034 
       
  1035     TInt err( KErrNone );
       
  1036 
       
  1037     TInt expectedUid;
       
  1038     User::LeaveIfError( aItem.GetNextInt( expectedUid ) );    
       
  1039     
       
  1040     TInt32 uid = iProgram->PluginUid();
       
  1041     
       
  1042     if( uid != expectedUid )
       
  1043         {
       
  1044         err = KErrCorrupt;
       
  1045         }
       
  1046     
       
  1047     return err;
       
  1048     }
       
  1049 
       
  1050 // -----------------------------------------------------------------------------
       
  1051 // CVideoScheduler_ApiTest::Program_ApplicationDataL
       
  1052 // -----------------------------------------------------------------------------
       
  1053 //
       
  1054 TInt CVideoScheduler_ApiTest::Program_ApplicationDataL( CStifItemParser& aItem )
       
  1055     {
       
  1056     VCXLOGLO1("CVideoScheduler_ApiTest::Program_ApplicationDataL ------>");
       
  1057     LogMethod(_L("Program_ApplicationDataL"));
       
  1058 
       
  1059     TInt err( KErrNone );
       
  1060 
       
  1061     aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing );
       
  1062     
       
  1063     TPtrC expectedData;
       
  1064     User::LeaveIfError( aItem.GetNextString( expectedData ) );
       
  1065     
       
  1066     const TPtrC8 data8 = iProgram->ApplicationData();
       
  1067     
       
  1068     TBuf<1024> data;
       
  1069     data.Copy( data8 );
       
  1070     
       
  1071     if( data != expectedData )
       
  1072         {
       
  1073         err = KErrCorrupt;
       
  1074         }
       
  1075     
       
  1076     return err;
       
  1077     }
       
  1078 
       
  1079 // -----------------------------------------------------------------------------
       
  1080 // CVideoScheduler_ApiTest::Program_DbIdentifierL
       
  1081 // -----------------------------------------------------------------------------
       
  1082 //
       
  1083 TInt CVideoScheduler_ApiTest::Program_DbIdentifierL( CStifItemParser& aItem )
       
  1084     {
       
  1085     VCXLOGLO1("CVideoScheduler_ApiTest::Program_DbIdentifierL ------>");
       
  1086     LogMethod(_L("Program_DbIdentifierL"));
       
  1087 
       
  1088     TInt err( KErrNone );
       
  1089     
       
  1090     TInt expectedId;
       
  1091     User::LeaveIfError( aItem.GetNextInt( expectedId ) );    
       
  1092    
       
  1093     TUint32 id = iProgram->DbIdentifier();
       
  1094    
       
  1095     if( id != expectedId )
       
  1096         {
       
  1097         err = KErrCorrupt;
       
  1098         }
       
  1099    
       
  1100     return err;
       
  1101     }
       
  1102 
       
  1103 // -----------------------------------------------------------------------------
       
  1104 // CVideoScheduler_ApiTest::Program_ScheduleTypeL
       
  1105 // -----------------------------------------------------------------------------
       
  1106 //
       
  1107 TInt CVideoScheduler_ApiTest::Program_ScheduleTypeL( CStifItemParser& aItem )
       
  1108     {
       
  1109     VCXLOGLO1("CVideoScheduler_ApiTest::API_AddScheduleL ------>");
       
  1110     LogMethod(_L("Program_ScheduleTypeL"));
       
  1111 
       
  1112     TInt err( KErrNone );
       
  1113 
       
  1114     TInt expectedType;
       
  1115     User::LeaveIfError( aItem.GetNextInt( expectedType ) );    
       
  1116    
       
  1117     TInt32 type = iProgram->ScheduleType();
       
  1118    
       
  1119     if( type != expectedType )
       
  1120         {
       
  1121         err = KErrCorrupt;
       
  1122         }
       
  1123     
       
  1124     return err;
       
  1125     }
       
  1126 
       
  1127 // -----------------------------------------------------------------------------
       
  1128 // CVideoScheduler_ApiTest::Program_DebugDumpL
       
  1129 // -----------------------------------------------------------------------------
       
  1130 //
       
  1131 TInt CVideoScheduler_ApiTest::Program_DebugDumpL( CStifItemParser& /*aItem*/ )
       
  1132     {
       
  1133     VCXLOGLO1("CVideoScheduler_ApiTest::Program_DebugDumpL ------>");
       
  1134     LogMethod(_L("Program_DebugDumpL"));
       
  1135 
       
  1136     TInt err( KErrNone );
       
  1137 
       
  1138     iProgram->DebugDump();
       
  1139     
       
  1140     return err;
       
  1141     }
       
  1142 
       
  1143 // -----------------------------------------------------------------------------
       
  1144 // CVideoScheduler_ApiTest::ComparePrograms
       
  1145 // -----------------------------------------------------------------------------
       
  1146 //
       
  1147 TInt CVideoScheduler_ApiTest::ComparePrograms( CCseScheduledProgram& aProgram1, CCseScheduledProgram& aProgram2 )
       
  1148     {
       
  1149     TInt err( KErrNone );
       
  1150     
       
  1151     if( aProgram1.DbIdentifier() != aProgram2.DbIdentifier() )
       
  1152         {
       
  1153         VCXLOGLO3("CVideoScheduler_ApiTest::ComparePrograms: Error, db identifiers differ: %d vs. %d.", aProgram1.DbIdentifier(), aProgram2.DbIdentifier() );
       
  1154         err = KErrCorrupt;
       
  1155         }
       
  1156 
       
  1157     return err;
       
  1158     }
       
  1159 // ========================== OTHER EXPORTED FUNCTIONS =========================
       
  1160 // None
       
  1161 
       
  1162 //  [End of File] - Do not remove