messagingfw/msgtestfw/TestActions/Sms/src/CMtfTestActionCompareLastSegmentReport.cpp
changeset 62 db3f5fa34ec7
parent 0 8e480a14352b
equal deleted inserted replaced
60:9f5ae1728557 62:db3f5fa34ec7
       
     1 // Copyright (c) 2006-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 // __ACTION_INFO_BEGIN__ 
       
    15 // [Action Name]
       
    16 // CompareLastSegmentReport
       
    17 // [Action Parameters]
       
    18 // smsSettingsOrg			input 			CSmsSettings
       
    19 // smsSettingsRef			input			CSmsSettings
       
    20 // [Action Description]
       
    21 // CompareLastSegmentReport Test Action is intended to compare the saved SMS service settings given in the SMS settings file  
       
    22 // with the loaded SMS service settings values from the Central Repository for the last segment status report request . 
       
    23 // [APIs Used]
       
    24 // CSmsSettings::LastSegmentDeliveryReport
       
    25 // __ACTION_INFO_END__
       
    26 // 
       
    27 //
       
    28 
       
    29 /**
       
    30  @file
       
    31 */
       
    32 
       
    33 
       
    34 #include "CMtfTestCase.h"
       
    35 #include "CMtfTestActionParameters.h"
       
    36 #include "CMtfTestActionCompareLastSegmentReport.h"
       
    37 
       
    38 
       
    39 /**
       
    40   Function : NewL
       
    41   Description : 
       
    42   @internalTechnology
       
    43   @param : aTestCase - CMtfTestCase for the CMtfTestAction base class
       
    44   @param : aActionParameters - CMtfTestActionParameters 
       
    45   @return : CMtfTestAction* - a base class pointer to the newly created CMtfTestActionCompareSmsSettingsCR object
       
    46   @pre none
       
    47   @post none
       
    48 */
       
    49 CMtfTestAction* CMtfTestActionCompareLastSegmentReport::NewL(CMtfTestCase& aTestCase,CMtfTestActionParameters* aActionParameters)
       
    50 	{
       
    51 	CMtfTestActionCompareLastSegmentReport* self = new (ELeave) CMtfTestActionCompareLastSegmentReport(aTestCase);
       
    52 	CleanupStack::PushL(self);
       
    53 	self->ConstructL(aActionParameters);
       
    54 	CleanupStack::Pop();
       
    55 	return self;
       
    56 	}
       
    57 	
       
    58 /**
       
    59   Function : CMtfTestActionCompareLastSegmentReport
       
    60   Description : Constructor
       
    61   @internalTechnology
       
    62   @param : aTestCase - CMtfTestCase for the CMtfTestAction base class
       
    63   @return : N/A
       
    64   @pre none
       
    65   @post none
       
    66 */
       
    67 CMtfTestActionCompareLastSegmentReport::CMtfTestActionCompareLastSegmentReport(CMtfTestCase& aTestCase)
       
    68 	: CMtfSynchronousTestAction(aTestCase)
       
    69 	{
       
    70 	}
       
    71 
       
    72 /**
       
    73   Function : ~CMtfTestActionCompareLastSegmentReport
       
    74   Description : Destructor
       
    75   @internalTechnology
       
    76   @param :
       
    77   @return : 
       
    78   @pre 
       
    79   @post 
       
    80 */
       
    81 CMtfTestActionCompareLastSegmentReport::~CMtfTestActionCompareLastSegmentReport()
       
    82 	{
       
    83 	}
       
    84 
       
    85 /**
       
    86   Function : ExecuteActionL
       
    87   Description : Entry point for the this test action in the test framework
       
    88   @internalTechnology
       
    89   @param : none
       
    90   @return : void
       
    91   @pre none 
       
    92   @post none
       
    93 */
       
    94 void CMtfTestActionCompareLastSegmentReport::ExecuteActionL()
       
    95 	{
       
    96 	TestCase().INFO_PRINTF2(_L("Test Action %S start..."), &KTestActionCompareLastSegmentReport);
       
    97 	CSmsSettings* smsSettingsOrg = ObtainParameterReferenceL<CSmsSettings>(TestCase(),ActionParameters().Parameter(0) );
       
    98 	CSmsSettings* smsSettingsRef = ObtainParameterReferenceL<CSmsSettings>(TestCase(),ActionParameters().Parameter(1) );
       
    99 
       
   100 	if(	smsSettingsOrg->LastSegmentDeliveryReport() !=	smsSettingsRef->LastSegmentDeliveryReport())
       
   101 		{
       
   102 		// failed
       
   103 		TestCase().ERR_PRINTF1(_L("SMS Settings for the last segment report request do not match !"));
       
   104 		TestCase().SetTestStepResult(EFail);
       
   105 		}
       
   106 	TestCase().INFO_PRINTF2(_L("Test Action %S completed."), &KTestActionCompareLastSegmentReport);
       
   107 	TestCase().ActionCompletedL(*this);
       
   108 	}
       
   109 
       
   110