sysstatemgmt/tsrc/public/basic/mt_rstartersession/MT_RStarterSession.h
branchRCL_3
changeset 22 8cb079868133
parent 21 ccb4f6b3db21
--- a/sysstatemgmt/tsrc/public/basic/mt_rstartersession/MT_RStarterSession.h	Tue Aug 31 16:29:05 2010 +0300
+++ b/sysstatemgmt/tsrc/public/basic/mt_rstartersession/MT_RStarterSession.h	Wed Sep 01 12:34:26 2010 +0100
@@ -11,50 +11,39 @@
 *
 * Contributors:
 *
-* Description: Unit test code for RStarterSession class
+* Description:
 *
 */
+
+
 #ifndef __MT_RSTARTERSESSION_H__
 #define __MT_RSTARTERSESSION_H__
 
-#if defined (_MSC_VER) && (_MSC_VER >= 1000)
-#pragma once
-#endif
-// Function pointer related internal definitions
-#ifndef __GCC32__
-#define GETPTR
-#else
-#define GETPTR &
-#endif  
-#define ENTRY(str,func) {_S(str), GETPTR func,0,0,0}
-#define FUNCENTRY(func) {_S(#func), GETPTR func,0,0,0}
+//  EXTERNAL INCLUDES
+#include <CEUnitTestSuiteClass.h>
+#include <EUnitDecorators.h>
 
-//  EXTERNAL INCLUDES
-#include <stiftestmodule.h>
 
 //  INTERNAL INCLUDES
 #include <starterclient.h>
 
-// FORWARD DECLARATIONS
-class TCaseInfo;
-class MT_RStarterSession;
-// DESCRIPTION
-// This a Test Module interface template
-// that does not really do anything.
-typedef TInt ( MT_RStarterSession::*TestFunction )( TTestResult& );
+//  FORWARD DECLARATIONS
+
+
 //  CLASS DEFINITION
 /**
  *
  */
 NONSHARABLE_CLASS( MT_RStarterSession )
-	: public CTestModuleBase
+	: public CEUnitTestSuiteClass
     {
     public:     // Constructors and destructors
 
         /**
          * Two phase construction
          */
-        static MT_RStarterSession* NewL(CTestModuleIf& aTestModuleIf);
+        static MT_RStarterSession* NewL();
+        static MT_RStarterSession* NewLC();
         /**
          * Destructor
          */
@@ -62,85 +51,31 @@
 
     private:    // Constructors and destructors
 
-        MT_RStarterSession( CTestModuleIf& aTestModuleIf );
-        
-        /**
-        * Function returning test case name and pointer to test case function
-        */
-        const TCaseInfo Case( const TInt aCaseNumber ) const;
-
-   	public: // Functions from base classes
+        MT_RStarterSession();
+        void ConstructL();
 
-        // @see CTestModuleBase
-        virtual TInt GetTestCasesL( const TFileName& aTestCaseFile,
-        RPointerArray<TTestCaseInfo>& aTestCases );
-
-        // @see CTestModuleBase
-        virtual TInt RunTestCaseL( const TInt aCaseNumber,
-        const TFileName& aTestCaseFile,
-		TTestResult& aResult );
-            
     private:    // New methods
 
         void SetupL();
+        void SetupEmptyL();
         void Teardown();
+        void TeardownEmpty();
 
-        TInt T_RStarterSession_Connect(TTestResult& aResult);
-        TInt T_RStarterSession_SetState(TTestResult& aResult);
-        TInt T_RStarterSession_SetStateToNormal(TTestResult& aResult);
-        TInt T_RStarterSession_SetStateToAlarm(TTestResult& aResult);
-        TInt T_RStarterSession_SetStateToCharging(TTestResult& aResult);
-        TInt T_RStarterSession_SetStateToOffLine(TTestResult& aResult);
-        TInt T_RStarterSession_SetStateToBTSap(TTestResult& aResult);
-        TInt T_RStarterSession_Reset(TTestResult& aResult);
-        TInt T_RStarterSession_Shutdown(TTestResult& aResult);
-        TInt T_RStarterSession_ResetNetwork(TTestResult& aResult);
-        TInt T_RStarterSession_IsRTCTimeValid(TTestResult& aResult);
-        TInt T_RStarterSession_ActivateRfForEmergencyCall(TTestResult& aResult);
-        TInt T_RStarterSession_DeactivateRfAfterEmergencyCall(TTestResult& aResult);
-        TInt T_RStarterSession_EndSplashScreen(TTestResult& aResult);
+        void T_RStarterSession_ConnectL();
+        void T_RStarterSession_SetStateL();
+        void T_RStarterSession_ResetL();
+        void T_RStarterSession_ShutdownL();
+        void T_RStarterSession_ResetNetworkL();
+        void T_RStarterSession_IsRTCTimeValidL();
+        void T_RStarterSession_ActivateRfForEmergencyCallL();
+        void T_RStarterSession_DeactivateRfAfterEmergencyCallL();
+        void T_RStarterSession_EndSplashScreenL();
 
     private:    // Data
-		TestFunction    iMethod;
+		
         RStarterSession iRStarterSession;
-
-    };
-
-// Function pointer related internal definitions
-
-// Hack around known GCC bug.
-#ifndef __GCC32__
-    #define GETPTR
-#else
-    #define GETPTR &
-#endif
-
+        EUNIT_DECLARE_TEST_TABLE; 
 
-// An internal structure containing a test case name and
-// the pointer to function doing the test
-class TCaseInfoInternal
-    {
-    public:
-        const TText* iCaseName;
-        TestFunction iMethod;
-        TBool           iIsOOMTest;
-        TInt            iFirstMemoryAllocation;
-        TInt            iLastMemoryAllocation;
-    };
-
-// An internal structure containing a test case name and
-// the pointer to function doing the test
-class TCaseInfo
-    {
-    public:
-        TPtrC iCaseName;
-        TestFunction iMethod;
-        TBool           iIsOOMTest;
-        TInt            iFirstMemoryAllocation;
-        TInt            iLastMemoryAllocation;
-    TCaseInfo( const TText* a ) : iCaseName( ( TText* ) a )
-        {
-        };
     };
 
 #endif      //  __MT_RSTARTERSESSION_H__