notepad/src/TestNpdApi.cpp
author Maciej Seroka <maciejs@symbian.org>
Thu, 21 Jan 2010 12:53:44 +0000
branchSymbian2
changeset 1 8758140453c0
child 6 c108117318cb
permissions -rw-r--r--
Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     1
/*
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     2
* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     3
* All rights reserved.
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     5
* under the terms of the License "Symbian Foundation License v1.0"
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     7
* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     8
*
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     9
* Initial Contributors:
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    11
*
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    12
* Contributors:
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    13
*
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    14
* Description:  the entry for Notepad Api stif
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    15
*
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    16
*/
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    17
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    18
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    19
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    20
// INCLUDE FILES
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    21
#include <Stiftestinterface.h>
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    22
#include "TestNpdApi.h"
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    23
#include <SettingServerClient.h>
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    24
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    25
// EXTERNAL DATA STRUCTURES
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    26
//extern  ?external_data;
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    27
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    28
// EXTERNAL FUNCTION PROTOTYPES  
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    29
//extern ?external_function( ?arg_type,?arg_type );
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    30
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    31
// CONSTANTS
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    32
//const ?type ?constant_var = ?constant;
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    33
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    34
// MACROS
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    35
//#define ?macro ?macro_def
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    36
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    37
// LOCAL CONSTANTS AND MACROS
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    38
//const ?type ?constant_var = ?constant;
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    39
//#define ?macro_name ?macro_def
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    40
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    41
// MODULE DATA STRUCTURES
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    42
//enum ?declaration
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    43
//typedef ?declaration
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    44
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    45
// LOCAL FUNCTION PROTOTYPES
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    46
//?type ?function_name( ?arg_type, ?arg_type );
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    47
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    48
// FORWARD DECLARATIONS
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    49
//class ?FORWARD_CLASSNAME;
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    50
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    51
// ============================= LOCAL FUNCTIONS ===============================
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    52
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    53
// -----------------------------------------------------------------------------
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    54
// ?function_name ?description.
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    55
// ?description
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    56
// Returns: ?value_1: ?description
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    57
//          ?value_n: ?description_line1
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    58
//                    ?description_line2
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    59
// -----------------------------------------------------------------------------
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    60
//
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    61
/*
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    62
?type ?function_name(
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    63
    ?arg_type arg,  // ?description
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    64
    ?arg_type arg)  // ?description
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    65
    {
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    66
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    67
    ?code  // ?comment
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    68
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    69
    // ?comment
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    70
    ?code
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    71
    }
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    72
*/
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    73
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    74
// ============================ MEMBER FUNCTIONS ===============================
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    75
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    76
// -----------------------------------------------------------------------------
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    77
// CTestNpdApi::CTestNpdApi
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    78
// C++ default constructor can NOT contain any code, that
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    79
// might leave.
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    80
// -----------------------------------------------------------------------------
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    81
//
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    82
CTestNpdApi::CTestNpdApi( 
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    83
    CTestModuleIf& aTestModuleIf ):
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    84
        CScriptBase( aTestModuleIf )
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    85
    {
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    86
    }
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    87
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    88
// -----------------------------------------------------------------------------
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    89
// CTestNpdApi::ConstructL
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    90
// Symbian 2nd phase constructor can leave.
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    91
// -----------------------------------------------------------------------------
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    92
//
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    93
void CTestNpdApi::ConstructL()
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    94
    {
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    95
    //Read logger settings to check whether test case name is to be
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    96
    //appended to log file name.
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    97
    RSettingServer settingServer;
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    98
    TInt ret = settingServer.Connect();
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    99
    if(ret != KErrNone)
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   100
        {
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   101
        User::Leave(ret);
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   102
        }
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   103
    // Struct to StifLogger settigs.
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   104
    TLoggerSettings loggerSettings; 
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   105
    // Parse StifLogger defaults from STIF initialization file.
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   106
    ret = settingServer.GetLoggerSettings(loggerSettings);
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   107
    if(ret != KErrNone)
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   108
        {
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   109
        User::Leave(ret);
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   110
        } 
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   111
    // Close Setting server session
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   112
    settingServer.Close();
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   113
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   114
    TFileName logFileName;
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   115
    
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   116
    if(loggerSettings.iAddTestCaseTitle)
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   117
        {
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   118
        TName title;
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   119
        TestModuleIf().GetTestCaseTitleL(title);
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   120
        logFileName.Format(KTestNpdApiLogFileWithTitle, &title);
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   121
        }
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   122
    else
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   123
        {
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   124
        logFileName.Copy(KTestNpdApiLogFile);
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   125
        }
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   126
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   127
    iLog = CStifLogger::NewL( KTestNpdApiLogPath, 
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   128
                          logFileName,
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   129
                          CStifLogger::ETxt,
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   130
                          CStifLogger::EFile,
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   131
                          EFalse );
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   132
    
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   133
    SendTestClassVersion();
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   134
    
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   135
    //iptrToNpd = CNotepadApi::NewL();	
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   136
    
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   137
    }
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   138
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   139
// -----------------------------------------------------------------------------
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   140
// CTestNpdApi::NewL
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   141
// Two-phased constructor.
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   142
// -----------------------------------------------------------------------------
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   143
//
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   144
CTestNpdApi* CTestNpdApi::NewL( 
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   145
    CTestModuleIf& aTestModuleIf )
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   146
    {
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   147
    CTestNpdApi* self = new (ELeave) CTestNpdApi( aTestModuleIf );
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   148
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   149
    CleanupStack::PushL( self );
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   150
    self->ConstructL();
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   151
    CleanupStack::Pop();
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   152
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   153
    return self;
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   154
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   155
    }
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   156
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   157
// Destructor
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   158
CTestNpdApi::~CTestNpdApi()
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   159
    { 
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   160
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   161
    // Delete resources allocated from test methods
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   162
    Delete();
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   163
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   164
    // Delete logger
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   165
    delete iLog; 
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   166
    if (iptrToNpd)
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   167
    {
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   168
	    delete iptrToNpd;
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   169
			iptrToNpd = NULL;
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   170
		}
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   171
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   172
    }
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   173
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   174
//-----------------------------------------------------------------------------
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   175
// CTestNpdApi::SendTestClassVersion
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   176
// Method used to send version of test class
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   177
//-----------------------------------------------------------------------------
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   178
//
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   179
void CTestNpdApi::SendTestClassVersion()
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   180
	{
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   181
	TVersion moduleVersion;
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   182
	moduleVersion.iMajor = TEST_CLASS_VERSION_MAJOR;
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   183
	moduleVersion.iMinor = TEST_CLASS_VERSION_MINOR;
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   184
	moduleVersion.iBuild = TEST_CLASS_VERSION_BUILD;
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   185
	
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   186
	TFileName moduleName;
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   187
	moduleName = _L("TestNpdApi.dll");
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   188
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   189
	TestModuleIf().SendTestModuleVersion(moduleVersion, moduleName);
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   190
	}
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   191
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   192
// ========================== OTHER EXPORTED FUNCTIONS =========================
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   193
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   194
// -----------------------------------------------------------------------------
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   195
// LibEntryL is a polymorphic Dll entry point.
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   196
// Returns: CScriptBase: New CScriptBase derived object
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   197
// -----------------------------------------------------------------------------
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   198
//
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   199
EXPORT_C CScriptBase* LibEntryL( 
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   200
    CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   201
    {
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   202
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   203
    return ( CScriptBase* ) CTestNpdApi::NewL( aTestModuleIf );
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   204
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   205
    }
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   206
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   207
8758140453c0 Added Symbian2 smoketests from FBF at changeset bde28f2b1d99
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   208
//  End of File