ssl/tsrc/crypto_test/src/crypto_test.cpp
changeset 0 e4d67989cc36
child 79 564bc7b7ad27
equal deleted inserted replaced
-1:000000000000 0:e4d67989cc36
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
       
     3 
       
     4 * Redistribution and use in source and binary forms, with or without 
       
     5 * modification, are permitted provided that the following conditions are met:
       
     6 
       
     7 * Redistributions of source code must retain the above copyright notice, this 
       
     8 * list of conditions and the following disclaimer.
       
     9 * Redistributions in binary form must reproduce the above copyright notice, 
       
    10 * this list of conditions and the following disclaimer in the documentation 
       
    11 * and/or other materials provided with the distribution.
       
    12 * Neither the name of Nokia Corporation nor the names of its contributors 
       
    13 * may be used to endorse or promote products derived from this software 
       
    14 * without specific prior written permission.
       
    15 
       
    16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
       
    17 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
       
    18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 
       
    19 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 
       
    20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 
       
    21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
       
    22 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 
       
    23 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 
       
    24 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
       
    25 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
       
    26 *
       
    27 * Description:  ?Description
       
    28 *
       
    29 */
       
    30 
       
    31 
       
    32 
       
    33 // INCLUDE FILES
       
    34 #include <Stiftestinterface.h>
       
    35 #include "crypto_test.h"
       
    36 
       
    37 // EXTERNAL DATA STRUCTURES
       
    38 //extern  ?external_data;
       
    39 
       
    40 // EXTERNAL FUNCTION PROTOTYPES  
       
    41 //extern ?external_function( ?arg_type,?arg_type );
       
    42 
       
    43 // CONSTANTS
       
    44 //const ?type ?constant_var = ?constant;
       
    45 
       
    46 // MACROS
       
    47 //#define ?macro ?macro_def
       
    48 
       
    49 // LOCAL CONSTANTS AND MACROS
       
    50 //const ?type ?constant_var = ?constant;
       
    51 //#define ?macro_name ?macro_def
       
    52 
       
    53 // MODULE DATA STRUCTURES
       
    54 //enum ?declaration
       
    55 //typedef ?declaration
       
    56 
       
    57 // LOCAL FUNCTION PROTOTYPES
       
    58 //?type ?function_name( ?arg_type, ?arg_type );
       
    59 
       
    60 // FORWARD DECLARATIONS
       
    61 //class ?FORWARD_CLASSNAME;
       
    62 
       
    63 // ============================= LOCAL FUNCTIONS ===============================
       
    64 
       
    65 // -----------------------------------------------------------------------------
       
    66 // ?function_name ?description.
       
    67 // ?description
       
    68 // Returns: ?value_1: ?description
       
    69 //          ?value_n: ?description_line1
       
    70 //                    ?description_line2
       
    71 // -----------------------------------------------------------------------------
       
    72 //
       
    73 /*
       
    74 ?type ?function_name(
       
    75     ?arg_type arg,  // ?description
       
    76     ?arg_type arg)  // ?description
       
    77     {
       
    78 
       
    79     ?code  // ?comment
       
    80 
       
    81     // ?comment
       
    82     ?code
       
    83     }
       
    84 */
       
    85 
       
    86 // ============================ MEMBER FUNCTIONS ===============================
       
    87 
       
    88 // -----------------------------------------------------------------------------
       
    89 // Ccrypto_test::Ccrypto_test
       
    90 // C++ default constructor can NOT contain any code, that
       
    91 // might leave.
       
    92 // -----------------------------------------------------------------------------
       
    93 //
       
    94 Ccrypto_test::Ccrypto_test( 
       
    95     CTestModuleIf& aTestModuleIf ):
       
    96         CScriptBase( aTestModuleIf )
       
    97     {
       
    98     }
       
    99 
       
   100 // -----------------------------------------------------------------------------
       
   101 // Ccrypto_test::ConstructL
       
   102 // Symbian 2nd phase constructor can leave.
       
   103 // -----------------------------------------------------------------------------
       
   104 //
       
   105 void Ccrypto_test::ConstructL()
       
   106     {
       
   107     iLog = CStifLogger::NewL( Kcrypto_testLogPath, 
       
   108                           Kcrypto_testLogFile,
       
   109                           CStifLogger::ETxt,
       
   110                           CStifLogger::EFile,
       
   111                           EFalse );
       
   112 
       
   113     }
       
   114 
       
   115 // -----------------------------------------------------------------------------
       
   116 // Ccrypto_test::NewL
       
   117 // Two-phased constructor.
       
   118 // -----------------------------------------------------------------------------
       
   119 //
       
   120 Ccrypto_test* Ccrypto_test::NewL( 
       
   121     CTestModuleIf& aTestModuleIf )
       
   122     {
       
   123     Ccrypto_test* self = new (ELeave) Ccrypto_test( aTestModuleIf );
       
   124 
       
   125     CleanupStack::PushL( self );
       
   126     self->ConstructL();
       
   127     CleanupStack::Pop();
       
   128 
       
   129     return self;
       
   130 
       
   131     }
       
   132 
       
   133 // Destructor
       
   134 Ccrypto_test::~Ccrypto_test()
       
   135     { 
       
   136 
       
   137     // Delete resources allocated from test methods
       
   138     Delete();
       
   139 
       
   140     // Delete logger
       
   141     delete iLog; 
       
   142 
       
   143     }
       
   144 
       
   145 // ========================== OTHER EXPORTED FUNCTIONS =========================
       
   146 
       
   147 // -----------------------------------------------------------------------------
       
   148 // LibEntryL is a polymorphic Dll entry point.
       
   149 // Returns: CScriptBase: New CScriptBase derived object
       
   150 // -----------------------------------------------------------------------------
       
   151 //
       
   152 EXPORT_C CScriptBase* LibEntryL( 
       
   153     CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework
       
   154     {
       
   155 
       
   156     return ( CScriptBase* ) Ccrypto_test::NewL( aTestModuleIf );
       
   157 
       
   158     }
       
   159 
       
   160 // -----------------------------------------------------------------------------
       
   161 // E32Dll is a DLL entry point function.
       
   162 // Returns: KErrNone
       
   163 // -----------------------------------------------------------------------------
       
   164 //
       
   165 #ifndef EKA2 // Hide Dll entry point to EKA2
       
   166 GLDEF_C TInt E32Dll(
       
   167     TDllReason /*aReason*/) // Reason code
       
   168     {
       
   169     return(KErrNone);
       
   170 
       
   171     }
       
   172 #endif // EKA2
       
   173 
       
   174 //  End of File