idlehomescreen/widgetmanager/tsrc/wmunittest/src/wmunittest.cpp
changeset 1 5315654608de
equal deleted inserted replaced
0:f72a12da539e 1:5315654608de
       
     1 /*
       
     2 * Copyright (c) 2009 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: This file contains testclass implementation.
       
    15 *
       
    16 */
       
    17 
       
    18 // INCLUDE FILES
       
    19 #include <stiftestinterface.h>
       
    20 #include <settingserverclient.h>
       
    21 
       
    22 #include "wmunittest.h"
       
    23 
       
    24 
       
    25 // ============================ MEMBER FUNCTIONS ===============================
       
    26 
       
    27 // -----------------------------------------------------------------------------
       
    28 // CWmUnitTest::CWmUnitTest
       
    29 // -----------------------------------------------------------------------------
       
    30 //
       
    31 CWmUnitTest::CWmUnitTest( 
       
    32     CTestModuleIf& aTestModuleIf ):
       
    33         CScriptBase( aTestModuleIf )
       
    34     {
       
    35     iChangeValue = NULL;
       
    36     }
       
    37 
       
    38 // -----------------------------------------------------------------------------
       
    39 // CWmUnitTest::ConstructL
       
    40 // -----------------------------------------------------------------------------
       
    41 //
       
    42 void CWmUnitTest::ConstructL()
       
    43     {
       
    44     iLog = CStifLogger::NewL( KWmUnitTestLogPath, 
       
    45             KWmUnitTestLogFile,
       
    46             CStifLogger::ETxt,
       
    47             CStifLogger::EFile,
       
    48             EFalse );
       
    49     
       
    50     SendTestClassVersion();
       
    51     
       
    52     User::LeaveIfError( iFs.Connect() );
       
    53     }
       
    54 
       
    55 // -----------------------------------------------------------------------------
       
    56 // CWmUnitTest::NewL
       
    57 // -----------------------------------------------------------------------------
       
    58 //
       
    59 CWmUnitTest* CWmUnitTest::NewL( 
       
    60     CTestModuleIf& aTestModuleIf )
       
    61     {
       
    62     CWmUnitTest* self = new (ELeave) CWmUnitTest( aTestModuleIf );
       
    63     CleanupStack::PushL( self );
       
    64     self->ConstructL();
       
    65     CleanupStack::Pop( self );
       
    66     return self;
       
    67     }
       
    68 
       
    69 // -----------------------------------------------------------------------------
       
    70 // CWmUnitTest::~CWmUnitTest
       
    71 // -----------------------------------------------------------------------------
       
    72 //
       
    73 CWmUnitTest::~CWmUnitTest()
       
    74     { 
       
    75     // Delete logger
       
    76     delete iLog; 
       
    77     // close file server
       
    78     iFs.Close();
       
    79     }
       
    80 
       
    81 //-----------------------------------------------------------------------------
       
    82 // CWmDeploymentClientTest::SendTestClassVersion
       
    83 //-----------------------------------------------------------------------------
       
    84 //
       
    85 void CWmUnitTest::SendTestClassVersion()
       
    86 	{
       
    87 	TVersion moduleVersion;
       
    88 	moduleVersion.iMajor = TEST_CLASS_VERSION_MAJOR;
       
    89 	moduleVersion.iMinor = TEST_CLASS_VERSION_MINOR;
       
    90 	moduleVersion.iBuild = TEST_CLASS_VERSION_BUILD;
       
    91 	
       
    92 	TFileName moduleName;
       
    93 	moduleName = _L("wmunittest.dll");
       
    94 
       
    95 	TBool newVersionOfMethod = ETrue;
       
    96 	TestModuleIf().SendTestModuleVersion(moduleVersion, moduleName, newVersionOfMethod);
       
    97 	}
       
    98 
       
    99 // ========================== OTHER EXPORTED FUNCTIONS =========================
       
   100 
       
   101 // -----------------------------------------------------------------------------
       
   102 // LibEntryL() - polymorphic Dll entry point.
       
   103 // -----------------------------------------------------------------------------
       
   104 //
       
   105 EXPORT_C CScriptBase* LibEntryL( 
       
   106     CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework
       
   107     {
       
   108     return ( CScriptBase* ) CWmUnitTest::NewL( aTestModuleIf );
       
   109     }
       
   110 
       
   111 
       
   112 //  End of File