305 CleanupStack::PushL(smsMessage); |
305 CleanupStack::PushL(smsMessage); |
306 |
306 |
307 RSmsSocketReadStream readstream(aSocket); |
307 RSmsSocketReadStream readstream(aSocket); |
308 TRAPD(ret, readstream >> *smsMessage); |
308 TRAPD(ret, readstream >> *smsMessage); |
309 |
309 |
|
310 TPckgBuf<TUint> sbuf; |
310 TRequestStatus status; |
311 TRequestStatus status; |
311 |
312 |
312 // aDesc arguments passed to Ioctl() method have been changed to NULL to keep it compliant with |
|
313 // usage rules and to prevent OOM tests from failing |
|
314 if(ret==KErrNone) |
313 if(ret==KErrNone) |
315 { |
314 { |
316 aSocket.Ioctl(aIoctl, status, NULL, KSolSmsProv); |
315 aSocket.Ioctl(aIoctl, status, &sbuf, KSolSmsProv); |
317 User::WaitForRequest(status); |
316 User::WaitForRequest(status); |
318 CleanupStack::Pop(smsMessage); |
317 CleanupStack::Pop(smsMessage); |
319 TESTCHECK(status.Int(), KErrNone, "Notifying the SMS stack that message was received successfully"); |
318 TESTCHECK(status.Int(), KErrNone, "Notifying the SMS stack that message was received successfully"); |
320 INFO_PRINTF1(_L("Message received successfully")); |
319 INFO_PRINTF1(_L("Message received successfully")); |
321 } |
320 } |
322 //An error has occured, no message has been received |
321 //An error has occured, no message has been received |
323 else |
322 else |
324 { |
323 { |
325 aSocket.Ioctl(KIoctlReadMessageFailed, status, NULL, KSolSmsProv); |
324 aSocket.Ioctl(KIoctlReadMessageFailed, status, &sbuf, KSolSmsProv); |
326 User::WaitForRequest(status); |
325 User::WaitForRequest(status); |
327 TESTCHECK(status.Int(), KErrNone, "Notifying the SMS stack that message was not received"); |
326 TESTCHECK(status.Int(), KErrNone, "Notifying the SMS stack that message was not received"); |
328 ERR_PRINTF2(_L("Receiving message failed %d"), ret); |
327 ERR_PRINTF2(_L("Receiving message failed %d"), ret); |
329 User::Leave(ret); |
328 User::Leave(ret); |
330 } |
329 } |