smsprotocols/smsstack/smsprot/Test/TE_Smsprt/TE_EnumerateInOODCondition.cpp
changeset 20 244d7c5f118e
parent 0 3553901f7fa8
child 24 6638e7f4bd8f
equal deleted inserted replaced
19:1f776524b15c 20:244d7c5f118e
    22 CEnumerateInOODCondition::CEnumerateInOODCondition(RSocketServ &aSocketServer)
    22 CEnumerateInOODCondition::CEnumerateInOODCondition(RSocketServ &aSocketServer)
    23 /** 
    23 /** 
    24 	Each test step initialises it's own name
    24 	Each test step initialises it's own name
    25 */
    25 */
    26 	{
    26 	{
    27 	iSocketServer = &aSocketServer;
    27     iSharedSocketServer = &aSocketServer;
       
    28     iPartOfMultiStepTestCase = ETrue;
    28 	}
    29 	}
    29 
    30 
    30 /**
    31 /**
    31   Enumerates SIM messages.
    32   Enumerates SIM messages.
    32 		*/
    33  */
    33 TVerdict CEnumerateInOODCondition::doTestStepL()
    34 TVerdict CEnumerateInOODCondition::doTestStepL()
    34 	{
    35 	{
    35 #ifndef _DEBUG
    36 #ifndef _DEBUG
    36     INFO_PRINTF1(_L("This test can only be run when the SMS Stack is in debug mode."));
    37     INFO_PRINTF1(_L("This test can only be run when the SMS Stack is in debug mode."));
    37 #else   
    38 #else   
    38 	
    39 	
    39 	//PrepareRegTestLC(*iSocketServer, 17);
    40 	//Open a socket 
       
    41 	RSocket socket;
       
    42 	OpenSmsSocketL(*iSharedSocketServer, socket, ESmsAddrRecvAny);
       
    43     CleanupClosePushL(socket);
    40 	
    44 	
    41 	//Open a socket 
       
    42 	INFO_PRINTF1(_L("Opening socket..."));
       
    43 	RSocket socket;
       
    44 	OpenSmsSocketL(*iSocketServer, socket, ESmsAddrRecvAny);
       
    45 
       
    46 	TRequestStatus status;
    45 	TRequestStatus status;
    47 	TPckgBuf<TUint> sbuf;
    46 	TPckgBuf<TUint> sbuf;
    48 	sbuf()=0;
    47 	sbuf()=0;
    49 
    48 
    50 	//Now enumerate messages from store
    49 	//Now enumerate messages from store
    51 	socket.Ioctl(KIoctlEnumerateSmsMessages,status,&sbuf, KSolSmsProv);
    50 	socket.Ioctl(KIoctlEnumerateSmsMessages,status,&sbuf, KSolSmsProv);
    52 	User::WaitForRequest(status);
    51 	User::WaitForRequest(status);
       
    52 	TESTCHECK(status.Int(), KErrDiskFull, "Checking the Enumeration was unsuccessful due to the disk being full");
    53 	
    53 	
    54 	//The Enumeration should fail due to the disk being full and returns KErrDiskFull
    54     CleanupStack::PopAndDestroy(&socket);
    55 	if(status==KErrDiskFull)
       
    56 		{
       
    57 		INFO_PRINTF1(_L("Status = KErrDiskFull"));
       
    58 		}
       
    59 	else
       
    60 		{
       
    61 		TEST(EFalse);
       
    62 		}
       
    63 	
       
    64 	socket.Close();
       
    65 #endif		
    55 #endif		
    66 	return TestStepResult();
    56 	return TestStepResult();
    67 	}
    57 	}
    68 //----------------------------------------------------------------------------->
       
    69 
       
    70