wvsettings20/tsrc/basic/private/TestTools/IMPSSAPSettingsStoreTestUtils.h
changeset 0 094583676ce7
equal deleted inserted replaced
-1:000000000000 0:094583676ce7
       
     1 /*
       
     2 * Copyright (c) 2004 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: TestUtils for SAP settings store module tests
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __IMPSSAPSettingsStoreTestUtils_H__
       
    20 #define __IMPSSAPSettingsStoreTestUtils_H__
       
    21 
       
    22 #include <E32Std.h>
       
    23 #include <CIMPSSAPSettingsStore.h> //for KIMPSDefaultSAPSettings
       
    24 
       
    25 
       
    26 //Forwards
       
    27 class CIMPSSAPSettings;
       
    28 
       
    29 
       
    30 // CONSTANTS AND MACROS
       
    31 //Store db files
       
    32 
       
    33 /*_LIT( KDbFilesFolder,"C:\\System\\Data\\");
       
    34 _LIT( KDbDefaultFilesFolder,"D:\\System\\Data\\");
       
    35 
       
    36 _LIT( KDbFileNameHead,"IMPSSapDb");
       
    37 _LIT( KDbFileNameTail,".dat");
       
    38 
       
    39 _LIT( KDbIniFileNameHead,"IMPSSapIni");
       
    40 _LIT( KDbIniFileNameTail,".dat");
       
    41 */
       
    42 
       
    43 //TEST source db:s
       
    44 /*
       
    45 _LIT( KSapDb_TestFileFolder, "c:\\SapDbs\\" );
       
    46 _LIT( KSapDb0_V1_Filled, "IMPSSapDb0.f1" );
       
    47 _LIT( KSapDb0_V1_Empty, "IMPSSapDb0.e1" );
       
    48 
       
    49 _LIT( KSapDb0_V2_Filled, "IMPSSapDb0.f2" );
       
    50 _LIT( KSapDb0_V2_Empty, "IMPSSapDb0.e2" );
       
    51 
       
    52 _LIT( KSapDb0_V3_Filled, "IMPSSapDb0.f3" );
       
    53 _LIT( KSapIni0_V3_Filled, "IMPSSapIni0.f3" );
       
    54 _LIT( KSapIni0_V3_Filled_Corrupted, "IMPSSapIni0.f3.c1" );
       
    55 _LIT( KSapIni0_V3_Filled_Corrupted_Slightly, "IMPSSapIni0.f3.c2" );
       
    56 
       
    57 _LIT( KSapDb0_V3_Empty, "IMPSSapDb0.e3" );
       
    58 _LIT( KSapIni0_V3_Empty, "IMPSSapIni0.e3" );
       
    59 
       
    60 */
       
    61 
       
    62 //  CLASS DEFINITION
       
    63 
       
    64 /*
       
    65 -----------------------------------------------------------------------------
       
    66 
       
    67     DESCRIPTION
       
    68 
       
    69     TestUtils for SAP settings store module tests.
       
    70 
       
    71 -----------------------------------------------------------------------------
       
    72 */
       
    73 class IMPSSAPSettingsStoreTestUtils
       
    74     {
       
    75     public: // New methods
       
    76 
       
    77         //store access & deletion
       
    78         //static void DeleteStoresL( TUint aStoreId = KIMPSDefaultSAPSettings );
       
    79         //static void DeleteNormalStoreL( TUint aStoreId = KIMPSDefaultSAPSettings );
       
    80         //static void DeleteDefaultStoresL( TUint aStoreId = KIMPSDefaultSAPSettings );
       
    81 
       
    82         //static void UseDbL( TUint aStoreId, const TDesC* aSapDbToUse, const TDesC* aIniFileToUse = NULL );
       
    83         //static void UseDefaultDbL( TUint aStoreId, const TDesC& aSapDbToUse, const TDesC* aIniFileToUse = NULL );
       
    84 
       
    85         //static void PrintStoreSizesL( TUint aStoreId = KIMPSDefaultSAPSettings );
       
    86 
       
    87 
       
    88         //SAP managing
       
    89         static void UnigueSAPNameL( TUint& aNameIndex,
       
    90                                     CIMPSSAPSettings& aSAP );
       
    91 
       
    92         static void AddSAPSettingsL( CIMPSSAPSettingsStore& aStoreToAdd,
       
    93                                      TInt aHowMany,
       
    94                                      TIMPSAccessGroup aGroup );
       
    95 
       
    96         static void AddSAPSettingsL( CIMPSSAPSettingsStore& aStoreToAdd,
       
    97                                      TInt aHowMany,
       
    98                                      TUint32& aFirstUid,
       
    99                                      TUint32& aLastUid,
       
   100                                      TIMPSAccessGroup aGroup );
       
   101 
       
   102 
       
   103         static TInt AddSAPSettingsWithLiteralNamesL( CIMPSSAPSettingsStore& aStoreToAdd,
       
   104                                                      TUint32& aFirstUid,
       
   105                                                      TUint32& aLastUid,
       
   106                                                      TIMPSAccessGroup aGroup );
       
   107 
       
   108 
       
   109         static TInt DeleteAllSAPSettingsL( CIMPSSAPSettingsStore& aStoreToClear );
       
   110 
       
   111 
       
   112         //container fills
       
   113         static void RandomFillKey( TDes& aBuffer, TInt64& aSeed );
       
   114         static void FillContainerL( CIMPSSAPSettings& aSettings,
       
   115                                     const TDesC& aName );
       
   116         static void FillContainerPartiallyL( CIMPSSAPSettings& aSettings,
       
   117                                              const TDesC& aName );
       
   118         static void FillContainerLongDataL( CIMPSSAPSettings& aSettings );
       
   119         static void FillContainerEvenLongerDataL( CIMPSSAPSettings& aSettings );
       
   120 
       
   121 
       
   122         //container checks
       
   123         static TBool Equals( CIMPSSAPSettings& aFirst,
       
   124                              CIMPSSAPSettings& aSecond );
       
   125 
       
   126         //static void AppendDbName( TFileName& aFileName, TUint aStoreId, TBool aFullPath = ETrue );
       
   127         //static void AppendIniName( TFileName& aFileName, TUint aStoreId, TBool aFullPath = ETrue );
       
   128 
       
   129     private:        // Helpers
       
   130         //static void CopyFileToNameL( const TDesC& aSourceFile, const TDesC& aDestinationFile );
       
   131         //static void DoDeleteDefaultFilesL( const TDesC& aDefFileSearchName );
       
   132         //static void DoDeleteNormalFileL( const TDesC& aFile );
       
   133 
       
   134 
       
   135     private:        // Constructors and destructors
       
   136 
       
   137         IMPSSAPSettingsStoreTestUtils();
       
   138         ~IMPSSAPSettingsStoreTestUtils();
       
   139 
       
   140 
       
   141 
       
   142     };
       
   143 
       
   144 #endif      //  __IMPSSAPSettingsStoreTestUtils_H__
       
   145 
       
   146 // end of file
       
   147