telephonyserverplugins/simtsy/test/Te_Sim/Te_SimPacketRel99Rel5QOSTest.cpp
changeset 0 3553901f7fa8
child 24 6638e7f4bd8f
equal deleted inserted replaced
-1:000000000000 0:3553901f7fa8
       
     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 // Te_SimPacketRel4Rel5QOSTest.cpp
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file
       
    20 */
       
    21 
       
    22 #include "Te_SimPacketRel99Rel5QOSTest.h"
       
    23 
       
    24 CSimPacketRel99Rel5QOSTest::CSimPacketRel99Rel5QOSTest() 
       
    25 	{ 
       
    26 	SetTestStepName(_L("Rel99Rel5QOSTest"));
       
    27 	}
       
    28 
       
    29 TVerdict CSimPacketRel99Rel5QOSTest::doTestStepL()
       
    30 	{
       
    31 	INFO_PRINTF1(_L("BeginPacketR4R5QOSTest"));
       
    32 
       
    33  	CreateConfigFileL(_L("c:\\config3.txt"));
       
    34  	SetTestNumberL(20);
       
    35 
       
    36 	TInt ret = iPhone.Open(iTelServer,KPhoneName); 
       
    37 	INFO_PRINTF2(_L("Result: %d"),ret);
       
    38 	TESTL(ret == KErrNone); 
       
    39 	INFO_PRINTF1(_L("Opened phone object"));
       
    40 	TESTL(iPacketService.Open(iPhone)==KErrNone);
       
    41 	INFO_PRINTF1(_L("Opened Packet object"));
       
    42 	TName contextName;
       
    43 	TName contextNameCompare;
       
    44 	TESTL(iFirstPrimaryPacketContext.OpenNewContext(iPacketService, contextName)==KErrNone);
       
    45 	contextNameCompare.Append(KSimPrimaryPacketContextName);
       
    46 	contextNameCompare.AppendNum(1);
       
    47 	TESTL(contextName.Compare(contextNameCompare)==KErrNone);
       
    48 	INFO_PRINTF1(_L("Opened Context object"));
       
    49 
       
    50 	TRequestStatus reqStatus, notifyR99Status, notifyR5Status;
       
    51 
       
    52 	// open Release99 Qos Profile Params
       
    53 	TName qosName;
       
    54 	TESTL(iRel99Packetqos.OpenNewQoS(iFirstPrimaryPacketContext, qosName)==KErrNone);
       
    55 	INFO_PRINTF1(_L("Opened Rel99 QoS object"));
       
    56 
       
    57 	// open Release5 Qos Profile Params
       
    58 	TESTL(iRel5Packetqos.OpenExistingQoS(iFirstPrimaryPacketContext, qosName)==KErrNone);
       
    59 	INFO_PRINTF1(_L("Opened R5 QoS object"));
       
    60 
       
    61 	// Set Profile on Rel99 QoS, check that getting profile on Rel5 Qos gives Rel99 neg values
       
    62 	// check notification on both release
       
    63 	RPacketQoS::TQoSR99_R4Negotiated aR99QoSNegNotifFromR99ProfileConfig;
       
    64 	TPckg<RPacketQoS::TQoSR99_R4Negotiated> aR99QoSNegNotifFromR99ProfilePckg(aR99QoSNegNotifFromR99ProfileConfig);
       
    65 	iRel99Packetqos.NotifyProfileChanged(notifyR99Status,aR99QoSNegNotifFromR99ProfilePckg);
       
    66 
       
    67 	RPacketQoS::TQoSR5Negotiated aR5QoSNegNotifFromR99ProfileConfig;
       
    68 	TPckg<RPacketQoS::TQoSR5Negotiated> aR5QoSNegNotifFromR99ProfilePckg(aR5QoSNegNotifFromR99ProfileConfig);
       
    69 	iRel5Packetqos.NotifyProfileChanged(notifyR5Status,aR5QoSNegNotifFromR99ProfilePckg);
       
    70 
       
    71 	// set the profile
       
    72 	TInt req = 4;
       
    73 	TInt min = 2; 	
       
    74 	RPacketQoS::TQoSR99_R4Requested aR99QoSReqConfig;
       
    75 	TPckg<RPacketQoS::TQoSR99_R4Requested> aR99QoSReqPckg(aR99QoSReqConfig);
       
    76 	aR99QoSReqConfig.iReqTrafficClass = RPacketQoS::ETrafficClassStreaming; // 0x04
       
    77 	aR99QoSReqConfig.iMinTrafficClass = RPacketQoS::ETrafficClassConversational; // 0x02
       
    78 	aR99QoSReqConfig.iReqDeliveryOrderReqd = RPacketQoS::EDeliveryOrderNotRequired; // 0x04
       
    79 	aR99QoSReqConfig.iMinDeliveryOrderReqd = RPacketQoS::EDeliveryOrderRequired;	// 0x02
       
    80 	aR99QoSReqConfig.iReqDeliverErroneousSDU = RPacketQoS::EErroneousSDUDeliveryNotRequired; // 0x08
       
    81 	aR99QoSReqConfig.iMinDeliverErroneousSDU = RPacketQoS::EErroneousSDUDeliveryRequired; // 0x04
       
    82 	aR99QoSReqConfig.iReqMaxSDUSize = req; // 4	
       
    83 	aR99QoSReqConfig.iMinAcceptableMaxSDUSize = min; // 2
       
    84 	aR99QoSReqConfig.iReqMaxRate.iUplinkRate = min;	// between 0 - 1840
       
    85 	aR99QoSReqConfig.iReqMaxRate.iDownlinkRate = min;
       
    86 	aR99QoSReqConfig.iMinAcceptableMaxRate.iDownlinkRate = min-1; // between 0 - 1840
       
    87 	aR99QoSReqConfig.iMinAcceptableMaxRate.iUplinkRate = req;
       
    88 	aR99QoSReqConfig.iReqBER = RPacketQoS::EBEROnePerHundred;	// 0x04
       
    89 	aR99QoSReqConfig.iMaxBER = RPacketQoS::EBERFivePerHundred;	// 0x02
       
    90 	aR99QoSReqConfig.iReqSDUErrorRatio = RPacketQoS::ESDUErrorRatioSevenPerThousand; // 0x08
       
    91 	aR99QoSReqConfig.iMaxSDUErrorRatio = RPacketQoS::ESDUErrorRatioOnePerHundred;	// 0x04
       
    92 	aR99QoSReqConfig.iReqTrafficHandlingPriority = RPacketQoS::ETrafficPriority2; // 0x04
       
    93 	aR99QoSReqConfig.iMinTrafficHandlingPriority = RPacketQoS::ETrafficPriority1; // 0x02
       
    94 	aR99QoSReqConfig.iReqTransferDelay = req;
       
    95 	aR99QoSReqConfig.iMaxTransferDelay = min;
       
    96 	aR99QoSReqConfig.iReqGuaranteedRate.iDownlinkRate = min;
       
    97 	aR99QoSReqConfig.iReqGuaranteedRate.iUplinkRate = req;
       
    98 	aR99QoSReqConfig.iMinGuaranteedRate.iDownlinkRate = min;
       
    99 	aR99QoSReqConfig.iMinGuaranteedRate.iUplinkRate = req;
       
   100 	
       
   101 	iRel99Packetqos.SetProfileParameters(reqStatus, aR99QoSReqPckg);
       
   102 	User::WaitForRequest(reqStatus);
       
   103 	TESTL(reqStatus.Int()==KErrNone);
       
   104 
       
   105 	// wait for notifications on both QoS
       
   106 	User::WaitForRequest(notifyR99Status);
       
   107 	User::WaitForRequest(notifyR5Status);
       
   108 
       
   109 	// GetProfileParameters
       
   110 	RPacketQoS::TQoSR5Negotiated aR5QoSNegConfig;
       
   111 	TPckg<RPacketQoS::TQoSR5Negotiated> aR5QoSNegPckg(aR5QoSNegConfig);
       
   112 	iRel5Packetqos.GetProfileParameters(reqStatus,aR5QoSNegPckg);
       
   113 	User::WaitForRequest(reqStatus);
       
   114 	TESTL(reqStatus.Int()==KErrNone);
       
   115 
       
   116 	// validate profile returned by GetProfileParameters. Expect data from QosProfileNegR99 tag
       
   117 	TEST(aR5QoSNegConfig.ExtensionId()==TPacketDataConfigBase::KConfigRel5);
       
   118 	TEST(aR5QoSNegConfig.iTrafficClass==RPacketQoS::ETrafficClassConversational);
       
   119 	TEST(aR5QoSNegConfig.iDeliveryOrderReqd==RPacketQoS::EDeliveryOrderNotRequired);
       
   120 	TEST(aR5QoSNegConfig.iDeliverErroneousSDU==RPacketQoS::EErroneousSDUNoDetection);
       
   121 	TEST(aR5QoSNegConfig.iMaxSDUSize==min);
       
   122 	TEST(aR5QoSNegConfig.iMaxRate.iUplinkRate==min);
       
   123 	TEST(aR5QoSNegConfig.iMaxRate.iDownlinkRate==req);
       
   124 	TEST(aR5QoSNegConfig.iBER==RPacketQoS::EBEROnePerHundred);
       
   125 	TEST(aR5QoSNegConfig.iSDUErrorRatio==RPacketQoS::ESDUErrorRatioOnePerTen);
       
   126 	TEST(aR5QoSNegConfig.iTrafficHandlingPriority==RPacketQoS::ETrafficPriority2);
       
   127 	TEST(aR5QoSNegConfig.iTransferDelay==min);
       
   128 	TEST(aR5QoSNegConfig.iGuaranteedRate.iUplinkRate==min);
       
   129 	TEST(aR5QoSNegConfig.iGuaranteedRate.iDownlinkRate==req);	
       
   130 	TEST(aR5QoSNegConfig.iSignallingIndication==EFalse);	
       
   131 	TEST(aR5QoSNegConfig.iSourceStatisticsDescriptor==RPacketQoS::ESourceStatisticsDescriptorUnknown);	
       
   132 
       
   133 	// check profile returned in the R5 notification
       
   134 	TEST(aR5QoSNegNotifFromR99ProfileConfig.ExtensionId()==TPacketDataConfigBase::KConfigRel5);
       
   135 	TestEquals(aR5QoSNegConfig, aR5QoSNegNotifFromR99ProfileConfig);
       
   136 	// check profile returned in the R99 notification
       
   137 	TEST(aR99QoSNegNotifFromR99ProfileConfig.ExtensionId()==TPacketDataConfigBase::KConfigRel99Rel4);
       
   138 	TestEquals(aR5QoSNegConfig, aR99QoSNegNotifFromR99ProfileConfig);
       
   139 
       
   140 	// wait for next notification, tigged by QosNetworkNotification 
       
   141 	iRel99Packetqos.NotifyProfileChanged(notifyR99Status,aR99QoSNegNotifFromR99ProfilePckg);
       
   142 	iRel5Packetqos.NotifyProfileChanged(notifyR5Status,aR5QoSNegNotifFromR99ProfilePckg);
       
   143 	User::WaitForRequest(notifyR99Status);
       
   144 	User::WaitForRequest(notifyR5Status);
       
   145 
       
   146 	// GetProfileParameters
       
   147 	iRel5Packetqos.GetProfileParameters(reqStatus,aR5QoSNegPckg);
       
   148 	User::WaitForRequest(reqStatus);
       
   149 	TESTL(reqStatus.Int()==KErrNone);
       
   150 
       
   151 	// validate profile returned by GetProfileParameters. Expect data from QosNetworkNotification tag
       
   152 	TEST(aR5QoSNegConfig.ExtensionId()==TPacketDataConfigBase::KConfigRel5);
       
   153 	TEST(aR5QoSNegConfig.iTrafficClass==RPacketQoS::ETrafficClassBackground);
       
   154 	TEST(aR5QoSNegConfig.iDeliveryOrderReqd==RPacketQoS::EDeliveryOrderNotRequired);
       
   155 	TEST(aR5QoSNegConfig.iDeliverErroneousSDU==RPacketQoS::EErroneousSDUNoDetection);
       
   156 	TEST(aR5QoSNegConfig.iMaxSDUSize==req*2);
       
   157 	TEST(aR5QoSNegConfig.iMaxRate.iUplinkRate==min*2);
       
   158 	TEST(aR5QoSNegConfig.iMaxRate.iDownlinkRate==req*2);
       
   159 	TEST(aR5QoSNegConfig.iBER==RPacketQoS::EBERFivePerThousand);
       
   160 	TEST(aR5QoSNegConfig.iSDUErrorRatio==RPacketQoS::ESDUErrorRatioOnePerThousand);
       
   161 	TEST(aR5QoSNegConfig.iTrafficHandlingPriority==RPacketQoS::ETrafficPriority3);
       
   162 	TEST(aR5QoSNegConfig.iTransferDelay==min*2);
       
   163 	TEST(aR5QoSNegConfig.iGuaranteedRate.iUplinkRate==min*2);
       
   164 	TEST(aR5QoSNegConfig.iGuaranteedRate.iDownlinkRate==req*2);	
       
   165 	TEST(aR5QoSNegConfig.iSignallingIndication==EFalse);	
       
   166 	TEST(aR5QoSNegConfig.iSourceStatisticsDescriptor==RPacketQoS::ESourceStatisticsDescriptorUnknown);	
       
   167 
       
   168 	// check profile returned in the R5 notification
       
   169 	TEST(aR5QoSNegNotifFromR99ProfileConfig.ExtensionId()==TPacketDataConfigBase::KConfigRel5);
       
   170 	TestEquals(aR5QoSNegConfig, aR5QoSNegNotifFromR99ProfileConfig);
       
   171 	// check profile returned in the R99 notification
       
   172 	TEST(aR99QoSNegNotifFromR99ProfileConfig.ExtensionId()==TPacketDataConfigBase::KConfigRel99Rel4);
       
   173 	TestEquals(aR5QoSNegConfig, aR99QoSNegNotifFromR99ProfileConfig);
       
   174 
       
   175 	// cleanup
       
   176 	iRel99Packetqos.NotifyProfileChanged(notifyR99Status,aR99QoSNegNotifFromR99ProfilePckg);
       
   177 	iRel99Packetqos.CancelAsyncRequest(EPacketQoSNotifyProfileChanged);
       
   178 	User::WaitForRequest(notifyR99Status);
       
   179 
       
   180 	iRel5Packetqos.NotifyProfileChanged(notifyR5Status,aR5QoSNegNotifFromR99ProfilePckg);
       
   181 	iRel5Packetqos.CancelAsyncRequest(EPacketQoSNotifyProfileChanged);
       
   182 	User::WaitForRequest(notifyR5Status);
       
   183 		
       
   184 	iRel5Packetqos.Close();
       
   185 	iRel99Packetqos.Close();
       
   186 
       
   187 	// Set Profile on Rel5 QoS, check that getting profile on Rel99 Qos gives Rel5 neg values
       
   188 	// check notification on both release
       
   189 	TESTL(iRel99Packetqos.OpenNewQoS(iFirstPrimaryPacketContext, qosName)==KErrNone);
       
   190 	TESTL(iRel5Packetqos.OpenExistingQoS(iFirstPrimaryPacketContext, qosName)==KErrNone);
       
   191 
       
   192 	RPacketQoS::TQoSR5Negotiated aR5QoSNegNotifFromR5ProfileConfig;
       
   193 	TPckg<RPacketQoS::TQoSR5Negotiated> aR5QoSNegNotifFromR5ProfilePckg(aR5QoSNegNotifFromR5ProfileConfig);
       
   194 	iRel5Packetqos.NotifyProfileChanged(notifyR5Status,aR5QoSNegNotifFromR5ProfilePckg);
       
   195 
       
   196 	RPacketQoS::TQoSR99_R4Negotiated aR99QoSNegNotifFromR5ProfileConfig;
       
   197 	TPckg<RPacketQoS::TQoSR99_R4Negotiated> aR99QoSNegNotifFromR5ProfilePckg(aR99QoSNegNotifFromR5ProfileConfig);
       
   198 	iRel99Packetqos.NotifyProfileChanged(notifyR99Status,aR99QoSNegNotifFromR5ProfilePckg);
       
   199 
       
   200 	// set the profile
       
   201 	RPacketQoS::TQoSR5Requested aR5QoSReqConfig;
       
   202 	TPckg<RPacketQoS::TQoSR5Requested> aR5QoSReqPckg(aR5QoSReqConfig);
       
   203 	aR5QoSReqConfig.iReqTrafficClass = RPacketQoS::ETrafficClassInteractive; // 0x08
       
   204 	aR5QoSReqConfig.iMinTrafficClass = RPacketQoS::ETrafficClassBackground; // 0x10
       
   205 	aR5QoSReqConfig.iReqDeliveryOrderReqd = RPacketQoS::EDeliveryOrderRequired;	// 0x02
       
   206 	aR5QoSReqConfig.iMinDeliveryOrderReqd = RPacketQoS::EDeliveryOrderNotRequired; // 0x04
       
   207 	aR5QoSReqConfig.iReqDeliverErroneousSDU = RPacketQoS::EErroneousSDUNoDetection; // 0x02
       
   208 	aR5QoSReqConfig.iMinDeliverErroneousSDU = RPacketQoS::EErroneousSDUDeliveryUnspecified; // 0x01
       
   209 	aR5QoSReqConfig.iReqMaxSDUSize = req*2; // 8	
       
   210 	aR5QoSReqConfig.iMinAcceptableMaxSDUSize = min*2; // 4
       
   211 	aR5QoSReqConfig.iReqMaxRate.iUplinkRate = min*2;	// between 0 - 1840
       
   212 	aR5QoSReqConfig.iReqMaxRate.iDownlinkRate = min*2;
       
   213 	aR5QoSReqConfig.iMinAcceptableMaxRate.iDownlinkRate = (min-1)*2; // between 0 - 1840
       
   214 	aR5QoSReqConfig.iMinAcceptableMaxRate.iUplinkRate = req*2;
       
   215 	aR5QoSReqConfig.iReqBER = RPacketQoS::EBERFourPerThousand; // 0x10
       
   216 	aR5QoSReqConfig.iMaxBER = RPacketQoS::EBERFivePerThousand; // 0x08
       
   217 	aR5QoSReqConfig.iReqSDUErrorRatio = RPacketQoS::ESDUErrorRatioOnePerTenThousand; // 0x20
       
   218 	aR5QoSReqConfig.iMaxSDUErrorRatio = RPacketQoS::ESDUErrorRatioOnePerThousand; // 0x10
       
   219 	aR5QoSReqConfig.iReqTrafficHandlingPriority = RPacketQoS::ETrafficPriority3; // 0x08
       
   220 	aR5QoSReqConfig.iMinTrafficHandlingPriority = RPacketQoS::ETrafficPriority2; // 0x04
       
   221 	aR5QoSReqConfig.iReqTransferDelay = req*2;
       
   222 	aR5QoSReqConfig.iMaxTransferDelay = min*2;
       
   223 	aR5QoSReqConfig.iReqGuaranteedRate.iDownlinkRate = min*2;
       
   224 	aR5QoSReqConfig.iReqGuaranteedRate.iUplinkRate = req*2;
       
   225 	aR5QoSReqConfig.iMinGuaranteedRate.iDownlinkRate = min*2;
       
   226 	aR5QoSReqConfig.iMinGuaranteedRate.iUplinkRate = req*2;
       
   227 	aR5QoSReqConfig.iSignallingIndication = ETrue;			 
       
   228 	aR5QoSReqConfig.iSourceStatisticsDescriptor = RPacketQoS::ESourceStatisticsDescriptorSpeech;
       
   229 	
       
   230 	iRel5Packetqos.SetProfileParameters(reqStatus, aR5QoSReqPckg);
       
   231 	User::WaitForRequest(reqStatus);
       
   232 	TESTL(reqStatus.Int()==KErrNone);
       
   233 	// wait for notifications on both QoS
       
   234 	User::WaitForRequest(notifyR5Status);
       
   235 	User::WaitForRequest(notifyR99Status);
       
   236 
       
   237 	// GetProfileParameters
       
   238 	RPacketQoS::TQoSR99_R4Negotiated aR99QoSNegConfig;
       
   239 	TPckg<RPacketQoS::TQoSR99_R4Negotiated> aR99QoSNegPckg(aR99QoSNegConfig);
       
   240 	iRel99Packetqos.GetProfileParameters(reqStatus,aR99QoSNegPckg);
       
   241 	User::WaitForRequest(reqStatus);
       
   242 	TESTL(reqStatus.Int()==KErrNone);
       
   243 
       
   244 	// validate profile returned by GetProfileParameters. Expect data from QosProfileNegR99 tag
       
   245 	TEST(aR99QoSNegConfig.ExtensionId()==TPacketDataConfigBase::KConfigRel99Rel4);
       
   246 	TEST(aR99QoSNegConfig.iTrafficClass==RPacketQoS::ETrafficClassBackground);
       
   247 	TEST(aR99QoSNegConfig.iDeliveryOrderReqd==RPacketQoS::EDeliveryOrderNotRequired);
       
   248 	TEST(aR99QoSNegConfig.iDeliverErroneousSDU==RPacketQoS::EErroneousSDUNoDetection);
       
   249 	TEST(aR99QoSNegConfig.iMaxSDUSize==req*2);
       
   250 	TEST(aR99QoSNegConfig.iMaxRate.iUplinkRate==min*2);
       
   251 	TEST(aR99QoSNegConfig.iMaxRate.iDownlinkRate==req*2);
       
   252 	TEST(aR99QoSNegConfig.iBER==RPacketQoS::EBERFivePerThousand);
       
   253 	TEST(aR99QoSNegConfig.iSDUErrorRatio==RPacketQoS::ESDUErrorRatioOnePerThousand);
       
   254 	TEST(aR99QoSNegConfig.iTrafficHandlingPriority==RPacketQoS::ETrafficPriority3);
       
   255 	TEST(aR99QoSNegConfig.iTransferDelay==min*2);
       
   256 	TEST(aR99QoSNegConfig.iGuaranteedRate.iUplinkRate==min*2);
       
   257 	TEST(aR99QoSNegConfig.iGuaranteedRate.iDownlinkRate==req*2);	
       
   258 
       
   259 	// check profile returned in the R99 notification
       
   260 	TEST(aR99QoSNegNotifFromR5ProfileConfig.ExtensionId()==TPacketDataConfigBase::KConfigRel99Rel4);
       
   261 	TestEquals(aR99QoSNegConfig, aR99QoSNegNotifFromR5ProfileConfig);
       
   262 	// check profile returned in the R5 notification
       
   263 	TEST(aR5QoSNegNotifFromR5ProfileConfig.ExtensionId()==TPacketDataConfigBase::KConfigRel5);
       
   264 	TestEquals(aR99QoSNegConfig, aR5QoSNegNotifFromR5ProfileConfig);
       
   265 
       
   266 	// wait for next notification, tigged by QosNetworkNotification 
       
   267 	iRel5Packetqos.NotifyProfileChanged(notifyR5Status,aR5QoSNegNotifFromR5ProfilePckg);
       
   268 	iRel99Packetqos.NotifyProfileChanged(notifyR99Status,aR99QoSNegNotifFromR5ProfilePckg);
       
   269 	User::WaitForRequest(notifyR5Status);
       
   270 	User::WaitForRequest(notifyR99Status);
       
   271 
       
   272 	// GetProfileParameters
       
   273 	iRel99Packetqos.GetProfileParameters(reqStatus,aR99QoSNegPckg);
       
   274 	User::WaitForRequest(reqStatus);
       
   275 	TESTL(reqStatus.Int()==KErrNone);
       
   276 
       
   277 	// validate profile returned by GetProfileParameters. Expect data from QosR5NetworkNotification tag
       
   278 	TEST(aR99QoSNegConfig.ExtensionId()==TPacketDataConfigBase::KConfigRel99Rel4);
       
   279 	TEST(aR99QoSNegConfig.iTrafficClass==RPacketQoS::ETrafficClassInteractive); //0x08
       
   280 	TEST(aR99QoSNegConfig.iDeliveryOrderReqd==RPacketQoS::EDeliveryOrderNotRequired); // 0x04
       
   281 	TEST(aR99QoSNegConfig.iDeliverErroneousSDU==RPacketQoS::EErroneousSDUDeliveryNotRequired); //0x08
       
   282 	TEST(aR99QoSNegConfig.iMaxSDUSize==req);
       
   283 	TEST(aR99QoSNegConfig.iMaxRate.iUplinkRate==min);
       
   284 	TEST(aR99QoSNegConfig.iMaxRate.iDownlinkRate==req);
       
   285 	TEST(aR99QoSNegConfig.iBER==RPacketQoS::EBERFivePerHundred); // 0x02
       
   286 	TEST(aR99QoSNegConfig.iSDUErrorRatio==RPacketQoS::ESDUErrorRatioOnePerHundredThousand); //0x40
       
   287 	TEST(aR99QoSNegConfig.iTrafficHandlingPriority==RPacketQoS::ETrafficPriority2); // 0x04
       
   288 	TEST(aR99QoSNegConfig.iTransferDelay==min);
       
   289 	TEST(aR99QoSNegConfig.iGuaranteedRate.iUplinkRate==min);
       
   290 	TEST(aR99QoSNegConfig.iGuaranteedRate.iDownlinkRate==req);	
       
   291 
       
   292 	// check profile returned in the R5 notification
       
   293 	TEST(aR5QoSNegNotifFromR99ProfileConfig.ExtensionId()==TPacketDataConfigBase::KConfigRel5);
       
   294 	TestEquals(aR99QoSNegConfig, aR5QoSNegNotifFromR5ProfileConfig);
       
   295 	// check profile returned in the R99 notification
       
   296 	TEST(aR99QoSNegNotifFromR99ProfileConfig.ExtensionId()==TPacketDataConfigBase::KConfigRel99Rel4);
       
   297 	TestEquals(aR99QoSNegConfig, aR99QoSNegNotifFromR5ProfileConfig);
       
   298 
       
   299 	// cleanup
       
   300 	iRel99Packetqos.NotifyProfileChanged(notifyR99Status,aR99QoSNegNotifFromR5ProfilePckg);
       
   301 	iRel99Packetqos.CancelAsyncRequest(EPacketQoSNotifyProfileChanged);
       
   302 	User::WaitForRequest(notifyR99Status);
       
   303 
       
   304 	iRel5Packetqos.NotifyProfileChanged(notifyR5Status,aR5QoSNegNotifFromR5ProfilePckg);
       
   305 	iRel5Packetqos.CancelAsyncRequest(EPacketQoSNotifyProfileChanged);
       
   306 	User::WaitForRequest(notifyR5Status);
       
   307 		
       
   308 
       
   309 	// End of RPacketQos tests
       
   310 	iRel5Packetqos.Close();
       
   311 	iRel99Packetqos.Close();
       
   312 	iFirstPrimaryPacketContext.Close();
       
   313 	iPacketService.Close();
       
   314 	iPhone.Close();
       
   315 	ASSERT(RThread().RequestCount()==0);
       
   316 
       
   317 	return TestStepResult();
       
   318 	}
       
   319 
       
   320 
       
   321 void CSimPacketRel99Rel5QOSTest::TestEquals(const RPacketQoS::TQoSR99_R4Negotiated& aProfile1, const RPacketQoS::TQoSR99_R4Negotiated& aProfile2)
       
   322 	{
       
   323 	TEST(aProfile1.iTrafficClass==aProfile2.iTrafficClass);
       
   324 	TEST(aProfile1.iDeliveryOrderReqd==aProfile2.iDeliveryOrderReqd);
       
   325 	TEST(aProfile1.iDeliverErroneousSDU==aProfile2.iDeliverErroneousSDU);
       
   326 	TEST(aProfile1.iMaxSDUSize==aProfile2.iMaxSDUSize);
       
   327 	TEST(aProfile1.iMaxRate.iUplinkRate==aProfile2.iMaxRate.iUplinkRate);
       
   328 	TEST(aProfile1.iMaxRate.iDownlinkRate==aProfile2.iMaxRate.iDownlinkRate);
       
   329 	TEST(aProfile1.iBER==aProfile2.iBER);
       
   330 	TEST(aProfile1.iSDUErrorRatio==aProfile2.iSDUErrorRatio);
       
   331 	TEST(aProfile1.iTrafficHandlingPriority==aProfile2.iTrafficHandlingPriority);
       
   332 	TEST(aProfile1.iTransferDelay==aProfile2.iTransferDelay);
       
   333 	TEST(aProfile1.iGuaranteedRate.iUplinkRate==aProfile2.iGuaranteedRate.iUplinkRate);
       
   334 	TEST(aProfile1.iGuaranteedRate.iDownlinkRate==aProfile2.iGuaranteedRate.iDownlinkRate);	
       
   335 	}