uiaccelerator_plat/alf_core_toolkit_api/tsrc/src/testuiaifctkitblockshuifixmath.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/huienv.h>
       
    25 #include <uiacceltk/huicontrol.h>
       
    26 #include <uiacceltk/huifixmath.h>
       
    27 
       
    28 #include "testuiaifcoretoolkit.h"
       
    29 
       
    30 // -----------------------------------------------------------------------------
       
    31 // CTestUiAifCoreToolkit::TestHFMFixHypot
       
    32 // -----------------------------------------------------------------------------
       
    33 //
       
    34 TInt CTestUiAifCoreToolkit::TestHFMFixHypot( CStifItemParser& /*aItem*/ )
       
    35     {
       
    36 
       
    37     // Print to UI
       
    38     _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" );
       
    39     _LIT( KHuiFixMath, "In TestHFMFixHypot" );
       
    40     TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KHuiFixMath );
       
    41     // Print to log file
       
    42     iLog->Log( KHuiFixMath );
       
    43 
       
    44     HuiFixMath::FixHypot( 1, 1 );
       
    45 
       
    46     return KErrNone;
       
    47     }
       
    48 
       
    49 // -----------------------------------------------------------------------------
       
    50 // CTestUiAifCoreToolkit::TestHFMFixSin
       
    51 // -----------------------------------------------------------------------------
       
    52 //
       
    53 TInt CTestUiAifCoreToolkit::TestHFMFixSin( CStifItemParser& /*aItem*/ )
       
    54     {
       
    55 
       
    56     // Print to UI
       
    57     _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" );
       
    58     _LIT( KHuiFixMath, "In TestHFMFixSin" );
       
    59     TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KHuiFixMath );
       
    60     // Print to log file
       
    61     iLog->Log( KHuiFixMath );
       
    62 
       
    63     HuiFixMath::FixSin( 1 );
       
    64 
       
    65     return KErrNone;
       
    66     }
       
    67 
       
    68 // -----------------------------------------------------------------------------
       
    69 // CTestUiAifCoreToolkit::TestHFMFixCos
       
    70 // -----------------------------------------------------------------------------
       
    71 //
       
    72 TInt CTestUiAifCoreToolkit::TestHFMFixCos( CStifItemParser& /*aItem*/ )
       
    73     {
       
    74 
       
    75     // Print to UI
       
    76     _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" );
       
    77     _LIT( KHuiFixMath, "In TestHFMFixCos" );
       
    78     TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KHuiFixMath );
       
    79     // Print to log file
       
    80     iLog->Log( KHuiFixMath );
       
    81 
       
    82     HuiFixMath::FixCos( 1 );
       
    83 
       
    84     return KErrNone;
       
    85     }
       
    86 
       
    87 // -----------------------------------------------------------------------------
       
    88 // CTestUiAifCoreToolkit::TestHFMFixMul
       
    89 // -----------------------------------------------------------------------------
       
    90 //
       
    91 TInt CTestUiAifCoreToolkit::TestHFMFixMul( CStifItemParser& /*aItem*/ )
       
    92     {
       
    93 
       
    94     // Print to UI
       
    95     _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" );
       
    96     _LIT( KHuiFixMath, "In TestHFMFixMul" );
       
    97     TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KHuiFixMath );
       
    98     // Print to log file
       
    99     iLog->Log( KHuiFixMath );
       
   100 
       
   101     HuiFixMath::FixMul( 1, 1 );
       
   102 
       
   103     return KErrNone;
       
   104     }
       
   105 
       
   106 // -----------------------------------------------------------------------------
       
   107 // CTestUiAifCoreToolkit::TestHFMFixDiv
       
   108 // -----------------------------------------------------------------------------
       
   109 //
       
   110 TInt CTestUiAifCoreToolkit::TestHFMFixDiv( CStifItemParser& /*aItem*/ )
       
   111     {
       
   112 
       
   113     // Print to UI
       
   114     _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" );
       
   115     _LIT( KHuiFixMath, "In TestHFMFixDiv" );
       
   116     TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KHuiFixMath );
       
   117     // Print to log file
       
   118     iLog->Log( KHuiFixMath );
       
   119 
       
   120     HuiFixMath::FixDiv( 1, 1 );
       
   121 
       
   122     return KErrNone;
       
   123     }
       
   124 
       
   125 // -----------------------------------------------------------------------------
       
   126 // CTestUiAifCoreToolkit::TestHFMFloatToFix
       
   127 // -----------------------------------------------------------------------------
       
   128 //
       
   129 TInt CTestUiAifCoreToolkit::TestHFMFloatToFix( CStifItemParser& /*aItem*/ )
       
   130     {
       
   131 
       
   132     // Print to UI
       
   133     _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" );
       
   134     _LIT( KHuiFixMath, "In TestHFMFloatToFix" );
       
   135     TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KHuiFixMath );
       
   136     // Print to log file
       
   137     iLog->Log( KHuiFixMath );
       
   138 
       
   139     HuiFixMath::FloatToFix( 1 );
       
   140 
       
   141     return KErrNone;
       
   142     }
       
   143 
       
   144 // -----------------------------------------------------------------------------
       
   145 // CTestUiAifCoreToolkit::TestHFMFixToFloat
       
   146 // -----------------------------------------------------------------------------
       
   147 //
       
   148 TInt CTestUiAifCoreToolkit::TestHFMFixToFloat( CStifItemParser& /*aItem*/ )
       
   149     {
       
   150 
       
   151     // Print to UI
       
   152     _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" );
       
   153     _LIT( KHuiFixMath, "In TestHFMFixToFloat" );
       
   154     TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KHuiFixMath );
       
   155     // Print to log file
       
   156     iLog->Log( KHuiFixMath );
       
   157 
       
   158     HuiFixMath::FixToFloat( 1 );
       
   159 
       
   160     return KErrNone;
       
   161     }