classicui_plat/common_file_dialogs_filter_factory_api/tsrc/src/testdomcfdfilterfactoryblocks.cpp
changeset 33 b3425bf29f82
parent 21 558113899881
child 34 6b5204869ed5
equal deleted inserted replaced
21:558113899881 33:b3425bf29f82
     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:  for testing the cfd filer factory module
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 // [INCLUDE FILES]
       
    21 #include <e32svr.h>
       
    22 #include <stifparser.h>
       
    23 #include <stiftestinterface.h>
       
    24 #include <aknfilefilterfactory.h>
       
    25 #include <testdomcfdfilterfactory.rsg>
       
    26 #include <coemain.h>
       
    27 #include <barsread.h>
       
    28 
       
    29 #include "testdomcfdfilterfactory.h"
       
    30 
       
    31 
       
    32 // ============================ MEMBER FUNCTIONS ===============================
       
    33 
       
    34 // -----------------------------------------------------------------------------
       
    35 // Ctestdomcfdfilterfactory::RunMethodL
       
    36 // Run specified method. Contains also table of test mothods and their names.
       
    37 // -----------------------------------------------------------------------------
       
    38 //
       
    39 TInt CTestDOMCFDFilterFactory::RunMethodL( CStifItemParser& aItem ) 
       
    40     {
       
    41 
       
    42     static TStifFunctionInfo const KFunctions[] =
       
    43         {  
       
    44         // First string is the function name used in TestScripter script file.
       
    45         // Second is the actual implementation member function. 
       
    46             ENTRY( "TestFFFCreateAttributeFilterLC", 
       
    47                 CTestDOMCFDFilterFactory::TestFFFCreateAttributeFilterLC ),
       
    48             ENTRY( "TestFFFCreateFilenameFilterLC", 
       
    49                 CTestDOMCFDFilterFactory::TestFFFCreateFilenameFilterLC ),
       
    50 
       
    51         // [test cases entries]
       
    52 
       
    53         };
       
    54 
       
    55     const TInt count = sizeof( KFunctions ) / sizeof( TStifFunctionInfo );
       
    56 
       
    57     return RunInternalL( KFunctions, count, aItem );
       
    58 
       
    59     }
       
    60 
       
    61 // -----------------------------------------------------------------------------
       
    62 // CTestDOMCFDFilterFactory::TestFFFCreateAttributeFilterLC
       
    63 // -----------------------------------------------------------------------------
       
    64 //
       
    65 TInt CTestDOMCFDFilterFactory::TestFFFCreateAttributeFilterLC( CStifItemParser& /*aItem*/ )
       
    66     {
       
    67 
       
    68     // Print to UI
       
    69     _LIT( Ktestdomcfdfilterfactory, "testdomcfdfilterfactory" );
       
    70     _LIT( KTestFFFCreateAttributeFilterLC, "In TestFFFCreateAttributeFilterLC" );
       
    71     TestModuleIf().Printf( 0, Ktestdomcfdfilterfactory, KTestFFFCreateAttributeFilterLC );
       
    72     // Print to log file
       
    73     iLog->Log( KTestFFFCreateAttributeFilterLC );
       
    74 
       
    75     MAknFileFilter* fileFilter;
       
    76     TResourceReader reader;
       
    77     CCoeEnv::Static()->CreateResourceReaderLC( reader, R_TEST_ATTRIBUTE_FILTER_FACTORY );
       
    78         
       
    79     fileFilter = AknFileFilterFactory::CreateFilterLC( reader );
       
    80     STIF_ASSERT_NOT_NULL( fileFilter );
       
    81     CleanupStack::Pop();
       
    82     CleanupStack::PopAndDestroy();
       
    83     
       
    84     return KErrNone;
       
    85     }
       
    86 
       
    87 // -----------------------------------------------------------------------------
       
    88 // CTestDOMCFDFilterFactory::TestFFFCreateFilenameFilterLC
       
    89 // -----------------------------------------------------------------------------
       
    90 //
       
    91 TInt CTestDOMCFDFilterFactory::TestFFFCreateFilenameFilterLC( CStifItemParser& /*aItem*/ )
       
    92     {
       
    93 
       
    94     // Print to UI
       
    95     _LIT( Ktestdomcfdfilterfactory, "testdomcfdfilterfactory" );
       
    96     _LIT( KTestFFFCreateFilenameFilterLC, "In TestFFFCreateFilenameFilterLC" );
       
    97     TestModuleIf().Printf( 0, Ktestdomcfdfilterfactory, KTestFFFCreateFilenameFilterLC );
       
    98     // Print to log file
       
    99     iLog->Log( KTestFFFCreateFilenameFilterLC );
       
   100 
       
   101     MAknFileFilter* fileFilter;
       
   102     TResourceReader reader;
       
   103     CCoeEnv::Static()->CreateResourceReaderLC( reader, R_TEST_FILENAME_FILTER_FACTORY );
       
   104         
       
   105     fileFilter = AknFileFilterFactory::CreateFilterLC( reader );
       
   106     STIF_ASSERT_NOT_NULL( fileFilter );
       
   107     CleanupStack::Pop();
       
   108     CleanupStack::PopAndDestroy();
       
   109     
       
   110     return KErrNone;
       
   111     }
       
   112 
       
   113 //  [End of File]
       
   114