messagingappbase/smsmtm/test/inc/T_SmsSc.h
changeset 25 84d9eb65b26f
parent 23 238255e8b033
child 27 e4592d119491
child 37 518b245aa84c
child 79 2981cb3aa489
equal deleted inserted replaced
23:238255e8b033 25:84d9eb65b26f
     1 // Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #include <smstestbase.h>
       
    17 #include <mmlist.h>
       
    18 
       
    19 
       
    20 class CSmsSimParamOperation;
       
    21 class CAutoTest;
       
    22 
       
    23 
       
    24 _LIT(KSmsScTestName, "Reading and Writing SIM parameters");
       
    25 
       
    26 class CSmsScTest : public CSmsTestBase
       
    27 	{
       
    28 public:
       
    29 	static CSmsScTest* NewLC(CAutoTest& aAutoTest, CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aNextTest);
       
    30 	~CSmsScTest();
       
    31 
       
    32 	void ReadInitialParamsL(TRequestStatus& aStatus);
       
    33 	void WriteOriginalParamsL(TRequestStatus& aStatus);
       
    34 	void RoundTripTestL(const CMobilePhoneSmspList& aList, TRequestStatus& aStatus);
       
    35 
       
    36 	void TestReadParamsFailL();
       
    37 	void TestWriteParamsFailL(const CMobilePhoneSmspList& aList);
       
    38 
       
    39 	//inline const CMobilePhoneSmspList& OriginalList() const {return iOriginalParams->SmspParams();}
       
    40 	inline const CSmsSimParamOperation& OriginalOperation() const {return *iOriginalParams;}
       
    41 
       
    42 	static void PrintListL(RTest& aTest, const CMobilePhoneSmspList& aList);
       
    43 	static void PrintEntry(RTest& aTest, const RMobileSmsMessaging::TMobileSmspEntryV1& aEntry);
       
    44 
       
    45 private:
       
    46 
       
    47 	CSmsScTest(CAutoTest& aAutoTest, CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aNextTest);
       
    48 
       
    49 	void WriteSimParamsL();
       
    50 	void ReadAfterWriteL();
       
    51 	
       
    52 	void DoRunReadInitialParamsL();
       
    53 	void DoRunWriteSimParamsL();
       
    54 	void DoRunReadAfterWriteL();
       
    55 	void DoRunWriteOriginalParamsL();
       
    56 
       
    57 	TBool CompareListsL(const CMobilePhoneSmspList& aWritten, const CMobilePhoneSmspList& aRead);
       
    58 	TBool CompareEntries(const RMobileSmsMessaging::TMobileSmspEntryV1& aWritten, const RMobileSmsMessaging::TMobileSmspEntryV1& aRead);
       
    59 
       
    60 	void ConstructL();
       
    61 
       
    62 	void RunL();
       
    63 	void DoCancel();
       
    64 
       
    65 	void ShowMenuL();
       
    66 	void RunAutoL();
       
    67 
       
    68 	void Queue(TRequestStatus& aStatus);
       
    69 	void Complete(TInt aError);
       
    70 	TInt RunError(TInt aError);
       
    71 
       
    72 private:
       
    73 
       
    74 	enum TSmsSendTestState
       
    75 	/**	@enum	TSmsSendTestState
       
    76 	 *	Enum defining the states of this test harness
       
    77 	 */
       
    78 		{
       
    79 		EStateWaiting,
       
    80 		EStateReadInitialParams,
       
    81 		EStateWriteSimParams,
       
    82 		EStateReadAfterWrite,
       
    83 		EStateWriteOriginalParams
       
    84 		} iState;
       
    85 
       
    86 	CSmsSimParamOperation* iOriginalParams;		//< The operation contains the original parameters
       
    87 	const CMobilePhoneSmspList* iListToWrite;	//< The list contains the new parameters to write
       
    88 	TRequestStatus* iReport;					//< A request status
       
    89 	CAutoTest& iAutoTest;						//< An auto test
       
    90 	};