os/ossrv/ssl/tsrc/crypto_test/src/crypto_test.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/ossrv/ssl/tsrc/crypto_test/src/crypto_test.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,174 @@
     1.4 +/*
     1.5 +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
     1.6 +
     1.7 +* Redistribution and use in source and binary forms, with or without 
     1.8 +* modification, are permitted provided that the following conditions are met:
     1.9 +
    1.10 +* Redistributions of source code must retain the above copyright notice, this 
    1.11 +* list of conditions and the following disclaimer.
    1.12 +* Redistributions in binary form must reproduce the above copyright notice, 
    1.13 +* this list of conditions and the following disclaimer in the documentation 
    1.14 +* and/or other materials provided with the distribution.
    1.15 +* Neither the name of Nokia Corporation nor the names of its contributors 
    1.16 +* may be used to endorse or promote products derived from this software 
    1.17 +* without specific prior written permission.
    1.18 +
    1.19 +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
    1.20 +* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
    1.21 +* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 
    1.22 +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 
    1.23 +* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 
    1.24 +* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
    1.25 +* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 
    1.26 +* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 
    1.27 +* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
    1.28 +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    1.29 +*
    1.30 +* Description:  ?Description
    1.31 +*
    1.32 +*/
    1.33 +
    1.34 +
    1.35 +
    1.36 +// INCLUDE FILES
    1.37 +#include <Stiftestinterface.h>
    1.38 +#include "crypto_test.h"
    1.39 +
    1.40 +// EXTERNAL DATA STRUCTURES
    1.41 +//extern  ?external_data;
    1.42 +
    1.43 +// EXTERNAL FUNCTION PROTOTYPES  
    1.44 +//extern ?external_function( ?arg_type,?arg_type );
    1.45 +
    1.46 +// CONSTANTS
    1.47 +//const ?type ?constant_var = ?constant;
    1.48 +
    1.49 +// MACROS
    1.50 +//#define ?macro ?macro_def
    1.51 +
    1.52 +// LOCAL CONSTANTS AND MACROS
    1.53 +//const ?type ?constant_var = ?constant;
    1.54 +//#define ?macro_name ?macro_def
    1.55 +
    1.56 +// MODULE DATA STRUCTURES
    1.57 +//enum ?declaration
    1.58 +//typedef ?declaration
    1.59 +
    1.60 +// LOCAL FUNCTION PROTOTYPES
    1.61 +//?type ?function_name( ?arg_type, ?arg_type );
    1.62 +
    1.63 +// FORWARD DECLARATIONS
    1.64 +//class ?FORWARD_CLASSNAME;
    1.65 +
    1.66 +// ============================= LOCAL FUNCTIONS ===============================
    1.67 +
    1.68 +// -----------------------------------------------------------------------------
    1.69 +// ?function_name ?description.
    1.70 +// ?description
    1.71 +// Returns: ?value_1: ?description
    1.72 +//          ?value_n: ?description_line1
    1.73 +//                    ?description_line2
    1.74 +// -----------------------------------------------------------------------------
    1.75 +//
    1.76 +/*
    1.77 +?type ?function_name(
    1.78 +    ?arg_type arg,  // ?description
    1.79 +    ?arg_type arg)  // ?description
    1.80 +    {
    1.81 +
    1.82 +    ?code  // ?comment
    1.83 +
    1.84 +    // ?comment
    1.85 +    ?code
    1.86 +    }
    1.87 +*/
    1.88 +
    1.89 +// ============================ MEMBER FUNCTIONS ===============================
    1.90 +
    1.91 +// -----------------------------------------------------------------------------
    1.92 +// Ccrypto_test::Ccrypto_test
    1.93 +// C++ default constructor can NOT contain any code, that
    1.94 +// might leave.
    1.95 +// -----------------------------------------------------------------------------
    1.96 +//
    1.97 +Ccrypto_test::Ccrypto_test( 
    1.98 +    CTestModuleIf& aTestModuleIf ):
    1.99 +        CScriptBase( aTestModuleIf )
   1.100 +    {
   1.101 +    }
   1.102 +
   1.103 +// -----------------------------------------------------------------------------
   1.104 +// Ccrypto_test::ConstructL
   1.105 +// Symbian 2nd phase constructor can leave.
   1.106 +// -----------------------------------------------------------------------------
   1.107 +//
   1.108 +void Ccrypto_test::ConstructL()
   1.109 +    {
   1.110 +    iLog = CStifLogger::NewL( Kcrypto_testLogPath, 
   1.111 +                          Kcrypto_testLogFile,
   1.112 +                          CStifLogger::ETxt,
   1.113 +                          CStifLogger::EFile,
   1.114 +                          EFalse );
   1.115 +
   1.116 +    }
   1.117 +
   1.118 +// -----------------------------------------------------------------------------
   1.119 +// Ccrypto_test::NewL
   1.120 +// Two-phased constructor.
   1.121 +// -----------------------------------------------------------------------------
   1.122 +//
   1.123 +Ccrypto_test* Ccrypto_test::NewL( 
   1.124 +    CTestModuleIf& aTestModuleIf )
   1.125 +    {
   1.126 +    Ccrypto_test* self = new (ELeave) Ccrypto_test( aTestModuleIf );
   1.127 +
   1.128 +    CleanupStack::PushL( self );
   1.129 +    self->ConstructL();
   1.130 +    CleanupStack::Pop();
   1.131 +
   1.132 +    return self;
   1.133 +
   1.134 +    }
   1.135 +
   1.136 +// Destructor
   1.137 +Ccrypto_test::~Ccrypto_test()
   1.138 +    { 
   1.139 +
   1.140 +    // Delete resources allocated from test methods
   1.141 +    Delete();
   1.142 +
   1.143 +    // Delete logger
   1.144 +    delete iLog; 
   1.145 +
   1.146 +    }
   1.147 +
   1.148 +// ========================== OTHER EXPORTED FUNCTIONS =========================
   1.149 +
   1.150 +// -----------------------------------------------------------------------------
   1.151 +// LibEntryL is a polymorphic Dll entry point.
   1.152 +// Returns: CScriptBase: New CScriptBase derived object
   1.153 +// -----------------------------------------------------------------------------
   1.154 +//
   1.155 +EXPORT_C CScriptBase* LibEntryL( 
   1.156 +    CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework
   1.157 +    {
   1.158 +
   1.159 +    return ( CScriptBase* ) Ccrypto_test::NewL( aTestModuleIf );
   1.160 +
   1.161 +    }
   1.162 +
   1.163 +// -----------------------------------------------------------------------------
   1.164 +// E32Dll is a DLL entry point function.
   1.165 +// Returns: KErrNone
   1.166 +// -----------------------------------------------------------------------------
   1.167 +//
   1.168 +#ifndef EKA2 // Hide Dll entry point to EKA2
   1.169 +GLDEF_C TInt E32Dll(
   1.170 +    TDllReason /*aReason*/) // Reason code
   1.171 +    {
   1.172 +    return(KErrNone);
   1.173 +
   1.174 +    }
   1.175 +#endif // EKA2
   1.176 +
   1.177 +//  End of File