uiservicetab/vimpststorage/tsrc/vimpststorage_ut/cvimpststoragecontactsorter_ut/inc/CVIMPSTStorageContactSorter_UT.h
changeset 0 5e5d6b214f4f
equal deleted inserted replaced
-1:000000000000 0:5e5d6b214f4f
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  
       
    15 :                
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 #ifndef CVIMPSTSTORAGECONTACTSORTER_UT_H
       
    22 #define CVIMPSTSTORAGECONTACTSORTER_UT_H
       
    23 
       
    24 //  INCLUDES
       
    25 #include <StifLogger.h>
       
    26 #include <TestScripterInternal.h>
       
    27 #include <StifTestModule.h>
       
    28 #include <TestclassAssert.h>
       
    29 #include <flogger.h>
       
    30 #include "vimpststorageutils.h"
       
    31 #include "cvimpststoragecontactsorter.h"
       
    32 
       
    33 // CONSTANTS
       
    34 //const ?type ?constant_var = ?constant;
       
    35 
       
    36 // MACROS
       
    37 //#define ?macro ?macro_def
       
    38 #define TEST_CLASS_VERSION_MAJOR 0
       
    39 #define TEST_CLASS_VERSION_MINOR 0
       
    40 #define TEST_CLASS_VERSION_BUILD 0
       
    41 
       
    42 // Logging path
       
    43 _LIT( KCVIMPSTStorageContactSorter_UTLogPath, "//logs//testframework//CVIMPSTStorageContactSorter_UT//" ); 
       
    44 // Log file
       
    45 _LIT( KCVIMPSTStorageContactSorter_UTLogFile, "CVIMPSTStorageContactSorter_UT.txt" ); 
       
    46 _LIT( KCVIMPSTStorageContactSorter_UTLogFileWithTitle, "CVIMPSTStorageContactSorter_UT_[%S].txt" );
       
    47 
       
    48 // FUNCTION PROTOTYPES
       
    49 //?type ?function_name(?arg_list);
       
    50 
       
    51 // FORWARD DECLARATIONS
       
    52 //class ?FORWARD_CLASSNAME;
       
    53 class CCVIMPSTStorageContactSorter_UT;
       
    54 
       
    55 // DATA TYPES
       
    56 //enum ?declaration
       
    57 //typedef ?declaration
       
    58 //extern ?data_type;
       
    59 
       
    60 // CLASS DECLARATION
       
    61 
       
    62 /**
       
    63 *  CCVIMPSTStorageContactSorter_UT test class for STIF Test Framework TestScripter.
       
    64 *  ?other_description_lines
       
    65 *
       
    66 *  @lib ?library
       
    67 *  @since ?Series60_version
       
    68 */
       
    69 NONSHARABLE_CLASS(CCVIMPSTStorageContactSorter_UT) : public CScriptBase
       
    70     {
       
    71     public:  // Constructors and destructor
       
    72 
       
    73         /**
       
    74         * Two-phased constructor.
       
    75         */
       
    76         static CCVIMPSTStorageContactSorter_UT* NewL( CTestModuleIf& aTestModuleIf );
       
    77 
       
    78         /**
       
    79         * Destructor.
       
    80         */
       
    81         virtual ~CCVIMPSTStorageContactSorter_UT();
       
    82 
       
    83     public: // New functions
       
    84 
       
    85         /**
       
    86         * ?member_description.
       
    87         * @since ?Series60_version
       
    88         * @param ?arg1 ?description
       
    89         * @return ?description
       
    90         */
       
    91         //?type ?member_function( ?type ?arg1 );
       
    92         
       
    93         /*
       
    94          * Test Function: Test construction of sorter object.
       
    95          */
       
    96         TInt Test_NewL( CStifItemParser& aItem );
       
    97         
       
    98         /*
       
    99          * Test Function: Tests sorting functionality. 
       
   100          */
       
   101         TInt Test_SortL( CStifItemParser& aItem );
       
   102         
       
   103         /*
       
   104          * Test Function: Tests Comparing functionality.
       
   105          */
       
   106         TInt Test_CompareL( CStifItemParser& aItem );
       
   107         
       
   108         /*
       
   109          *  Test Function: Tests setting algorithm.
       
   110          */
       
   111         TInt SetSortAlgorithm( CStifItemParser& aItem );
       
   112         
       
   113 
       
   114     public: // Functions from base classes
       
   115 
       
   116         /**
       
   117         * From CScriptBase Runs a script line.
       
   118         * @since ?Series60_version
       
   119         * @param aItem Script line containing method name and parameters
       
   120         * @return Symbian OS error code
       
   121         */
       
   122         virtual TInt RunMethodL( CStifItemParser& aItem );
       
   123 
       
   124     protected:  // New functions
       
   125 
       
   126         /**
       
   127         * ?member_description.
       
   128         * @since ?Series60_version
       
   129         * @param ?arg1 ?description
       
   130         * @return ?description
       
   131         */
       
   132         //?type ?member_function( ?type ?arg1 );
       
   133 
       
   134     protected:  // Functions from base classes
       
   135 
       
   136         /**
       
   137         * From ?base_class ?member_description
       
   138         */
       
   139         //?type ?member_function();
       
   140 
       
   141     private:
       
   142 
       
   143         /**
       
   144         * C++ default constructor.
       
   145         */
       
   146         CCVIMPSTStorageContactSorter_UT( CTestModuleIf& aTestModuleIf );
       
   147 
       
   148         /**
       
   149         * By default Symbian 2nd phase constructor is private.
       
   150         */
       
   151         void ConstructL();
       
   152 
       
   153         /**
       
   154         * Frees all resources allocated from test methods.
       
   155         * @since ?Series60_version
       
   156         */
       
   157         void Delete();
       
   158 
       
   159         /**
       
   160         * Test methods are listed below. 
       
   161         */
       
   162 
       
   163        /**
       
   164          * Method used to log version of test class
       
   165          */
       
   166         void SendTestClassVersion();
       
   167         
       
   168         /*
       
   169          * Helper Function: Creates an array of contacts.
       
   170          */
       
   171         void CreateContactArray();
       
   172         
       
   173         /*
       
   174          * Helper Function: Creates an array of contacts.
       
   175          * In alphabetical order.
       
   176          * The array created by this function is used to
       
   177          * cross check the array given as a result by sort function.
       
   178          */
       
   179         void CreateAlphabeticalSortArray();
       
   180         
       
   181         /*
       
   182          * Helper Function: Creates an array of contacts.
       
   183          * In order of presence.
       
   184          * The array created by this function is used to cross 
       
   185          * check the array given as a result by sort function.
       
   186          */
       
   187         void CreatePresenceSortArray();
       
   188 
       
   189         /*
       
   190          * Helper Function: Compares two arrays.
       
   191          * It compares the userids of the corresponding elements
       
   192          * of the arrays and returns 
       
   193          * : zero, if arrays are equal.
       
   194          * : index of difference, if difference is found.
       
   195          */
       
   196         TInt CompareArray(RPointerArray< MVIMPSTStorageContact > & aFirstArray, RPointerArray< MVIMPSTStorageContact >& aSecondArray );
       
   197         
       
   198         /*
       
   199          * Helper Function: Resets the arrays after use.
       
   200          */
       
   201         void ResetArray( RPointerArray< MVIMPSTStorageContact > & aArray );
       
   202 
       
   203         //ADD NEW METHOD DEC HERE
       
   204         //[TestMethods] - Do not remove
       
   205 
       
   206     public:     // Data
       
   207         // ?one_line_short_description_of_data
       
   208         //?data_declaration;
       
   209 
       
   210     protected:  // Data
       
   211         // ?one_line_short_description_of_data
       
   212         //?data_declaration;
       
   213 
       
   214     private:    // Data
       
   215         
       
   216         RPointerArray< MVIMPSTStorageContact > iContactArray;
       
   217         
       
   218         RPointerArray< MVIMPSTStorageContact > iAlphabeticalSortArray;
       
   219         
       
   220         RPointerArray< MVIMPSTStorageContact > iPresenceSortArray;
       
   221         
       
   222     public:     // Friend classes
       
   223         //?friend_class_declaration;
       
   224     protected:  // Friend classes
       
   225         //?friend_class_declaration;
       
   226     private:    // Friend classes
       
   227         //?friend_class_declaration;
       
   228 
       
   229     };
       
   230 
       
   231 #endif      // CVIMPSTSTORAGECONTACTSORTER_UT_H
       
   232 
       
   233 // End of File