16 /** |
16 /** |
17 @file |
17 @file |
18 */ |
18 */ |
19 |
19 |
20 #include "te_smsprt_R6.h" |
20 #include "te_smsprt_R6.h" |
21 #include "e32def.h" |
21 |
22 #include "gsmunonieoperations.h" |
22 #include <gsmunonieoperations.h> |
23 |
23 #include <gsmubuf.h> |
|
24 #include <gsmuset.h> |
|
25 #include <gsmuieoperations.h> |
|
26 |
|
27 #include "smsstacktestconsts.h" |
|
28 #include "smsstacktestutilities.h" |
24 |
29 |
25 TVerdict CTestSinglePDUHyperLinks::doTestStepL() |
30 TVerdict CTestSinglePDUHyperLinks::doTestStepL() |
26 /** |
31 /** |
27 * Test a simple Transmit and Receive of a TPDU |
32 * Test a simple Transmit and Receive of a TPDU |
28 */ |
33 */ |
29 { |
34 { |
30 INFO_PRINTF1(_L("Test HyperLinks in SMS message")); |
35 INFO_PRINTF1(_L("Test HyperLinks in SMS message")); |
31 |
|
32 __UHEAP_MARK; |
|
33 |
|
34 RSocketServ socketServer; |
|
35 PrepareRegTestLC(socketServer, 70); |
|
36 |
|
37 RSocket socket; |
36 RSocket socket; |
38 iSmsStackTestUtils->OpenSmsSocketLC(socketServer,socket,ESmsAddrRecvAny); |
37 iSmsStackTestUtils->OpenSmsSocketLC(iSocketServer,socket,ESmsAddrRecvAny); |
39 |
38 |
40 //This is a 95 character msg. |
39 //This is a 95 character msg. |
41 _LIT(KTestMsg,"HyperLink message, Symbian. http://www.symbian.com Some content Intranet http://web.intra/homes"); |
40 _LIT(KTestMsg,"HyperLink message, Symbian. http://www.symbian.com Some content Intranet http://web.intra/homes"); |
42 |
41 |
43 //Set destination and SC numbers |
42 //Set destination and SC numbers |
44 iTelephoneNumber=KPekka; |
43 iTelephoneNumber=KPekka; |
45 iServiceCenterNumber=KRadiolinjaSC; |
44 iServiceCenterNumber=KRadiolinjaSC; |
46 |
45 |
47 //8 bit coding scheme |
46 //8 bit coding scheme |
48 TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit; |
47 TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit; |
49 CSmsMessage* smsMessage=CreateSmsMessageL(KTestMsg,alphabet); |
48 CSmsMessage* smsMessage=CreateSmsMessageLC(KTestMsg,alphabet); |
50 CleanupStack::PushL(smsMessage); |
|
51 |
49 |
52 INFO_PRINTF2(_L("Destination number:..... %S "),&iTelephoneNumber); |
50 INFO_PRINTF2(_L("Destination number:..... %S "),&iTelephoneNumber); |
53 INFO_PRINTF2(_L("ServiceCenter number:... %S "),&iServiceCenterNumber); |
51 INFO_PRINTF2(_L("ServiceCenter number:... %S "),&iServiceCenterNumber); |
54 |
52 |
55 //Get the operations |
53 //Get the operations |
194 //Multiple Hyperlink SMS |
193 //Multiple Hyperlink SMS |
195 INFO_PRINTF1(_L("waiting for incoming SMS with two hyperlinks...") ); |
194 INFO_PRINTF1(_L("waiting for incoming SMS with two hyperlinks...") ); |
196 WaitForRecvL(socket); |
195 WaitForRecvL(socket); |
197 smsMessage = RecvSmsL(socket); |
196 smsMessage = RecvSmsL(socket); |
198 CleanupStack::PushL(smsMessage); |
197 CleanupStack::PushL(smsMessage); |
|
198 |
199 TestSmsContentsL(smsMessage,KTestMsg); |
199 TestSmsContentsL(smsMessage,KTestMsg); |
200 //Get the operations |
200 //Get the operations |
201 CSmsHyperLinkOperations& multipleHyperLinkOperations = static_cast<CSmsHyperLinkOperations&>(smsMessage->GetOperationsForIEL(CSmsInformationElement::ESmsHyperLinkFormat)); |
201 CSmsHyperLinkOperations& multipleHyperLinkOperations = static_cast<CSmsHyperLinkOperations&>(smsMessage->GetOperationsForIEL(CSmsInformationElement::ESmsHyperLinkFormat)); |
202 //NumberOfHyperLinks |
202 //NumberOfHyperLinks |
203 count=multipleHyperLinkOperations.NumberOfHyperLinksL(); |
203 count=multipleHyperLinkOperations.NumberOfHyperLinksL(); |
227 count=noneHyperLinkOperations.NumberOfHyperLinksL(); |
227 count=noneHyperLinkOperations.NumberOfHyperLinksL(); |
228 TEST(count==0); |
228 TEST(count==0); |
229 CleanupStack::PopAndDestroy(smsMessage); |
229 CleanupStack::PopAndDestroy(smsMessage); |
230 |
230 |
231 CleanupStack::PopAndDestroy(&socket); |
231 CleanupStack::PopAndDestroy(&socket); |
232 CleanupStack::PopAndDestroy(&socketServer); |
|
233 |
|
234 __UHEAP_MARKEND; |
|
235 |
|
236 return TestStepResult() ; |
232 return TestStepResult() ; |
237 } |
233 } |
238 |
|
239 |
|
240 //Multiple PDU's |
|
241 |
234 |
242 TVerdict CTestMultiplePDUHyperLinks::doTestStepL() |
235 TVerdict CTestMultiplePDUHyperLinks::doTestStepL() |
243 /** |
236 /** |
244 * Test a simple Transmit and Receive of a TPDU |
237 * Test a simple Transmit and Receive of a TPDU |
245 */ |
238 */ |
246 { |
239 { |
247 INFO_PRINTF1(_L("Test multiple PDUs with hyperLinks in SMS message")); |
240 INFO_PRINTF1(_L("Test multiple PDUs with hyperLinks in SMS message")); |
248 |
|
249 __UHEAP_MARK; |
|
250 |
|
251 RSocketServ socketServer; |
|
252 PrepareRegTestLC(socketServer, 71); |
|
253 |
|
254 RSocket socket; |
241 RSocket socket; |
255 iSmsStackTestUtils->OpenSmsSocketLC(socketServer,socket,ESmsAddrRecvAny); |
242 iSmsStackTestUtils->OpenSmsSocketLC(iSocketServer,socket,ESmsAddrRecvAny); |
256 |
243 |
257 _LIT(KLongText,"YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBCCCCCCC"); |
244 _LIT(KLongText,"YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBCCCCCCC"); |
258 |
245 |
259 //Set destination and SC numbers |
246 //Set destination and SC numbers |
260 iTelephoneNumber=KPekka; |
247 iTelephoneNumber=KPekka; |
261 iServiceCenterNumber=KRadiolinjaSC; |
248 iServiceCenterNumber=KRadiolinjaSC; |
262 |
249 |
263 TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit; |
250 TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit; |
264 CSmsMessage* smsMessage=CreateSmsMessageL(KLongText,alphabet); |
251 CSmsMessage* smsMessage=CreateSmsMessageLC(KLongText,alphabet); |
265 |
|
266 CleanupStack::PushL(smsMessage); |
|
267 |
252 |
268 //Check number of hyperlinks |
253 //Check number of hyperlinks |
269 //Get the operations |
254 //Get the operations |
270 CSmsHyperLinkOperations& operations = |
255 CSmsHyperLinkOperations& operations = |
271 static_cast<CSmsHyperLinkOperations&>(smsMessage->GetOperationsForIEL(CSmsInformationElement::ESmsHyperLinkFormat)); |
256 static_cast<CSmsHyperLinkOperations&>(smsMessage->GetOperationsForIEL(CSmsInformationElement::ESmsHyperLinkFormat)); |
441 count=noHyperlinksInFirstPDUOperations.NumberOfHyperLinksL(); |
426 count=noHyperlinksInFirstPDUOperations.NumberOfHyperLinksL(); |
442 TEST(count==9); |
427 TEST(count==9); |
443 |
428 |
444 CleanupStack::PopAndDestroy(smsMessage); |
429 CleanupStack::PopAndDestroy(smsMessage); |
445 CleanupStack::PopAndDestroy(&socket); |
430 CleanupStack::PopAndDestroy(&socket); |
446 CleanupStack::PopAndDestroy(&socketServer); |
|
447 |
|
448 __UHEAP_MARKEND; |
|
449 |
|
450 return TestStepResult() ; |
431 return TestStepResult() ; |
451 } |
432 } |
452 |
433 |
453 |
434 |
454 TVerdict CTestSinglePDUReplyAddress::doTestStepL() |
435 TVerdict CTestSinglePDUReplyAddress::doTestStepL() |
455 /** |
436 /** |
456 * Test reply address can be different to the senders address |
437 * Test reply address can be different to the senders address |
457 */ |
438 */ |
458 { |
439 { |
459 __UHEAP_MARK; |
|
460 |
|
461 INFO_PRINTF1(_L("Test reply address in SMS message")); |
440 INFO_PRINTF1(_L("Test reply address in SMS message")); |
462 |
|
463 RSocketServ socketServer; |
|
464 PrepareRegTestLC(socketServer, 72); |
|
465 |
|
466 RSocket socket; |
441 RSocket socket; |
467 iSmsStackTestUtils->OpenSmsSocketLC(socketServer,socket,ESmsAddrRecvAny); |
442 iSmsStackTestUtils->OpenSmsSocketLC(iSocketServer,socket,ESmsAddrRecvAny); |
468 |
443 |
469 //This is character msg |
444 //This is character msg |
470 _LIT(KTestMsg,"Reply address message. Message will be sent to other address than sender"); |
445 _LIT(KTestMsg,"Reply address message. Message will be sent to other address than sender"); |
471 _LIT(KEmptyMsg,""); |
446 _LIT(KEmptyMsg,""); |
472 //Set destination and SC numbers |
447 //Set destination and SC numbers |
473 iTelephoneNumber=KPekka; |
448 iTelephoneNumber=KPekka; |
474 iServiceCenterNumber=KRadiolinjaSC; |
449 iServiceCenterNumber=KRadiolinjaSC; |
475 |
450 |
476 //8 bit coding scheme |
451 //8 bit coding scheme |
477 TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit; |
452 TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit; |
478 CSmsMessage* specialMessageAndReplyAddresMessage=CreateSmsMessageL(KEmptyMsg,alphabet); |
453 CSmsMessage* specialMessageAndReplyAddresMessage=CreateSmsMessageLC(KEmptyMsg,alphabet); |
479 CleanupStack::PushL(specialMessageAndReplyAddresMessage); |
|
480 |
454 |
481 //Get the operations |
455 //Get the operations |
482 CSmsReplyAddressOperations& replyAddressOperations = |
456 CSmsReplyAddressOperations& replyAddressOperations = |
483 static_cast<CSmsReplyAddressOperations&>(specialMessageAndReplyAddresMessage->GetOperationsForIEL(CSmsInformationElement::ESmsReplyAddressFormat)); |
457 static_cast<CSmsReplyAddressOperations&>(specialMessageAndReplyAddresMessage->GetOperationsForIEL(CSmsInformationElement::ESmsReplyAddressFormat)); |
484 |
458 |
512 |
486 |
513 //PDU maximym of 140 octects = C8 |
487 //PDU maximym of 140 octects = C8 |
514 //Each special message is 4 octects. |
488 //Each special message is 4 octects. |
515 //Maximum variations on the type of messages for 5 bits is 32 |
489 //Maximum variations on the type of messages for 5 bits is 32 |
516 for(TInt indicationType=EGsmSmsVoiceMessageWaiting; indicationType<=EGsmSmsExtendedMessageTypeWaiting; |
490 for(TInt indicationType=EGsmSmsVoiceMessageWaiting; indicationType<=EGsmSmsExtendedMessageTypeWaiting; |
517 indicationType++) |
491 ++indicationType) |
518 { |
492 { |
519 TBool toStore=EFalse; |
493 TBool toStore=EFalse; |
520 TSmsMessageProfileType messageProfileType=EGsmSmsProfileId1; |
494 TSmsMessageProfileType messageProfileType=EGsmSmsProfileId1; |
521 TUint8 messageCount=5; |
495 TUint8 messageCount=5; |
522 |
496 |
523 for(TUint extendedType=EGsmSmsNoExtendedMessageTypeIndication; |
497 for(TUint extendedType=EGsmSmsNoExtendedMessageTypeIndication; |
524 extendedType<=EGsmSmsExtendedIndicationType7; extendedType++) |
498 extendedType<=EGsmSmsExtendedIndicationType7; ++extendedType) |
525 { |
499 { |
526 TRAP(err,specialMessageOperations.AddSpecialMessageIndicationL(toStore,TSmsMessageIndicationType(indicationType), |
500 TRAP(err,specialMessageOperations.AddSpecialMessageIndicationL(toStore,TSmsMessageIndicationType(indicationType), |
527 TExtendedSmsIndicationType(extendedType),messageProfileType,messageCount)); |
501 TExtendedSmsIndicationType(extendedType),messageProfileType,messageCount)); |
528 TEST(err==KErrNone); |
502 TEST(err==KErrNone); |
529 |
|
530 } |
503 } |
531 |
|
532 } |
504 } |
533 |
505 |
534 //Add six zero length information elements |
506 //Add six zero length information elements |
535 //Get the PDU |
507 //Get the PDU |
536 CSmsPDU &pdu=specialMessageAndReplyAddresMessage->SmsPDU(); |
508 CSmsPDU &pdu=specialMessageAndReplyAddresMessage->SmsPDU(); |
537 //Get the UserData |
509 //Get the UserData |
538 CSmsUserData &userData=pdu.UserData(); |
510 CSmsUserData &userData=pdu.UserData(); |
539 _LIT8(KEmptyString,""); |
511 |
540 //Add the information element |
512 //Add the information element |
541 //TSmsId |
513 //TSmsId |
542 for(TUint informationElement=CSmsInformationElement::ESmsIEISIMToolkitSecurityHeaders1; |
514 for(TUint informationElement=CSmsInformationElement::ESmsIEISIMToolkitSecurityHeaders1; |
543 informationElement<=CSmsInformationElement::ESmsIEISIMToolkitSecurityHeaders5; |
515 informationElement<=CSmsInformationElement::ESmsIEISIMToolkitSecurityHeaders5; |
544 informationElement++) |
516 ++informationElement) |
545 { |
517 { |
546 //CSmsInformationElement::TSmsInformationElementIdentifier informationElement; |
|
547 TRAP(err,userData.AddInformationElementL( |
518 TRAP(err,userData.AddInformationElementL( |
548 CSmsInformationElement::TSmsInformationElementIdentifier(informationElement),KEmptyString())); |
519 CSmsInformationElement::TSmsInformationElementIdentifier(informationElement),KNullDesC8())); |
549 TEST(err==KErrNone); |
520 TEST(err==KErrNone); |
550 } |
521 } |
551 |
|
552 |
522 |
553 //Add address |
523 //Add address |
554 TPtrC replyAddress; |
524 TPtrC replyAddress; |
555 GetStringFromConfig(ConfigSection(), _L("replyAddressInternational"), replyAddress); |
525 GetStringFromConfig(ConfigSection(), _L("replyAddressInternational"), replyAddress); |
556 TRAP(err,replyAddressOperations.AddReplyAddressL(replyAddress)); |
526 TRAP(err,replyAddressOperations.AddReplyAddressL(replyAddress)); |
848 //-------- END Receive with no reply address |
815 //-------- END Receive with no reply address |
849 |
816 |
850 INFO_PRINTF1(_L("waiting for incoming SMS with reply address...") ); |
817 INFO_PRINTF1(_L("waiting for incoming SMS with reply address...") ); |
851 WaitForRecvL(socket); |
818 WaitForRecvL(socket); |
852 smsMessage = RecvSmsL(socket); |
819 smsMessage = RecvSmsL(socket); |
853 |
820 CleanupStack::PushL(smsMessage); |
854 INFO_PRINTF1(_L("incoming SMS") ); |
821 |
855 |
|
856 CleanupStack::PushL(smsMessage); |
|
857 TestSmsContentsL(smsMessage,KTestMsg); |
822 TestSmsContentsL(smsMessage,KTestMsg); |
858 |
823 |
859 //Get the operations |
824 //Get the operations |
860 CSmsReplyAddressOperations& deliverReplyOperations = |
825 CSmsReplyAddressOperations& deliverReplyOperations = |
861 static_cast<CSmsReplyAddressOperations&>(smsMessage->GetOperationsForIEL(CSmsInformationElement::ESmsReplyAddressFormat)); |
826 static_cast<CSmsReplyAddressOperations&>(smsMessage->GetOperationsForIEL(CSmsInformationElement::ESmsReplyAddressFormat)); |
877 //-------- END Receive with reply address |
842 //-------- END Receive with reply address |
878 |
843 |
879 INFO_PRINTF1(_L("waiting for incoming SMS with parsed reply address...") ); |
844 INFO_PRINTF1(_L("waiting for incoming SMS with parsed reply address...") ); |
880 WaitForRecvL(socket); |
845 WaitForRecvL(socket); |
881 smsMessage = RecvSmsL(socket); |
846 smsMessage = RecvSmsL(socket); |
882 |
847 CleanupStack::PushL(smsMessage); |
883 INFO_PRINTF1(_L("incoming SMS") ); |
848 |
884 |
|
885 CleanupStack::PushL(smsMessage); |
|
886 TestSmsContentsL(smsMessage,KTestMsg); |
849 TestSmsContentsL(smsMessage,KTestMsg); |
887 |
850 |
888 //Get the operations |
851 //Get the operations |
889 CSmsReplyAddressOperations& deliverParsedReplyOperations = |
852 CSmsReplyAddressOperations& deliverParsedReplyOperations = |
890 static_cast<CSmsReplyAddressOperations&>(smsMessage->GetOperationsForIEL(CSmsInformationElement::ESmsReplyAddressFormat)); |
853 static_cast<CSmsReplyAddressOperations&>(smsMessage->GetOperationsForIEL(CSmsInformationElement::ESmsReplyAddressFormat)); |
950 CleanupStack::PopAndDestroy(smsMessage); |
910 CleanupStack::PopAndDestroy(smsMessage); |
951 |
911 |
952 //-------- END receive with corrupt reply address |
912 //-------- END receive with corrupt reply address |
953 //-------- END receive |
913 //-------- END receive |
954 CleanupStack::PopAndDestroy(&socket); |
914 CleanupStack::PopAndDestroy(&socket); |
955 CleanupStack::PopAndDestroy(&socketServer); |
|
956 |
|
957 __UHEAP_MARKEND; |
|
958 |
|
959 return TestStepResult(); |
915 return TestStepResult(); |
960 |
|
961 } |
916 } |
962 |
917 |
963 |
918 |
964 TVerdict CTestMultiplePDUReplyAddress::doTestStepL() |
919 TVerdict CTestMultiplePDUReplyAddress::doTestStepL() |
965 /** |
920 /** |
966 * Test a simple Transmit and Receive of a TPDU |
921 * Test a simple Transmit and Receive of a TPDU |
967 */ |
922 */ |
968 { |
923 { |
|
924 // TODO: redundant test case??? |
969 INFO_PRINTF1(_L("Test multiple PDUs with reply address in SMS message")); |
925 INFO_PRINTF1(_L("Test multiple PDUs with reply address in SMS message")); |
970 |
926 |
971 return TestStepResult(); |
927 return TestStepResult(); |
972 } |
928 } |
973 |
929 |
976 /** |
932 /** |
977 * Test the operations available for special message waiting |
933 * Test the operations available for special message waiting |
978 */ |
934 */ |
979 { |
935 { |
980 INFO_PRINTF1(_L("Test special message waiting operations")); |
936 INFO_PRINTF1(_L("Test special message waiting operations")); |
981 |
|
982 __UHEAP_MARK; |
|
983 |
|
984 //This is character msg - 96 characters |
937 //This is character msg - 96 characters |
985 _LIT(KTestMsg,"This message is a special message waiting message. You have a special message waiting for you :)"); |
938 _LIT(KTestMsg,"This message is a special message waiting message. You have a special message waiting for you :)"); |
986 |
939 |
987 //8 bit coding scheme |
940 //8 bit coding scheme |
988 TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit; |
941 TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit; |
989 CSmsMessage* smsMessage=CreateSmsMessageL(KTestMsg,alphabet); |
942 CSmsMessage* smsMessage=CreateSmsMessageLC(KTestMsg,alphabet); |
990 CleanupStack::PushL(smsMessage); |
|
991 |
943 |
992 //Get the operations for a version 0 message i.e. before operations for IE were added |
944 //Get the operations for a version 0 message i.e. before operations for IE were added |
993 smsMessage->SetVersion(CSmsMessage::ESmsMessageV0); |
945 smsMessage->SetVersion(CSmsMessage::ESmsMessageV0); |
994 TRAPD(err,smsMessage->GetOperationsForIEL(CSmsInformationElement::ESmsIEISpecialSMSMessageIndication)); |
946 TRAPD(err,smsMessage->GetOperationsForIEL(CSmsInformationElement::ESmsIEISpecialSMSMessageIndication)); |
995 TEST(err==KErrNotSupported); |
947 TEST(err==KErrNotSupported); |
1297 |
1249 |
1298 INFO_PRINTF1(_L("Test step end !")); |
1250 INFO_PRINTF1(_L("Test step end !")); |
1299 |
1251 |
1300 CleanupStack::PopAndDestroy(smsMessage); |
1252 CleanupStack::PopAndDestroy(smsMessage); |
1301 //-------- END API Test for special message operations |
1253 //-------- END API Test for special message operations |
1302 |
|
1303 __UHEAP_MARKEND; |
|
1304 |
|
1305 return TestStepResult(); |
1254 return TestStepResult(); |
1306 } |
1255 } |
1307 |
|
1308 |
1256 |
1309 TVerdict CTestSinglePDUSpecialMessageWaiting::doTestStepL() |
1257 TVerdict CTestSinglePDUSpecialMessageWaiting::doTestStepL() |
1310 /** |
1258 /** |
1311 * Test a simple Transmit and Receive of a TPDU |
1259 * Test a simple Transmit and Receive of a TPDU |
1312 */ |
1260 */ |
1313 { |
1261 { |
1314 INFO_PRINTF1(_L("Test special message waiting in single PDU SMS message")); |
1262 INFO_PRINTF1(_L("Test special message waiting in single PDU SMS message")); |
1315 |
|
1316 __UHEAP_MARK; |
|
1317 |
|
1318 RSocketServ socketServer; |
|
1319 PrepareRegTestLC(socketServer, 73); |
|
1320 |
|
1321 RSocket socket; |
1263 RSocket socket; |
1322 iSmsStackTestUtils->OpenSmsSocketLC(socketServer,socket,ESmsAddrRecvAny); |
1264 iSmsStackTestUtils->OpenSmsSocketLC(iSocketServer,socket,ESmsAddrRecvAny); |
1323 |
1265 |
1324 //This is a 95 character msg. |
1266 //This is a 95 character msg. |
1325 _LIT(KTestMsg,"This message is a special message waiting message. You have a special message waiting for you :)"); |
1267 _LIT(KTestMsg,"This message is a special message waiting message. You have a special message waiting for you :)"); |
1326 |
1268 |
1327 //Set destination and SC numbers |
1269 //Set destination and SC numbers |
1328 iTelephoneNumber=KPekka; |
1270 iTelephoneNumber=KPekka; |
1329 iServiceCenterNumber=KRadiolinjaSC; |
1271 iServiceCenterNumber=KRadiolinjaSC; |
1330 |
1272 |
1331 //8 bit coding scheme |
1273 //8 bit coding scheme |
1332 TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit; |
1274 TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit; |
1333 CSmsMessage* smsMessage=CreateSmsMessageL(KTestMsg,alphabet); |
1275 CSmsMessage* smsMessage=CreateSmsMessageLC(KTestMsg,alphabet); |
1334 CleanupStack::PushL(smsMessage); |
|
1335 |
1276 |
1336 INFO_PRINTF2(_L("Destination number:..... %S "),&iTelephoneNumber); |
1277 INFO_PRINTF2(_L("Destination number:..... %S "),&iTelephoneNumber); |
1337 INFO_PRINTF2(_L("ServiceCenter number:... %S "),&iServiceCenterNumber); |
1278 INFO_PRINTF2(_L("ServiceCenter number:... %S "),&iServiceCenterNumber); |
1338 |
1279 |
1339 //Get the operations |
1280 //Get the operations |
1410 |
1351 |
1411 CleanupStack::PopAndDestroy(smsMessage); |
1352 CleanupStack::PopAndDestroy(smsMessage); |
1412 //-------- END Sending Single PDU |
1353 //-------- END Sending Single PDU |
1413 |
1354 |
1414 //-------- START receiving |
1355 //-------- START receiving |
1415 INFO_PRINTF1(_L("waiting for incoming SMS...") ); |
1356 WaitForRecvL(socket); |
1416 WaitForRecvL(socket); |
1357 smsMessage = RecvSmsL(socket); |
1417 smsMessage = RecvSmsL(socket); |
|
1418 |
|
1419 CleanupStack::PushL(smsMessage); |
1358 CleanupStack::PushL(smsMessage); |
1420 |
1359 |
1421 //Get the operations |
1360 //Get the operations |
1422 CSmsSpecialSMSMessageOperations& noSpecialMessageOperations = static_cast<CSmsSpecialSMSMessageOperations&>(smsMessage->GetOperationsForIEL(CSmsInformationElement::ESmsIEISpecialSMSMessageIndication)); |
1361 CSmsSpecialSMSMessageOperations& noSpecialMessageOperations = static_cast<CSmsSpecialSMSMessageOperations&>(smsMessage->GetOperationsForIEL(CSmsInformationElement::ESmsIEISpecialSMSMessageIndication)); |
1423 count=noSpecialMessageOperations.GetCountOfSpecialMessageIndicationsL(); |
1362 count=noSpecialMessageOperations.GetCountOfSpecialMessageIndicationsL(); |
1613 INFO_PRINTF1(_L("Test special message waiting in multiple PDU SMS message")); |
1547 INFO_PRINTF1(_L("Test special message waiting in multiple PDU SMS message")); |
1614 |
1548 |
1615 return TestStepResult(); |
1549 return TestStepResult(); |
1616 } |
1550 } |
1617 |
1551 |
1618 |
|
1619 TVerdict CTestEnhancedVoiceMailOperations::doTestStepL() |
1552 TVerdict CTestEnhancedVoiceMailOperations::doTestStepL() |
1620 /** |
1553 /** |
1621 * Test the operations available for special message waiting |
1554 * Test the operations available for special message waiting |
1622 */ |
1555 */ |
1623 { |
1556 { |
1624 INFO_PRINTF1(_L("Test enhanced voice mail message operations")); |
1557 INFO_PRINTF1(_L("Test enhanced voice mail message operations")); |
1625 |
|
1626 __UHEAP_MARK; |
|
1627 |
|
1628 //This is character msg - 96 characters |
1558 //This is character msg - 96 characters |
1629 _LIT(KTestMsg,"This is a enhanced voice mail information message!"); |
1559 _LIT(KTestMsg,"This is a enhanced voice mail information message!"); |
1630 |
1560 |
1631 //8 bit coding scheme |
1561 //8 bit coding scheme |
1632 TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit; |
1562 TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit; |
1633 CSmsMessage* smsMessage=CreateSmsMessageL(KTestMsg,alphabet); |
1563 CSmsMessage* smsMessage=CreateSmsMessageLC(KTestMsg,alphabet); |
1634 CleanupStack::PushL(smsMessage); |
|
1635 |
1564 |
1636 //Get the operations |
1565 //Get the operations |
1637 CSmsEnhancedVoiceMailOperations& operations = |
1566 CSmsEnhancedVoiceMailOperations& operations = |
1638 static_cast<CSmsEnhancedVoiceMailOperations&>(smsMessage->GetOperationsForIEL(CSmsInformationElement::ESmsEnhanceVoiceMailInformation)); |
1567 static_cast<CSmsEnhancedVoiceMailOperations&>(smsMessage->GetOperationsForIEL(CSmsInformationElement::ESmsEnhanceVoiceMailInformation)); |
1639 |
1568 |
1755 count=notNeededEnhancedVoiceMailNotification->NumberOfVoiceMails(); |
1684 count=notNeededEnhancedVoiceMailNotification->NumberOfVoiceMails(); |
1756 TEST(count==1); |
1685 TEST(count==1); |
1757 |
1686 |
1758 delete notNeededEnhancedVoiceMailNotification; |
1687 delete notNeededEnhancedVoiceMailNotification; |
1759 } |
1688 } |
1760 |
|
1761 |
|
1762 } |
1689 } |
1763 } |
1690 } |
1764 |
|
1765 |
1691 |
1766 voiceMailNotification->SetParsedCallingLineIdentityL(accessAddressTGsm); |
1692 voiceMailNotification->SetParsedCallingLineIdentityL(accessAddressTGsm); |
1767 |
1693 |
1768 //Get the notifications in the enhanced message |
1694 //Get the notifications in the enhanced message |
1769 RPointerArray<CVoiceMailNotification>& newNotificationsList= |
1695 RPointerArray<CVoiceMailNotification>& newNotificationsList= |
1770 enhancedVoiceMailNotification->GetVoiceMailNotifications(); |
1696 enhancedVoiceMailNotification->GetVoiceMailNotifications(); |
1771 |
1697 |
1772 count=newNotificationsList.Count(); |
1698 count=newNotificationsList.Count(); |
1773 //Remove all pointers to notifications |
1699 //Remove all pointers to notifications |
1774 if(count) |
1700 if(count) |
1775 { |
1701 { |
1776 newNotificationsList.Reset(); |
1702 newNotificationsList.Reset(); |
1777 } |
1703 } |
1778 |
1704 |
1779 result=newNotificationsList.Append(voiceMailNotification); |
1705 result=newNotificationsList.Append(voiceMailNotification); |
1780 TEST(result==KErrNone); |
1706 TEST(result==KErrNone); |
1781 count=enhancedVoiceMailNotification->NumberOfVoiceMails(); |
1707 count=enhancedVoiceMailNotification->NumberOfVoiceMails(); |
1782 TEST(count==1); |
1708 TEST(count==1); |
1844 TEST(!result); |
1770 TEST(!result); |
1845 |
1771 |
1846 CleanupStack::PopAndDestroy(retrievedNotification); |
1772 CleanupStack::PopAndDestroy(retrievedNotification); |
1847 CleanupStack::PopAndDestroy(enhancedVoiceMailNotification); |
1773 CleanupStack::PopAndDestroy(enhancedVoiceMailNotification); |
1848 CleanupStack::PopAndDestroy(smsMessage); |
1774 CleanupStack::PopAndDestroy(smsMessage); |
1849 |
|
1850 __UHEAP_MARKEND; |
|
1851 |
|
1852 return TestStepResult(); |
1775 return TestStepResult(); |
1853 } |
1776 } |
1854 |
|
1855 |
1777 |
1856 //Helper function: Adds the address to a notification |
1778 //Helper function: Adds the address to a notification |
1857 void CTestEnhancedVoiceMailOperations::AddAddressToNotifcationL( |
1779 void CTestEnhancedVoiceMailOperations::AddAddressToNotifcationL( |
1858 CEnhancedVoiceMailNotification* aEnhancedVoiceMailNotification, |
1780 CEnhancedVoiceMailNotification* aEnhancedVoiceMailNotification, |
1859 CVoiceMailNotification* aVoiceMailNotification, |
1781 CVoiceMailNotification* aVoiceMailNotification, |
1860 TPtrC aCallingLineIdentity,TUint aAddressType) |
1782 TPtrC aCallingLineIdentity,TUint aAddressType) |
1861 { |
1783 { |
1862 //Get the notifications in the enhanced message |
1784 //Get the notifications in the enhanced message |
1863 RPointerArray<CVoiceMailNotification>& notificationsList= |
1785 RPointerArray<CVoiceMailNotification>& notificationsList= |
1864 aEnhancedVoiceMailNotification->GetVoiceMailNotifications(); |
1786 aEnhancedVoiceMailNotification->GetVoiceMailNotifications(); |
1865 |
1787 |
1866 TUint count=notificationsList.Count(); |
1788 TUint count=notificationsList.Count(); |
1867 |
1789 |
1868 if(count==1) |
1790 if(count==1) |
1869 { |
1791 { |
1870 notificationsList.Remove(0); |
1792 notificationsList.Remove(0); |
1871 } |
1793 } |
1872 |
1794 |
1873 //Add the address |
1795 //Add the address |
1874 if(aAddressType==EParsed) |
1796 if(aAddressType==EParsed) |
1875 { |
1797 { |
1876 //Create Calling Line Identity |
1798 //Create Calling Line Identity |
1877 TGsmSmsTelNumber callingLineIdentityTGsm; |
1799 TGsmSmsTelNumber callingLineIdentityTGsm; |
1878 callingLineIdentityTGsm.iTelNumber=aCallingLineIdentity; |
1800 callingLineIdentityTGsm.iTelNumber=aCallingLineIdentity; |
1879 callingLineIdentityTGsm.iTypeOfAddress=EGsmSmsTONAlphaNumeric; |
1801 callingLineIdentityTGsm.iTypeOfAddress=EGsmSmsTONAlphaNumeric; |
1880 aVoiceMailNotification->SetParsedCallingLineIdentityL(callingLineIdentityTGsm); |
1802 aVoiceMailNotification->SetParsedCallingLineIdentityL(callingLineIdentityTGsm); |
1881 } |
1803 } |
1882 else |
1804 else |
1883 { |
1805 { |
1884 aVoiceMailNotification->SetCallingLineIdentityL(aCallingLineIdentity); |
1806 aVoiceMailNotification->SetCallingLineIdentityL(aCallingLineIdentity); |
1885 } |
1807 } |
1886 |
1808 |
1887 //Add the notification to the voice mail |
1809 //Add the notification to the voice mail |
1888 TInt result=notificationsList.Append(aVoiceMailNotification); |
1810 TInt result=notificationsList.Append(aVoiceMailNotification); |
1889 TEST(result==KErrNone); |
1811 TEST(result==KErrNone); |
1890 } |
1812 } |
1891 |
|
1892 |
1813 |
1893 TVerdict CTestSinglePDUEnhancedVoiceMailInformation::doTestStepL() |
1814 TVerdict CTestSinglePDUEnhancedVoiceMailInformation::doTestStepL() |
1894 /** |
1815 /** |
1895 * Test the sending and receiving of enhanced voice mail |
1816 * Test the sending and receiving of enhanced voice mail |
1896 */ |
1817 */ |
1897 { |
1818 { |
1898 INFO_PRINTF1(_L("Test enhanced voice mail information with a single PDU message")); |
1819 INFO_PRINTF1(_L("Test enhanced voice mail information with a single PDU message")); |
1899 |
|
1900 __UHEAP_MARK; |
|
1901 |
|
1902 RSocketServ socketServer; |
|
1903 PrepareRegTestLC(socketServer, 74); |
|
1904 |
|
1905 RSocket socket; |
1820 RSocket socket; |
1906 iSmsStackTestUtils->OpenSmsSocketLC(socketServer,socket,ESmsAddrRecvAny); |
1821 iSmsStackTestUtils->OpenSmsSocketLC(iSocketServer,socket,ESmsAddrRecvAny); |
1907 |
1822 |
1908 //This is an enhanced voice mail character msg. |
1823 //This is an enhanced voice mail character msg. |
1909 _LIT(KTestMsg,""); |
1824 _LIT(KTestMsg,""); |
1910 |
1825 |
1911 //Set destination and SC numbers |
1826 //Set destination and SC numbers |
1912 iTelephoneNumber=KPekka; |
1827 iTelephoneNumber=KPekka; |
1913 iServiceCenterNumber=KRadiolinjaSC; |
1828 iServiceCenterNumber=KRadiolinjaSC; |
1914 |
1829 |
1915 //8 bit coding scheme |
1830 //8 bit coding scheme |
1916 TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit; |
1831 TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit; |
1917 CSmsMessage* smsMessage=CreateSmsMessageL(KTestMsg,alphabet); |
1832 CSmsMessage* smsMessage=CreateSmsMessageLC(KTestMsg,alphabet); |
1918 CleanupStack::PushL(smsMessage); |
|
1919 |
1833 |
1920 INFO_PRINTF2(_L("Destination number:..... %S "),&iTelephoneNumber); |
1834 INFO_PRINTF2(_L("Destination number:..... %S "),&iTelephoneNumber); |
1921 INFO_PRINTF2(_L("ServiceCenter number:... %S "),&iServiceCenterNumber); |
1835 INFO_PRINTF2(_L("ServiceCenter number:... %S "),&iServiceCenterNumber); |
1922 |
1836 |
1923 //Get the operations |
1837 //Get the operations |
1983 //----------------------------------- |
1897 //----------------------------------- |
1984 //Send message with enhanced voice mail length at boundary values |
1898 //Send message with enhanced voice mail length at boundary values |
1985 //Single pdu, max size = 137. That is 140-2(UDHL) -1(IEId) = 137 |
1899 //Single pdu, max size = 137. That is 140-2(UDHL) -1(IEId) = 137 |
1986 //User data = 8C |
1900 //User data = 8C |
1987 //Make a new message |
1901 //Make a new message |
1988 for (TUint i = 0; i < enhancedVoiceMailNotification->NumberOfVoiceMails(); i++) |
1902 for (TUint i = 0; i < enhancedVoiceMailNotification->NumberOfVoiceMails(); ++i) |
1989 { |
1903 { |
1990 delete notificationsList[i]; |
1904 delete notificationsList[i]; |
1991 } |
1905 } |
1992 |
|
1993 notificationsList.Reset(); |
1906 notificationsList.Reset(); |
1994 |
1907 |
1995 CSmsMessage* boundaryValueVoiceMessage=CreateSmsMessageL(KTestMsg,alphabet); |
1908 CSmsMessage* boundaryValueVoiceMessage=CreateSmsMessageL(KTestMsg,alphabet); |
1996 CleanupStack::PushL(boundaryValueVoiceMessage); |
1909 CleanupStack::PushL(boundaryValueVoiceMessage); |
1997 CleanupStack::PushL(enhancedVoiceMailNotification); |
1910 CleanupStack::PushL(enhancedVoiceMailNotification); |
2000 CSmsEnhancedVoiceMailOperations& boundaryValueVoiceMailOperations = |
1913 CSmsEnhancedVoiceMailOperations& boundaryValueVoiceMailOperations = |
2001 static_cast<CSmsEnhancedVoiceMailOperations&>(boundaryValueVoiceMessage->GetOperationsForIEL(CSmsInformationElement::ESmsEnhanceVoiceMailInformation)); |
1914 static_cast<CSmsEnhancedVoiceMailOperations&>(boundaryValueVoiceMessage->GetOperationsForIEL(CSmsInformationElement::ESmsEnhanceVoiceMailInformation)); |
2002 |
1915 |
2003 //Add five more notifications |
1916 //Add five more notifications |
2004 const TUint KNumNotifications=4; |
1917 const TUint KNumNotifications=4; |
2005 for(count=0;count<KNumNotifications; count++) |
1918 for(count=0; count<KNumNotifications; ++count) |
2006 { |
1919 { |
2007 CVoiceMailNotification* voiceMailNotification=CreateVoiceMailNotificationL(callingLineIdentityTGsm); |
1920 CVoiceMailNotification* voiceMailNotification=CreateVoiceMailNotificationL(callingLineIdentityTGsm); |
2008 result=notificationsList.Append(voiceMailNotification); |
1921 result=notificationsList.Append(voiceMailNotification); |
2009 TEST(result==KErrNone); |
1922 TEST(result==KErrNone); |
2010 } |
1923 } |
2011 |
1924 |
2012 //Add the number to make the size on the boundary |
1925 //Add the number to make the size on the boundary |
2013 TPtrC boundaryCallingLineIdentity; |
1926 TPtrC boundaryCallingLineIdentity; |
2014 GetStringFromConfig(ConfigSection(), _L("boundaryAccessAddress"), boundaryCallingLineIdentity); |
1927 GetStringFromConfig(ConfigSection(), _L("boundaryAccessAddress"), boundaryCallingLineIdentity); |
2015 callingLineIdentityTGsm.iTelNumber=boundaryCallingLineIdentity; |
1928 callingLineIdentityTGsm.iTelNumber=boundaryCallingLineIdentity; |
2104 |
2017 |
2105 CleanupStack::PopAndDestroy(retrievedNotification); |
2018 CleanupStack::PopAndDestroy(retrievedNotification); |
2106 CleanupStack::PopAndDestroy(smsMessage); |
2019 CleanupStack::PopAndDestroy(smsMessage); |
2107 |
2020 |
2108 //---------- END receiving |
2021 //---------- END receiving |
2109 |
|
2110 CleanupStack::PopAndDestroy(&socket); |
2022 CleanupStack::PopAndDestroy(&socket); |
2111 CleanupStack::PopAndDestroy(&socketServer); |
2023 return TestStepResult(); |
2112 |
|
2113 __UHEAP_MARKEND; |
|
2114 |
|
2115 return TestStepResult(); |
|
2116 } |
2024 } |
2117 |
2025 |
2118 CEnhancedVoiceMailNotification* CTestEnhancedVoiceMail::CreateEnhancedVoiceMailNotificationL(TGsmSmsTelNumber aAccessAddress) |
2026 CEnhancedVoiceMailNotification* CSmsEnhancedVoiceMailTestStep::CreateEnhancedVoiceMailNotificationL(TGsmSmsTelNumber aAccessAddress) |
2119 { |
2027 { |
2120 CEnhancedVoiceMailNotification* enhancedVoiceMailNotification=CEnhancedVoiceMailNotification::NewL(); |
2028 CEnhancedVoiceMailNotification* enhancedVoiceMailNotification=CEnhancedVoiceMailNotification::NewL(); |
2121 |
2029 |
2122 //Set the properties |
2030 //Set the properties |
2123 TSmsMessageProfileType messageProfileType=EGsmSmsProfileId1; |
2031 TSmsMessageProfileType messageProfileType=EGsmSmsProfileId1; |
2153 TVerdict CTestMultiplePDUEnhancedVoiceMailInformation::doTestStepL() |
2060 TVerdict CTestMultiplePDUEnhancedVoiceMailInformation::doTestStepL() |
2154 /** |
2061 /** |
2155 * Test the sending and receiving of enhanced voice mail |
2062 * Test the sending and receiving of enhanced voice mail |
2156 */ |
2063 */ |
2157 { |
2064 { |
|
2065 // TODO: redundant test case??? |
2158 INFO_PRINTF1(_L("Test enhanced voice mail information with multiple PDU message")); |
2066 INFO_PRINTF1(_L("Test enhanced voice mail information with multiple PDU message")); |
2159 |
2067 |
2160 return TestStepResult(); |
2068 return TestStepResult(); |
2161 } |
2069 } |
2162 |
|
2163 |
2070 |
2164 TVerdict CTestEnhancedVoiceMailDeleteOperations::doTestStepL() |
2071 TVerdict CTestEnhancedVoiceMailDeleteOperations::doTestStepL() |
2165 /** |
2072 /** |
2166 * Test the enhanced voice mail delete confirmation |
2073 * Test the enhanced voice mail delete confirmation |
2167 */ |
2074 */ |
2168 { |
2075 { |
2169 INFO_PRINTF1(_L("Test enhanced voice mail delete confirmation operations")); |
2076 INFO_PRINTF1(_L("Test enhanced voice mail delete confirmation operations")); |
2170 |
|
2171 __UHEAP_MARK; |
|
2172 |
|
2173 //This is character msg - 96 characters |
2077 //This is character msg - 96 characters |
2174 _LIT(KTestMsg,"This is a enhanced voice mail information message!"); |
2078 _LIT(KTestMsg,"This is a enhanced voice mail information message!"); |
2175 |
2079 |
2176 //8 bit coding scheme |
2080 //8 bit coding scheme |
2177 TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit; |
2081 TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit; |
2178 CSmsMessage* smsMessage=CreateSmsMessageL(KTestMsg,alphabet); |
2082 CSmsMessage* smsMessage=CreateSmsMessageLC(KTestMsg,alphabet); |
2179 CleanupStack::PushL(smsMessage); |
|
2180 |
2083 |
2181 //Get the operations |
2084 //Get the operations |
2182 CSmsEnhancedVoiceMailOperations& operations = |
2085 CSmsEnhancedVoiceMailOperations& operations = |
2183 static_cast<CSmsEnhancedVoiceMailOperations&>(smsMessage->GetOperationsForIEL(CSmsInformationElement::ESmsEnhanceVoiceMailInformation)); |
2086 static_cast<CSmsEnhancedVoiceMailOperations&>(smsMessage->GetOperationsForIEL(CSmsInformationElement::ESmsEnhanceVoiceMailInformation)); |
2184 |
2087 |
2285 TEST(!result); |
2188 TEST(!result); |
2286 |
2189 |
2287 CleanupStack::PopAndDestroy(retrievedDeletion); |
2190 CleanupStack::PopAndDestroy(retrievedDeletion); |
2288 CleanupStack::PopAndDestroy(enhancedVoiceMailDeleteConfirmation); |
2191 CleanupStack::PopAndDestroy(enhancedVoiceMailDeleteConfirmation); |
2289 CleanupStack::PopAndDestroy(smsMessage); |
2192 CleanupStack::PopAndDestroy(smsMessage); |
2290 |
|
2291 __UHEAP_MARKEND; |
|
2292 |
|
2293 return TestStepResult(); |
2193 return TestStepResult(); |
2294 } |
2194 } |
2295 |
|
2296 |
2195 |
2297 TVerdict CTestSinglePDUEnhancedVoiceMailDeleteConfirmation::doTestStepL() |
2196 TVerdict CTestSinglePDUEnhancedVoiceMailDeleteConfirmation::doTestStepL() |
2298 /** |
2197 /** |
2299 * Test the enhanced voice mail delete confirmation |
2198 * Test the enhanced voice mail delete confirmation |
2300 */ |
2199 */ |
2301 { |
2200 { |
2302 INFO_PRINTF1(_L("Test enhanced voice mail single PDU message delete confirmation")); |
2201 INFO_PRINTF1(_L("Test enhanced voice mail single PDU message delete confirmation")); |
2303 |
|
2304 __UHEAP_MARK; |
|
2305 |
|
2306 RSocketServ socketServer; |
|
2307 PrepareRegTestLC(socketServer, 75); |
|
2308 |
|
2309 RSocket socket; |
2202 RSocket socket; |
2310 iSmsStackTestUtils->OpenSmsSocketLC(socketServer,socket,ESmsAddrRecvAny); |
2203 iSmsStackTestUtils->OpenSmsSocketLC(iSocketServer,socket,ESmsAddrRecvAny); |
2311 |
2204 |
2312 //This is an enhanced voice mail character msg. |
2205 //This is an enhanced voice mail character msg. |
2313 _LIT(KTestMsg,""); |
2206 _LIT(KTestMsg,""); |
2314 |
2207 |
2315 //Set destination and SC numbers |
2208 //Set destination and SC numbers |
2316 iTelephoneNumber=KPekka; |
2209 iTelephoneNumber=KPekka; |
2317 iServiceCenterNumber=KRadiolinjaSC; |
2210 iServiceCenterNumber=KRadiolinjaSC; |
2318 |
2211 |
2319 //8 bit coding scheme |
2212 //8 bit coding scheme |
2320 TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit; |
2213 TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit; |
2321 CSmsMessage* smsMessage=CreateSmsMessageL(KTestMsg,alphabet); |
2214 CSmsMessage* smsMessage=CreateSmsMessageLC(KTestMsg,alphabet); |
2322 CleanupStack::PushL(smsMessage); |
|
2323 |
2215 |
2324 INFO_PRINTF2(_L("Destination number:..... %S "),&iTelephoneNumber); |
2216 INFO_PRINTF2(_L("Destination number:..... %S "),&iTelephoneNumber); |
2325 INFO_PRINTF2(_L("ServiceCenter number:... %S "),&iServiceCenterNumber); |
2217 INFO_PRINTF2(_L("ServiceCenter number:... %S "),&iServiceCenterNumber); |
2326 |
2218 |
2327 //Get the operations |
2219 //Get the operations |
2451 static_cast<CEnhancedVoiceMailDeleteConfirmations*>(retrievedNotification); |
2343 static_cast<CEnhancedVoiceMailDeleteConfirmations*>(retrievedNotification); |
2452 count=retrievedEnhancedVoiceMailDeleteConfirmation->NumberOfDeletes(); |
2344 count=retrievedEnhancedVoiceMailDeleteConfirmation->NumberOfDeletes(); |
2453 TEST(count==1); |
2345 TEST(count==1); |
2454 |
2346 |
2455 CleanupStack::PopAndDestroy(retrievedNotification); |
2347 CleanupStack::PopAndDestroy(retrievedNotification); |
2456 |
|
2457 CleanupStack::PopAndDestroy(smsMessage); |
2348 CleanupStack::PopAndDestroy(smsMessage); |
2458 //---------- END receiving |
2349 //---------- END receiving |
2459 CleanupStack::PopAndDestroy(&socket); |
2350 CleanupStack::PopAndDestroy(&socket); |
2460 CleanupStack::PopAndDestroy(&socketServer); |
|
2461 |
|
2462 __UHEAP_MARKEND; |
|
2463 |
|
2464 return TestStepResult(); |
2351 return TestStepResult(); |
2465 } |
2352 } |
2466 |
2353 |
2467 |
2354 |
2468 TVerdict CTestMultiplePDUEnhancedVoiceMailDeleteConfirmation::doTestStepL() |
2355 TVerdict CTestMultiplePDUEnhancedVoiceMailDeleteConfirmation::doTestStepL() |
2469 /** |
2356 /** |
2470 * Test the enhanced voice mail delete confirmation |
2357 * Test the enhanced voice mail delete confirmation |
2471 */ |
2358 */ |
2472 { |
2359 { |
|
2360 // TODO: redundant test case??? |
2473 INFO_PRINTF1(_L("Test enhanced voice mail multiple PDU message delete confirmation")); |
2361 INFO_PRINTF1(_L("Test enhanced voice mail multiple PDU message delete confirmation")); |
2474 |
2362 |
2475 return TestStepResult(); |
2363 return TestStepResult(); |
2476 } |
2364 } |
2477 |
|
2478 |
2365 |
2479 TVerdict CTest7BitDefaultAlphabet::doTestStepL() |
2366 TVerdict CTest7BitDefaultAlphabet::doTestStepL() |
2480 /** |
2367 /** |
2481 * Test the enhanced voice mail delete confirmation |
2368 * Test the enhanced voice mail delete confirmation |
2482 */ |
2369 */ |
2483 { |
2370 { |
2484 INFO_PRINTF1(_L("Test 7 bit default alphabet")); |
2371 INFO_PRINTF1(_L("Test 7 bit default alphabet")); |
2485 |
2372 |
2486 __UHEAP_MARK; |
|
2487 |
|
2488 //Send a message with no alphabet set |
2373 //Send a message with no alphabet set |
2489 RSocketServ socketServer; |
|
2490 PrepareRegTestLC(socketServer, 76); |
|
2491 |
|
2492 RSocket socket; |
2374 RSocket socket; |
2493 iSmsStackTestUtils->OpenSmsSocketLC(socketServer,socket,ESmsAddrRecvAny); |
2375 iSmsStackTestUtils->OpenSmsSocketLC(iSocketServer,socket,ESmsAddrRecvAny); |
2494 |
2376 |
2495 //This is a msg. |
2377 //This is a msg. |
2496 _LIT(KTestMsg,"This message has no coding scheme set. Assume 7 bit default."); |
2378 _LIT(KTestMsg,"This message has no coding scheme set. Assume 7 bit default."); |
2497 |
2379 |
2498 //Set destination and SC numbers |
2380 //Set destination and SC numbers |
2542 smsMessage->UserDataSettings(smsSettings); |
2424 smsMessage->UserDataSettings(smsSettings); |
2543 alphabet=smsSettings.Alphabet(); |
2425 alphabet=smsSettings.Alphabet(); |
2544 TEST(alphabet==TSmsDataCodingScheme::ESmsAlphabet7Bit); |
2426 TEST(alphabet==TSmsDataCodingScheme::ESmsAlphabet7Bit); |
2545 CleanupStack::PopAndDestroy(smsMessage); |
2427 CleanupStack::PopAndDestroy(smsMessage); |
2546 |
2428 |
2547 |
|
2548 CleanupStack::PopAndDestroy(&socket); |
2429 CleanupStack::PopAndDestroy(&socket); |
2549 CleanupStack::PopAndDestroy(&socketServer); |
|
2550 |
|
2551 __UHEAP_MARKEND; |
|
2552 |
|
2553 return TestStepResult(); |
2430 return TestStepResult(); |
2554 } |
2431 } |
2555 |
|
2556 |
2432 |
2557 TVerdict CTestZeroLengthIE::doTestStepL() |
2433 TVerdict CTestZeroLengthIE::doTestStepL() |
2558 /** |
2434 /** |
2559 * Test the enhanced voice mail delete confirmation |
2435 * Test the enhanced voice mail delete confirmation |
2560 */ |
2436 */ |
2561 { |
2437 { |
2562 INFO_PRINTF1(_L("Test zero length IE, USIM toolkit IE")); |
2438 INFO_PRINTF1(_L("Test zero length IE, USIM toolkit IE")); |
2563 |
2439 |
2564 __UHEAP_MARK; |
|
2565 |
|
2566 //Send a message with no alphabet set |
2440 //Send a message with no alphabet set |
2567 RSocketServ socketServer; |
|
2568 PrepareRegTestLC(socketServer, 77); |
|
2569 |
|
2570 RSocket socket; |
2441 RSocket socket; |
2571 iSmsStackTestUtils->OpenSmsSocketLC(socketServer,socket,ESmsAddrRecvAny); |
2442 iSmsStackTestUtils->OpenSmsSocketLC(iSocketServer,socket,ESmsAddrRecvAny); |
2572 |
2443 |
2573 _LIT(KTestMsg,"This message has a zero length information element. USIM toolkit security header."); |
2444 _LIT(KTestMsg,"This message has a zero length information element. USIM toolkit security header."); |
2574 |
2445 |
2575 //Set destination and SC numbers |
2446 //Set destination and SC numbers |
2576 iTelephoneNumber=KPekka; |
2447 iTelephoneNumber=KPekka; |
2577 iServiceCenterNumber=KRadiolinjaSC; |
2448 iServiceCenterNumber=KRadiolinjaSC; |
2578 |
2449 |
2579 //Create message |
2450 //Create message |
2580 //8 bit coding scheme |
2451 //8 bit coding scheme |
2581 TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit; |
2452 TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit; |
2582 CSmsMessage* smsMessage=CreateSmsMessageL(KTestMsg,alphabet); |
2453 CSmsMessage* smsMessage=CreateSmsMessageLC(KTestMsg,alphabet); |
2583 CleanupStack::PushL(smsMessage); |
|
2584 |
2454 |
2585 INFO_PRINTF2(_L("Destination number:..... %S "),&iTelephoneNumber); |
2455 INFO_PRINTF2(_L("Destination number:..... %S "),&iTelephoneNumber); |
2586 INFO_PRINTF2(_L("ServiceCenter number:... %S "),&iServiceCenterNumber); |
2456 INFO_PRINTF2(_L("ServiceCenter number:... %S "),&iServiceCenterNumber); |
2587 |
2457 |
2588 //Add zero length IE |
2458 //Add zero length IE |
2630 TEST(informationElement==CSmsInformationElement::ESmsIEISIMToolkitSecurityHeaders16); |
2500 TEST(informationElement==CSmsInformationElement::ESmsIEISIMToolkitSecurityHeaders16); |
2631 CleanupStack::PopAndDestroy(smsMessage); |
2501 CleanupStack::PopAndDestroy(smsMessage); |
2632 |
2502 |
2633 //----------- |
2503 //----------- |
2634 //Receive message with multiple USIM security headers - 7F and 70, with zero length |
2504 //Receive message with multiple USIM security headers - 7F and 70, with zero length |
2635 INFO_PRINTF1(_L("waiting for incoming SMS with multiple USIM security headers, 7F and 70, with zero length...") ); |
2505 INFO_PRINTF1(_L("Receive SMS with multiple USIM security headers, 7F and 70, with zero length...") ); |
2636 WaitForRecvL(socket); |
2506 WaitForRecvL(socket); |
2637 smsMessage = RecvSmsL(socket); |
2507 smsMessage = RecvSmsL(socket); |
2638 |
2508 |
2639 CleanupStack::PushL(smsMessage); |
2509 CleanupStack::PushL(smsMessage); |
2640 TestSmsContentsL(smsMessage,KTestMsg); |
2510 TestSmsContentsL(smsMessage,KTestMsg); |
2649 CleanupStack::PopAndDestroy(smsMessage); |
2519 CleanupStack::PopAndDestroy(smsMessage); |
2650 |
2520 |
2651 //----------- |
2521 //----------- |
2652 //Receive message with multiple USIM security headers - 7F and 7F, with zero length |
2522 //Receive message with multiple USIM security headers - 7F and 7F, with zero length |
2653 //This is a duplicate information element |
2523 //This is a duplicate information element |
2654 INFO_PRINTF1(_L("waiting for incoming SMS with multiple USIM security headers, 7F and 7F, with zero length...") ); |
2524 INFO_PRINTF1(_L("Receive SMS with multiple USIM security headers, 7F and 7F, with zero length...") ); |
2655 WaitForRecvL(socket); |
2525 WaitForRecvL(socket); |
2656 smsMessage = RecvSmsL(socket); |
2526 smsMessage = RecvSmsL(socket); |
2657 |
2527 |
2658 CleanupStack::PushL(smsMessage); |
2528 CleanupStack::PushL(smsMessage); |
2659 TestSmsContentsL(smsMessage,KTestMsg); |
2529 TestSmsContentsL(smsMessage,KTestMsg); |
2795 informationElement=secondInformationElement.Identifier(); |
2664 informationElement=secondInformationElement.Identifier(); |
2796 TEST(informationElement==CSmsInformationElement::ESmsIEISIMToolkitSecurityHeaders6); |
2665 TEST(informationElement==CSmsInformationElement::ESmsIEISIMToolkitSecurityHeaders6); |
2797 |
2666 |
2798 CleanupStack::PopAndDestroy(longSmsMessage); |
2667 CleanupStack::PopAndDestroy(longSmsMessage); |
2799 CleanupStack::PopAndDestroy(&socket); |
2668 CleanupStack::PopAndDestroy(&socket); |
2800 CleanupStack::PopAndDestroy(&socketServer); |
|
2801 |
|
2802 __UHEAP_MARKEND; |
|
2803 |
|
2804 return TestStepResult(); |
2669 return TestStepResult(); |
2805 } |
2670 } |
2806 |
|
2807 |
2671 |
2808 /* |
2672 /* |
2809 Class 2 Messages are stored on the SIM. Automatic deletion in the DCS does not delete these messages |
2673 Class 2 Messages are stored on the SIM. Automatic deletion in the DCS does not delete these messages |
2810 from the SIM. This is the default behaviour. This behaviour can be changed and it is done in |
2674 from the SIM. This is the default behaviour. This behaviour can be changed and it is done in |
2811 the esk file. This is tested in test step CTestAutomaticDeletionInDCSAndInESK. |
2675 the esk file. This is tested in test step CTestAutomaticDeletionInDCSAndInESK. |
2814 /** |
2678 /** |
2815 * Test the enhanced voice mail delete confirmation |
2679 * Test the enhanced voice mail delete confirmation |
2816 */ |
2680 */ |
2817 { |
2681 { |
2818 INFO_PRINTF1(_L("Test automatic deletion of messages marked as such in the code data segment(cds)")); |
2682 INFO_PRINTF1(_L("Test automatic deletion of messages marked as such in the code data segment(cds)")); |
2819 |
|
2820 __UHEAP_MARK; |
|
2821 |
|
2822 RSocketServ socketServer; |
|
2823 PrepareRegTestLC(socketServer, 78); |
|
2824 |
|
2825 RSocket socket; |
2683 RSocket socket; |
2826 iSmsStackTestUtils->OpenSmsSocketLC(socketServer,socket,ESmsAddrRecvAny); |
2684 iSmsStackTestUtils->OpenSmsSocketLC(iSocketServer,socket,ESmsAddrRecvAny); |
2827 |
2685 |
2828 _LIT(KTestMsg,""); |
2686 _LIT(KTestMsg,""); |
2829 |
2687 |
2830 //Set destination and SC numbers |
2688 //Set destination and SC numbers |
2831 iTelephoneNumber=KPekka; |
2689 iTelephoneNumber=KPekka; |
2832 iServiceCenterNumber=KRadiolinjaSC; |
2690 iServiceCenterNumber=KRadiolinjaSC; |
2833 |
2691 |
2834 //8 bit coding scheme |
2692 //8 bit coding scheme |
2835 TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit; |
2693 TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit; |
2836 CSmsMessage* smsMessage=CreateSmsMessageL(KTestMsg,alphabet); |
2694 CSmsMessage* smsMessage=CreateSmsMessageLC(KTestMsg,alphabet); |
2837 CleanupStack::PushL(smsMessage); |
|
2838 |
2695 |
2839 //Set message to class 2 |
2696 //Set message to class 2 |
2840 TSmsDataCodingScheme::TSmsClass pduClass=TSmsDataCodingScheme::ESmsClass2; |
2697 TSmsDataCodingScheme::TSmsClass pduClass=TSmsDataCodingScheme::ESmsClass2; |
2841 CSmsPDU& pdu = smsMessage->SmsPDU(); |
2698 CSmsPDU& pdu = smsMessage->SmsPDU(); |
2842 pdu.SetClass(ETrue,pduClass); |
2699 pdu.SetClass(ETrue,pduClass); |
2865 //Set message to auto delete |
2722 //Set message to auto delete |
2866 TInt autoDeleteHexValue=0x40; |
2723 TInt autoDeleteHexValue=0x40; |
2867 pdu.SetBits7To4(TSmsDataCodingScheme::TSmsDCSBits7To4(autoDeleteHexValue)); |
2724 pdu.SetBits7To4(TSmsDataCodingScheme::TSmsDCSBits7To4(autoDeleteHexValue)); |
2868 //Send this message |
2725 //Send this message |
2869 SendSmsL(smsMessage,socket); |
2726 SendSmsL(smsMessage,socket); |
2870 |
|
2871 CleanupStack::PopAndDestroy(smsMessage); |
2727 CleanupStack::PopAndDestroy(smsMessage); |
2872 //----------End Sending |
2728 //----------End Sending |
2873 |
2729 |
2874 //Receive a message of class 2 - message will be stored on the SIM |
2730 INFO_PRINTF1(_L("Receive a message of class 2 - message will be stored on the SIM...")); |
2875 INFO_PRINTF1(_L("waiting for incoming SMS...") ); |
2731 WaitForRecvL(socket); |
2876 WaitForRecvL(socket); |
2732 smsMessage = RecvSmsL(socket); |
2877 smsMessage = RecvSmsL(socket); |
2733 CleanupStack::PushL(smsMessage); |
2878 CleanupStack::PushL(smsMessage); |
2734 |
2879 //Get PDU |
2735 //Get PDU |
2880 CSmsPDU& classTwoPdu = smsMessage->SmsPDU(); |
2736 CSmsPDU& classTwoPdu = smsMessage->SmsPDU(); |
2881 //Class |
2737 //Class |
2882 //TSmsDataCodingScheme::TSmsClass pduClass; |
2738 //TSmsDataCodingScheme::TSmsClass pduClass; |
2883 classTwoPdu.Class(pduClass); |
2739 classTwoPdu.Class(pduClass); |
2888 //Test the slots |
2744 //Test the slots |
2889 count=smsMessage->iSlotArray.Count(); |
2745 count=smsMessage->iSlotArray.Count(); |
2890 TEST(count==1); |
2746 TEST(count==1); |
2891 TGsmSmsSlotEntry smsSlot=smsMessage->iSlotArray[0]; |
2747 TGsmSmsSlotEntry smsSlot=smsMessage->iSlotArray[0]; |
2892 TEST(smsSlot.iStore.Compare(_L("S14"))==0); |
2748 TEST(smsSlot.iStore.Compare(_L("S14"))==0); |
2893 |
2749 CleanupStack::PopAndDestroy(smsMessage); |
2894 CleanupStack::PopAndDestroy(smsMessage); |
2750 |
2895 |
2751 INFO_PRINTF1(_L("Receive a message of class 2 with automatic delete - message will be stored on the SIM...")); |
2896 //Receive a message of class 2 with automatic delete - message will be stored on the SIM |
|
2897 INFO_PRINTF1(_L("waiting for incoming SMS class 2 with automatic delete...") ); |
|
2898 WaitForRecvL(socket); |
2752 WaitForRecvL(socket); |
2899 smsMessage = RecvSmsL(socket); |
2753 smsMessage = RecvSmsL(socket); |
2900 CleanupStack::PushL(smsMessage); |
2754 CleanupStack::PushL(smsMessage); |
2901 //Get PDU |
2755 //Get PDU |
2902 CSmsPDU& pduClass2 = smsMessage->SmsPDU(); |
2756 CSmsPDU& pduClass2 = smsMessage->SmsPDU(); |
2911 TEST(count==1); |
2765 TEST(count==1); |
2912 smsSlot=smsMessage->iSlotArray[0]; |
2766 smsSlot=smsMessage->iSlotArray[0]; |
2913 TEST(smsSlot.iStore.Compare(_L("S14"))==0); |
2767 TEST(smsSlot.iStore.Compare(_L("S14"))==0); |
2914 CleanupStack::PopAndDestroy(smsMessage); |
2768 CleanupStack::PopAndDestroy(smsMessage); |
2915 |
2769 |
2916 //Receive a message of class 1 with automatic delete |
2770 INFO_PRINTF1(_L("Receive a message of class 1 with automatic delete...") ); |
2917 INFO_PRINTF1(_L("waiting for incoming SMS class 1 with automatic delete...") ); |
2771 WaitForRecvL(socket); |
2918 WaitForRecvL(socket); |
2772 smsMessage = RecvSmsL(socket); |
2919 smsMessage = RecvSmsL(socket); |
2773 CleanupStack::PushL(smsMessage); |
2920 CleanupStack::PushL(smsMessage); |
2774 |
2921 //Get PDU |
2775 //Get PDU |
2922 CSmsPDU& pduClass1 = smsMessage->SmsPDU(); |
2776 CSmsPDU& pduClass1 = smsMessage->SmsPDU(); |
2923 //Class |
2777 //Class |
2924 pduClass1.Class(pduClass); |
2778 pduClass1.Class(pduClass); |
2925 TEST(pduClass==TSmsDataCodingScheme::ESmsClass1); |
2779 TEST(pduClass==TSmsDataCodingScheme::ESmsClass1); |
|
2780 |
2926 //Test the storage |
2781 //Test the storage |
2927 storage=smsMessage->Storage(); |
2782 storage=smsMessage->Storage(); |
2928 TEST(storage==CSmsMessage::ESmsNoStorage); |
2783 TEST(storage==CSmsMessage::ESmsNoStorage); |
2929 CleanupStack::PopAndDestroy(smsMessage); |
2784 CleanupStack::PopAndDestroy(smsMessage); |
2930 |
2785 |
2931 //Receive a message of class 3 with automatic delete |
2786 INFO_PRINTF1(_L("Receive a message of class 3 with automatic delete...") ); |
2932 INFO_PRINTF1(_L("waiting for incoming SMS class 3 with automatic delete...") ); |
2787 WaitForRecvL(socket); |
2933 WaitForRecvL(socket); |
2788 smsMessage = RecvSmsL(socket); |
2934 smsMessage = RecvSmsL(socket); |
2789 CleanupStack::PushL(smsMessage); |
2935 CleanupStack::PushL(smsMessage); |
2790 |
2936 //Get PDU |
2791 //Get PDU |
2937 CSmsPDU& pduClass3 = smsMessage->SmsPDU(); |
2792 CSmsPDU& pduClass3 = smsMessage->SmsPDU(); |
2938 //Class |
2793 //Class |
2939 pduClass3.Class(pduClass); |
2794 pduClass3.Class(pduClass); |
2940 TEST(pduClass==TSmsDataCodingScheme::ESmsClass3); |
2795 TEST(pduClass==TSmsDataCodingScheme::ESmsClass3); |
|
2796 |
2941 //Test the storage |
2797 //Test the storage |
2942 storage=smsMessage->Storage(); |
2798 storage=smsMessage->Storage(); |
2943 TEST(storage==CSmsMessage::ESmsNoStorage); |
2799 TEST(storage==CSmsMessage::ESmsNoStorage); |
2944 CleanupStack::PopAndDestroy(smsMessage); |
2800 CleanupStack::PopAndDestroy(smsMessage); |
2945 |
2801 |
2946 //Receive a message of class 0 with automatic delete |
2802 INFO_PRINTF1(_L("Receive a message of class 0 with automatic delete...") ); |
2947 INFO_PRINTF1(_L("waiting for incoming SMS class 0 with automatic delete...") ); |
2803 WaitForRecvL(socket); |
2948 WaitForRecvL(socket); |
2804 smsMessage = RecvSmsL(socket); |
2949 smsMessage = RecvSmsL(socket); |
2805 CleanupStack::PushL(smsMessage); |
2950 CleanupStack::PushL(smsMessage); |
2806 |
2951 //Get PDU |
2807 //Get PDU |
2952 CSmsPDU& pduClass0 = smsMessage->SmsPDU(); |
2808 CSmsPDU& pduClass0 = smsMessage->SmsPDU(); |
2953 //Class |
2809 //Class |
2954 pduClass0.Class(pduClass); |
2810 pduClass0.Class(pduClass); |
2955 TEST(pduClass==TSmsDataCodingScheme::ESmsClass0); |
2811 TEST(pduClass==TSmsDataCodingScheme::ESmsClass0); |
|
2812 |
2956 //Test the storage |
2813 //Test the storage |
2957 storage=smsMessage->Storage(); |
2814 storage=smsMessage->Storage(); |
2958 TEST(storage==CSmsMessage::ESmsNoStorage); |
2815 TEST(storage==CSmsMessage::ESmsNoStorage); |
2959 CleanupStack::PopAndDestroy(smsMessage); |
2816 CleanupStack::PopAndDestroy(smsMessage); |
2960 |
2817 |
2999 /** |
2851 /** |
3000 * Test the enhanced voice mail delete confirmation |
2852 * Test the enhanced voice mail delete confirmation |
3001 */ |
2853 */ |
3002 { |
2854 { |
3003 INFO_PRINTF1(_L("Test automatic deletion of messages marked in dcs, and set for delete in the ESK file")); |
2855 INFO_PRINTF1(_L("Test automatic deletion of messages marked in dcs, and set for delete in the ESK file")); |
3004 |
|
3005 __UHEAP_MARK; |
|
3006 |
|
3007 RSocketServ socketServer; |
|
3008 PrepareRegTestLC(socketServer, 79); |
|
3009 |
|
3010 RSocket socket; |
2856 RSocket socket; |
3011 iSmsStackTestUtils->OpenSmsSocketLC(socketServer,socket,ESmsAddrRecvAny); |
2857 iSmsStackTestUtils->OpenSmsSocketLC(iSocketServer,socket,ESmsAddrRecvAny); |
3012 |
2858 |
3013 _LIT(KTestMsg,"Esk file has been set to delete class 2 messages marked for automatic deletion"); |
2859 _LIT(KTestMsg,"Esk file has been set to delete class 2 messages marked for automatic deletion"); |
3014 |
2860 |
3015 //Set destination and SC numbers |
2861 //Set destination and SC numbers |
3016 iTelephoneNumber=KPekka; |
2862 iTelephoneNumber=KPekka; |
3017 iServiceCenterNumber=KRadiolinjaSC; |
2863 iServiceCenterNumber=KRadiolinjaSC; |
3018 |
2864 |
3019 //8 bit coding scheme - create message |
2865 //8 bit coding scheme - create message |
3020 TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit; |
2866 TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit; |
3021 CSmsMessage* smsMessage=CreateSmsMessageL(KTestMsg,alphabet); |
2867 CSmsMessage* smsMessage=CreateSmsMessageLC(KTestMsg,alphabet); |
3022 CleanupStack::PushL(smsMessage); |
|
3023 |
2868 |
3024 //Set message to class 2 |
2869 //Set message to class 2 |
3025 TSmsDataCodingScheme::TSmsClass pduClass=TSmsDataCodingScheme::ESmsClass2; |
2870 TSmsDataCodingScheme::TSmsClass pduClass=TSmsDataCodingScheme::ESmsClass2; |
3026 CSmsPDU& pdu = smsMessage->SmsPDU(); |
2871 CSmsPDU& pdu = smsMessage->SmsPDU(); |
3027 pdu.SetClass(ETrue,pduClass); |
2872 pdu.SetClass(ETrue,pduClass); |
3126 count = sbuf(); |
2971 count = sbuf(); |
3127 INFO_PRINTF2(_L("%d enumerated messages after receiving messages"), count); |
2972 INFO_PRINTF2(_L("%d enumerated messages after receiving messages"), count); |
3128 TEST(count==0); |
2973 TEST(count==0); |
3129 |
2974 |
3130 CleanupStack::PopAndDestroy(&socket); |
2975 CleanupStack::PopAndDestroy(&socket); |
3131 CleanupStack::PopAndDestroy(&socketServer); |
2976 return TestStepResult(); |
3132 |
|
3133 __UHEAP_MARKEND; |
|
3134 |
|
3135 return TestStepResult(); |
|
3136 } |
2977 } |
3137 |
2978 |
3138 |
2979 |
3139 TVerdict CTestAutomaticDeletionTypeZeroSMS::doTestStepL() |
2980 TVerdict CTestAutomaticDeletionTypeZeroSMS::doTestStepL() |
3140 /** |
2981 /** |
3141 * Test the enhanced voice mail delete confirmation |
2982 * Test the enhanced voice mail delete confirmation |
3142 */ |
2983 */ |
3143 { |
2984 { |
3144 INFO_PRINTF1(_L("Test automatic deletion of messages of type zero")); |
2985 INFO_PRINTF1(_L("Test automatic deletion of messages of type zero")); |
3145 |
|
3146 __UHEAP_MARK; |
|
3147 |
|
3148 RSocketServ socketServer; |
|
3149 PrepareRegTestLC(socketServer, 80); |
|
3150 |
|
3151 RSocket socket; |
2986 RSocket socket; |
3152 iSmsStackTestUtils->OpenSmsSocketLC(socketServer,socket,ESmsAddrRecvAny); |
2987 iSmsStackTestUtils->OpenSmsSocketLC(iSocketServer,socket,ESmsAddrRecvAny); |
3153 |
2988 |
3154 _LIT(KTestMsg,"Type 0 Sms message"); |
2989 _LIT(KTestMsg,"Type 0 Sms message"); |
3155 |
2990 |
3156 //Set destination and SC numbers |
2991 //Set destination and SC numbers |
3157 iTelephoneNumber=KPekka; |
2992 iTelephoneNumber=KPekka; |
3158 iServiceCenterNumber=KRadiolinjaSC; |
2993 iServiceCenterNumber=KRadiolinjaSC; |
3159 |
2994 |
3160 //8 bit coding scheme - create message |
2995 //8 bit coding scheme - create message |
3161 TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit; |
2996 TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit; |
3162 CSmsMessage* smsMessage=CreateSmsMessageL(KTestMsg,alphabet); |
2997 CSmsMessage* smsMessage=CreateSmsMessageLC(KTestMsg,alphabet); |
3163 CleanupStack::PushL(smsMessage); |
|
3164 |
2998 |
3165 //Set message to type 0 |
2999 //Set message to type 0 |
3166 CSmsPDU& pdu = smsMessage->SmsPDU(); |
3000 CSmsPDU& pdu = smsMessage->SmsPDU(); |
3167 //Set the PID type |
3001 //Set the PID type |
3168 TSmsProtocolIdentifier::TSmsPIDType pIdType=TSmsProtocolIdentifier::ESmsPIDShortMessageType; |
3002 TSmsProtocolIdentifier::TSmsPIDType pIdType=TSmsProtocolIdentifier::ESmsPIDShortMessageType; |
3274 count = sbuf(); |
3108 count = sbuf(); |
3275 INFO_PRINTF2(_L("%d enumerated messages"), count); |
3109 INFO_PRINTF2(_L("%d enumerated messages"), count); |
3276 TEST(count==2); |
3110 TEST(count==2); |
3277 |
3111 |
3278 CleanupStack::PopAndDestroy(&socket); |
3112 CleanupStack::PopAndDestroy(&socket); |
3279 CleanupStack::PopAndDestroy(&socketServer); |
3113 return TestStepResult(); |
3280 |
|
3281 __UHEAP_MARKEND; |
|
3282 |
|
3283 return TestStepResult(); |
|
3284 } |
3114 } |
3285 |
|
3286 |
|
3287 |
3115 |
3288 TVerdict CTestAutomaticDeletionTypeZeroAndSetInESK::doTestStepL() |
3116 TVerdict CTestAutomaticDeletionTypeZeroAndSetInESK::doTestStepL() |
3289 /** |
3117 /** |
3290 * Test the enhanced voice mail delete confirmation |
3118 * Test the enhanced voice mail delete confirmation |
3291 */ |
3119 */ |
3292 { |
3120 { |
3293 INFO_PRINTF1(_L("Test automatic deletion of messages of type zero, and set for deletion for Class 0 in ESK file.")); |
3121 INFO_PRINTF1(_L("Test automatic deletion of messages of type zero, and set for deletion for Class 0 in ESK file.")); |
3294 |
|
3295 __UHEAP_MARK; |
|
3296 |
|
3297 RSocketServ socketServer; |
|
3298 PrepareRegTestLC(socketServer, 81); |
|
3299 |
|
3300 RSocket socket; |
3122 RSocket socket; |
3301 iSmsStackTestUtils->OpenSmsSocketLC(socketServer,socket,ESmsAddrRecvAny); |
3123 iSmsStackTestUtils->OpenSmsSocketLC(iSocketServer,socket,ESmsAddrRecvAny); |
3302 |
3124 |
3303 _LIT(KTestMsg,"Type 0 Sms message"); |
3125 _LIT(KTestMsg,"Type 0 Sms message"); |
3304 |
3126 |
3305 //Set destination and SC numbers |
3127 //Set destination and SC numbers |
3306 iTelephoneNumber=KPekka; |
3128 iTelephoneNumber=KPekka; |
3307 iServiceCenterNumber=KRadiolinjaSC; |
3129 iServiceCenterNumber=KRadiolinjaSC; |
3308 |
3130 |
3309 //8 bit coding scheme - create message |
3131 //8 bit coding scheme - create message |
3310 TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit; |
3132 TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit; |
3311 CSmsMessage* smsMessage=CreateSmsMessageL(KTestMsg,alphabet); |
3133 CSmsMessage* smsMessage=CreateSmsMessageLC(KTestMsg,alphabet); |
3312 CleanupStack::PushL(smsMessage); |
|
3313 |
3134 |
3314 //Set message to type 0 |
3135 //Set message to type 0 |
3315 CSmsPDU& pdu = smsMessage->SmsPDU(); |
3136 CSmsPDU& pdu = smsMessage->SmsPDU(); |
3316 //Set the PID type |
3137 //Set the PID type |
3317 TSmsProtocolIdentifier::TSmsPIDType pIdType=TSmsProtocolIdentifier::ESmsPIDShortMessageType; |
3138 TSmsProtocolIdentifier::TSmsPIDType pIdType=TSmsProtocolIdentifier::ESmsPIDShortMessageType; |
3420 * 4) Repeat the test iteratively, incrementing the counter "i" each time until the message is sent |
3236 * 4) Repeat the test iteratively, incrementing the counter "i" each time until the message is sent |
3421 * successfully. |
3237 * successfully. |
3422 */ |
3238 */ |
3423 { |
3239 { |
3424 INFO_PRINTF1(_L("Test out of memory handling")); |
3240 INFO_PRINTF1(_L("Test out of memory handling")); |
3425 RSocketServ socketServer; |
|
3426 PrepareRegTestLC(socketServer, 82); |
|
3427 |
|
3428 RSocket socket; |
3241 RSocket socket; |
3429 iSmsStackTestUtils->OpenSmsSocketLC(socketServer,socket,ESmsAddrRecvAny); |
3242 iSmsStackTestUtils->OpenSmsSocketLC(iSocketServer,socket,ESmsAddrRecvAny); |
3430 |
3243 |
3431 //Set destination and SC numbers |
3244 //Set destination and SC numbers |
3432 iTelephoneNumber=KPekka; |
3245 iTelephoneNumber=KPekka; |
3433 iServiceCenterNumber=KRadiolinjaSC; |
3246 iServiceCenterNumber=KRadiolinjaSC; |
3434 |
3247 |
3435 _LIT(KTestMsg1,"test message, 8bits, length 30"); |
3248 _LIT(KTestMsg1,"test message, 8bits, length 30"); |
3436 |
3249 |
3437 TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit; |
3250 TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit; |
3438 CSmsMessage* smsMessage=CreateSmsMessageL(KTestMsg1,alphabet); |
3251 CSmsMessage* smsMessage=CreateSmsMessageLC(KTestMsg1,alphabet); |
3439 CleanupStack::PushL(smsMessage); |
|
3440 |
3252 |
3441 //Get the operations |
3253 //Get the operations |
3442 CSmsHyperLinkOperations& hyperLinkOperations = static_cast<CSmsHyperLinkOperations&>(smsMessage->GetOperationsForIEL(CSmsInformationElement::ESmsHyperLinkFormat)); |
3254 CSmsHyperLinkOperations& hyperLinkOperations = static_cast<CSmsHyperLinkOperations&>(smsMessage->GetOperationsForIEL(CSmsInformationElement::ESmsHyperLinkFormat)); |
3443 |
3255 |
3444 TUint count=hyperLinkOperations.NumberOfHyperLinksL(); |
3256 TUint count=hyperLinkOperations.NumberOfHyperLinksL(); |
3552 count=0; |
3364 count=0; |
3553 TInt ret=KErrNoMemory; |
3365 TInt ret=KErrNoMemory; |
3554 TInt successfullSends=0; //maximum expected number of succeeded sends is 2 in TSY config file |
3366 TInt successfullSends=0; //maximum expected number of succeeded sends is 2 in TSY config file |
3555 while (successfullSends<8) |
3367 while (successfullSends<8) |
3556 { |
3368 { |
3557 socketServer.__DbgFailNext(count); |
3369 iSocketServer.__DbgFailNext(count); |
3558 socketServer.__DbgMarkHeap(); |
3370 iSocketServer.__DbgMarkHeap(); |
3559 TRAP(ret,SendSmsDontCheckReturnValueL(smsMessage,socket)); |
3371 TRAP(ret,SendSmsDontCheckReturnValueL(smsMessage,socket)); |
3560 socketServer.__DbgMarkEnd(0); |
3372 iSocketServer.__DbgMarkEnd(0); |
3561 if(ret==KErrNone) |
3373 if(ret==KErrNone) |
3562 successfullSends++; |
3374 { |
3563 count++; |
3375 ++successfullSends; |
|
3376 } |
|
3377 ++count; |
3564 } |
3378 } |
3565 |
3379 |
3566 TEST(ret == KErrNone); |
3380 TEST(ret == KErrNone); |
3567 socketServer.__DbgFailNext(-1); // Reset heap |
3381 iSocketServer.__DbgFailNext(-1); // Reset heap |
3568 |
3382 |
3569 INFO_PRINTF1(_L("TPSRR Scheme")); |
3383 INFO_PRINTF1(_L("TPSRR Scheme")); |
3570 |
3384 |
3571 // TPSRR Scheme |
3385 // TPSRR Scheme |
3572 CSmsTPSRROperations& TPSRROperations = static_cast<CSmsTPSRROperations&>(smsMessage->GetOperationsForNonIEL(ESmsTPSRRParameter)); |
3386 CSmsTPSRROperations& TPSRROperations = static_cast<CSmsTPSRROperations&>(smsMessage->GetOperationsForNonIEL(ESmsTPSRRParameter)); |
3576 count=0; |
3390 count=0; |
3577 ret=KErrNoMemory; |
3391 ret=KErrNoMemory; |
3578 successfullSends=0; //maximum expected number of succeeded sends is 2 in TSY config file |
3392 successfullSends=0; //maximum expected number of succeeded sends is 2 in TSY config file |
3579 while (successfullSends<12) |
3393 while (successfullSends<12) |
3580 { |
3394 { |
3581 socketServer.__DbgFailNext(count); |
3395 iSocketServer.__DbgFailNext(count); |
3582 |
3396 |
3583 socketServer.__DbgMarkHeap(); |
3397 iSocketServer.__DbgMarkHeap(); |
3584 TRAP(ret,SendSmsDontCheckReturnValueL(smsMessage,socket)); |
3398 TRAP(ret,SendSmsDontCheckReturnValueL(smsMessage,socket)); |
3585 socketServer.__DbgMarkEnd(0); |
3399 iSocketServer.__DbgMarkEnd(0); |
3586 if(ret==KErrNone) |
3400 if(ret==KErrNone) |
3587 successfullSends++; |
3401 { |
3588 count++; |
3402 ++successfullSends; |
|
3403 } |
|
3404 ++count; |
3589 } |
3405 } |
3590 |
3406 |
3591 TEST(ret == KErrNone); |
3407 TEST(ret == KErrNone); |
3592 socketServer.__DbgFailNext(-1); // Reset heap |
3408 iSocketServer.__DbgFailNext(-1); // Reset heap |
3593 |
3409 |
3594 CleanupStack::PopAndDestroy(2); //smsMessage, socket |
3410 CleanupStack::PopAndDestroy(2, &socket); // socket, smsMessage |
3595 |
|
3596 //Ensure socket server session is closed to remove cache |
|
3597 CleanupStack::PopAndDestroy(&socketServer); |
|
3598 |
|
3599 return TestStepResult() ; |
3411 return TestStepResult() ; |
3600 } |
3412 } |
3601 |
3413 |
3602 |
3414 TVerdict CTestEnhancedVoiceMessageBoundary::doTestStepL() |
3603 TVerdict CEnhancedVoiceMessageBoundaryTest::doTestStepL() |
|
3604 { |
3415 { |
3605 /** |
3416 /** |
3606 * Create a Enhanced Voice Mail Information Element that occupies 139 bytes. |
3417 * Create a Enhanced Voice Mail Information Element that occupies 139 bytes. |
3607 * 139 bytes is the maximum that fit into a single segment message. |
3418 * 139 bytes is the maximum that fit into a single segment message. |
3608 */ |
3419 */ |
3609 RSocketServ socketServer; |
|
3610 PrepareRegTestLC(socketServer, 83); |
|
3611 |
|
3612 RSocket socket; |
3420 RSocket socket; |
3613 iSmsStackTestUtils->OpenSmsSocketLC(socketServer,socket,ESmsAddrRecvAny); |
3421 iSmsStackTestUtils->OpenSmsSocketLC(iSocketServer,socket,ESmsAddrRecvAny); |
3614 |
3422 |
3615 CEnhancedVoiceMailNotification* enhancedVoiceMailNotification = CEnhancedVoiceMailNotification::NewL(); |
3423 CEnhancedVoiceMailNotification* enhancedVoiceMailNotification = CEnhancedVoiceMailNotification::NewL(); |
3616 |
3424 |
3617 // Set up base class |
3425 // Set up base class |
3618 enhancedVoiceMailNotification->SetProfile(EGsmSmsProfileId3); |
3426 enhancedVoiceMailNotification->SetProfile(EGsmSmsProfileId3); |
3659 delete enhancedVoiceMailNotification; |
3466 delete enhancedVoiceMailNotification; |
3660 |
3467 |
3661 //Send the message |
3468 //Send the message |
3662 SendSmsL(smsMessage,socket); |
3469 SendSmsL(smsMessage,socket); |
3663 |
3470 |
3664 CleanupStack::PopAndDestroy(smsMessage); |
3471 CleanupStack::PopAndDestroy(2, &socket); // socket, smsMessage |
3665 CleanupStack::PopAndDestroy(&socket); |
3472 return TestStepResult(); |
3666 CleanupStack::PopAndDestroy(&socketServer); |
|
3667 |
|
3668 return TestStepResult(); |
|
3669 } |
3473 } |
3670 |
3474 |
3671 |
3475 TVerdict CTestEnhancedVoiceMessageBoundary1::doTestStepL() |
3672 TVerdict CEnhancedVoiceMessageBoundaryTest1::doTestStepL() |
|
3673 { |
3476 { |
3674 /*Creates the maximum size enhanced voice message ie that will fit |
3477 /*Creates the maximum size enhanced voice message ie that will fit |
3675 * into a concatenated message, size 134 bytes, allowing 5 bytes for |
3478 * into a concatenated message, size 134 bytes, allowing 5 bytes for |
3676 * a concatenation ie in the PDU. |
3479 * a concatenation ie in the PDU. |
3677 */ |
3480 */ |
3678 RSocketServ socketServer; |
|
3679 PrepareRegTestLC(socketServer, 84); |
|
3680 |
|
3681 RSocket socket; |
3481 RSocket socket; |
3682 iSmsStackTestUtils->OpenSmsSocketLC(socketServer,socket,ESmsAddrRecvAny); |
3482 iSmsStackTestUtils->OpenSmsSocketLC(iSocketServer,socket,ESmsAddrRecvAny); |
3683 |
3483 |
3684 CEnhancedVoiceMailNotification* enhancedVoiceMailNotification = CEnhancedVoiceMailNotification::NewL(); |
3484 CEnhancedVoiceMailNotification* enhancedVoiceMailNotification = CEnhancedVoiceMailNotification::NewL(); |
3685 |
3485 |
3686 // Set up base class |
3486 // Set up base class |
3687 enhancedVoiceMailNotification->SetProfile(EGsmSmsProfileId3); |
3487 enhancedVoiceMailNotification->SetProfile(EGsmSmsProfileId3); |
3723 voiceMailNotificationArray.Append(voiceMailNotification); |
3523 voiceMailNotificationArray.Append(voiceMailNotification); |
3724 } |
3524 } |
3725 |
3525 |
3726 _LIT(KTestMsg1,"Dundee United"); |
3526 _LIT(KTestMsg1,"Dundee United"); |
3727 TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit; |
3527 TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit; |
3728 CSmsMessage* smsMessage=CreateSmsMessageL(KTestMsg1,alphabet); |
3528 CSmsMessage* smsMessage=CreateSmsMessageLC(KTestMsg1,alphabet); |
3729 CleanupStack::PushL(smsMessage); |
|
3730 |
3529 |
3731 TSmsUserDataSettings userDataSettings; |
3530 TSmsUserDataSettings userDataSettings; |
3732 userDataSettings.SetAlphabet(TSmsDataCodingScheme::ESmsAlphabet8Bit); |
3531 userDataSettings.SetAlphabet(TSmsDataCodingScheme::ESmsAlphabet8Bit); |
3733 smsMessage->SetUserDataSettingsL(userDataSettings); |
3532 smsMessage->SetUserDataSettingsL(userDataSettings); |
3734 |
3533 |