uiaccelerator_plat/alf_core_toolkit_api/tsrc/src/testuiaifctkitblockshuimf.cpp
branchRCL_3
changeset 19 e5af45d51884
parent 18 1801340c26a2
child 20 31fccae4f8a7
equal deleted inserted replaced
18:1801340c26a2 19:e5af45d51884
     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:  test api of alf_core_toolkit
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 // [INCLUDE FILES]
       
    21 #include <e32svr.h>
       
    22 #include <stifparser.h>
       
    23 #include <stiftestinterface.h>
       
    24 #include <uiacceltk/HuiMappingFunctions.h>
       
    25 
       
    26 #include "testuiaifcoretoolkit.h"
       
    27 
       
    28 // --------------------------THuiConstantMappingFunction------------------------
       
    29 // -----------------------------------------------------------------------------
       
    30 // CTestUiAifCoreToolkit::TestTHCMFConstructorL
       
    31 // -----------------------------------------------------------------------------
       
    32 //
       
    33 TInt CTestUiAifCoreToolkit::TestTHCMFConstructorL( CStifItemParser& /*aItem*/ )
       
    34     {
       
    35 
       
    36     // Print to UI
       
    37     _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" );
       
    38     _LIT( KHuiMappingFunctions, "In TestTHCMFConstructorL" );
       
    39     TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KHuiMappingFunctions );
       
    40     // Print to log file
       
    41     iLog->Log( KHuiMappingFunctions );
       
    42 
       
    43     THuiConstantMappingFunction* function = new( ELeave ) THuiConstantMappingFunction();
       
    44     CleanupStack::PushL( function );
       
    45     STIF_ASSERT_NOT_NULL( function );
       
    46     CleanupStack::Pop( function );
       
    47     delete function;
       
    48     function = NULL;
       
    49 
       
    50     return KErrNone;
       
    51     }
       
    52 
       
    53 // -----------------------------------------------------------------------------
       
    54 // CTestUiAifCoreToolkit::TestTHCMFMapValueL
       
    55 // -----------------------------------------------------------------------------
       
    56 //
       
    57 TInt CTestUiAifCoreToolkit::TestTHCMFMapValueL( CStifItemParser& /*aItem*/ )
       
    58     {
       
    59 
       
    60     // Print to UI
       
    61     _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" );
       
    62     _LIT( KHuiMappingFunctions, "In TestTHCMFMapValueL" );
       
    63     TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KHuiMappingFunctions );
       
    64     // Print to log file
       
    65     iLog->Log( KHuiMappingFunctions );
       
    66 
       
    67     THuiConstantMappingFunction* function = new( ELeave ) THuiConstantMappingFunction();
       
    68     CleanupStack::PushL( function );
       
    69     STIF_ASSERT_NOT_NULL( function );
       
    70     function->MapValue( 0 ,0 );
       
    71     CleanupStack::Pop( function );
       
    72     delete function;
       
    73     function = NULL;
       
    74 
       
    75     return KErrNone;
       
    76     }
       
    77 
       
    78 // ---------------------------THuiLinearMappingFunction-------------------------
       
    79 // -----------------------------------------------------------------------------
       
    80 // CTestUiAifCoreToolkit::TestTHLMFConstructorL
       
    81 // -----------------------------------------------------------------------------
       
    82 //
       
    83 TInt CTestUiAifCoreToolkit::TestTHLMFConstructorL( CStifItemParser& /*aItem*/ )
       
    84     {
       
    85 
       
    86     // Print to UI
       
    87     _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" );
       
    88     _LIT( KHuiMappingFunctions, "In TestTHLMFConstructorL" );
       
    89     TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KHuiMappingFunctions );
       
    90     // Print to log file
       
    91     iLog->Log( KHuiMappingFunctions );
       
    92 
       
    93     THuiLinearMappingFunction* function = new( ELeave ) THuiLinearMappingFunction();
       
    94     CleanupStack::PushL( function );
       
    95     STIF_ASSERT_NOT_NULL( function );
       
    96     CleanupStack::Pop( function );
       
    97     delete function;
       
    98     function = NULL;
       
    99 
       
   100     return KErrNone;
       
   101     }
       
   102 
       
   103 // -----------------------------------------------------------------------------
       
   104 // CTestUiAifCoreToolkit::TestTHLMFMapValueL
       
   105 // -----------------------------------------------------------------------------
       
   106 //
       
   107 TInt CTestUiAifCoreToolkit::TestTHLMFMapValueL( CStifItemParser& /*aItem*/ )
       
   108     {
       
   109 
       
   110     // Print to UI
       
   111     _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" );
       
   112     _LIT( KHuiMappingFunctions, "In TestTHLMFMapValueL" );
       
   113     TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KHuiMappingFunctions );
       
   114     // Print to log file
       
   115     iLog->Log( KHuiMappingFunctions );
       
   116 
       
   117     THuiLinearMappingFunction* function = new( ELeave ) THuiLinearMappingFunction();
       
   118     CleanupStack::PushL( function );
       
   119     STIF_ASSERT_NOT_NULL( function );
       
   120     function->MapValue( 0 ,0 );
       
   121     CleanupStack::Pop( function );
       
   122     delete function;
       
   123     function = NULL;
       
   124 
       
   125     return KErrNone;
       
   126     }
       
   127 
       
   128 // ----------------------------THuiSineMappingFunction--------------------------
       
   129 // -----------------------------------------------------------------------------
       
   130 // CTestUiAifCoreToolkit::TestTHSMFConstructorL
       
   131 // -----------------------------------------------------------------------------
       
   132 //
       
   133 TInt CTestUiAifCoreToolkit::TestTHSMFConstructorL( CStifItemParser& /*aItem*/ )
       
   134     {
       
   135 
       
   136     // Print to UI
       
   137     _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" );
       
   138     _LIT( KHuiMappingFunctions, "In TestTHSMFConstructorL" );
       
   139     TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KHuiMappingFunctions );
       
   140     // Print to log file
       
   141     iLog->Log( KHuiMappingFunctions );
       
   142 
       
   143     THuiSineMappingFunction* function = new( ELeave ) THuiSineMappingFunction();
       
   144     CleanupStack::PushL( function );
       
   145     STIF_ASSERT_NOT_NULL( function );
       
   146     CleanupStack::Pop( function );
       
   147     delete function;
       
   148     function = NULL;
       
   149 
       
   150     return KErrNone;
       
   151     }
       
   152 
       
   153 // -----------------------------------------------------------------------------
       
   154 // CTestUiAifCoreToolkit::TestTHSMFMapValueL
       
   155 // -----------------------------------------------------------------------------
       
   156 //
       
   157 TInt CTestUiAifCoreToolkit::TestTHSMFMapValueL( CStifItemParser& /*aItem*/ )
       
   158     {
       
   159 
       
   160     // Print to UI
       
   161     _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" );
       
   162     _LIT( KHuiMappingFunctions, "In TestTHSMFMapValueL" );
       
   163     TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KHuiMappingFunctions );
       
   164     // Print to log file
       
   165     iLog->Log( KHuiMappingFunctions );
       
   166 
       
   167     THuiSineMappingFunction* function = new( ELeave ) THuiSineMappingFunction();
       
   168     CleanupStack::PushL( function );
       
   169     STIF_ASSERT_NOT_NULL( function );
       
   170     function->MapValue( 0 ,0 );
       
   171     CleanupStack::Pop( function );
       
   172     delete function;
       
   173     function = NULL;
       
   174 
       
   175     return KErrNone;
       
   176     }
       
   177 
       
   178 // ---------------------------THuiCosineMappingFunction-------------------------
       
   179 // -----------------------------------------------------------------------------
       
   180 // CTestUiAifCoreToolkit::TestTHCosineMFConstructorL
       
   181 // -----------------------------------------------------------------------------
       
   182 //
       
   183 TInt CTestUiAifCoreToolkit::TestTHCosineMFConstructorL( CStifItemParser& /*aItem*/ )
       
   184     {
       
   185 
       
   186     // Print to UI
       
   187     _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" );
       
   188     _LIT( KHuiMappingFunctions, "In TestTHCosineMFConstructorL" );
       
   189     TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KHuiMappingFunctions );
       
   190     // Print to log file
       
   191     iLog->Log( KHuiMappingFunctions );
       
   192 
       
   193     THuiCosineMappingFunction* function = new( ELeave ) THuiCosineMappingFunction();
       
   194     CleanupStack::PushL( function );
       
   195     STIF_ASSERT_NOT_NULL( function );
       
   196     CleanupStack::Pop( function );
       
   197     delete function;
       
   198     function = NULL;
       
   199 
       
   200     return KErrNone;
       
   201     }
       
   202 
       
   203 // -----------------------------------------------------------------------------
       
   204 // CTestUiAifCoreToolkit::TestTHCosineMFMapValueL
       
   205 // -----------------------------------------------------------------------------
       
   206 //
       
   207 TInt CTestUiAifCoreToolkit::TestTHCosineMFMapValueL( CStifItemParser& /*aItem*/ )
       
   208     {
       
   209 
       
   210     // Print to UI
       
   211     _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" );
       
   212     _LIT( KHuiMappingFunctions, "In TestTHCosineMFMapValueL" );
       
   213     TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KHuiMappingFunctions );
       
   214     // Print to log file
       
   215     iLog->Log( KHuiMappingFunctions );
       
   216 
       
   217     THuiCosineMappingFunction* function = new( ELeave ) THuiCosineMappingFunction();
       
   218     CleanupStack::PushL( function );
       
   219     STIF_ASSERT_NOT_NULL( function );
       
   220     function->MapValue( 0 ,0 );
       
   221     CleanupStack::Pop( function );
       
   222     delete function;
       
   223     function = NULL;
       
   224 
       
   225     return KErrNone;
       
   226     }
       
   227 
       
   228 // --------------------------THuiAverageMappingFunction-------------------------
       
   229 // -----------------------------------------------------------------------------
       
   230 // CTestUiAifCoreToolkit::TestTHAMFConstructorL
       
   231 // -----------------------------------------------------------------------------
       
   232 //
       
   233 TInt CTestUiAifCoreToolkit::TestTHAMFConstructorL( CStifItemParser& /*aItem*/ )
       
   234     {
       
   235 
       
   236     // Print to UI
       
   237     _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" );
       
   238     _LIT( KHuiMappingFunctions, "In TestTHAMFConstructorL" );
       
   239     TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KHuiMappingFunctions );
       
   240     // Print to log file
       
   241     iLog->Log( KHuiMappingFunctions );
       
   242 
       
   243     THuiAverageMappingFunction* function = new( ELeave ) THuiAverageMappingFunction();
       
   244     CleanupStack::PushL( function );
       
   245     STIF_ASSERT_NOT_NULL( function );
       
   246     CleanupStack::Pop( function );
       
   247     delete function;
       
   248     function = NULL;
       
   249 
       
   250     return KErrNone;
       
   251     }
       
   252 
       
   253 // -----------------------------------------------------------------------------
       
   254 // CTestUiAifCoreToolkit::TestTHAMFMapValueL
       
   255 // -----------------------------------------------------------------------------
       
   256 //
       
   257 TInt CTestUiAifCoreToolkit::TestTHAMFMapValueL( CStifItemParser& /*aItem*/ )
       
   258     {
       
   259 
       
   260     // Print to UI
       
   261     _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" );
       
   262     _LIT( KHuiMappingFunctions, "In TestTHAMFMapValueL" );
       
   263     TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KHuiMappingFunctions );
       
   264     // Print to log file
       
   265     iLog->Log( KHuiMappingFunctions );
       
   266 
       
   267     THuiAverageMappingFunction* function = new( ELeave ) THuiAverageMappingFunction();
       
   268     CleanupStack::PushL( function );
       
   269     STIF_ASSERT_NOT_NULL( function );
       
   270     function->MapValue( 0 ,0 );
       
   271     CleanupStack::Pop( function );
       
   272     delete function;
       
   273     function = NULL;
       
   274 
       
   275     return KErrNone;
       
   276     }
       
   277 
       
   278 // -----------------------------------------------------------------------------
       
   279 // CTestUiAifCoreToolkit::TestTHAMFMappingFunctionChangedL
       
   280 // -----------------------------------------------------------------------------
       
   281 //
       
   282 TInt CTestUiAifCoreToolkit::TestTHAMFMappingFunctionChangedL( CStifItemParser& /*aItem*/ )
       
   283     {
       
   284 
       
   285     // Print to UI
       
   286     _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" );
       
   287     _LIT( KHuiMappingFunctions, "In TestTHAMFMappingFunctionChangedL" );
       
   288     TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KHuiMappingFunctions );
       
   289     // Print to log file
       
   290     iLog->Log( KHuiMappingFunctions );
       
   291 
       
   292     THuiAverageMappingFunction* function = new( ELeave ) THuiAverageMappingFunction();
       
   293     CleanupStack::PushL( function );
       
   294     STIF_ASSERT_NOT_NULL( function );
       
   295     function->MappingFunctionChanged();
       
   296     CleanupStack::Pop( function );
       
   297     delete function;
       
   298     function = NULL;
       
   299 
       
   300     return KErrNone;
       
   301     }
       
   302 
       
   303 // -----------------------------------------------------------------------------
       
   304 // CTestUiAifCoreToolkit::TestTHAMFMappingFunctionClearChangedL
       
   305 // -----------------------------------------------------------------------------
       
   306 //
       
   307 TInt CTestUiAifCoreToolkit::TestTHAMFMappingFunctionClearChangedL( CStifItemParser& /*aItem*/ )
       
   308     {
       
   309 
       
   310     // Print to UI
       
   311     _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" );
       
   312     _LIT( KHuiMappingFunctions, "In TestTHAMFMappingFunctionClearChangedL" );
       
   313     TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KHuiMappingFunctions );
       
   314     // Print to log file
       
   315     iLog->Log( KHuiMappingFunctions );
       
   316 
       
   317     THuiAverageMappingFunction* function = new( ELeave ) THuiAverageMappingFunction();
       
   318     CleanupStack::PushL( function );
       
   319     STIF_ASSERT_NOT_NULL( function );
       
   320     function->MappingFunctionClearChanged();
       
   321     CleanupStack::Pop( function );
       
   322     delete function;
       
   323     function = NULL;
       
   324 
       
   325     return KErrNone;
       
   326     }