psmservices/psmserver/tsrc/PsmTestModule/src/PSMTestBlocks.cpp
changeset 0 4e1aa6a622a0
child 59 0f7422b6b602
equal deleted inserted replaced
-1:000000000000 0:4e1aa6a622a0
       
     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 "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
       
    21 #include <e32svr.h>
       
    22 #include <StifParser.h>
       
    23 #include <Stiftestinterface.h>
       
    24 #include <StifItemParser.h>
       
    25 #include <psmclient.h>
       
    26 #include <psmsettings.h>
       
    27 #include <psmtypes.h>
       
    28 
       
    29 #include <psmsrvdomaincrkeys.h>
       
    30 #include <centralrepository.h>
       
    31 
       
    32 #include "PSMTest.h"
       
    33 
       
    34 
       
    35     // CONSTANT DEFINITIONS
       
    36 
       
    37     // For Settings API tests
       
    38     const TUint32 KCenRepUid2 = 0x10200EE4;
       
    39     const TUint32 KCenRepUid5 = 0x10200EE5;
       
    40 
       
    41     _LIT( KKey1FullPsm, "FullPowerSaveMode" );
       
    42     _LIT( KKey1PartialPsm, "PartialPowerSaveMode" );
       
    43     _LIT( KKey1NormalMode, "NormalMode" );
       
    44 
       
    45     const TInt KKey2FullPsm = 600;
       
    46     const TInt KKey2NormalMode = 450;
       
    47     
       
    48     const TInt KKey3FullPsm = 10;
       
    49     const TInt KKey3NormalMode = 50;
       
    50 
       
    51     const TInt KKey4FullPsm = 1500;
       
    52     const TInt KKey4PartialPsm = 2475;
       
    53     const TInt KKey4NormalMode = 5250;
       
    54 
       
    55     const TReal KKey5FullPsm = 2.75;
       
    56     const TReal KKey5PartialPsm = 2.435;
       
    57     const TReal KKey5NormalMode = 1.65;
       
    58 
       
    59     // For CenRep change checkings
       
    60     const TUint32 KCenRepUid = 0x10200EE3;
       
    61     TUid KCenRepUidValue = { KCenRepUid };
       
    62 
       
    63     _LIT8( KOriginalValue4, "ThirdFour" );
       
    64 
       
    65     enum TPsmPluginFirstKeys
       
    66         {
       
    67         EPsmPluginSecondKey1 = 1,
       
    68         EPsmPluginSecondKey2,
       
    69         EPsmPluginSecondKey3,
       
    70         EPsmPluginSecondKey4,
       
    71         EPsmPluginSecondKey5
       
    72         };
       
    73 
       
    74 
       
    75 
       
    76 
       
    77 // ============================ MEMBER FUNCTIONS ===============================
       
    78 
       
    79 // -----------------------------------------------------------------------------
       
    80 // CPSMTest::Delete
       
    81 // Delete here all resources allocated and opened from test methods. 
       
    82 // Called from destructor. 
       
    83 // -----------------------------------------------------------------------------
       
    84 //
       
    85 void CPSMTest::Delete() 
       
    86     {
       
    87     }
       
    88 
       
    89 // -----------------------------------------------------------------------------
       
    90 // CPSMTest::RunMethodL
       
    91 // Run specified method. Contains also table of test mothods and their names.
       
    92 // -----------------------------------------------------------------------------
       
    93 //
       
    94 TInt CPSMTest::RunMethodL( 
       
    95     CStifItemParser& aItem ) 
       
    96     {
       
    97 
       
    98     static TStifFunctionInfo const KFunctions[] =
       
    99         {  
       
   100         // Copy this line for every implemented function.
       
   101         // First string is the function name used in TestScripter script file.
       
   102         // Second is the actual implementation member function. 
       
   103         ENTRY( "InitTest", CPSMTest::InitializeTest ),
       
   104         ENTRY( "FullPsmChange", CPSMTest::FullPowerSaveModeChange ),
       
   105         ENTRY( "ChangePsmInit", CPSMTest::NotifyPowerSaveModeChangeInit ),
       
   106         ENTRY( "ChangePsmWaitComplete", CPSMTest::PsmWaitComplete ),
       
   107         ENTRY( "ChangePsmEnd", CPSMTest::NotifyPowerSaveModeChangeEnd ),
       
   108         ENTRY( "CancelPsm", CPSMTest::CancelPowerSaveModeChange ),
       
   109 
       
   110         ENTRY( "CheckPsmMode", CPSMTest::CheckPsmMode ),
       
   111         ENTRY( "GetCurrentSettings", CPSMTest::GetCurrentSettings ),
       
   112         ENTRY( "BackupSettings", CPSMTest::BackupSettings ),
       
   113         ENTRY( "PSMNotificationInit", CPSMTest::PsmNotificationInit ),
       
   114         ENTRY( "PSMNotificationCancel", CPSMTest::PsmNotificationCancel ),
       
   115         ENTRY( "PSMNotificationEnd", CPSMTest::PsmNotificationEnd ),
       
   116 
       
   117         ENTRY( "LoadUnload", CPSMTest::LoadAndUnload ),
       
   118         ENTRY( "CenRepChange", CPSMTest::CenRepChange ),
       
   119         ENTRY( "VerifyCenRepChange", CPSMTest::VerifyCenRepChangeL ),
       
   120         ENTRY( "ChangeSettingsInit", CPSMTest::ChangeSettingsInit ),
       
   121         ENTRY( "ChangeSettings", CPSMTest::ChangeSettings ),
       
   122         ENTRY( "ChangeSettingsEnd", CPSMTest::ChangeSettingsEnd ),
       
   123         ENTRY( "OpenClosePerformanceInit", CPSMTest::OpenClosePerformanceInit ),
       
   124         ENTRY( "OpenClosePerformanceRequest", CPSMTest::OpenClosePerformanceRequest ),
       
   125         ENTRY( "OpenClosePerformanceCancel", CPSMTest::OpenClosePerformanceCancel ),
       
   126         ENTRY( "OpenClosePerformanceChange", CPSMTest::OpenClosePerformanceChange ),
       
   127         ENTRY( "OpenClosePerformanceEnd", CPSMTest::OpenClosePerformanceEnd ),
       
   128         ENTRY( "ChangePsmPerformance", CPSMTest::ChangePsmPerformance ),
       
   129         ENTRY( "ChangeSettingsPerformance", CPSMTest::ChangeSettingsPerformance )
       
   130         };
       
   131 
       
   132     const TInt count = sizeof( KFunctions ) / 
       
   133                         sizeof( TStifFunctionInfo );
       
   134 
       
   135     return RunInternalL( KFunctions, count, aItem );
       
   136 
       
   137     }
       
   138 
       
   139 // -----------------------------------------------------------------------------
       
   140 // CPSMTest::InitializeTest
       
   141 // 
       
   142 // (other items were commented in a header).
       
   143 // -----------------------------------------------------------------------------
       
   144 //
       
   145 TInt CPSMTest::InitializeTest( CStifItemParser& aItem )
       
   146     {
       
   147 
       
   148     // Print to log file
       
   149     iLog->Log( _L("PSMTest: InitializeTest") );
       
   150 
       
   151     FullPowerSaveModeChange( aItem );
       
   152 
       
   153     // reset error code
       
   154     iErrorCode = KErrNone;
       
   155 
       
   156     return KErrNone;
       
   157     }
       
   158 
       
   159 // -----------------------------------------------------------------------------
       
   160 // CPSMTest::LoadAndUnload
       
   161 // 
       
   162 // (other items were commented in a header).
       
   163 // -----------------------------------------------------------------------------
       
   164 //
       
   165 TInt CPSMTest::LoadAndUnload( CStifItemParser& /*aItem*/ )
       
   166     {
       
   167 
       
   168     // Print to log file
       
   169     iLog->Log( _L("PSMTest: LoadAndUnload") );
       
   170 
       
   171 __UHEAP_MARK;
       
   172     // Create DLL and notify PSM change
       
   173     iPsmClient = CPsmClient::NewL( *this );
       
   174 
       
   175     delete iPsmClient;
       
   176 __UHEAP_MARKEND;
       
   177     return KErrNone;
       
   178     }
       
   179 
       
   180 // -----------------------------------------------------------------------------
       
   181 // CPSMTest::CenRepChange
       
   182 // 
       
   183 // (other items were commented in a header).
       
   184 // -----------------------------------------------------------------------------
       
   185 //
       
   186 TInt CPSMTest::CenRepChange( CStifItemParser& aItem )
       
   187     {
       
   188 
       
   189     // Print to log file
       
   190     iLog->Log( _L("PSMTest: CenRepChange") );
       
   191     
       
   192     CRepository* cenrep = CRepository::NewLC( KCenRepUidValue );
       
   193 
       
   194     TInt value1 = 0;
       
   195     TInt value2 = 0;
       
   196     TInt value3 = 0;
       
   197     TInt value4 = 0;
       
   198     TInt value5 = 0;
       
   199 
       
   200     cenrep->Get( EPsmPluginSecondKey1, value1 );
       
   201     cenrep->Get( EPsmPluginSecondKey2, value2 );
       
   202     cenrep->Get( EPsmPluginSecondKey3, value3 );
       
   203     cenrep->Get( EPsmPluginSecondKey4, value4 );
       
   204     cenrep->Get( EPsmPluginSecondKey5, value5 );
       
   205 
       
   206     CleanupStack::PopAndDestroy( cenrep );
       
   207     
       
   208     // Print old values from array
       
   209     RDebug::Print( _L( "PSMTest::CenRepChange(): oldValue info1: %d" ), value1 );
       
   210     RDebug::Print( _L( "PSMTest::CenRepChange(): oldValue info2: %d" ), value2 );
       
   211     RDebug::Print( _L( "PSMTest::CenRepChange(): oldValue info3: %d" ), value3 );
       
   212     RDebug::Print( _L( "PSMTest::CenRepChange(): oldValue info4: %d" ), value4 );
       
   213     RDebug::Print( _L( "PSMTest::CenRepChange(): oldValue info5: %d" ), value5 );
       
   214 
       
   215     NotifyPowerSaveModeChangeInit( aItem );
       
   216     PsmWaitComplete( aItem );
       
   217 
       
   218     return iErrorCode;
       
   219     }
       
   220 
       
   221 // -----------------------------------------------------------------------------
       
   222 // CPSMTest::VerifyCenRepChangeL
       
   223 // 
       
   224 // (other items were commented in a header).
       
   225 // -----------------------------------------------------------------------------
       
   226 //
       
   227 TInt CPSMTest::VerifyCenRepChangeL( CStifItemParser& aItem )
       
   228     {
       
   229 
       
   230     // Print to log file
       
   231     iLog->Log( _L("PSMTest: VerifyCenRepChangeL") );
       
   232 
       
   233     // Get mode 
       
   234     TInt mode( 0 );
       
   235     TInt err = aItem.GetNextInt( mode );
       
   236 
       
   237     CRepository* cenrep = CRepository::NewLC( KCenRepUidValue );
       
   238 
       
   239     TInt value1 = 0;
       
   240     TInt value2 = 0;
       
   241     TInt value3 = 0;
       
   242     TInt value4 = 0;
       
   243     TInt value5 = 0;
       
   244 
       
   245     cenrep->Get( EPsmPluginSecondKey1, value1 );
       
   246     cenrep->Get( EPsmPluginSecondKey2, value2 );
       
   247     cenrep->Get( EPsmPluginSecondKey3, value3 );
       
   248     cenrep->Get( EPsmPluginSecondKey4, value4 );
       
   249     cenrep->Get( EPsmPluginSecondKey5, value5 );
       
   250 
       
   251     CleanupStack::PopAndDestroy( cenrep );
       
   252 
       
   253     // Print new values from array
       
   254     RDebug::Print( _L( "PSMTest::CenRepChange(): newValue info1: %d" ), value1 );
       
   255     RDebug::Print( _L( "PSMTest::CenRepChange(): newValue info2: %d" ), value2 );
       
   256     RDebug::Print( _L( "PSMTest::CenRepChange(): newValue info3: %d" ), value3 );
       
   257     RDebug::Print( _L( "PSMTest::CenRepChange(): newValue info4: %d" ), value4 );
       
   258     RDebug::Print( _L( "PSMTest::CenRepChange(): newValue info5: %d" ), value5 );
       
   259 
       
   260     // Checks
       
   261     switch ( mode )
       
   262         {
       
   263         case EPsmsrvModeNormal:
       
   264             {
       
   265             if ( value1 == 5 && value2 == 6 &&
       
   266                  value3 == 7 && value4 == 8 &&
       
   267                  value5 == 9 )
       
   268                 {
       
   269                 err = KErrNone;
       
   270                 }
       
   271             else
       
   272                 {
       
   273                 err = KErrArgument;
       
   274                 }
       
   275             break;            
       
   276             }
       
   277         case EPsmsrvModePowerSave:
       
   278             {
       
   279             if ( value1 == 55 && value2 == 66 &&
       
   280                  value3 == 77 && value4 == 88 &&
       
   281                  value5 == 99 )
       
   282                 {
       
   283                 err = KErrNone;
       
   284                 }
       
   285             else
       
   286                 {
       
   287                 err = KErrArgument;
       
   288                 }
       
   289             break;            
       
   290             }
       
   291         case EPsmsrvPartialMode:
       
   292             {
       
   293             if ( value1 == 555 && value2 == 666 &&
       
   294                  value3 == 777 && value4 == 888 &&
       
   295                  value5 == 999 )
       
   296                 {
       
   297                 err = KErrNone;
       
   298                 }
       
   299             else
       
   300                 {
       
   301                 err = KErrArgument;
       
   302                 }
       
   303             break;            
       
   304             }
       
   305         }
       
   306 
       
   307     return err;
       
   308     }
       
   309 
       
   310 // -----------------------------------------------------------------------------
       
   311 // CPSMTest::FullPowerSaveModeChange
       
   312 // 
       
   313 // (other items were commented in a header).
       
   314 // -----------------------------------------------------------------------------
       
   315 //
       
   316 TInt CPSMTest::FullPowerSaveModeChange( CStifItemParser& aItem )
       
   317     {
       
   318 
       
   319     // Print to log file
       
   320     iLog->Log( _L("PSMTest: FullPowerSaveModeChange") );
       
   321 
       
   322     NotifyPowerSaveModeChangeInit( aItem );
       
   323     PsmWaitComplete( aItem );
       
   324     return NotifyPowerSaveModeChangeEnd( aItem );
       
   325     }
       
   326 
       
   327 // -----------------------------------------------------------------------------
       
   328 // CPSMTest::NotifyPowerSaveModeChangeInit
       
   329 // 
       
   330 // (other items were commented in a header).
       
   331 // -----------------------------------------------------------------------------
       
   332 //
       
   333 TInt CPSMTest::NotifyPowerSaveModeChangeInit( CStifItemParser& aItem )
       
   334     {
       
   335 
       
   336     // Print to log file
       
   337     iLog->Log( _L("PSMTest: NotifyPowerSaveModeChangeInit") );
       
   338 
       
   339     TInt tomode( 0 );
       
   340     TInt err = aItem.GetNextInt( tomode );
       
   341 
       
   342     iErrorCode = KErrNone;
       
   343 
       
   344     // Store to-mode for later use
       
   345     iChangedMode = tomode;
       
   346     iPsmComplete = EFalse;
       
   347 
       
   348     iLog->Log( _L("PSMTest: NotifyPowerSaveModeChangeInit: parameter[%d] error: %d"), tomode, err );
       
   349 
       
   350     if ( !iPsmClient )
       
   351         {
       
   352         iPsmClient = CPsmClient::NewL( *this );
       
   353         }
       
   354 
       
   355     iPsmClient->ChangePowerSaveMode( tomode );
       
   356 
       
   357     return err;
       
   358     }
       
   359 
       
   360 // -----------------------------------------------------------------------------
       
   361 // CPSMTest::PsmWaitComplete
       
   362 // 
       
   363 // (other items were commented in a header).
       
   364 // -----------------------------------------------------------------------------
       
   365 //
       
   366 TInt CPSMTest::PsmWaitComplete( CStifItemParser& /*aItem*/ )
       
   367     {
       
   368 
       
   369     // Print to log file
       
   370     iLog->Log( _L("PSMTest: PsmWaitComplete") );
       
   371 
       
   372     if ( !iPsmComplete )
       
   373         {
       
   374         // Wait for PSM mode change complete
       
   375         iSchedulerWait.Start();
       
   376         }
       
   377 
       
   378     return KErrNone;
       
   379     }
       
   380 
       
   381 // -----------------------------------------------------------------------------
       
   382 // CPSMTest::NotifyPowerSaveModeChangeEnd
       
   383 // 
       
   384 // (other items were commented in a header).
       
   385 // -----------------------------------------------------------------------------
       
   386 //
       
   387 TInt CPSMTest::NotifyPowerSaveModeChangeEnd( CStifItemParser& /*aItem*/ )
       
   388     {
       
   389 
       
   390     // Print to log file
       
   391     iLog->Log( _L("PSMTest: NotifyPowerSaveModeChangeEnd") );
       
   392 
       
   393     delete iPsmClient;
       
   394     iPsmClient = NULL;
       
   395 
       
   396     return iErrorCode;
       
   397     }
       
   398 
       
   399 // -----------------------------------------------------------------------------
       
   400 // CPSMTest::CancelPowerSaveModeChange
       
   401 // 
       
   402 // (other items were commented in a header).
       
   403 // -----------------------------------------------------------------------------
       
   404 //
       
   405 TInt CPSMTest::CancelPowerSaveModeChange( CStifItemParser& /*aItem*/ )
       
   406     {
       
   407 
       
   408     // Print to log file
       
   409     iLog->Log( _L("PSMTest: CancelPowerSaveModeChange") );
       
   410 
       
   411     // Cancel PSM change
       
   412     iPsmClient->CancelPowerSaveModeChange();
       
   413 
       
   414     return iErrorCode;
       
   415     }
       
   416 
       
   417 // -----------------------------------------------------------------------------
       
   418 // CPSMTest::PsmNotification
       
   419 // 
       
   420 // (other items were commented in a header).
       
   421 // -----------------------------------------------------------------------------
       
   422 //
       
   423 TInt CPSMTest::PsmNotificationInit( CStifItemParser& /*aItem*/ )
       
   424     {
       
   425 
       
   426     // Print to log file
       
   427     iLog->Log( _L("PSMTest: PsmNotificationInit") );
       
   428 
       
   429     if ( !iPsmClient )
       
   430         {
       
   431         iPsmClient = CPsmClient::NewL( *this );
       
   432         }
       
   433 
       
   434     iPsmClient->RequestPowerSaveModeNotification();
       
   435 
       
   436     return KErrNone;
       
   437     }
       
   438 
       
   439 // -----------------------------------------------------------------------------
       
   440 // CPSMTest::PsmNotificationCancel
       
   441 // 
       
   442 // (other items were commented in a header).
       
   443 // -----------------------------------------------------------------------------
       
   444 //
       
   445 TInt CPSMTest::PsmNotificationCancel( CStifItemParser& /*aItem*/ )
       
   446     {
       
   447 
       
   448     // Print to log file
       
   449     iLog->Log( _L("PSMTest: PsmNotificationCancel") );
       
   450 
       
   451     TInt error( KErrNone );
       
   452 
       
   453     if ( !iPsmClient )
       
   454         {
       
   455         error = KErrNotFound;
       
   456         }
       
   457     else
       
   458         {
       
   459         iPsmClient->CancelPowerSaveModeNotificationRequest();
       
   460         }
       
   461 
       
   462     return error;
       
   463     }
       
   464 
       
   465 // -----------------------------------------------------------------------------
       
   466 // CPSMTest::PsmNotification
       
   467 // 
       
   468 // (other items were commented in a header).
       
   469 // -----------------------------------------------------------------------------
       
   470 //
       
   471 TInt CPSMTest::PsmNotificationEnd( CStifItemParser& aItem )
       
   472     {
       
   473 
       
   474     // Print to log file
       
   475     iLog->Log( _L("PSMTest: PsmNotificationEnd") );
       
   476 
       
   477     TInt currentmode( 0 );
       
   478     TInt err = aItem.GetNextInt( currentmode );
       
   479 
       
   480     if ( KErrNone != err )
       
   481         {
       
   482         return KErrGeneral;
       
   483         }
       
   484 
       
   485     if ( currentmode == iChangedMode )
       
   486         {
       
   487         // Test pass
       
   488         err = KErrNone;
       
   489         }
       
   490     else
       
   491         {
       
   492         err = KErrArgument;
       
   493         }
       
   494 
       
   495     delete iPsmClient;
       
   496     iPsmClient = NULL;
       
   497 
       
   498     return err;
       
   499     }
       
   500 
       
   501 // -----------------------------------------------------------------------------
       
   502 // CPSMTest::ChangeSettingsInit
       
   503 // 
       
   504 // (other items were commented in a header).
       
   505 // -----------------------------------------------------------------------------
       
   506 //
       
   507 TInt CPSMTest::ChangeSettingsInit( CStifItemParser& aItem )
       
   508     {
       
   509     // Print to log file
       
   510     iLog->Log( _L("PSMTest: ChangeSettingsInit") );
       
   511 
       
   512     TInt initmode( 0 );
       
   513     TInt err = aItem.GetNextInt( initmode );
       
   514 
       
   515     if ( KErrNone != err )
       
   516         {
       
   517         return KErrGeneral;
       
   518         }
       
   519 
       
   520     // Initialize config array with init mode. This is different than the mode we are 
       
   521     // changing to
       
   522     GenerateConfigArray( iPsmConfigArray, initmode, 0 );
       
   523 
       
   524     return KErrNone;
       
   525     }
       
   526 
       
   527 // -----------------------------------------------------------------------------
       
   528 // CPSMTest::GenerateConfigArray
       
   529 // 
       
   530 // (other items were commented in a header).
       
   531 // -----------------------------------------------------------------------------
       
   532 //
       
   533 void CPSMTest::GenerateConfigArray( RConfigInfoArray& aPsmConfigArray, TInt aMode, TInt aIncrement )
       
   534     {
       
   535 
       
   536     // Print to log file
       
   537     iLog->Log( _L("PSMTest: GenerateConfigArray") );
       
   538 
       
   539     // Initialize infos
       
   540     TPsmsrvConfigInfo info1;
       
   541     info1.iConfigId = 1 + aIncrement;
       
   542     info1.iConfigType = EConfigTypeBuf;
       
   543     
       
   544     TPsmsrvConfigInfo info2;
       
   545     info2.iConfigId = 2 + aIncrement;
       
   546     info2.iConfigType = EConfigTypeInt;
       
   547 
       
   548     TPsmsrvConfigInfo info3;
       
   549     info3.iConfigId = 3 + aIncrement;
       
   550     info3.iConfigType = EConfigTypeInt;
       
   551 
       
   552     TPsmsrvConfigInfo info4;
       
   553     info4.iConfigId = 4 + aIncrement;
       
   554     info4.iConfigType = EConfigTypeInt;
       
   555 
       
   556     TPsmsrvConfigInfo info5;
       
   557     info5.iConfigId = 5 + aIncrement;
       
   558     info5.iConfigType = EConfigTypeReal;
       
   559 
       
   560     switch ( aMode )
       
   561         {
       
   562         case EPsmsrvModeNormal:
       
   563             {
       
   564             info1.iDesValue.Append( KKey1NormalMode );
       
   565             info2.iIntValue = KKey2NormalMode;
       
   566             info3.iIntValue = KKey3NormalMode;
       
   567             info4.iIntValue = KKey4NormalMode;
       
   568             info5.iRealValue = KKey5NormalMode;
       
   569             break;
       
   570             }
       
   571         case EPsmsrvModePowerSave:
       
   572             {
       
   573             info1.iDesValue.Append( KKey1FullPsm );
       
   574             info2.iIntValue = KKey2FullPsm;
       
   575             info3.iIntValue = KKey3FullPsm;
       
   576             info4.iIntValue = KKey4FullPsm;
       
   577             info5.iRealValue = KKey5FullPsm;
       
   578             break;
       
   579             }
       
   580         case EPsmsrvPartialMode:
       
   581             {
       
   582             info1.iDesValue.Append( KKey1PartialPsm );
       
   583             info2.iIntValue = KKey2NormalMode;
       
   584             info3.iIntValue = KKey3NormalMode;
       
   585             info4.iIntValue = KKey4PartialPsm;
       
   586             info5.iRealValue = KKey5PartialPsm;
       
   587             break;
       
   588             }
       
   589         default:
       
   590             {
       
   591             iLog->Log( _L("PSMTest: GenerateConfigArray - Unknown mode") );
       
   592             }
       
   593         }
       
   594 
       
   595     aPsmConfigArray.AppendL( info1 );
       
   596     aPsmConfigArray.AppendL( info2 );
       
   597     aPsmConfigArray.AppendL( info3 );
       
   598     aPsmConfigArray.AppendL( info4 );
       
   599     aPsmConfigArray.AppendL( info5 );
       
   600 
       
   601     }
       
   602 
       
   603 // -----------------------------------------------------------------------------
       
   604 // CPSMTest::ChangeSettings
       
   605 // 
       
   606 // (other items were commented in a header).
       
   607 // -----------------------------------------------------------------------------
       
   608 //
       
   609 TInt CPSMTest::ChangeSettings( CStifItemParser& aItem )
       
   610     {
       
   611     // Print to log file
       
   612     iLog->Log( _L("PSMTest: ChangeSettings") );
       
   613 
       
   614     TBool useExistingApi( EFalse );
       
   615     TInt err = aItem.GetNextInt( useExistingApi );
       
   616 
       
   617     if ( KErrNone != err )
       
   618         {
       
   619         return KErrGeneral;
       
   620         }
       
   621 
       
   622     if ( !useExistingApi )
       
   623         {
       
   624         CPsmSettings* settings = CPsmSettings::NewLC();
       
   625         err = settings->BackupAndGetSettings( iPsmConfigArray, KCenRepUid2 );
       
   626         CleanupStack::PopAndDestroy( settings );
       
   627         }
       
   628     else
       
   629         {
       
   630         if ( iPsmClient )
       
   631             {
       
   632             iPsmClient->PsmSettings().BackupAndGetSettings( iPsmConfigArray, KCenRepUid2 );
       
   633             }
       
   634         else
       
   635             {
       
   636             err = KErrNotFound;
       
   637             }
       
   638         }
       
   639     
       
   640     return err;
       
   641     }
       
   642 
       
   643 // -----------------------------------------------------------------------------
       
   644 // CPSMTest::ChangeSettingsEnd
       
   645 // 
       
   646 // (other items were commented in a header).
       
   647 // -----------------------------------------------------------------------------
       
   648 //
       
   649 TInt CPSMTest::ChangeSettingsEnd( CStifItemParser& aItem )
       
   650     {
       
   651 
       
   652     // Print to log file
       
   653     iLog->Log( _L("PSMTest: ChangeSettingsEnd") );
       
   654 
       
   655     TInt mode( 0 );
       
   656     TInt err = aItem.GetNextInt( mode );
       
   657 
       
   658     if ( KErrNone != err )
       
   659         {
       
   660         return KErrGeneral;
       
   661         }
       
   662 
       
   663     // First, generate array for changed mode settings
       
   664     RConfigInfoArray compareArray;
       
   665     GenerateConfigArray( compareArray, mode, 0 );
       
   666 
       
   667     // Compare iPsmConfigArray with changed mode settings
       
   668     for ( TInt i = 0; i < iPsmConfigArray.Count() && !err; i++ )
       
   669         {
       
   670         TBool found( EFalse );
       
   671         for ( TInt c = 0; c < compareArray.Count() && !found; c++ )
       
   672             {
       
   673             found = Compare( iPsmConfigArray[i], compareArray[c] );
       
   674             }
       
   675 
       
   676         if ( !found )
       
   677             {
       
   678             RDebug::Print( _L( " Compare failed with item: %i " ), i );
       
   679             err = KErrArgument;
       
   680             }
       
   681         }
       
   682 
       
   683     // Cleanup, no memory leaks
       
   684     compareArray.Close();
       
   685     iPsmConfigArray.Close();
       
   686 
       
   687     return err;
       
   688     }
       
   689 
       
   690 // -----------------------------------------------------------------------------
       
   691 // CPSMTest::Compare
       
   692 // 
       
   693 // (other items were commented in a header).
       
   694 // -----------------------------------------------------------------------------
       
   695 //
       
   696 TBool CPSMTest::Compare( TPsmsrvConfigInfo aTarget, TPsmsrvConfigInfo aSource )
       
   697     {
       
   698     // Print to log file
       
   699     iLog->Log( _L("PSMTest: Compare") );
       
   700     TBool returnValue( EFalse );
       
   701 
       
   702     if ( aTarget.iConfigId == aSource.iConfigId &&
       
   703          aTarget.iConfigType == aSource.iConfigType )
       
   704         {
       
   705         iLog->Log( _L( "aTarget.iConfigId: %i, aSource.iConfigId: %i" ), aTarget.iConfigId, aSource.iConfigId );
       
   706         iLog->Log( _L( "aTarget.iConfigType: %i, aSource.iConfigType: %i" ), aTarget.iConfigType, aSource.iConfigType );
       
   707         switch ( aTarget.iConfigType )
       
   708             {
       
   709             case EConfigTypeInt:
       
   710                 {
       
   711                 iLog->Log( _L( "aTarget.iIntValue: %i, aSource.iIntValue: %i" ), aTarget.iIntValue, aSource.iIntValue );
       
   712                 returnValue = aTarget.iIntValue == aSource.iIntValue;
       
   713                 break;
       
   714                 }
       
   715             case EConfigTypeReal:
       
   716                 {
       
   717                 iLog->Log( _L( "aTarget.iRealValue: %f, aSource.iRealValue: %f" ), aTarget.iRealValue, aSource.iRealValue );
       
   718                 returnValue = aTarget.iRealValue == aSource.iRealValue;
       
   719                 break;
       
   720                 }
       
   721             case EConfigTypeBuf:
       
   722                 {
       
   723                 TBuf<256> targetBuf;
       
   724                 targetBuf.Copy( aTarget.iDesValue );
       
   725                 TBuf<256> sourceBuf;
       
   726                 sourceBuf.Copy( aSource.iDesValue );
       
   727                 iLog->Log( _L( "aTarget.iDesValue: %S, aSource.iDesValue: %S" ), &targetBuf, &sourceBuf );
       
   728                 // Compare returns zero if both descroptors are the same
       
   729                 if ( 0 == targetBuf.Compare( sourceBuf ) )
       
   730                     {
       
   731                     returnValue = ETrue;
       
   732                     }
       
   733                 break;
       
   734                 }
       
   735             default:
       
   736                 {
       
   737                 iLog->Log( ( _L( "PSMTest: Compare - Unknown type" ) ) );
       
   738                 returnValue = EFalse;
       
   739                 }
       
   740             }
       
   741         }
       
   742     return returnValue;
       
   743     }
       
   744 
       
   745 // -----------------------------------------------------------------------------
       
   746 // CPSMTest::OpenClosePerformanceInit
       
   747 // 
       
   748 // (other items were commented in a header).
       
   749 // -----------------------------------------------------------------------------
       
   750 //
       
   751 TInt CPSMTest::OpenClosePerformanceInit( CStifItemParser& /*aItem*/ )
       
   752     {
       
   753 
       
   754     // Print to log file
       
   755     iLog->Log( _L("PSMTest: OpenClosePerformanceInit") );
       
   756 
       
   757  /*   TInt amount( 0 );
       
   758     TInt err = aItem.GetNextInt( amount );
       
   759 
       
   760     if ( KErrNone != err )
       
   761         {
       
   762         return KErrGeneral;
       
   763         }
       
   764 
       
   765     // Open amount of client connections
       
   766     for ( TInt i = 0; i < amount; i++ )
       
   767         {
       
   768         CPSMTestObserver* observer = new ( ELeave ) CPSMTestObserver();
       
   769         CPsmNotifier* client = CPsmNotifier::NewL( *observer );
       
   770         iObserverArray.Append( observer );
       
   771         iNotifierArray.Append( client );
       
   772         }
       
   773 */
       
   774     return KErrNotSupported;
       
   775     }
       
   776 
       
   777 // -----------------------------------------------------------------------------
       
   778 // CPSMTest::OpenClosePerformanceRequest
       
   779 // 
       
   780 // (other items were commented in a header).
       
   781 // -----------------------------------------------------------------------------
       
   782 //
       
   783 TInt CPSMTest::OpenClosePerformanceRequest( CStifItemParser& /*aItem*/ )
       
   784     {
       
   785 
       
   786     // Print to log file
       
   787     iLog->Log( _L("PSMTest: OpenClosePerformanceRequest") );
       
   788 
       
   789     // Open amount of client connections
       
   790   /*  for ( TInt i = 0; i < iNotifierArray.Count(); i++ )
       
   791         {
       
   792         iNotifierArray[ i ]->RequestPSMChangeNotification();
       
   793         }
       
   794 
       
   795     // Put member variable to NULL
       
   796     iPsmNotifier = NULL;
       
   797     */
       
   798 
       
   799     return KErrNotSupported;
       
   800     }
       
   801 
       
   802 // -----------------------------------------------------------------------------
       
   803 // CPSMTest::OpenClosePerformanceChange
       
   804 // 
       
   805 // (other items were commented in a header).
       
   806 // -----------------------------------------------------------------------------
       
   807 //
       
   808 TInt CPSMTest::OpenClosePerformanceChange( CStifItemParser& /*aItem*/ )
       
   809     {
       
   810 
       
   811     // Print to log file
       
   812     iLog->Log( _L("PSMTest: OpenClosePerformanceChange") );
       
   813 
       
   814     // aItem has three parameters:
       
   815     //  - First indicates initialization mode, 
       
   816     //  - Second indicates use existing settings API and
       
   817     //  - Third indicates the mode to compare changed settings
       
   818 
       
   819     // Open amount of client connections
       
   820     /*for ( TInt i = 0; i < iNotifierArray.Count(); i++ )
       
   821         {
       
   822    //     iPsmNotifier = iNotifierArray[ i ];
       
   823         CStifItemParser* params = &aItem;
       
   824         ChangeSettingsInit( *params );
       
   825         ChangeSettings( *params );
       
   826         ChangeSettingsEnd( *params );
       
   827         }
       
   828     */
       
   829     // Put member variable to NULL
       
   830     // iPsmNotifier = NULL;
       
   831 
       
   832     return KErrNotSupported;
       
   833     }
       
   834 
       
   835 // -----------------------------------------------------------------------------
       
   836 // CPSMTest::OpenClosePerformanceCancel
       
   837 // 
       
   838 // (other items were commented in a header).
       
   839 // -----------------------------------------------------------------------------
       
   840 //
       
   841 TInt CPSMTest::OpenClosePerformanceCancel( CStifItemParser& /*aItem*/ )
       
   842     {
       
   843 
       
   844     // Print to log file
       
   845     iLog->Log( _L("PSMTest: OpenClosePerformanceCancel") );
       
   846 
       
   847 /*    if ( iNotifierArray.Count() != iObserverArray.Count() )
       
   848         {
       
   849         // Initialization error
       
   850         return KErrBadHandle;
       
   851         }
       
   852 
       
   853     // Open amount of client connections
       
   854     for ( TInt i = 0; i < iNotifierArray.Count(); i++ )
       
   855         {
       
   856         iPsmNotifier = iNotifierArray[ i ];
       
   857         iChangeObserver = iObserverArray[ i ];
       
   858         PsmNotificationCancel( aItem );
       
   859         }
       
   860 
       
   861     // Put member variable to NULL
       
   862     iPsmNotifier = NULL;
       
   863     iChangeObserver = NULL;
       
   864 */
       
   865     return KErrNotSupported;
       
   866     }
       
   867 
       
   868 // -----------------------------------------------------------------------------
       
   869 // CPSMTest::OpenClosePerformanceEnd
       
   870 // 
       
   871 // (other items were commented in a header).
       
   872 // -----------------------------------------------------------------------------
       
   873 //
       
   874 TInt CPSMTest::OpenClosePerformanceEnd( CStifItemParser& /*aItem*/ )
       
   875     {
       
   876 
       
   877     // Print to log file
       
   878     iLog->Log( _L("PSMTest: OpenClosePerformanceEnd") );
       
   879 
       
   880     /*for ( TInt i = 0; i < iNotifierArray.Count(); i++ )
       
   881         {
       
   882         delete iNotifierArray[i];
       
   883         iNotifierArray.Remove( i );
       
   884         i--;
       
   885         }
       
   886 
       
   887     for ( TInt i = 0; i < iObserverArray.Count(); i++ )
       
   888         {
       
   889         delete iObserverArray[i];
       
   890         iObserverArray.Remove( i );
       
   891         i--;
       
   892         }
       
   893 
       
   894     iNotifierArray.Close();
       
   895     iObserverArray.Close();
       
   896     */
       
   897     return KErrNotSupported;
       
   898     }
       
   899 
       
   900 // -----------------------------------------------------------------------------
       
   901 // CPSMTest::CheckPsmMode
       
   902 // 
       
   903 // (other items were commented in a header).
       
   904 // -----------------------------------------------------------------------------
       
   905 //
       
   906 TInt CPSMTest::CheckPsmMode( CStifItemParser& aItem )
       
   907     {
       
   908 
       
   909     // Print to log file
       
   910     iLog->Log( _L("PSMTest: CheckPsmMode") );
       
   911 
       
   912 
       
   913     TInt mode( 0 );
       
   914     TInt checkmode( 0 );
       
   915 
       
   916     TInt err = aItem.GetNextInt( checkmode );
       
   917 
       
   918     if ( KErrNone != err )
       
   919         {
       
   920         return KErrGeneral;
       
   921         }
       
   922 
       
   923     CPsmSettings* settings = CPsmSettings::NewLC();
       
   924     err = settings->GetCurrentMode( mode );
       
   925     CleanupStack::PopAndDestroy( settings );
       
   926     
       
   927 
       
   928    /* CRepository* cenrep = CRepository::NewLC( KCRUidPowerSaveMode );
       
   929     cenrep->Get( KPsmCurrentMode, mode );
       
   930     CleanupStack::PopAndDestroy( cenrep );
       
   931     */
       
   932 
       
   933     if ( KErrNone == err && mode != checkmode )
       
   934         {
       
   935         err = KErrArgument;
       
   936         }
       
   937 
       
   938     return err;
       
   939     }
       
   940 
       
   941 // -----------------------------------------------------------------------------
       
   942 // CPSMTest::GetCurrentSettings
       
   943 // 
       
   944 // (other items were commented in a header).
       
   945 // -----------------------------------------------------------------------------
       
   946 //
       
   947 TInt CPSMTest::GetCurrentSettings( CStifItemParser& aItem )
       
   948     {
       
   949     // Print to log file
       
   950     iLog->Log( _L("PSMTest: GetCurrentSettings") );
       
   951 
       
   952     TInt initmode( 0 );
       
   953     TInt err = aItem.GetNextInt( initmode );
       
   954 
       
   955     if ( KErrNone != err )
       
   956         {
       
   957         return KErrGeneral;
       
   958         }
       
   959 
       
   960     // Initialize config array with init mode. This is different than the mode we are 
       
   961     // changing to
       
   962     RConfigInfoArray compareArray;
       
   963     GenerateConfigArray( compareArray, initmode, 0 );
       
   964 
       
   965     // Generate to normal mode settings
       
   966     RConfigInfoArray currentSettings;
       
   967     GenerateConfigArray( currentSettings, EPsmsrvModeNormal, 0 );
       
   968 
       
   969     CPsmSettings* settings = CPsmSettings::NewLC();
       
   970     err = settings->GetSettings( currentSettings, KCenRepUid2 );
       
   971     CleanupStack::PopAndDestroy( settings );
       
   972 
       
   973      // Compare arrays
       
   974     for ( TInt i = 0; i < compareArray.Count() && !err; i++ )
       
   975         {
       
   976         TBool found( EFalse );
       
   977         for ( TInt c = 0; c < currentSettings.Count() && !found; c++ )
       
   978             {
       
   979             found = Compare( currentSettings[i], compareArray[c] );
       
   980             }
       
   981 
       
   982         if ( !found )
       
   983             {
       
   984             err = KErrArgument;
       
   985             }
       
   986         }
       
   987 
       
   988     // Cleanup, no memory leaks
       
   989     compareArray.Close();
       
   990     currentSettings.Close();
       
   991 
       
   992     return err;
       
   993     }
       
   994 
       
   995 // -----------------------------------------------------------------------------
       
   996 // CPSMTest::BackupSettings
       
   997 // 
       
   998 // (other items were commented in a header).
       
   999 // -----------------------------------------------------------------------------
       
  1000 //
       
  1001 TInt CPSMTest::BackupSettings( CStifItemParser& aItem )
       
  1002     {
       
  1003     // Print to log file
       
  1004     iLog->Log( _L("PSMTest: BackupSettings") );
       
  1005 
       
  1006     TInt initmode( 0 );
       
  1007     TInt err = aItem.GetNextInt( initmode );
       
  1008 
       
  1009     if ( KErrNone != err )
       
  1010         {
       
  1011         return KErrGeneral;
       
  1012         }
       
  1013 
       
  1014     // Initialize config array with init mode. This is different than the mode we are 
       
  1015     // changing to
       
  1016     RConfigInfoArray backupArray;
       
  1017     GenerateConfigArray( backupArray, initmode, 5 );
       
  1018 
       
  1019     CPsmSettings* settings = CPsmSettings::NewLC();
       
  1020     err = settings->BackupSettings( backupArray, KCenRepUid5 );
       
  1021     CleanupStack::PopAndDestroy( settings );
       
  1022 
       
  1023     // Cleanup, no memory leaks
       
  1024     backupArray.Close();
       
  1025 
       
  1026     return err;
       
  1027     }
       
  1028 
       
  1029 // -----------------------------------------------------------------------------
       
  1030 // CPSMTest::ChangePsmPerformance
       
  1031 // 
       
  1032 // (other items were commented in a header).
       
  1033 // -----------------------------------------------------------------------------
       
  1034 //
       
  1035 TInt CPSMTest::ChangePsmPerformance( CStifItemParser& aItem )
       
  1036     {
       
  1037 
       
  1038     // Print to log file
       
  1039     iLog->Log( _L("PSMTest: ChangePsmPerformance") );
       
  1040 
       
  1041     // aItem has three parameters:
       
  1042     //  - First one is the amount of actions to do
       
  1043     //  - Second one is the first mode to change
       
  1044     //  - Third one is the second mode to change
       
  1045    
       
  1046     TInt amount( 0 );
       
  1047     TInt firstmode( 0 );
       
  1048     TInt secondmode( 0 );
       
  1049 
       
  1050     TInt err = aItem.GetNextInt( amount );
       
  1051 
       
  1052     if ( KErrNone != err )
       
  1053         {
       
  1054         return KErrGeneral;
       
  1055         }
       
  1056     
       
  1057     err = aItem.GetNextInt( firstmode );
       
  1058 
       
  1059     if ( KErrNone != err )
       
  1060         {
       
  1061         return KErrGeneral;
       
  1062         }
       
  1063 
       
  1064     err = aItem.GetNextInt( secondmode );
       
  1065 
       
  1066     if ( KErrNone != err )
       
  1067         {
       
  1068         return KErrGeneral;
       
  1069         }
       
  1070 
       
  1071     // Create local client, no need for memeber
       
  1072     CPsmClient* client = CPsmClient::NewLC( *this );
       
  1073 
       
  1074     // Need to change mode in turns
       
  1075     TBool changeFirstMode( ETrue );
       
  1076 
       
  1077     // Loop and change mode
       
  1078     for ( TInt i = 0; i < amount && iErrorCode == KErrNone; i++ )
       
  1079         {
       
  1080         if ( changeFirstMode )
       
  1081             {
       
  1082             client->ChangePowerSaveMode( firstmode );
       
  1083             changeFirstMode = EFalse;
       
  1084             }
       
  1085         else
       
  1086             {
       
  1087             client->ChangePowerSaveMode( secondmode );
       
  1088             changeFirstMode = ETrue;
       
  1089             }
       
  1090 
       
  1091         // Wait for mode to change
       
  1092         iSchedulerWait.Start();
       
  1093 
       
  1094         // No need to do anything else, continue to next mode
       
  1095         }
       
  1096 
       
  1097     CleanupStack::PopAndDestroy( client );
       
  1098 
       
  1099     return iErrorCode;
       
  1100     }
       
  1101 
       
  1102 // -----------------------------------------------------------------------------
       
  1103 // CPSMTest::ChangeSettingsPerformance
       
  1104 // 
       
  1105 // (other items were commented in a header).
       
  1106 // -----------------------------------------------------------------------------
       
  1107 //
       
  1108 TInt CPSMTest::ChangeSettingsPerformance( CStifItemParser& /*aItem*/ )
       
  1109     {
       
  1110     // Print to log file
       
  1111     iLog->Log( _L("PSMTest: ChangeSettingsPerformance") );
       
  1112 
       
  1113     TInt increment = 0;
       
  1114     TInt err = KErrNone;
       
  1115     
       
  1116     // Initialize config array with normal mode.
       
  1117     for ( TInt i = 0; i < 10; i++ )
       
  1118         {
       
  1119         GenerateConfigArray( iPsmConfigArray, EPsmsrvModeNormal, increment );
       
  1120         increment = iPsmConfigArray.Count();
       
  1121         }
       
  1122 
       
  1123     // Change settings
       
  1124     CPsmSettings* settings = CPsmSettings::NewLC();
       
  1125     err = settings->BackupAndGetSettings( iPsmConfigArray, KCenRepUid5 );
       
  1126     CleanupStack::PopAndDestroy( settings );
       
  1127 
       
  1128     // Generate array for changed mode settings
       
  1129     increment = 0;
       
  1130     RConfigInfoArray compareArray;
       
  1131     for ( TInt k = 0; k < 10; k++ )
       
  1132         {
       
  1133         GenerateConfigArray( compareArray, EPsmsrvModePowerSave, increment );
       
  1134         increment = compareArray.Count();
       
  1135         }
       
  1136 
       
  1137     // Compare iPsmConfigArray with changed mode settings
       
  1138     for ( TInt j = 0; j < iPsmConfigArray.Count() && !err; j++ )
       
  1139         {
       
  1140         TBool found( EFalse );
       
  1141         for ( TInt c = 0; c < compareArray.Count() && !found; c++ )
       
  1142             {
       
  1143             found = Compare( iPsmConfigArray[j], compareArray[c] );
       
  1144             }
       
  1145 
       
  1146         if ( !found )
       
  1147             {
       
  1148             err = KErrArgument;
       
  1149             }
       
  1150         }
       
  1151 
       
  1152     // Cleanup, no memory leaks
       
  1153     compareArray.Close();
       
  1154     iPsmConfigArray.Close();
       
  1155     return err;
       
  1156     }
       
  1157 
       
  1158 // -----------------------------------------------------------------------------
       
  1159 // CPSMTest::PowerSaveModeChanged
       
  1160 // 
       
  1161 // (other items were commented in a header).
       
  1162 // -----------------------------------------------------------------------------
       
  1163 //
       
  1164 void CPSMTest::PowerSaveModeChanged( const TPsmsrvMode aMode )
       
  1165     {
       
  1166     // Print to log file
       
  1167     iLog->Log( _L("PSMTest: PowerSaveModeChanged - mode: %d"), aMode );
       
  1168 
       
  1169     iErrorCode = KErrNone;
       
  1170 
       
  1171     iChangedMode = aMode;
       
  1172 
       
  1173     iPsmComplete = ETrue;
       
  1174 
       
  1175     // Stop scheduler wait
       
  1176     if ( iSchedulerWait.IsStarted() )
       
  1177         {
       
  1178         iSchedulerWait.AsyncStop();    
       
  1179         }
       
  1180     }
       
  1181 
       
  1182 // -----------------------------------------------------------------------------
       
  1183 // CPSMTest::PowerSaveModeChangeError
       
  1184 // 
       
  1185 // (other items were commented in a header).
       
  1186 // -----------------------------------------------------------------------------
       
  1187 //
       
  1188 void CPSMTest::PowerSaveModeChangeError( const TInt aError )
       
  1189     {
       
  1190     // Print to log file
       
  1191     iLog->Log( _L("PSMTest: PowerSaveModeChangeError - Error: %d"), aError );
       
  1192 
       
  1193     iErrorCode = aError;
       
  1194 
       
  1195     // Stop scheduler wait
       
  1196     if ( iSchedulerWait.IsStarted() )
       
  1197         {
       
  1198         iSchedulerWait.AsyncStop();    
       
  1199         }
       
  1200     }
       
  1201 
       
  1202 /***************************************************************************
       
  1203  * TestObserver functions
       
  1204  ***************************************************************************/
       
  1205 // -----------------------------------------------------------------------------
       
  1206 // CPSMTest::PowerSaveModeChanged
       
  1207 // 
       
  1208 // (other items were commented in a header).
       
  1209 // -----------------------------------------------------------------------------
       
  1210 //
       
  1211 /*void CPSMTestObserver::PowerSaveModeChanged( const TPsmsrvMode aMode )
       
  1212     {
       
  1213     // Print to log file
       
  1214     RDebug::Print( _L("CPSMTestObserver: PowerSaveModeChanged - Mode: %d"), aMode );
       
  1215     iNewMode = aMode;
       
  1216     }
       
  1217 
       
  1218 // -----------------------------------------------------------------------------
       
  1219 // CPSMTest::PowerSaveModeChangeError
       
  1220 // 
       
  1221 // (other items were commented in a header).
       
  1222 // -----------------------------------------------------------------------------
       
  1223 //
       
  1224 void CPSMTestObserver::PowerSaveModeChangeError( const TInt aError )
       
  1225     {
       
  1226     // Print to log file
       
  1227     RDebug::Print( _L("CPSMTestObserver: PowerSaveModeChangeError - Error: %d"), aError );
       
  1228     iNewMode = aError;
       
  1229     }
       
  1230 
       
  1231 // -----------------------------------------------------------------------------
       
  1232 // CPSMTest::CPSMTestObserver
       
  1233 // -----------------------------------------------------------------------------
       
  1234 //
       
  1235 CPSMTestObserver::CPSMTestObserver()
       
  1236     {
       
  1237     }
       
  1238 
       
  1239 // -----------------------------------------------------------------------------
       
  1240 // CPSMTest::NotifyPowerSaveModeChange
       
  1241 // -----------------------------------------------------------------------------
       
  1242 //
       
  1243 CPSMTestObserver::~CPSMTestObserver()
       
  1244     {
       
  1245     }
       
  1246 */
       
  1247 //  End of File