emailservices/emailstore/tsrc/message_store_test/src/t_msgstoreCases.cpp
changeset 1 12c456ceeff2
equal deleted inserted replaced
0:8466d47a6819 1:12c456ceeff2
       
     1 /*
       
     2 * Copyright (c) 2002 - 2007 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:  implementation of test cases methods.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 // [INCLUDE FILES] - do not remove
       
    21 #include <e32math.h>
       
    22 #include "t_msgstore.h"
       
    23 #include "mailboxtests.h"
       
    24 #include "propertytests.h"
       
    25 #include "foldertests.h"
       
    26 #include "messagetests.h"
       
    27 #include "parttests.h"
       
    28 #include "observertests.h"
       
    29 #include "contenttests.h"
       
    30 #include "mrutests.h"
       
    31 #include "searchtests.h"
       
    32 #include "sorttests.h"
       
    33 #include "sizetests.h"
       
    34 #include "DbCorruptTests.h"
       
    35 #include "shutdownservertest.h"
       
    36 #include "EncryptionTests.h"
       
    37 
       
    38 // EXTERNAL DATA STRUCTURES
       
    39 //extern  ?external_data;
       
    40 
       
    41 // EXTERNAL FUNCTION PROTOTYPES  
       
    42 //extern ?external_function( ?arg_type,?arg_type );
       
    43 
       
    44 // CONSTANTS
       
    45 //const ?type ?constant_var = ?constant;
       
    46 
       
    47 // MACROS
       
    48 //#define ?macro ?macro_def
       
    49 
       
    50 // LOCAL CONSTANTS AND MACROS
       
    51 //const ?type ?constant_var = ?constant;
       
    52 //#define ?macro_name ?macro_def
       
    53 
       
    54 // MODULE DATA STRUCTURES
       
    55 //enum ?declaration
       
    56 //typedef ?declaration
       
    57 
       
    58 // LOCAL FUNCTION PROTOTYPES
       
    59 //?type ?function_name( ?arg_type, ?arg_type );
       
    60 
       
    61 // FORWARD DECLARATIONS
       
    62 //class ?FORWARD_CLASSNAME;
       
    63 
       
    64 // ============================= LOCAL FUNCTIONS ===============================
       
    65 
       
    66 // -----------------------------------------------------------------------------
       
    67 // ?function_name ?description.
       
    68 // ?description
       
    69 // Returns: ?value_1: ?description
       
    70 //          ?value_n: ?description_line1
       
    71 //                    ?description_line2
       
    72 // -----------------------------------------------------------------------------
       
    73 //
       
    74 /*
       
    75 ?type ?function_name(
       
    76     ?arg_type arg,  // ?description
       
    77     ?arg_type arg)  // ?description
       
    78     {
       
    79 
       
    80     ?code  // ?comment
       
    81 
       
    82     // ?comment
       
    83     ?code
       
    84     }
       
    85 */
       
    86 
       
    87 // ============================ MEMBER FUNCTIONS ===============================
       
    88 
       
    89 // -----------------------------------------------------------------------------
       
    90 // Ct_msgstore::Case
       
    91 // Returns a test case by number.
       
    92 //
       
    93 // This function contains an array of all available test cases 
       
    94 // i.e pair of case name and test function. If case specified by parameter
       
    95 // aCaseNumber is found from array, then that item is returned.
       
    96 // 
       
    97 // The reason for this rather complicated function is to specify all the
       
    98 // test cases only in one place. It is not necessary to understand how
       
    99 // function pointers to class member functions works when adding new test
       
   100 // cases. See function body for instructions how to add new test case.
       
   101 // -----------------------------------------------------------------------------
       
   102 //
       
   103 const TCaseInfo Ct_msgstore::Case ( 
       
   104     const TInt aCaseNumber ) const 
       
   105      {
       
   106 
       
   107     /**
       
   108     * To add new test cases, implement new test case function and add new 
       
   109     * line to KCases array specify the name of the case and the function 
       
   110     * doing the test case
       
   111     * In practice, do following
       
   112     * 1) Make copy of existing test case function and change its name
       
   113     *    and functionality. Note that the function must be added to 
       
   114     *    t_msgstore.cpp file and to t_msgstore.h 
       
   115     *    header file.
       
   116     *
       
   117     * 2) Add entry to following KCases array either by using:
       
   118     *
       
   119     * 2.1: FUNCENTRY or ENTRY macro
       
   120     * ENTRY macro takes two parameters: test case name and test case 
       
   121     * function name.
       
   122     *
       
   123     * FUNCENTRY macro takes only test case function name as a parameter and
       
   124     * uses that as a test case name and test case function name.
       
   125     *
       
   126     * Or
       
   127     *
       
   128     * 2.2: OOM_FUNCENTRY or OOM_ENTRY macro. Note that these macros are used
       
   129     * only with OOM (Out-Of-Memory) testing!
       
   130     *
       
   131     * OOM_ENTRY macro takes five parameters: test case name, test case 
       
   132     * function name, TBool which specifies is method supposed to be run using
       
   133     * OOM conditions, TInt value for first heap memory allocation failure and 
       
   134     * TInt value for last heap memory allocation failure.
       
   135     * 
       
   136     * OOM_FUNCENTRY macro takes test case function name as a parameter and uses
       
   137     * that as a test case name, TBool which specifies is method supposed to be
       
   138     * run using OOM conditions, TInt value for first heap memory allocation 
       
   139     * failure and TInt value for last heap memory allocation failure. 
       
   140     */ 
       
   141 
       
   142     static TCaseInfoInternal const KCases[] =
       
   143         {
       
   144         // [test cases entries] - do not remove
       
   145         
       
   146         // NOTE: When compiled to GCCE, there must be Classname::
       
   147         // declaration in front of the method name, e.g. 
       
   148         // Ct_msgstore::PrintTest. Otherwise the compiler
       
   149         // gives errors.
       
   150         ENTRY( "Mailbox Tests",     Ct_msgstore::MailboxTestsL ),
       
   151         ENTRY( "Property Tests",    Ct_msgstore::PropertyTestsL ),
       
   152         ENTRY( "Folder Tests",      Ct_msgstore::FolderTestsL ),
       
   153         ENTRY( "Message Tests",     Ct_msgstore::MessageTestsL ),
       
   154         ENTRY( "Database Corruption Test", Ct_msgstore::DbCorruptTestsL ),
       
   155         ENTRY( "Part Tests",        Ct_msgstore::PartTestsL ),
       
   156         ENTRY( "Observer Tests",    Ct_msgstore::ObserverTestsL ),
       
   157         ENTRY( "Content Tests",     Ct_msgstore::ContentTestsL ),
       
   158         ENTRY( "Mru Tests",         Ct_msgstore::MruTestsL ),
       
   159         ENTRY( "Search Tests",      Ct_msgstore::SearchTestsL ),
       
   160         ENTRY( "Sort Tests",        Ct_msgstore::SortTestsL ),
       
   161         ENTRY( "Encryption Tests",  Ct_msgstore::EncryptionTestsL ),
       
   162         ENTRY( "Size Tests",        Ct_msgstore::SizeTestsL ),
       
   163         // Example how to use OOM functionality
       
   164         //OOM_ENTRY( "Loop test with OOM", Ct_msgstore::LoopTest, ETrue, 2, 3),
       
   165         //OOM_FUNCENTRY( Ct_msgstore::PrintTest, ETrue, 1, 3 ),
       
   166         };
       
   167 
       
   168     // Verify that case number is valid
       
   169     if( (TUint) aCaseNumber >= sizeof( KCases ) / 
       
   170                                sizeof( TCaseInfoInternal ) )
       
   171         {
       
   172         // Invalid case, construct empty object
       
   173         TCaseInfo null( (const TText*) L"" );
       
   174         null.iMethod = NULL;
       
   175         null.iIsOOMTest = EFalse;
       
   176         null.iFirstMemoryAllocation = 0;
       
   177         null.iLastMemoryAllocation = 0;
       
   178         return null;
       
   179         } 
       
   180 
       
   181     // Construct TCaseInfo object and return it
       
   182     TCaseInfo tmp ( KCases[ aCaseNumber ].iCaseName );
       
   183     tmp.iMethod = KCases[ aCaseNumber ].iMethod;
       
   184     tmp.iIsOOMTest = KCases[ aCaseNumber ].iIsOOMTest;
       
   185     tmp.iFirstMemoryAllocation = KCases[ aCaseNumber ].iFirstMemoryAllocation;
       
   186     tmp.iLastMemoryAllocation = KCases[ aCaseNumber ].iLastMemoryAllocation;
       
   187     return tmp;
       
   188 
       
   189     }
       
   190 
       
   191 // -----------------------------------------------------------------------------
       
   192 // Ct_msgstore::MailboxTests
       
   193 // Test Mailbox operations.
       
   194 // -----------------------------------------------------------------------------
       
   195 //
       
   196 TInt Ct_msgstore::MailboxTestsL( TTestResult& aResult )
       
   197     {
       
   198     _LIT( KMailboxTests, "Mailbox Tests" );
       
   199     _LIT( KEnter, "Enter" );
       
   200     _LIT( KExit, "Exit" );
       
   201 
       
   202     TestModuleIf().Printf( 0, KMailboxTests, KEnter );
       
   203            
       
   204     // Run test cases
       
   205     CMailboxTests* testCase = CMailboxTests::NewL( iLog );
       
   206     CActiveScheduler::Start();
       
   207     
       
   208     TInt result = testCase->Result();    
       
   209     
       
   210     delete testCase;
       
   211     
       
   212     TestModuleIf().Printf( 0, KMailboxTests, KExit );
       
   213     
       
   214     // Sets test case result and description(Maximum size is KStifMaxResultDes)
       
   215     _LIT( KPassDescription, "Mailbox tests passed" );
       
   216     _LIT( KFailDescription, "Mailbox tests failed" );
       
   217     aResult.SetResult( result, (result==KErrNone ? KPassDescription : KFailDescription) );
       
   218 
       
   219     // Case was executed
       
   220     return KErrNone;
       
   221     }
       
   222 
       
   223 // -----------------------------------------------------------------------------
       
   224 // Ct_msgstore::PropertyTests
       
   225 // Test Property related features.
       
   226 // -----------------------------------------------------------------------------
       
   227 //
       
   228 TInt Ct_msgstore::PropertyTestsL( TTestResult& aResult )
       
   229     {
       
   230     _LIT( KPropertyTests, "Property Tests" );
       
   231     _LIT( KEnter, "Enter" );
       
   232     _LIT( KExit, "Exit" );
       
   233 
       
   234     TestModuleIf().Printf( 0, KPropertyTests, KEnter );
       
   235            
       
   236     // Run test cases
       
   237     CPropertyTests* testCase = CPropertyTests::NewL( iLog );
       
   238     CActiveScheduler::Start();
       
   239     
       
   240     TInt result = testCase->Result();    
       
   241     
       
   242     delete testCase;
       
   243     
       
   244     TestModuleIf().Printf( 0, KPropertyTests, KExit );
       
   245     
       
   246     // Sets test case result and description(Maximum size is KStifMaxResultDes)
       
   247     _LIT( KPassDescription, "Property tests passed" );
       
   248     _LIT( KFailDescription, "Property tests failed" );
       
   249     aResult.SetResult( result, (result==KErrNone ? KPassDescription : KFailDescription) );
       
   250 
       
   251     // Case was executed
       
   252     return KErrNone;
       
   253     }
       
   254 
       
   255 // -----------------------------------------------------------------------------
       
   256 // Ct_msgstore::FolderTests
       
   257 // Test Folder related features.
       
   258 // -----------------------------------------------------------------------------
       
   259 //
       
   260 TInt Ct_msgstore::FolderTestsL( TTestResult& aResult )
       
   261     {
       
   262     _LIT( KFolderTests, "Folder Tests" );
       
   263     _LIT( KEnter, "Enter" );
       
   264     _LIT( KExit, "Exit" );
       
   265 
       
   266     TestModuleIf().Printf( 0, KFolderTests, KEnter );
       
   267            
       
   268     // Run test cases
       
   269     CFolderTests* testCase = CFolderTests::NewL( iLog );
       
   270     CActiveScheduler::Start();
       
   271     
       
   272     TInt result = testCase->Result();    
       
   273     
       
   274     delete testCase;
       
   275     
       
   276     TestModuleIf().Printf( 0, KFolderTests, KExit );
       
   277     
       
   278     // Sets test case result and description(Maximum size is KStifMaxResultDes)
       
   279     _LIT( KPassDescription, "Folder tests passed" );
       
   280     _LIT( KFailDescription, "Folder tests failed" );
       
   281     aResult.SetResult( result, (result==KErrNone ? KPassDescription : KFailDescription) );
       
   282 
       
   283     // Case was executed
       
   284     return KErrNone;
       
   285     }
       
   286 
       
   287 // -----------------------------------------------------------------------------
       
   288 // Ct_msgstore::MessageTests
       
   289 // Test Folder related features.
       
   290 // -----------------------------------------------------------------------------
       
   291 //
       
   292 TInt Ct_msgstore::MessageTestsL( TTestResult& aResult )
       
   293     {
       
   294     _LIT( KMessageTests, "Message Tests" );
       
   295     _LIT( KEnter, "Enter" );
       
   296     _LIT( KExit, "Exit" );
       
   297 
       
   298     TestModuleIf().Printf( 0, KMessageTests, KEnter );
       
   299            
       
   300     // Run test cases
       
   301     CMessageTests* testCase = CMessageTests::NewL( iLog );
       
   302     CActiveScheduler::Start();
       
   303     
       
   304     TInt result = testCase->Result();    
       
   305     
       
   306     delete testCase;
       
   307     
       
   308     TestModuleIf().Printf( 0, KMessageTests, KExit );
       
   309     
       
   310     // Sets test case result and description(Maximum size is KStifMaxResultDes)
       
   311     _LIT( KPassDescription, "Message tests passed" );
       
   312     _LIT( KFailDescription, "Message tests failed" );
       
   313     aResult.SetResult( result, (result==KErrNone ? KPassDescription : KFailDescription) );
       
   314 
       
   315     // Case was executed
       
   316     return KErrNone;
       
   317     }
       
   318 
       
   319 
       
   320 // -----------------------------------------------------------------------------
       
   321 // Ct_msgstore::PartTests
       
   322 // Test Folder related features.
       
   323 // -----------------------------------------------------------------------------
       
   324 //
       
   325 TInt Ct_msgstore::PartTestsL( TTestResult& aResult )
       
   326     {
       
   327     _LIT( KPartTests, "Part Tests" );
       
   328     _LIT( KEnter, "Enter" );
       
   329     _LIT( KExit, "Exit" );
       
   330 
       
   331     TestModuleIf().Printf( 0, KPartTests, KEnter );
       
   332            
       
   333     // Run test cases
       
   334     CPartTests* testCase = CPartTests::NewL( iLog );
       
   335     CActiveScheduler::Start();
       
   336     
       
   337     TInt result = testCase->Result();    
       
   338     
       
   339     delete testCase;
       
   340     
       
   341     TestModuleIf().Printf( 0, KPartTests, KExit );
       
   342     
       
   343     // Sets test case result and description(Maximum size is KStifMaxResultDes)
       
   344     _LIT( KPassDescription, "Part tests passed" );
       
   345     _LIT( KFailDescription, "Part tests failed" );
       
   346     aResult.SetResult( result, (result==KErrNone ? KPassDescription : KFailDescription) );
       
   347 
       
   348     // Case was executed
       
   349     return KErrNone;
       
   350     }
       
   351 
       
   352 // -----------------------------------------------------------------------------
       
   353 // Ct_msgstore::ObserverTests
       
   354 // Test Folder related features.
       
   355 // -----------------------------------------------------------------------------
       
   356 //
       
   357 TInt Ct_msgstore::ObserverTestsL( TTestResult& aResult )
       
   358     {
       
   359     _LIT( KObserverTests, "Observer Tests" );
       
   360     _LIT( KEnter, "Enter" );
       
   361     _LIT( KExit, "Exit" );
       
   362 
       
   363     TestModuleIf().Printf( 0, KObserverTests, KEnter );
       
   364            
       
   365     // Run test cases
       
   366     CObserverTests* testCase = CObserverTests::NewL( iLog );
       
   367     CActiveScheduler::Start();
       
   368     
       
   369     TInt result = testCase->Result();    
       
   370     
       
   371     delete testCase;
       
   372     
       
   373     TestModuleIf().Printf( 0, KObserverTests, KExit );
       
   374     
       
   375     // Sets test case result and description(Maximum size is KStifMaxResultDes)
       
   376     _LIT( KPassDescription, "Observer tests passed" );
       
   377     _LIT( KFailDescription, "Observer tests failed" );
       
   378     aResult.SetResult( result, (result==KErrNone ? KPassDescription : KFailDescription) );
       
   379 
       
   380     // Case was executed
       
   381     return KErrNone;
       
   382     }
       
   383 
       
   384 // -----------------------------------------------------------------------------
       
   385 // Ct_msgstore::ContentTests
       
   386 // Test Folder related features.
       
   387 // -----------------------------------------------------------------------------
       
   388 //
       
   389 TInt Ct_msgstore::ContentTestsL( TTestResult& aResult )
       
   390     {
       
   391     _LIT( KContentTests, "Content Tests" );
       
   392     _LIT( KEnter, "Enter" );
       
   393     _LIT( KExit, "Exit" );
       
   394 
       
   395     TestModuleIf().Printf( 0, KContentTests, KEnter );
       
   396            
       
   397     // Run test cases
       
   398     CContentTests* testCase = CContentTests::NewL( iLog );
       
   399     CActiveScheduler::Start();
       
   400     
       
   401     TInt result = testCase->Result();    
       
   402     
       
   403     delete testCase;
       
   404     
       
   405     TestModuleIf().Printf( 0, KContentTests, KExit );
       
   406     
       
   407     // Sets test case result and description(Maximum size is KStifMaxResultDes)
       
   408     _LIT( KPassDescription, "Content tests passed" );
       
   409     _LIT( KFailDescription, "Content tests failed" );
       
   410     aResult.SetResult( result, (result==KErrNone ? KPassDescription : KFailDescription) );
       
   411 
       
   412     // Case was executed
       
   413     return KErrNone;
       
   414     }
       
   415 
       
   416 
       
   417 // -----------------------------------------------------------------------------
       
   418 // Ct_msgstore::MruTests
       
   419 // Test Folder related features.
       
   420 // -----------------------------------------------------------------------------
       
   421 //
       
   422 TInt Ct_msgstore::MruTestsL( TTestResult& aResult )
       
   423     {
       
   424     _LIT( KMruTests, "Mru Tests" );
       
   425     _LIT( KEnter, "Enter" );
       
   426     _LIT( KExit, "Exit" );
       
   427 
       
   428     TestModuleIf().Printf( 0, KMruTests, KEnter );
       
   429            
       
   430     // Run test cases
       
   431     CMruTests* testCase = CMruTests::NewL( iLog );
       
   432     CActiveScheduler::Start();
       
   433     
       
   434     TInt result = testCase->Result();    
       
   435     
       
   436     delete testCase;
       
   437     
       
   438     TestModuleIf().Printf( 0, KMruTests, KExit );
       
   439     
       
   440     // Sets test case result and description(Maximum size is KStifMaxResultDes)
       
   441     _LIT( KPassDescription, "MRU tests passed" );
       
   442     _LIT( KFailDescription, "MRU tests failed" );
       
   443     aResult.SetResult( result, (result==KErrNone ? KPassDescription : KFailDescription) );
       
   444 
       
   445     // Case was executed
       
   446     return KErrNone;
       
   447     }
       
   448 
       
   449 // -----------------------------------------------------------------------------
       
   450 // Ct_msgstore::SearchTests
       
   451 // Test Folder related features.
       
   452 // -----------------------------------------------------------------------------
       
   453 //
       
   454 TInt Ct_msgstore::SearchTestsL( TTestResult& aResult )
       
   455     {
       
   456     _LIT( KSearchTests, "Search Tests" );
       
   457     _LIT( KEnter, "Enter" );
       
   458     _LIT( KExit, "Exit" );
       
   459 
       
   460     TestModuleIf().Printf( 0, KSearchTests, KEnter );
       
   461            
       
   462     // Run test cases
       
   463     CSearchTests* testCase = CSearchTests::NewL( iLog );
       
   464     CActiveScheduler::Start();
       
   465     
       
   466     TInt result = testCase->Result();    
       
   467     
       
   468     delete testCase;
       
   469     
       
   470     TestModuleIf().Printf( 0, KSearchTests, KExit );
       
   471     
       
   472     // Sets test case result and description(Maximum size is KStifMaxResultDes)
       
   473     _LIT( KPassDescription, "Search tests passed" );
       
   474     _LIT( KFailDescription, "Search tests failed" );
       
   475     aResult.SetResult( result, (result==KErrNone ? KPassDescription : KFailDescription) );
       
   476 
       
   477     // Case was executed
       
   478     return KErrNone;
       
   479     }
       
   480 
       
   481 // -----------------------------------------------------------------------------
       
   482 // Ct_msgstore::SortTests
       
   483 // Test Folder related features.
       
   484 // -----------------------------------------------------------------------------
       
   485 //
       
   486 TInt Ct_msgstore::SortTestsL( TTestResult& aResult )
       
   487     {
       
   488     _LIT( KSortTests, "Sort Tests" );
       
   489     _LIT( KEnter, "Enter" );
       
   490     _LIT( KExit, "Exit" );
       
   491 
       
   492     TestModuleIf().Printf( 0, KSortTests, KEnter );
       
   493            
       
   494     // Run test cases
       
   495     CSortTests* testCase = CSortTests::NewL( iLog );
       
   496     CActiveScheduler::Start();
       
   497     
       
   498     TInt result = testCase->Result();    
       
   499     
       
   500     delete testCase;
       
   501     
       
   502     TestModuleIf().Printf( 0, KSortTests, KExit );
       
   503     
       
   504     // Sets test case result and description(Maximum size is KStifMaxResultDes)
       
   505     _LIT( KPassDescription, "Sort tests passed" );
       
   506     _LIT( KFailDescription, "Sort tests failed" );
       
   507     aResult.SetResult( result, (result==KErrNone ? KPassDescription : KFailDescription) );
       
   508 
       
   509     // Case was executed
       
   510     return KErrNone;
       
   511     }
       
   512 
       
   513 // -----------------------------------------------------------------------------
       
   514 // Ct_msgstore::SizeTests
       
   515 // Test Folder related features.
       
   516 // -----------------------------------------------------------------------------
       
   517 //
       
   518 TInt Ct_msgstore::EncryptionTestsL( TTestResult& aResult )
       
   519     {
       
   520     _LIT( KEncryptionTests, "Encryption Tests" );
       
   521     _LIT( KEnter, "Enter" );
       
   522     _LIT( KExit, "Exit" );
       
   523 
       
   524     TestModuleIf().Printf( 0, KEncryptionTests, KEnter );
       
   525            
       
   526     // Run test cases
       
   527     CEncryptionTests* testCase = CEncryptionTests::NewL( iLog );
       
   528     CActiveScheduler::Start();
       
   529     
       
   530     TInt result = testCase->Result();    
       
   531     
       
   532     delete testCase;
       
   533     
       
   534     TestModuleIf().Printf( 0, KEncryptionTests, KExit );
       
   535     
       
   536     // Sets test case result and description(Maximum size is KStifMaxResultDes)
       
   537     _LIT( KPassDescription, "Encryption tests passed" );
       
   538     _LIT( KFailDescription, "Encryption tests failed" );
       
   539     aResult.SetResult( result, (result==KErrNone ? KPassDescription : KFailDescription) );
       
   540 
       
   541     // Case was executed
       
   542     return KErrNone;
       
   543     }
       
   544 
       
   545 // -----------------------------------------------------------------------------
       
   546 // Ct_msgstore::SizeTests
       
   547 // Test Folder related features.
       
   548 // -----------------------------------------------------------------------------
       
   549 //
       
   550 TInt Ct_msgstore::SizeTestsL( TTestResult& aResult )
       
   551     {
       
   552     _LIT( KSizeTests, "Size Tests" );
       
   553     _LIT( KEnter, "Enter" );
       
   554     _LIT( KExit, "Exit" );
       
   555 
       
   556     TestModuleIf().Printf( 0, KSizeTests, KEnter );
       
   557            
       
   558     // Run test cases
       
   559     CSizeTests* testCase = CSizeTests::NewL( iLog );
       
   560     CActiveScheduler::Start();
       
   561     
       
   562     TInt result = testCase->Result();    
       
   563     
       
   564     delete testCase;
       
   565     
       
   566     TestModuleIf().Printf( 0, KSizeTests, KExit );
       
   567     
       
   568     // Sets test case result and description(Maximum size is KStifMaxResultDes)
       
   569     _LIT( KPassDescription, "Size tests passed" );
       
   570     _LIT( KFailDescription, "Size tests failed" );
       
   571     aResult.SetResult( result, (result==KErrNone ? KPassDescription : KFailDescription) );
       
   572 
       
   573     // Case was executed
       
   574     return KErrNone;
       
   575     }
       
   576 
       
   577 // -----------------------------------------------------------------------------
       
   578 // Ct_msgstore::DbCorruptTests
       
   579 // Test Folder related features.
       
   580 // -----------------------------------------------------------------------------
       
   581 //
       
   582 TInt Ct_msgstore::DbCorruptTestsL( TTestResult& aResult )
       
   583     {
       
   584     _LIT( KDbCorruptTests, "Database Corruption Test" );
       
   585     _LIT( KEnter, "Enter" );
       
   586     _LIT( KExit, "Exit" );
       
   587 
       
   588     TestModuleIf().Printf( 0, KDbCorruptTests, KEnter );
       
   589            
       
   590     // Run test cases
       
   591     CDbCorruptTests* testCase = CDbCorruptTests::NewL( iLog );
       
   592     CActiveScheduler::Start();
       
   593     
       
   594     TInt result = testCase->Result();    
       
   595     
       
   596     delete testCase;
       
   597     
       
   598     TestModuleIf().Printf( 0, KDbCorruptTests, KExit );
       
   599     
       
   600     // Sets test case result and description(Maximum size is KStifMaxResultDes)
       
   601     _LIT( KPassDescription, "Database Corruption Tests test passed" );
       
   602     _LIT( KFailDescription, "Database Corruption Tests test failed" );
       
   603     aResult.SetResult( result, (result==KErrNone ? KPassDescription : KFailDescription) );
       
   604 
       
   605     // Case was executed
       
   606     return KErrNone;
       
   607     }
       
   608 
       
   609 // ========================== OTHER EXPORTED FUNCTIONS =========================
       
   610 
       
   611 // -----------------------------------------------------------------------------
       
   612 // ?function_name implements...
       
   613 // ?implementation_description.
       
   614 // Returns: ?value_1: ?description
       
   615 //          ?value_n: ?description
       
   616 //                    ?description
       
   617 // -----------------------------------------------------------------------------
       
   618 //
       
   619 /*
       
   620 ?type  ?function_name(
       
   621     ?arg_type arg,  // ?description
       
   622     ?arg_type arg )  // ?description
       
   623     {
       
   624 
       
   625     ?code
       
   626 
       
   627     }
       
   628 */
       
   629 //  [End of File] - do not remove