datacommsserver/esockserver/test/TE_EsockTestSteps/src/Connections.TestSteps.cpp
changeset 30 df67dc5d759e
parent 25 e53adc4c49de
child 48 07656293a99c
equal deleted inserted replaced
25:e53adc4c49de 30:df67dc5d759e
   950 		INFO_PRINTF2(_L("%S: Connection name missing."),&iParams.iEventName);
   950 		INFO_PRINTF2(_L("%S: Connection name missing."),&iParams.iEventName);
   951 		return KErrNotFound;
   951 		return KErrNotFound;
   952 		}
   952 		}
   953 
   953 
   954 	TPtrC eventName;
   954 	TPtrC eventName;
   955 
   955     TInt event;
   956 	if (GetStringFromConfig(iSection,KTe_SelectedProgress,eventName)==1)
   956     if (GetIntFromConfig(iSection,KTe_SelectedProgress, event)==1)
       
   957         {
       
   958         iParams.iEventMask = event;
       
   959         }
       
   960     else if (GetStringFromConfig(iSection,KTe_SelectedProgress,eventName)==1)
   957 		{
   961 		{
   958 		if (eventName.Compare(KTe_LinkLayerOpen)==0)
   962 		if (eventName.Compare(KTe_LinkLayerOpen)==0)
   959 			{ iParams.iEventMask = KLinkLayerOpen; }
   963 			{ iParams.iEventMask = KLinkLayerOpen; }
   960 		else if (eventName.Compare(KTe_LinkLayerClosed)==0)
   964 		else if (eventName.Compare(KTe_LinkLayerClosed)==0)
   961 			{ iParams.iEventMask = KLinkLayerClosed; }
   965 			{ iParams.iEventMask = KLinkLayerClosed; }
  1007 	if (GetStringFromConfig(iSection,KTe_ConnEventsName,iParams.iEventName)!=1
  1011 	if (GetStringFromConfig(iSection,KTe_ConnEventsName,iParams.iEventName)!=1
  1008 	    || iParams.iEventName.Length()==0)
  1012 	    || iParams.iEventName.Length()==0)
  1009 		return KErrNotFound;
  1013 		return KErrNotFound;
  1010 
  1014 
  1011 	TPtrC eventName;
  1015 	TPtrC eventName;
  1012 
  1016     TInt event;
  1013 	if (GetStringFromConfig(iSection,KTe_SelectedProgress,eventName)==1)
  1017     if (GetIntFromConfig(iSection,KTe_SelectedProgress, event)==1)
       
  1018         {
       
  1019         iParams.iEventMask = event;
       
  1020         }
       
  1021     else if (GetStringFromConfig(iSection,KTe_SelectedProgress,eventName)==1)
  1014 		{
  1022 		{
  1015 		if (eventName.Compare(KTe_LinkLayerOpen)==0)
  1023 		if (eventName.Compare(KTe_LinkLayerOpen)==0)
  1016 			{ iParams.iEventMask = KLinkLayerOpen; }
  1024 			{ iParams.iEventMask = KLinkLayerOpen; }
  1017 		else if (eventName.Compare(KTe_LinkLayerClosed)==0)
  1025 		else if (eventName.Compare(KTe_LinkLayerClosed)==0)
  1018 			{ iParams.iEventMask = KLinkLayerClosed; }
  1026 			{ iParams.iEventMask = KLinkLayerClosed; }
  1109 	if (GetStringFromConfig(iSection,KTe_ConnEventsName,iParams.iEventName)!=1
  1117 	if (GetStringFromConfig(iSection,KTe_ConnEventsName,iParams.iEventName)!=1
  1110 	    || iParams.iEventName.Length()==0)
  1118 	    || iParams.iEventName.Length()==0)
  1111 		return KErrNotFound;
  1119 		return KErrNotFound;
  1112 
  1120 
  1113 	TPtrC eventName;
  1121 	TPtrC eventName;
  1114 
  1122 	TInt event;
  1115 	if (GetStringFromConfig(iSection,KTe_SelectedProgress,eventName)==1)
  1123 	if (GetIntFromConfig(iSection,KTe_SelectedProgress, event)==1)
  1116 		{
  1124 	    {
  1117 		if (eventName.Compare(KTe_LinkLayerOpen)==0)
  1125         iParams.iEventMask = event;
  1118 			{ iParams.iEventMask = KLinkLayerOpen; }
  1126 	    }
  1119 		else if (eventName.Compare(KTe_LinkLayerClosed)==0)
  1127 	else if (GetStringFromConfig(iSection,KTe_SelectedProgress,eventName)==1)
  1120 			{ iParams.iEventMask = KLinkLayerClosed; }
  1128 	    {
  1121 		else
  1129         if (eventName.Compare(KTe_LinkLayerOpen)==0)
  1122 			{
  1130             { iParams.iEventMask = KLinkLayerOpen; }
  1123 			INFO_PRINTF3(_L("%S: Event type (%S) not recognised."),&iParams.iEventName,&eventName);
  1131         else if (eventName.Compare(KTe_LinkLayerClosed)==0)
  1124 			return KErrNotFound;
  1132             { iParams.iEventMask = KLinkLayerClosed; }
  1125 			}
  1133         else
  1126 		}
  1134             {
  1127 	else
  1135             INFO_PRINTF3(_L("%S: Event type (%S) not recognised."),&iParams.iEventName,&eventName);
  1128 		{
  1136             return KErrNotFound;
  1129 		INFO_PRINTF1(_L("Event type missing."));
  1137             }
  1130 		return KErrNotFound;
  1138         }
  1131 		}
  1139     else
       
  1140         {
       
  1141         INFO_PRINTF1(_L("Event type missing."));
       
  1142         return KErrNotFound;
       
  1143         }	
  1132 
  1144 
  1133 	if (!GetIntFromConfig(iSection, KExpectedError, iExpectedError))
  1145 	if (!GetIntFromConfig(iSection, KExpectedError, iExpectedError))
  1134 		{
  1146 		{
  1135 		iExpectedError = KExpectedErrorNotUsed;
  1147 		iExpectedError = KExpectedErrorNotUsed;
  1136 		}
  1148 		}
  1155 TVerdict CCheckNegativeProgressNotificationStep::doSingleTestStep()
  1167 TVerdict CCheckNegativeProgressNotificationStep::doSingleTestStep()
  1156 	{
  1168 	{
  1157 	TNifProgress* event = NULL;
  1169 	TNifProgress* event = NULL;
  1158 	TInt err = iEsockTest->ReceiveProgressNotificationEvent(event, iParams.iEventName, iParams.iTimeoutMiliSecs);
  1170 	TInt err = iEsockTest->ReceiveProgressNotificationEvent(event, iParams.iEventName, iParams.iTimeoutMiliSecs);
  1159 
  1171 
  1160 	if (event == NULL || err == KErrNone)
  1172 	if (event == NULL && err == KErrNone)
  1161 		{
  1173 		{
  1162 		INFO_PRINTF2(_L("%S: Did not receive any event."),&iParams.iEventName);
  1174 		INFO_PRINTF2(_L("%S: Did not receive any event."),&iParams.iEventName);
  1163 
       
  1164 		return EPass;
  1175 		return EPass;
  1165 		}
  1176 		}
  1166 		else if (event == NULL || err != KErrNone)
  1177     else if (event == NULL || err != KErrNone)
  1167 		{
  1178         {
  1168 		INFO_PRINTF2(_L("%S: Did not receive any event but error condiction detected !"),&iParams.iEventName);
  1179         INFO_PRINTF2(_L("%S: Did not receive any event but error condiction detected !"),&iParams.iEventName);
  1169 		INFO_PRINTF2(_L("The error code returned was %d."),err);
  1180         INFO_PRINTF2(_L("The error code returned was %d."),err);
  1170 		return EFail;
  1181         return EFail;
  1171 		}
  1182         }
  1172 
  1183 
  1173 
  1184 
  1174 	TInt eventId = event->iStage;
  1185 	TInt eventId = event->iStage;
  1175 
  1186 
  1176 	if (eventId == KLinkLayerOpen )
  1187 	if (eventId == KLinkLayerOpen )