phoneengine/loghandling/tsrc/mocks/mock_centralrepository.cpp
changeset 21 92ab7f8d0eab
equal deleted inserted replaced
4:c84cf270c54f 21:92ab7f8d0eab
       
     1 /** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 * All rights reserved.
       
     3 * This component and the accompanying materials are made available
       
     4 * under the terms of "Eclipse Public License v1.0"
       
     5 * which accompanies this distribution, and is available
       
     6 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 *
       
     8 * Initial Contributors:
       
     9 * Nokia Corporation - initial contribution.
       
    10 *
       
    11 * Contributors:
       
    12 *
       
    13 * Description:
       
    14 *
       
    15 */
       
    16 #include <smcmockclassincludes.h>
       
    17 #include <ceunitalloctestcasedecorator.h>
       
    18 #include "centralrepository.h"
       
    19 
       
    20 // ============================ MEMBER FUNCTIONS ===============================
       
    21 
       
    22 // -----------------------------------------------------------------------------
       
    23 // CRepository::NewL
       
    24 // -----------------------------------------------------------------------------
       
    25 //
       
    26 CRepository * CRepository::NewL( 
       
    27         TUid aRepositoryUid )
       
    28     {
       
    29     SMC_MOCK_NEWL1( CRepository *, TUid, aRepositoryUid )
       
    30 
       
    31     CRepository* self = new( ELeave ) CRepository;
       
    32     CleanupStack::PushL( self );
       
    33     //self->ConstructL()
       
    34     CleanupStack::Pop( self );
       
    35     return self;
       
    36     }
       
    37 
       
    38 
       
    39 // -----------------------------------------------------------------------------
       
    40 // CRepository::NewLC
       
    41 // -----------------------------------------------------------------------------
       
    42 //
       
    43 CRepository * CRepository::NewLC( 
       
    44         TUid aRepositoryUid )
       
    45     {
       
    46     SMC_MOCK_NEWLC1( CRepository *, TUid, aRepositoryUid )
       
    47 
       
    48     CRepository* self = new( ELeave ) CRepository;
       
    49     CleanupStack::PushL( self );
       
    50     //self->ConstructL()
       
    51     return self;
       
    52     }
       
    53 
       
    54 
       
    55 // -----------------------------------------------------------------------------
       
    56 // CRepository::~CRepository
       
    57 // -----------------------------------------------------------------------------
       
    58 //
       
    59 CRepository::~CRepository(  )
       
    60     {
       
    61     
       
    62     }
       
    63 
       
    64 
       
    65 // -----------------------------------------------------------------------------
       
    66 // CRepository::Create
       
    67 // -----------------------------------------------------------------------------
       
    68 //
       
    69 TInt CRepository::Create( 
       
    70         TUint32 aKey,
       
    71         TInt aValue )
       
    72     {
       
    73     SMC_MOCK_METHOD2( TInt, TUint32, aKey, 
       
    74         TInt, aValue )
       
    75     }
       
    76 
       
    77 
       
    78 // -----------------------------------------------------------------------------
       
    79 // CRepository::Create
       
    80 // -----------------------------------------------------------------------------
       
    81 //
       
    82 TInt CRepository::Create( 
       
    83         TUint32 aKey,
       
    84         const TReal & aValue )
       
    85     {
       
    86     SMC_MOCK_METHOD2( TInt, TUint32, aKey, 
       
    87         const TReal &, aValue )
       
    88     }
       
    89 
       
    90 
       
    91 // -----------------------------------------------------------------------------
       
    92 // CRepository::Create
       
    93 // -----------------------------------------------------------------------------
       
    94 //
       
    95 TInt CRepository::Create( 
       
    96         TUint32 aKey,
       
    97         const TDesC8 & aValue )
       
    98     {
       
    99     SMC_MOCK_METHOD2( TInt, TUint32, aKey, 
       
   100         const TDesC8 &, aValue )
       
   101     }
       
   102 
       
   103 
       
   104 // -----------------------------------------------------------------------------
       
   105 // CRepository::Create
       
   106 // -----------------------------------------------------------------------------
       
   107 //
       
   108 TInt CRepository::Create( 
       
   109         TUint32 aKey,
       
   110         const TDesC16 & aValue )
       
   111     {
       
   112     SMC_MOCK_METHOD2( TInt, TUint32, aKey, 
       
   113         const TDesC16 &, aValue )
       
   114     }
       
   115 
       
   116 
       
   117 // -----------------------------------------------------------------------------
       
   118 // CRepository::Delete
       
   119 // -----------------------------------------------------------------------------
       
   120 //
       
   121 TInt CRepository::Delete( 
       
   122         TUint32 aKey )
       
   123     {
       
   124     SMC_MOCK_METHOD1( TInt, TUint32, aKey )
       
   125     }
       
   126 
       
   127 
       
   128 // -----------------------------------------------------------------------------
       
   129 // CRepository::Delete
       
   130 // -----------------------------------------------------------------------------
       
   131 //
       
   132 TInt CRepository::Delete( 
       
   133         TUint32 aPartialKey,
       
   134         TUint32 aMask,
       
   135         TUint32 & aErrorKey )
       
   136     {
       
   137     SMC_MOCK_METHOD3( TInt, TUint32, aPartialKey, 
       
   138         TUint32, aMask, 
       
   139         TUint32 &, aErrorKey )
       
   140     }
       
   141 
       
   142 
       
   143 // -----------------------------------------------------------------------------
       
   144 // CRepository::Get
       
   145 // -----------------------------------------------------------------------------
       
   146 //
       
   147 TInt CRepository::Get( 
       
   148         TUint32 aKey,
       
   149         TInt & aValue )
       
   150     {
       
   151     SMC_MOCK_METHOD2( TInt, TUint32, aKey, 
       
   152         TInt &, aValue )
       
   153     }
       
   154 
       
   155 
       
   156 // -----------------------------------------------------------------------------
       
   157 // CRepository::Set
       
   158 // -----------------------------------------------------------------------------
       
   159 //
       
   160 TInt CRepository::Set( 
       
   161         TUint32 aKey,
       
   162         TInt aValue )
       
   163     {
       
   164     SMC_MOCK_METHOD2( TInt, TUint32, aKey, 
       
   165         TInt, aValue )
       
   166     }
       
   167 
       
   168 
       
   169 // -----------------------------------------------------------------------------
       
   170 // CRepository::Get
       
   171 // -----------------------------------------------------------------------------
       
   172 //
       
   173 TInt CRepository::Get( 
       
   174         TUint32 aKey,
       
   175         TReal & aValue )
       
   176     {
       
   177     SMC_MOCK_METHOD2( TInt, TUint32, aKey, 
       
   178         TReal &, aValue )
       
   179     }
       
   180 
       
   181 
       
   182 // -----------------------------------------------------------------------------
       
   183 // CRepository::Set
       
   184 // -----------------------------------------------------------------------------
       
   185 //
       
   186 TInt CRepository::Set( 
       
   187         TUint32 aKey,
       
   188         const TReal & aValue )
       
   189     {
       
   190     SMC_MOCK_METHOD2( TInt, TUint32, aKey, 
       
   191         const TReal &, aValue )
       
   192     }
       
   193 
       
   194 
       
   195 // -----------------------------------------------------------------------------
       
   196 // CRepository::Get
       
   197 // -----------------------------------------------------------------------------
       
   198 //
       
   199 TInt CRepository::Get( 
       
   200         TUint32 aKey,
       
   201         TDes8 & aValue )
       
   202     {
       
   203     SMC_MOCK_METHOD2( TInt, TUint32, aKey, 
       
   204         TDes8 &, aValue )
       
   205     }
       
   206 
       
   207 
       
   208 // -----------------------------------------------------------------------------
       
   209 // CRepository::Get
       
   210 // -----------------------------------------------------------------------------
       
   211 //
       
   212 TInt CRepository::Get( 
       
   213         TUint32 aId,
       
   214         TDes8 & aValue,
       
   215         TInt & aActualLength )
       
   216     {
       
   217     SMC_MOCK_METHOD3( TInt, TUint32, aId, 
       
   218         TDes8 &, aValue, 
       
   219         TInt &, aActualLength )
       
   220     }
       
   221 
       
   222 
       
   223 // -----------------------------------------------------------------------------
       
   224 // CRepository::Set
       
   225 // -----------------------------------------------------------------------------
       
   226 //
       
   227 TInt CRepository::Set( 
       
   228         TUint32 aKey,
       
   229         const TDesC8 & aValue )
       
   230     {
       
   231     SMC_MOCK_METHOD2( TInt, TUint32, aKey, 
       
   232         const TDesC8 &, aValue )
       
   233     }
       
   234 
       
   235 
       
   236 // -----------------------------------------------------------------------------
       
   237 // CRepository::Get
       
   238 // -----------------------------------------------------------------------------
       
   239 //
       
   240 TInt CRepository::Get( 
       
   241         TUint32 aKey,
       
   242         TDes16 & aValue )
       
   243     {
       
   244     SMC_MOCK_METHOD2( TInt, TUint32, aKey, 
       
   245         TDes16 &, aValue )
       
   246     }
       
   247 
       
   248 
       
   249 // -----------------------------------------------------------------------------
       
   250 // CRepository::Get
       
   251 // -----------------------------------------------------------------------------
       
   252 //
       
   253 TInt CRepository::Get( 
       
   254         TUint32 aId,
       
   255         TDes16 & aValue,
       
   256         TInt & aActualLength )
       
   257     {
       
   258     SMC_MOCK_METHOD3( TInt, TUint32, aId, 
       
   259         TDes16 &, aValue, 
       
   260         TInt &, aActualLength )
       
   261     }
       
   262 
       
   263 
       
   264 // -----------------------------------------------------------------------------
       
   265 // CRepository::Set
       
   266 // -----------------------------------------------------------------------------
       
   267 //
       
   268 TInt CRepository::Set( 
       
   269         TUint32 aKey,
       
   270         const TDesC16 & aValue )
       
   271     {
       
   272     SMC_MOCK_METHOD2( TInt, TUint32, aKey, 
       
   273         const TDesC16 &, aValue )
       
   274     }
       
   275 
       
   276 
       
   277 // -----------------------------------------------------------------------------
       
   278 // CRepository::GetMeta
       
   279 // -----------------------------------------------------------------------------
       
   280 //
       
   281 TInt CRepository::GetMeta( 
       
   282         TUint32 aKey,
       
   283         TUint32 & aMeta )
       
   284     {
       
   285     SMC_MOCK_METHOD2( TInt, TUint32, aKey, 
       
   286         TUint32 &, aMeta )
       
   287     }
       
   288 
       
   289 
       
   290 // -----------------------------------------------------------------------------
       
   291 // CRepository::Move
       
   292 // -----------------------------------------------------------------------------
       
   293 //
       
   294 TInt CRepository::Move( 
       
   295         TUint32 aSourcePartialKey,
       
   296         TUint32 aTargetPartialKey,
       
   297         TUint32 aMask,
       
   298         TUint32 & aErrorKey )
       
   299     {
       
   300     SMC_MOCK_METHOD4( TInt, TUint32, aSourcePartialKey, 
       
   301         TUint32, aTargetPartialKey, 
       
   302         TUint32, aMask, 
       
   303         TUint32 &, aErrorKey )
       
   304     }
       
   305 
       
   306 
       
   307 // -----------------------------------------------------------------------------
       
   308 // CRepository::FindL
       
   309 // -----------------------------------------------------------------------------
       
   310 //
       
   311 TInt CRepository::FindL( 
       
   312         TUint32 aPartialKey,
       
   313         TUint32 aMask,
       
   314         RArray<TUint32> & aFoundKeys )
       
   315     {
       
   316     EUNIT_LEAVE_POINT
       
   317     SMC_MOCK_METHOD3( TInt, TUint32, aPartialKey, 
       
   318         TUint32, aMask, 
       
   319         RArray<TUint32> &, aFoundKeys )
       
   320     }
       
   321 
       
   322 
       
   323 // -----------------------------------------------------------------------------
       
   324 // CRepository::FindEqL
       
   325 // -----------------------------------------------------------------------------
       
   326 //
       
   327 TInt CRepository::FindEqL( 
       
   328         TUint32 aPartialKey,
       
   329         TUint32 aMask,
       
   330         TInt aValue,
       
   331         RArray<TUint32> & aFoundKeys )
       
   332     {
       
   333     EUNIT_LEAVE_POINT
       
   334     SMC_MOCK_METHOD4( TInt, TUint32, aPartialKey, 
       
   335         TUint32, aMask, 
       
   336         TInt, aValue, 
       
   337         RArray<TUint32> &, aFoundKeys )
       
   338     }
       
   339 
       
   340 
       
   341 // -----------------------------------------------------------------------------
       
   342 // CRepository::FindEqL
       
   343 // -----------------------------------------------------------------------------
       
   344 //
       
   345 TInt CRepository::FindEqL( 
       
   346         TUint32 aPartialKey,
       
   347         TUint32 aMask,
       
   348         const TReal & aValue,
       
   349         RArray<TUint32> & aFoundKeys )
       
   350     {
       
   351     EUNIT_LEAVE_POINT
       
   352     SMC_MOCK_METHOD4( TInt, TUint32, aPartialKey, 
       
   353         TUint32, aMask, 
       
   354         const TReal &, aValue, 
       
   355         RArray<TUint32> &, aFoundKeys )
       
   356     }
       
   357 
       
   358 
       
   359 // -----------------------------------------------------------------------------
       
   360 // CRepository::FindEqL
       
   361 // -----------------------------------------------------------------------------
       
   362 //
       
   363 TInt CRepository::FindEqL( 
       
   364         TUint32 aPartialKey,
       
   365         TUint32 aMask,
       
   366         const TDesC8 & aValue,
       
   367         RArray<TUint32> & aFoundKeys )
       
   368     {
       
   369     EUNIT_LEAVE_POINT
       
   370     SMC_MOCK_METHOD4( TInt, TUint32, aPartialKey, 
       
   371         TUint32, aMask, 
       
   372         const TDesC8 &, aValue, 
       
   373         RArray<TUint32> &, aFoundKeys )
       
   374     }
       
   375 
       
   376 
       
   377 // -----------------------------------------------------------------------------
       
   378 // CRepository::FindEqL
       
   379 // -----------------------------------------------------------------------------
       
   380 //
       
   381 TInt CRepository::FindEqL( 
       
   382         TUint32 aPartialKey,
       
   383         TUint32 aMask,
       
   384         const TDesC16 & aValue,
       
   385         RArray<TUint32> & aFoundKeys )
       
   386     {
       
   387     EUNIT_LEAVE_POINT
       
   388     SMC_MOCK_METHOD4( TInt, TUint32, aPartialKey, 
       
   389         TUint32, aMask, 
       
   390         const TDesC16 &, aValue, 
       
   391         RArray<TUint32> &, aFoundKeys )
       
   392     }
       
   393 
       
   394 
       
   395 // -----------------------------------------------------------------------------
       
   396 // CRepository::FindNeqL
       
   397 // -----------------------------------------------------------------------------
       
   398 //
       
   399 TInt CRepository::FindNeqL( 
       
   400         TUint32 aPartialKey,
       
   401         TUint32 aMask,
       
   402         TInt aValue,
       
   403         RArray<TUint32> & aFoundKeys )
       
   404     {
       
   405     EUNIT_LEAVE_POINT
       
   406     SMC_MOCK_METHOD4( TInt, TUint32, aPartialKey, 
       
   407         TUint32, aMask, 
       
   408         TInt, aValue, 
       
   409         RArray<TUint32> &, aFoundKeys )
       
   410     }
       
   411 
       
   412 
       
   413 // -----------------------------------------------------------------------------
       
   414 // CRepository::FindNeqL
       
   415 // -----------------------------------------------------------------------------
       
   416 //
       
   417 TInt CRepository::FindNeqL( 
       
   418         TUint32 aPartialKey,
       
   419         TUint32 aMask,
       
   420         const TReal & aValue,
       
   421         RArray<TUint32> & aFoundKeys )
       
   422     {
       
   423     EUNIT_LEAVE_POINT
       
   424     SMC_MOCK_METHOD4( TInt, TUint32, aPartialKey, 
       
   425         TUint32, aMask, 
       
   426         const TReal &, aValue, 
       
   427         RArray<TUint32> &, aFoundKeys )
       
   428     }
       
   429 
       
   430 
       
   431 // -----------------------------------------------------------------------------
       
   432 // CRepository::FindNeqL
       
   433 // -----------------------------------------------------------------------------
       
   434 //
       
   435 TInt CRepository::FindNeqL( 
       
   436         TUint32 aPartialKey,
       
   437         TUint32 aMask,
       
   438         const TDesC8 & aValue,
       
   439         RArray<TUint32> & aFoundKeys )
       
   440     {
       
   441     EUNIT_LEAVE_POINT
       
   442     SMC_MOCK_METHOD4( TInt, TUint32, aPartialKey, 
       
   443         TUint32, aMask, 
       
   444         const TDesC8 &, aValue, 
       
   445         RArray<TUint32> &, aFoundKeys )
       
   446     }
       
   447 
       
   448 
       
   449 // -----------------------------------------------------------------------------
       
   450 // CRepository::FindNeqL
       
   451 // -----------------------------------------------------------------------------
       
   452 //
       
   453 TInt CRepository::FindNeqL( 
       
   454         TUint32 aPartialKey,
       
   455         TUint32 aMask,
       
   456         const TDesC16 & aValue,
       
   457         RArray<TUint32> & aFoundKeys )
       
   458     {
       
   459     EUNIT_LEAVE_POINT
       
   460     SMC_MOCK_METHOD4( TInt, TUint32, aPartialKey, 
       
   461         TUint32, aMask, 
       
   462         const TDesC16 &, aValue, 
       
   463         RArray<TUint32> &, aFoundKeys )
       
   464     }
       
   465 
       
   466 
       
   467 // -----------------------------------------------------------------------------
       
   468 // CRepository::NotifyRequest
       
   469 // -----------------------------------------------------------------------------
       
   470 //
       
   471 TInt CRepository::NotifyRequest( 
       
   472         TUint32 aKey,
       
   473         TRequestStatus & aStatus )
       
   474     {
       
   475     SMC_MOCK_METHOD2( TInt, TUint32, aKey, 
       
   476         TRequestStatus &, aStatus )
       
   477     }
       
   478 
       
   479 
       
   480 // -----------------------------------------------------------------------------
       
   481 // CRepository::NotifyRequest
       
   482 // -----------------------------------------------------------------------------
       
   483 //
       
   484 TInt CRepository::NotifyRequest( 
       
   485         TUint32 aPartialKey,
       
   486         TUint32 aMask,
       
   487         TRequestStatus & aStatus )
       
   488     {
       
   489     SMC_MOCK_METHOD3( TInt, TUint32, aPartialKey, 
       
   490         TUint32, aMask, 
       
   491         TRequestStatus &, aStatus )
       
   492     }
       
   493 
       
   494 
       
   495 // -----------------------------------------------------------------------------
       
   496 // CRepository::NotifyCancel
       
   497 // -----------------------------------------------------------------------------
       
   498 //
       
   499 TInt CRepository::NotifyCancel( 
       
   500         TUint32 aKey )
       
   501     {
       
   502     SMC_MOCK_METHOD1( TInt, TUint32, aKey )
       
   503     }
       
   504 
       
   505 
       
   506 // -----------------------------------------------------------------------------
       
   507 // CRepository::NotifyCancel
       
   508 // -----------------------------------------------------------------------------
       
   509 //
       
   510 TInt CRepository::NotifyCancel( 
       
   511         TUint32 aPartialKey,
       
   512         TUint32 aMask )
       
   513     {
       
   514     SMC_MOCK_METHOD2( TInt, TUint32, aPartialKey, 
       
   515         TUint32, aMask )
       
   516     }
       
   517 
       
   518 
       
   519 // -----------------------------------------------------------------------------
       
   520 // CRepository::NotifyCancelAll
       
   521 // -----------------------------------------------------------------------------
       
   522 //
       
   523 TInt CRepository::NotifyCancelAll(  )
       
   524     {
       
   525     SMC_MOCK_METHOD0( TInt )
       
   526     }
       
   527 
       
   528 
       
   529 // -----------------------------------------------------------------------------
       
   530 // CRepository::Reset
       
   531 // -----------------------------------------------------------------------------
       
   532 //
       
   533 TInt CRepository::Reset(  )
       
   534     {
       
   535     SMC_MOCK_METHOD0( TInt )
       
   536     }
       
   537 
       
   538 
       
   539 // -----------------------------------------------------------------------------
       
   540 // CRepository::Reset
       
   541 // -----------------------------------------------------------------------------
       
   542 //
       
   543 TInt CRepository::Reset( 
       
   544         TUint32 aKey )
       
   545     {
       
   546     SMC_MOCK_METHOD1( TInt, TUint32, aKey )
       
   547     }
       
   548 
       
   549 
       
   550 // -----------------------------------------------------------------------------
       
   551 // CRepository::StartTransaction
       
   552 // -----------------------------------------------------------------------------
       
   553 //
       
   554 TInt CRepository::StartTransaction( 
       
   555         TTransactionMode aMode )
       
   556     {
       
   557     SMC_MOCK_METHOD1( TInt, TTransactionMode, aMode )
       
   558     }
       
   559 
       
   560 
       
   561 // -----------------------------------------------------------------------------
       
   562 // CRepository::StartTransaction
       
   563 // -----------------------------------------------------------------------------
       
   564 //
       
   565 void CRepository::StartTransaction( 
       
   566         TTransactionMode aMode,
       
   567         TRequestStatus & aStatus )
       
   568     {
       
   569     SMC_MOCK_METHOD2( void, TTransactionMode, aMode, 
       
   570         TRequestStatus &, aStatus )
       
   571     }
       
   572 
       
   573 
       
   574 // -----------------------------------------------------------------------------
       
   575 // CRepository::CommitTransaction
       
   576 // -----------------------------------------------------------------------------
       
   577 //
       
   578 TInt CRepository::CommitTransaction( 
       
   579         TUint32 & aKeyInfo )
       
   580     {
       
   581     SMC_MOCK_METHOD1( TInt, TUint32 &, aKeyInfo )
       
   582     }
       
   583 
       
   584 
       
   585 // -----------------------------------------------------------------------------
       
   586 // CRepository::CommitTransaction
       
   587 // -----------------------------------------------------------------------------
       
   588 //
       
   589 void CRepository::CommitTransaction( 
       
   590         TDes8 & aKeyInfo,
       
   591         TRequestStatus & aStatus )
       
   592     {
       
   593     SMC_MOCK_METHOD2( void, TDes8 &, aKeyInfo, 
       
   594         TRequestStatus &, aStatus )
       
   595     }
       
   596 
       
   597 
       
   598 // -----------------------------------------------------------------------------
       
   599 // CRepository::CancelTransaction
       
   600 // -----------------------------------------------------------------------------
       
   601 //
       
   602 void CRepository::CancelTransaction(  )
       
   603     {
       
   604     SMC_MOCK_METHOD0( void )
       
   605     }
       
   606 
       
   607 
       
   608 // -----------------------------------------------------------------------------
       
   609 // CRepository::CleanupCancelTransactionPushL
       
   610 // -----------------------------------------------------------------------------
       
   611 //
       
   612 void CRepository::CleanupCancelTransactionPushL(  )
       
   613     {
       
   614     EUNIT_LEAVE_POINT
       
   615     SMC_MOCK_METHOD0( void )
       
   616     }
       
   617 
       
   618 
       
   619 // -----------------------------------------------------------------------------
       
   620 // CRepository::FailTransaction
       
   621 // -----------------------------------------------------------------------------
       
   622 //
       
   623 void CRepository::FailTransaction(  )
       
   624     {
       
   625     SMC_MOCK_METHOD0( void )
       
   626     }
       
   627 
       
   628 
       
   629 // -----------------------------------------------------------------------------
       
   630 // CRepository::CleanupFailTransactionPushL
       
   631 // -----------------------------------------------------------------------------
       
   632 //
       
   633 void CRepository::CleanupFailTransactionPushL(  )
       
   634     {
       
   635     EUNIT_LEAVE_POINT
       
   636     SMC_MOCK_METHOD0( void )
       
   637     }
       
   638 
       
   639 
       
   640 
       
   641