self->ConstructL(  );
    CleanupStack::Pop(self);
    return self;
    }

    
// -----------------------------------------------------------------------------
// Destructor.
// -----------------------------------------------------------------------------
//
CBTSAController::~CBTSAController()
    {
    TRACE_FUNC
    if(iStreamingSockets.Count())
		{
		TRACE_INFO((_L("[SOCKET] closed.")))
		iStreamingSockets[0].Close();
		}
	iStreamingSockets.Close();
	delete iStreamer;
    delete iGavdp;
    delete iState;
    delete iGavdpErrorActive;
    delete iLocalSEPs;
	delete iRemoteSEPs;
    iAccDb.ResetAndDestroy();
	iAccDb.Close();    
    RProperty::Delete( KBTAudioRemCon, KBTAudioPlayerControl );
    TRACE_INFO((_L("CBTSAController::~CBTSAController() completed")))
    }
//
// Initial Contributors:
// Nokia Corporation - initial contribution.
//
// Contributors:
//
// Description:
// T_LOGSERVCRASH.CPP
// This tests the fix implemented for DEF047320
// 
#include <s32file.h>
#include <e32math.h>
#include "t_logutil2.h"
#include <logview.h>

RTest TheTest(_L("t_logservercrash"));

const TInt KTestEventNum = 10;
const TLogDurationType KTestDurationType1 = 1;
const TLogDuration KTestDuration1 = 0x1234;
const TLogFlags KTestFlags1 = 0x5;
const TLogLink KTestLink1 = 0x1234;

_LIT(KTestRemoteParty1, "Remote Party");
_LIT(KTestDirection1, "Direction");
_LIT(KTestStatus1, "Status");
_LIT(KTestSubject1, "Subject");
_LIT(KTestNumber1, "TheNumber");
_LIT8(KTestData1, "ABCDEFGH");

TBool TheMatchingIsEnabled = EFalse;
示例#3
0
// Assumptions/Requirement/Pre-requisites:
// Failures and causes:
// Base Port information:
//
//

#include <e32std.h>
#include <e32std_private.h>
#include <e32svr.h>
#include <e32test.h>
#include <e32ldr.h>
#include <e32def.h>
#include <e32def_private.h>
#include <u32std.h>

RTest test(_L("T_CONDVAR"));
RMutex M1;
RMutex M2;
RCondVar CV1;
RCondVar CV2;

#define __TRACE_LINE__	test.Printf(_L("Line %d\n"),__LINE__)

struct SThreadData
{
    SThreadData();
    RMutex iM;
    RCondVar iV;
    RArray<TInt>* iA;
    TInt iTotal;
    TInt iInnerLoops;
示例#4
0
// constructor
CCommDbTest020_02::CCommDbTest020_02()
	{
	// store the name of this test case
	SetTestStepName(_L("step_020_02"));
	}
示例#5
0
TVerdict Caddfield_logStep::doTestStepL()
/**
 * @return - TVerdict code
 * Override of base class pure virtual
 * Our implementation only gets called if the base class doTestStepPreambleL() did
 * not leave. That being the case, the current test result value will be EPass.
 */
	{
	
	if(TestStepResult()==EFail) return TestStepResult();
	INFO_PRINTF1(_L("AddField test and logging test")); 

	// OS needs time to shutdown the server in case being connected previous test
	// The delay means we get server terminated from the OS
//	
	RFileFlogger ilogger;
	TInt err=ilogger.Connect();
	if(err)
	{
		INFO_PRINTF2(_L("Connect() failed. err = %d"),err);
		SetTestStepResult(EFail);
		return TestStepResult();
	}
	err=ilogger.CreateLog(KLogFile1,RFileFlogger::ELogModeAppend);
//	err=ilogger.CreateLog(KLogFile1,RFileFlogger::ELogModeOverWrite);
	//ELogModeAppend
	if(!err)
	{
		INFO_PRINTF1(_L("xml format file open passed and test start"));
	}
	else  
	{
		ERR_PRINTF2(_L("error value = %d"),err);
		SetTestStepResult(EFail);
		return TestStepResult();

	}

	TBuf<20> buf16(K16BitString);
	TInt n=0;
	ilogger.SetLogLevel(RFileFlogger::ESevrAll);
	ilogger.Log(((TText8*)__FILE__), __LINE__,RFileFlogger::ESevrAll, K16BitFormatText,n++,&buf16);
	ilogger.Log(((TText8*)__FILE__), __LINE__,RFileFlogger::ESevrInfo, K16BitFormatText,n++,&buf16);
	ilogger.Log(((TText8*)__FILE__), __LINE__,RFileFlogger::ESevrWarn, K16BitFormatText,n++,&buf16);
	ilogger.Log(((TText8*)__FILE__), __LINE__,RFileFlogger::ESevrHigh, K16BitFormatText,n++,&buf16);
	ilogger.Log(((TText8*)__FILE__), __LINE__,RFileFlogger::ESevrMedium, K16BitFormatText,n++,&buf16);
	ilogger.Log(((TText8*)__FILE__), __LINE__,RFileFlogger::ESevrLow, K16BitFormatText,n++,&buf16);

	INFO_PRINTF1(_L("test ESevrErr"));
	ilogger.SetLogLevel(RFileFlogger::ESevrErr);
	ilogger.Log(((TText8*)__FILE__), __LINE__,RFileFlogger::ESevrAll, K16BitFormatText,n++,&buf16);
	ilogger.Log(((TText8*)__FILE__), __LINE__,RFileFlogger::ESevrInfo, K16BitFormatText,n++,&buf16);
	ilogger.Log(((TText8*)__FILE__), __LINE__,RFileFlogger::ESevrWarn, K16BitFormatText,n++,&buf16);

	INFO_PRINTF1(_L("test log with add fileds"));
	TInt aLength = 2;
	TExtraLogField logField[2];
	logField[0].iLogFieldName.Copy(_L("SUITE_NAME"));
	logField[0].iLogFieldValue.Copy(_L("SUITE_VALUE"));
	logField[1].iLogFieldName.Copy(_L("TEST_NAME"));
	logField[1].iLogFieldValue.Copy(_L("TEST_VALUE"));
	
	ilogger.Log(((TText8*)__FILE__), __LINE__,RFileFlogger::ESevrErr, aLength, logField, K16BitFormatText,n++,&buf16);


	INFO_PRINTF1(_L("test ESevrWarn"));
	n=0;
	ilogger.SetLogLevel(RFileFlogger::ESevrWarn);
	ilogger.Log(((TText8*)__FILE__), __LINE__,RFileFlogger::ESevrAll, K16BitFormatText,n++,&buf16);
	ilogger.Log(((TText8*)__FILE__), __LINE__,RFileFlogger::ESevrInfo, K16BitFormatText,n++,&buf16);
	ilogger.Log(((TText8*)__FILE__), __LINE__,RFileFlogger::ESevrWarn, K16BitFormatText,n++,&buf16);

	ilogger.Log(((TText8*)__FILE__), __LINE__,RFileFlogger::ESevrErr, K16BitFormatText,n++,&buf16);

	INFO_PRINTF1(_L("test ESevrInfo"));
	n=0;
	ilogger.SetLogLevel(RFileFlogger::ESevrInfo);
	ilogger.Log(((TText8*)__FILE__), __LINE__,RFileFlogger::ESevrAll, K16BitFormatText,n++,&buf16);
	ilogger.Log(((TText8*)__FILE__), __LINE__,RFileFlogger::ESevrInfo, K16BitFormatText,n++,&buf16);
	ilogger.Log(((TText8*)__FILE__), __LINE__,RFileFlogger::ESevrWarn, K16BitFormatText,n++,&buf16);

	ilogger.Log(((TText8*)__FILE__), __LINE__,RFileFlogger::ESevrErr, K16BitFormatText,n++,&buf16);

	INFO_PRINTF1(_L("test ESevrAll"));
	n=0;
	ilogger.SetLogLevel(RFileFlogger::ESevrAll);
	ilogger.Log(((TText8*)__FILE__), __LINE__,RFileFlogger::ESevrAll, K16BitFormatText,n++,&buf16);
	ilogger.Log(((TText8*)__FILE__), __LINE__,RFileFlogger::ESevrInfo, K16BitFormatText,n++,&buf16);
	ilogger.Log(((TText8*)__FILE__), __LINE__,RFileFlogger::ESevrWarn, K16BitFormatText,n++,&buf16);

	ilogger.Log(((TText8*)__FILE__), __LINE__,RFileFlogger::ESevrErr, K16BitFormatText,n++,&buf16);
// txt log test
	ilogger.Close();
	err=ilogger.Connect();
	if(err)
	{
		INFO_PRINTF2(_L("Connect() failed. err = %d"),err);
		SetTestStepResult(EFail);
		return TestStepResult();
	}
	INFO_PRINTF1(_L("RFileFlogger::ELogModeAppend test ..."));
	err=ilogger.CreateLog(KLogFiletxt,RFileFlogger::ELogModeAppend);
	if(!err)
	{
	    INFO_PRINTF1(_L("RFileFlogger::ELogModeAppend testing is fine"));
		INFO_PRINTF1(_L("txt format file open passed and test start"));
	}
	else  
	{
		ERR_PRINTF2(_L("error value = %d"),err);
		SetTestStepResult(EFail);
		return TestStepResult();

	}

	n=0;
	ilogger.SetLogLevel(RFileFlogger::ESevrAll);
	ilogger.Log(((TText8*)__FILE__), __LINE__,RFileFlogger::ESevrAll, K16BitFormatText,n++,&buf16);
	ilogger.Log(((TText8*)__FILE__), __LINE__,RFileFlogger::ESevrInfo, K16BitFormatText,n++,&buf16);
	ilogger.Log(((TText8*)__FILE__), __LINE__,RFileFlogger::ESevrWarn, K16BitFormatText,n++,&buf16);
	ilogger.Log(((TText8*)__FILE__), __LINE__,RFileFlogger::ESevrHigh, K16BitFormatText,n++,&buf16);
	ilogger.Log(((TText8*)__FILE__), __LINE__,RFileFlogger::ESevrMedium, K16BitFormatText,n++,&buf16);
	ilogger.Log(((TText8*)__FILE__), __LINE__,RFileFlogger::ESevrLow, K16BitFormatText,n++,&buf16);

	INFO_PRINTF1(_L("test ESevrErr"));
	ilogger.SetLogLevel(RFileFlogger::ESevrErr);
	ilogger.Log(((TText8*)__FILE__), __LINE__,RFileFlogger::ESevrAll, K16BitFormatText,n++,&buf16);
	ilogger.Log(((TText8*)__FILE__), __LINE__,RFileFlogger::ESevrInfo, K16BitFormatText,n++,&buf16);
	ilogger.Log(((TText8*)__FILE__), __LINE__,RFileFlogger::ESevrWarn, K16BitFormatText,n++,&buf16);

	INFO_PRINTF1(_L("test log with add fileds"));
    aLength = 2;
	logField[0].iLogFieldName.Copy(_L("SUITE_NAME"));
	logField[0].iLogFieldValue.Copy(_L("SUITE_VALUE"));
	logField[1].iLogFieldName.Copy(_L("TEST_NAME"));
	logField[1].iLogFieldValue.Copy(_L("TEST_VALUE"));
	
	ilogger.Log(((TText8*)__FILE__), __LINE__,RFileFlogger::ESevrErr, aLength, logField, K16BitFormatText,n++,&buf16);

	
	INFO_PRINTF1(_L("test ESevrWarn"));
	n=0;
	ilogger.SetLogLevel(RFileFlogger::ESevrWarn);
	ilogger.Log(((TText8*)__FILE__), __LINE__,RFileFlogger::ESevrAll, K16BitFormatText,n++,&buf16);
	ilogger.Log(((TText8*)__FILE__), __LINE__,RFileFlogger::ESevrInfo, K16BitFormatText,n++,&buf16);
	ilogger.Log(((TText8*)__FILE__), __LINE__,RFileFlogger::ESevrWarn, K16BitFormatText,n++,&buf16);

	ilogger.Log(((TText8*)__FILE__), __LINE__,RFileFlogger::ESevrErr, K16BitFormatText,n++,&buf16);

	INFO_PRINTF1(_L("test ESevrInfo"));
	n=0;
	ilogger.SetLogLevel(RFileFlogger::ESevrInfo);
	ilogger.Log(((TText8*)__FILE__), __LINE__,RFileFlogger::ESevrAll, K16BitFormatText,n++,&buf16);
	ilogger.Log(((TText8*)__FILE__), __LINE__,RFileFlogger::ESevrInfo, K16BitFormatText,n++,&buf16);
	ilogger.Log(((TText8*)__FILE__), __LINE__,RFileFlogger::ESevrWarn, K16BitFormatText,n++,&buf16);

	ilogger.Log(((TText8*)__FILE__), __LINE__,RFileFlogger::ESevrErr, K16BitFormatText,n++,&buf16);

	INFO_PRINTF1(_L("test ESevrAll"));
	n=0;
	ilogger.SetLogLevel(RFileFlogger::ESevrAll);
	ilogger.Log(((TText8*)__FILE__), __LINE__,RFileFlogger::ESevrAll, K16BitFormatText,n++,&buf16);
	ilogger.Log(((TText8*)__FILE__), __LINE__,RFileFlogger::ESevrInfo, K16BitFormatText,n++,&buf16);
	ilogger.Log(((TText8*)__FILE__), __LINE__,RFileFlogger::ESevrWarn, K16BitFormatText,n++,&buf16);

	ilogger.Log(((TText8*)__FILE__), __LINE__,RFileFlogger::ESevrErr, K16BitFormatText,n++,&buf16);


	ilogger.Close();
	
	INFO_PRINTF1(_L("test finished"));
	
	return TestStepResult();
	}
/**
 *
 * Display command line format.
 * 
 * @xxxx
 *
 */
void CTestFrameworkMain::UsageL()
	{
	// If command line is erroneous, raise a panic. 
	// At this point, there may be no log outputs at all.
	User::Panic(_L("TestFramework"), 2);
	}
TVerdict CSysUtilsGetSWVersionStep::doTestStepL()
	{
	TInt err=KErrNone;
	
	_LIT16(KDummy,"xxxxx");

	TBuf16<KSysUtilVersionTextLength> version;
	version.Insert(0,KDummy);
	
	TInt fileErr = CheckIsFileExist( _L("C:\\versions\\sw.txt"));

	if(fileErr == KErrNone)
		{
		err = DeletePSProperties();
		if(err != KErrNone)
			{
			ERR_PRINTF2(_L("Could not delete P&S properties. Error = %d"), err);
			SetTestStepResult(EAbort);
			return TestStepResult();
			}
		INFO_PRINTF1(_L("Deleted P&S properties successfully."));
		
		err = SetTestPath(ETrue);
		if( err != KErrNone )
			{
			ERR_PRINTF2(_L("Could not turn test path off. Error = %d"), err);
			SetTestStepResult(EAbort);
			return TestStepResult();
			}
		INFO_PRINTF1(_L("Test path turned off."));
		
		err = SysUtil::GetSWVersion( version );
		if ( err != KErrNone )
			{
			ERR_PRINTF2(_L("Get SW version failed. Error = %d"), err);
			SetTestStepResult(EFail);
			}
		else
			{
			//Get the information from the ini file
			_LIT(KSw, "SW");
			TPtrC16 line;

			TESTL( GetStringFromConfig(ConfigSection(), KSw, line) );
			TBuf16<KSysUtilVersionTextLength> testBuf(line);
		    //Parse the information from the ini file
		    // Replace new-line patterns with real ones
			_LIT(KNewLinePattern, "\\n");
			_LIT( KNewline, "\n" );
			
			err = testBuf.Find(KNewLinePattern);
	        while (err != KErrNotFound)
	            {
	            // err is a position
	            testBuf.Replace(err, KNewLinePattern().Length(), KNewline );
	            err = testBuf.Find(KNewLinePattern);
	            }
	        
	        if (version.Compare(testBuf)!=0)
				{
				ERR_PRINTF1(_L("software version formatted incorrectly"));
				INFO_PRINTF1(_L("From ini file: "));
                INFO_PRINTF1(testBuf);
                INFO_PRINTF1(_L("From txt file: "));
                INFO_PRINTF1(version);
                INFO_PRINTF2(_L("Comparison returned value %d"), version.Compare(testBuf));
				SetTestStepResult(EFail);
				}
			else
				{
				INFO_PRINTF1(_L("software version formatted correctly"));
				INFO_PRINTF1(_L("from ini file "));
				INFO_PRINTF1(testBuf);
				INFO_PRINTF1(_L("from txt file "));
				INFO_PRINTF1(version);
				}
			}
		}
	else
		{
		ERR_PRINTF1(_L("sw.txt is missing, should be included to base packets"));
		SetTestStepResult(EFail);
		}
	
	SetTestPath(EFalse);
	return TestStepResult();
	}
TInt CAudioOutputControlTestClass::SetDRMConfig( CStifItemParser& aItem )
{
	TPtrC object;
	TInt error = KErrNone;
	TInt drmType;
	aItem.GetNextInt(drmType);
	/* ENone,
	   EOMA1,
	   EOMA2,
	   EWMDRM*/

	if (iDRMConfigIntfc)
		{
		iDRMConfigIntfc->SetDRMType(TDRMType(drmType));
		iDRMConfigIntfc->Commit();
		TInt allowdevice = 0;
		iDRMConfigIntfc->GetAllowedOutputDeviceCount(allowdevice);
    	FTRACE(FPrint(_L("GetAllowedOutputDeviceCount [%d]"),allowdevice));
    	iLog->Log(_L("GetAllowedOutputDeviceCount [%d]"),allowdevice);
		TDRMAllowedOutputDevice output;
		output = TDRMAllowedOutputDevice(0);
    	iDRMConfigIntfc->AppendAllowedOutputDevice(output);
		output = TDRMAllowedOutputDevice(1);
    	iDRMConfigIntfc->AppendAllowedOutputDevice(output);
		output = TDRMAllowedOutputDevice(2);
    	iDRMConfigIntfc->AppendAllowedOutputDevice(output);
		output = TDRMAllowedOutputDevice(3);
    	iDRMConfigIntfc->AppendAllowedOutputDevice(output);
		output = TDRMAllowedOutputDevice(4);
    	iDRMConfigIntfc->AppendAllowedOutputDevice(output);
		output = TDRMAllowedOutputDevice(5);
    	iDRMConfigIntfc->AppendAllowedOutputDevice(output);
		output = TDRMAllowedOutputDevice(6);
    	iDRMConfigIntfc->AppendAllowedOutputDevice(output);
		output = TDRMAllowedOutputDevice(7);
    	iDRMConfigIntfc->AppendAllowedOutputDevice(output);
		output = TDRMAllowedOutputDevice(8);
    	iDRMConfigIntfc->AppendAllowedOutputDevice(output);
    	//EAudioAllowHDMI added as part of RIM CR 417-7642: HDMI with HDCP to Resctricted Audio Output API
    	output = TDRMAllowedOutputDevice(11);
    	iDRMConfigIntfc->AppendAllowedOutputDevice(output);
    	//EAudioAllowHdmiHdcpRequired added as part of RIM CR 417-7642: HDMI with HDCP to Resctricted Audio Output API
    	output = TDRMAllowedOutputDevice(12);
    	iDRMConfigIntfc->AppendAllowedOutputDevice(output);
		iDRMConfigIntfc->Commit();
		iDRMConfigIntfc->GetAllowedOutputDeviceCount(allowdevice);
    	FTRACE(FPrint(_L("GetAllowedOutputDeviceCount [%d]"),allowdevice));
    	iLog->Log(_L("GetAllowedOutputDeviceCount [%d]"),allowdevice);

		}
	error = iAudioOutputControlUtility->Configure(*iDevSound);

    if(error == KErrNone)
        {
    	FTRACE(FPrint(_L("CAudioOutputControlTestClass::SetDRMConfig ")));
    	iLog->Log(_L("CAudioOutputControlTestClass::SetDRMConfig "));
		}
	else
		{
    	FTRACE(FPrint(_L("CAudioOutputControlTestClass::SetDRMConfig Error [%d]"),error));
    	iLog->Log(_L("CAudioOutputControlTestClass::SetDRMConfig Error [%d]"),error);

		}

	return error;
}
示例#9
0
#include "NetConLog.h"
#include "CNetworkController.h"
#include "NetConPanic.h"

/**
First ordinal export

@return a pointer to class CNetworkController
*/
extern "C" EXPORT_C CNetworkController* InstallL()
	{	
	
	return CNetworkController::NewL();
	}

_LIT(KNetConPanic, "NetworkController"); //< Network Controller Panic

/**
Panic - programming error!

@param aPanic, NetworkController Panic.
@panic aPanic, NetworkController Panic.
*/
GLDEF_C void NetConPanic(NetworkController::TNetConPanic aPanic)
	{
	LOG( NetConLog::Printf(_L("NetworkController Panic %d"), aPanic); )
	User::Panic(KNetConPanic, aPanic);
	}


示例#10
0
/**
 * Function called after the receipt of a game status from a player.
 * The game status is dealt with by placing the player number into an array of either
 * finished or current players. When both player have responded then we can construct
 * an update descriptor to send to all players.
 */
void CScabbyQueenDealer::DealWithGameStatus(TGameStatus aGameStatus)
	{

	if (iResponseCount == 0)
		{
		// First response, reset Update
		iCurrentPlayers.Reset();
		iPlayerUpdate.Delete(0,iPlayerUpdate.Length());
		}
		
	iResponseCount++;
	
	// Check the enum status that we have received, and append the
	// appropriate player number to the appropriate array.
	switch(aGameStatus)
		{
		case EPlayingZero:
			iCurrentPlayers.Append(0);
		break;
		
		case EPlayingOne:
			iCurrentPlayers.Append(1);
		break;
		
		case EPlayingTwo:
			iCurrentPlayers.Append(2);	
		break;
		
		case EPlayingThree:
			iCurrentPlayers.Append(3);		
		break;
		
		case EPlayingFour:
			iCurrentPlayers.Append(4);		
		break;
		
		case EPlayingFive:		
			iCurrentPlayers.Append(5);
		break;
	
		case EPlayingSix:		
			iCurrentPlayers.Append(6);
		break;
		
		case EPlayingSeven:		
			iCurrentPlayers.Append(7);
		break;
	
		case EFinishedZero:		
			iFinishedPlayers.Append(0);
		break;

		case EFinishedOne:		
			iFinishedPlayers.Append(1);
		break;
		
		case EFinishedTwo:		
			iFinishedPlayers.Append(2);
		break;
		
		case EFinishedThree:		
			iFinishedPlayers.Append(3);
		break;
	
		case EFinishedFour:		
			iFinishedPlayers.Append(4);
		break;
	
		case EFinishedFive:		
			iFinishedPlayers.Append(5);
		break;

		case EFinishedSix:		
    		iFinishedPlayers.Append(6);
		break;
		
		case EFinishedSeven:		
			iFinishedPlayers.Append(7);
		break;
		
		default:
		break;
		}
			
	if (iResponseCount == 2)// heard back from both
		{
		if (iOldPlayerUpdate == KNullDesC8)// first time 
			{
			// as this is the first time we can construct the
			// update descriptor as follows
			// append any finished players
			for (TInt i=0;i<iFinishedPlayers.Count();i++)
				{
				iPlayerUpdate.AppendNum(iFinishedPlayers[i]);
				}
			// append the F that seperates In and Out Players.
			iPlayerUpdate.Append('F');
			
			// append the players that are still in
			for (TInt i=0;i<iCurrentPlayers.Count();i++)
				{
				iPlayerUpdate.AppendNum(iCurrentPlayers[i]);
				}
				
			// append all the players that didnt do nothing
			for (TInt i=0;i<iRemoteNames.Count();i++)
				{ 
				if (i == iPlayerToken || i == iSender)
					{	
					}
				else
					{
					iPlayerUpdate.AppendNum(i);
					}
				} 
			}
		else
			{

			// as oldupdate contains something then this isn't the first time
			// a card has been exchanged we need to inspect the finished array.
			// for each of the values in the array we need to check whether it is to the left of the 
			// F (we already know that they have finished) if it isn't then we need to add it.
			// and remove it from the right of the F (these are the current players)
			
			
			TInt index = 0;
			// locate where the F is
			while (iOldPlayerUpdate[index] != 'F')
				{
				index++;
				}
				
			// index is position of F
			// get a pointer to finished players
			TPtrC8 playersOut(iOldPlayerUpdate.Mid(0, index));


			for (TInt i=0; i<iFinishedPlayers.Count();i++)
				{
				// i is a finished player, check that we have this number to the left of the F
				// if we dont then add it.
				TBuf8<1> num;
				num.AppendNum(iFinishedPlayers[i]);
				TInt loc = playersOut.Find(num);// has num finished already
				if (loc == KErrNotFound)
					{
					// we have finished with i but it isnt in the finished descriptor list
					iPlayerUpdate.AppendNum(iFinishedPlayers[i]);
					TInt match = iOldPlayerUpdate.Find(num);
					if (match != KErrNotFound)
						{
						iOldPlayerUpdate.Delete(match, 1);
						}
					}
				}
			iPlayerUpdate.Insert(0, playersOut);
			index = 0;
			// locate where the F is
			while (iOldPlayerUpdate[index] != 'F')
				{
				index++;
				}
			iOldPlayerUpdate.Delete(0, index);
			}
	

		if (iOldPlayerUpdate.Length() == 2)//  we only have one char to the right of the F
			{
			// we have our loser. hopefully they will have the scabby queen!
			// instead of sending a ready inquiry send a notification that tells the user game has finished.
			iGameOver = ETrue;
			}
			
		iPlayerUpdate.Append(iOldPlayerUpdate);
		iOldPlayerUpdate.Copy(iPlayerUpdate);
		TBufC16<20> buffer;
		buffer.Des().Copy(iPlayerUpdate);
		iConsole.Printf(_L("Update : %S"), &buffer);
		
		iResponseCount=0;
		iCount = 0;
		SendReadyInquiry();
		}
	}
示例#11
0
/**
 * Function that will deal the deck out to the players. 
 */
void CScabbyQueenDealer::DealDeckL()
	{
	DealCards(*iFullDeck);
	iConsole.Printf(_L("\nDealt"));
	iFullDeck->Des().Delete(0, iFullDeck->Length());
	}
示例#12
0
/**
 * Function that is called after we have sent a game over message to a player.
 * Call the functuion that will send the next game over message.
 */
void CScabbyQueenDealer::SentGameOverMessage()
	{
	// we have sent a message to a player, move onto next
	iConsole.Printf(_L("\nPlayer %d has left the game"), iCount);
	InformNextGameOver();
	}
示例#13
0
/**
@SYMTestCaseID				PIM-APPENG-CNTMODEL-EC021-CIT-0011
@SYMTestCaseDesc			Performance measurement test
@SYMTestType				CIT
@SYMTestPriority			High
@SYMTestActions				Make 100 calls to all the interface methods and report the average time for each call. 
@SYMTestExpectedResults		No errors should occur. The average time taken for all the API’s should be printed to epocwind.out.
@SYMTestStatus				Implemented
@SYMTestCaseDependencies	Plug-in implementation must exist. The contacts DB should contain some contact items for test purposes.
@SYMEC						EC021 Break dependency of Log engine (Syslibs/Logeng) on Contacts model (App-engines/Cntmodel)
*/
LOCAL_D void PerformanceTestContactMatchingPluginL()
	{
	TIMERINSTALL;
	TInt i;

	// Delete the contacts DB so when we open it teh 1st time the DB will be created
	theTest.Printf(_L("Delete the contacts DB\n"));
	TRAPD(err, CContactDatabase::DeleteDefaultFileL());
	TEST(err == KErrNone || err == KErrNotFound);
	
	CLogCntModel *cntModel=NULL;
	for (i = 0; i < KMaxIterations; i++)
		{
		TIMERSTART;
		// Don't trap open, want the load time only
		cntModel=CLogCntModel::NewL();
		TIMERSTOP;
		TIMERPRINT;
		// Delete to allow next create
		delete cntModel;
		}
	theTest.Printf(_L("Average: Plugin load           (us) %08d\n"), TIMERAVERAGE);

	// Load the plug-in for the rest of the test
	cntModel=CLogCntModel::NewL();
	CleanupStack::PushL(cntModel);

	TIMERRESET;
	TIMERSTART;
	// Open contacts DB - this will create the DB because it doesn't exist
	cntModel->OpenContactsL();
	TIMERSTOP;
	theTest.Printf(_L("First open of contacts DB      (us) %08d\n"), delta);
	// Close DB so we can reopen it in the test below.
	cntModel->CloseContacts();
	
	TIMERRESET;
	for (i = 0; i < KMaxIterations; i++)
		{
		TIMERSTART;
		// Don't trap open, want the load time only
		cntModel->OpenContactsL();
		TIMERSTOP;
		TIMERPRINT;		
		// Close to allow next open
		cntModel->CloseContacts();
		}
	theTest.Printf(_L("Average: Open contacts DB      (us) %08d\n"), TIMERAVERAGE);
	
	// Open the contacts DB for the rest of the test.
	cntModel->OpenContactsL();
	
	// Create a contact
	TLogContactItemId id1 = CreateContactL(KFirstName1, KLastName1, KNumber1);
	
	// Setup buffer to contain concatenated result
	TBuf<128> buf;
	// Separator
	TBufC<2> separator(KRemotePartyNameSeparator);
	
	// Get average time to read the contact Id using the plugin interface
	TIMERRESET;
	for (i = 0; i < KMaxIterations; i++)
		{
		TLogContactItemId  contactId;
		TIMERSTART;
		contactId=cntModel->MatchPhoneNumberL(KNumber1, 7);
		TIMERSTOP;
		TIMERPRINT;
		TEST2(id1,contactId);
		}
	theTest.Printf(_L("Average: Match phone number    (us) %08d\n"), TIMERAVERAGE);
	
	// Get average time to read the text information using the plugin interface
	TIMERRESET;
	for (i = 0; i < KMaxIterations; i++)
		{
		TIMERSTART;
		cntModel->ReadContactNameL(id1, buf, ELogWesternFormat);
		TIMERSTOP;
		TIMERPRINT;
		}
	theTest.Printf(_L("Average: Read contact info     (us) %08d\n"), TIMERAVERAGE);

	// Get average time to close the DB using the plugin interface
	TIMERRESET;
	for (i = 0; i < KMaxIterations; i++)
		{
		TIMERSTART;
		cntModel->CloseContacts();
		TIMERSTOP;
		TIMERPRINT;
		// Reopen to allow next close
		cntModel->OpenContactsL();
		}
	theTest.Printf(_L("Average: Close contacts DB     (us) %08d\n"), TIMERAVERAGE);

	cntModel->CloseContacts();
	CleanupStack::PopAndDestroy(); // cntModel;
	
	// Check memory usage for plugin. At this stage ECOM and contacts are running so the HEAP usage
	// detected by loading the plugin should be just due to the plugin

	// Save initial heap available size
	TInt largestBlock;
	TInt initialSize=User::Heap().Available(largestBlock);

	// Load plugin and save heap available size
	cntModel=CLogCntModel::NewL();
	TInt size=User::Heap().Available(largestBlock);
	
	// Delete the plugin and check that the heap size reverts to the initial size
	delete cntModel;
	TEST(initialSize==User::Heap().Available(largestBlock));
	
	// Print heap used by plugin load
	theTest.Printf(_L("Plugin load uses %08d bytes on the heap\n"), initialSize-size);
	}
示例#14
0
* Description: 
*
*/


#include <e32test.h>
#include <cntdb.h>
#include <cntitem.h>
#include <cntfldst.h>
#include <logcntmodel.h>
#include "test.h"

GLREF_D RTest theTest;
GLDEF_D CTrapCleanup* theCleanup;

RTest theTest(_L("Log View Contact Matching plugin test"));

LOCAL_D void Check(TInt aValue, TInt aExpected, TInt aLine)
	{
	if(aValue != aExpected)
		{
		RDebug::Print(_L("*** Expected error: %d, got: %d\r\n"), aExpected, aValue);
		theTest(EFalse, aLine);
		}
	}

_LIT(KFirstName1, "Barney");
_LIT(KLastName1, "Rubble");
_LIT(KNumber1, "447774770432");
_LIT(KFirstName2, "Elma");
_LIT(KLastName2, "Fudd");
enum TVerdict CTestNotifyMtlr::doTestStepL()
	{
	INFO_PRINTF1(_L("Successful MT-LR request"));

 	TRequestStatus mtlrStatus;
	TRequestStatus mcontrolStatus;
	TRequestStatus reqStatus;
    TInt notificationTypeReceived = 0;
    
	TInt expectedNotificationType;
	GetIntFromConfig(ConfigSection(), _L("expectedNotificationType"), expectedNotificationType);

	TInt dataCodingScheme ;
	GetIntFromConfig(ConfigSection(), _L("DataCodingScheme"), dataCodingScheme);

	TInt invalidCliendIdFlag ;
	TBool existsInvalidCliendIdFlag = GetIntFromConfig(ConfigSection(), _L("InvalidCliendIdFlag"), invalidCliendIdFlag);

	iNotifyMtlr.iLocationInfo.iLcsClientName.iLcsDataCodingScheme = dataCodingScheme;
	
    RMobileLocationServices::TNotifyMtlrV7Pckg  notifyMtlrPckg(iNotifyMtlr);
 
     //  Notify Mtlr request
    iLocationSvc.NotifyMtlr(mtlrStatus,notifyMtlrPckg);
    User::WaitForRequest(mtlrStatus);
    TEST(mtlrStatus == KErrNone);
     
	//notificationtype ENotifyLocationAllowed
	if(iNotifyMtlr.iNotificationType == DMMTSY_NOTIFICATION_TYPE1 )
		{
			notificationTypeReceived = 1; 
		}
	// notificationtype ENotifyAndVerify_LocationAllowedIfNoResponse		
	if(iNotifyMtlr.iNotificationType == DMMTSY_NOTIFICATION_TYPE2 )
		{
			notificationTypeReceived = 2; 
		}
	// notificationtype ENotifyAndVerify_LocationNotAllowedIfNoResponse				
	if(iNotifyMtlr.iNotificationType == DMMTSY_NOTIFICATION_TYPE3 )
		{
			notificationTypeReceived = 3; 
		}
	// notificationtype ELocationPrivacyOverride				
	if(iNotifyMtlr.iNotificationType == DMMTSY_NOTIFICATION_TYPE4 )
		{
			notificationTypeReceived = 4; 
		}
	// notificationtype ELocationNotAllowed				
	if(iNotifyMtlr.iNotificationType == DMMTSY_NOTIFICATION_TYPE5 )
		{
			notificationTypeReceived = 5; 
		}

	if(existsInvalidCliendIdFlag)
		{
		TEST(iNotifyMtlr.iLocationInfo.iLcsClientID == DMMTSY_INVALID_EXTERNAL_CLIENT_ID);
		}
	else
		{
	    TEST(expectedNotificationType == notificationTypeReceived);
		}
		
	INFO_PRINTF2(_L("Test %d - RMobileLocationServices::NotifyMtlr passed"), iTestCount++);

	return TestStepResult();
	}
示例#16
0
// constructor
CTestAgendaCreateDB::CTestAgendaCreateDB()
	{
	SetTestStepName(_L("CreateDB"));
	}
/**
 *
 * Main testing loop.
 * Read a script file, parse it and execute each test step in turn.
 *
 * @param "const TDesC& aCmdLine"
 *			The command line
 * 
 * @xxxx
 *
 */
void CTestFrameworkMain::RunTestScriptL(const TDesC& aCmdLine)
	{
	// use TLex to decode the cmd line
	TLex lex(aCmdLine);
	TPtrC token=lex.NextToken();
	
	// if there is no input filename on the cmd line, panic
	if (token.Length() == 0) 
		UsageL();
	else
		{
		// Process any options
		while(token.Length() > 1 && token[0] == '-')
			{
			switch(token[1])
				{
				case 'C':
				case 'c':
					// log to console ONLY
					iLogMode = ELogToConsole;
					break;
				case 'A':
				case 'a':
					iLogMode |= ELogConsoleFull;
					break;
				case 'F':
				case 'f':
					// log to file ONLY
					iLogMode = ELogToFile; 
					break;
				case 'P':
				case 'p':
					// log to port AS WELL AS to console / file
					iLogMode |= ELogToPort;
					break;
				//This stops the emulator from thowing int 3 if a panic occurs in debug builds
				case 'T':
				case 't':
					User::SetJustInTime(EFalse);
				// -S flag removed - was for old Unit Test mode only
				// -A 'automated mode' removed - it's always automated
					break;
				case 'G':
				case 'g':
					{
					// ** guard timer override - get numeric value that follows
					TPtrC val = &token[2];
					TLex lexTimeOut(val);
					if (lexTimeOut.Val(iGuardTimer) != KErrNone)
						UsageL();
					}
					break;
				case 'm':
				case 'M':
					{
					if (token.Length()<=2)
						{
						// only -m found. must be -m<arg> with no space
						UsageL();
						}
					TPtrC restOfLine = &token[2]; // this will be rest of command line
					TLex argument(restOfLine);
					TPtrC matchString = argument.NextToken(); // will be the argument itself
					ASSERT(matchString.Length()>1);
					iTestMatchString = matchString;
					}
					break;
				case 'Q':
				case 'q':
					{
					// This flag has been removed.  This block is just to ensure that if used it wont panic
					}
					break;

				default:
					UsageL();
					return;
				}

			token.Set(lex.NextToken());
			}

		// save the input filename
		CFileName* scriptFileName = CFileName::NewLC();
		*scriptFileName = token;

		// make the log file name from the script file name
		CFileName* logFileName = CFileName::NewLC();
		*logFileName = token;
		RDebug::Print(_L("TestFrameWorkMain.cpp: RunTestScriptL 1"));
		// open the log file
		iLogClient->OpenLogFileL(logFileName->FileName(), iLogMode);
		RDebug::Print(_L("TestFrameWorkMain.cpp: RunTestScriptL 2"));	
		iLogClient->LogExtra(__FILE8__, __LINE__, ESevrInfo,
				KTxtFrameworkStarting, &KTxtVersion(), &KTxtTarget(), &KTxtBuild());
		RDebug::Print(_L("TestFrameWorkMain.cpp: RunTestScriptL 3"));
		// create a ParseScript object
		CScript* parseScript = CScript::NewLC(iTestUtils, 
											  iLogClient, 
											  iGuardTimer,
											  iTestMatchString);
		RDebug::Print(_L("TestFrameWorkMain.cpp: RunTestScriptL 4"));
		// parse all scripts
		do
			{
			// get the next file
			*scriptFileName = token;
				
			// read in the script file
			if ( parseScript->OpenScriptFile(scriptFileName))
				{
				// process it
				parseScript->ExecuteScriptL();
				// display results summary
				parseScript->DisplayResults();
				}
			// get the next
			token.Set(lex.NextToken());
			} while ( token.Length()!=0 );
		RDebug::Print(_L("TestFrameWorkMain.cpp: RunTestScriptL 5"));
		CleanupStack::PopAndDestroy(parseScript);

		// close the logging system
		iLogClient->CloseLogFile();

		CleanupStack::PopAndDestroy(logFileName);
		CleanupStack::PopAndDestroy(scriptFileName);
		}
	}
EXPORT_C void CBaseSmsActiveSocketWatcher::StoreMsgL(CSmsMessage* aSmsMessage, TBool aCheckForSID)
	{
	BIOWATCHERLOG(iWatcherLog.Printf(_L("Bio: StoreMsgL: %S"), &iBioMsgText));

	CleanupStack::PushL(aSmsMessage);

	CMsvSession* session = CMsvSession::OpenSyncL(*this);
	CleanupStack::PushL(session);

	BIOWATCHERLOG(LogMessageL(*aSmsMessage));
	// The trap error code is ignored here. We already have loaded the settings
	// in the SetupL method. Any catastrophic failure would be reported later
	// when the message store is attempted.
	TRAP_IGNORE(RestoreSettingsL(*session));

	PreStoreActionL(*session, *aSmsMessage);

	CMsvEntry* msvEntry = session->GetEntryL(KMsvGlobalInBoxIndexEntryId);
	CleanupStack::PushL(msvEntry);
	TInt systemDrive = RFs::GetSystemDrive();
  	TInt driveUnit = session->CurrentDriveL();
  	 
  	TVolumeInfo volumeInfo;
  	User::LeaveIfError(iFs.Volume(volumeInfo, driveUnit));
  	 
  	 
  	BIOWATCHERLOG(iWatcherLog.Printf(_L("BioNbs: driveUnit: %d "),driveUnit));
  	BIOWATCHERLOG(iWatcherLog.Printf(_L("BioNbs: volumeInfo  : %d"), volumeInfo.iFree));
  	BIOWATCHERLOG(iWatcherLog.Printf(_L("BioNbs: threshold level= : %d"), KSmsThresholdDiskSpaceValue));
 
 
  	//Check if  non-system drive has enough space to store the message
  	if (driveUnit != systemDrive ) 
  	  	{
  	  	BIOWATCHERLOG(iWatcherLog.Printf(_L8("Low Memory")));
  	  	
  	  	TInt value;
  	  	TInt err = RProperty::Get(KUidSystemCategory,KUidPSDiskSpaceMonitorKeyType, value);
  	  	
  	  	BIOWATCHERLOG(iWatcherLog.Printf(_L("RProperty Get Value: %d "),err));
		
		if (volumeInfo.iFree < KSmsThresholdDiskSpaceValue)
  	  	 	{
  	  	 	if(value == ESmsDiskSpaceAvailable)
  	  	 	    {
  	  	 	    User::LeaveIfError(RProperty::Set(KUidSystemCategory,KUidPSDiskSpaceMonitorKeyType, ESmsDiskSpaceFull));
  	  	 	    }
  	  	 	User::Leave(KErrDiskFull);
  	  	 	}
  	  	 else
  	  	 	{
  	  	 	if(value == ESmsDiskSpaceFull)
  	  	 	    {
  	  	 	    User::LeaveIfError(RProperty::Set(KUidSystemCategory,KUidPSDiskSpaceMonitorKeyType, ESmsDiskSpaceAvailable));
  	  	 	    }
  	  	 	}
  	  	}


	if( CanStoreMessage() )
		{
		TBool retainReplaceMessage = ETrue;
		ReplaceTypeMessageL(*msvEntry, *aSmsMessage, retainReplaceMessage);
		CleanupStack::Pop(3, aSmsMessage); 
		CleanupStack::PushL(session); //guaranteed not leave because of the 3 previous POPs
		CleanupStack::PushL(msvEntry);

		if( retainReplaceMessage )
			CreateMessageL(*msvEntry, aSmsMessage, aCheckForSID); //destroys the CSmsMessage
		else
			delete aSmsMessage; //destroy the CSmsMessage as CreateMessageL() would have done

		CleanupStack::PopAndDestroy(2, session);
		}
	else
		{
		CleanupStack::PopAndDestroy(3, aSmsMessage);
		BIOWATCHERLOG(iWatcherLog.Printf(_L8("Not Creating Message")));
		}
	}
示例#19
0
// -----------------------------------------------------------------------------
// CDcfRepSrv::StopWatchingL
// -----------------------------------------------------------------------------
//
void CDcfRepSrv::StopWatchingL()
{
    DRMLOG( _L( "CDcfRepSrv::StopWatchingL ->" ) );
    iArmed = EFalse;
    DRMLOG( _L( "CDRMRightsServer::StopWatchingL <-" ) );
}
示例#20
0
TVerdict CTestSysunistd::doTestStepL()
	{
	int err;

   	if(TestStepName() == Kftruncate_file)
   		{
   		INFO_PRINTF1(_L("ftruncate_file():"));
   		err = ftruncate_file();
   		SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   		}
	else if(TestStepName() == Kftruncate_dir)
   		{
   	   	INFO_PRINTF1(_L("ftruncate_dir():"));
   	   	err = ftruncate_dir();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	else if(TestStepName() == Kftruncate_num)
   		{
   	   	INFO_PRINTF1(_L("ftruncate_num():"));
   	   	err = ftruncate_num();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	   	
	else if(TestStepName() == Kftruncate_siz)
   		{
   	   	INFO_PRINTF1(_L("ftruncate_siz():"));
   	   	err = ftruncate_siz();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	   	
	else if(TestStepName() == Kfchdir_dir)
   		{
   	   	INFO_PRINTF1(_L("fchdir_dir():"));
   	   	err = fchdir_dir();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	   	
	else if(TestStepName() == Kfchdir_file)
   		{
   	   	INFO_PRINTF1(_L("fchdir_file():"));
   	   	err = fchdir_file();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	   	
	else if(TestStepName() == Kfchdir_num)
   		{
   	   	INFO_PRINTF1(_L("fchdir_num():"));
   	   	err = fchdir_num();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	   	
	else if(TestStepName() == Kfdatasync_file)
   		{
   	   	INFO_PRINTF1(_L("fdatasync_file():"));
   	   	err = fdatasync_file();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	   	
	else if(TestStepName() == Kgetpagesize)
   		{
   	   	INFO_PRINTF1(_L("getpagesize():"));
   	   	err = getpagesizeL();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	   	
	else if(TestStepName() == Kgetpriority)
   		{
   	   	INFO_PRINTF1(_L("getpriority():"));
   	   	err = getpriorityL();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	   	
	else if(TestStepName() == Kgetpriority_other)
   		{
   	   	INFO_PRINTF1(_L("getpriority_other():"));
   	   	err = getpriority_other();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	   	
	else if(TestStepName() == Ksetpriority_get)
   		{
   	   	INFO_PRINTF1(_L("setpriority_get():"));
   	   	err = setpriority_get();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	   	
	else if(TestStepName() == Ksetpriority_high)
   		{
   	   	INFO_PRINTF1(_L("setpriority_high():"));
   	   	err = setpriority_high();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	   	
	else if(TestStepName() == Ksetpriority_other_lower)
   		{
   	   	INFO_PRINTF1(_L("setpriority_other_lower():"));
   	   	err = setpriority_other_lower();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	   	
	else if(TestStepName() == Ksetpriority_other_higher)
   		{
   	   	INFO_PRINTF1(_L("setpriority_other_higher():"));
   	   	err = setpriority_other_higher();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	   	
	else if(TestStepName() == Ksetpriority_other)
   		{
   	   	INFO_PRINTF1(_L("setpriority_other():"));
   	   	err = setpriority_other();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	   	
	else if(TestStepName() == Knice_within_range)
   		{
   	   	INFO_PRINTF1(_L("nice_within_range():"));
   	   	err = nice_within_range();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	   	
	else if(TestStepName() == Knice_more_than_highest)
   		{
   	   	INFO_PRINTF1(_L("nice_more_than_highest():"));
   	   	err = nice_more_than_highest();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	   	
   	else if(TestStepName() == Knice_less_than_lowest)
   		{
   	   	INFO_PRINTF1(_L("nice_less_than_lowest():"));
   	   	err = nice_less_than_lowest();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	   	
	else if(TestStepName() == Kpathconf_valid)
   		{
   	   	INFO_PRINTF1(_L("pathconf_valid():"));
   	   	err = pathconf_valid();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	   	
	else if(TestStepName() == Kpathconf_invalid)
   		{
   	   	INFO_PRINTF1(_L("pathconf_invalid():"));
   	   	err = pathconf_invalid();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	   	
	else if(TestStepName() == Kuname)
   		{
   	   	INFO_PRINTF1(_L("uname():"));
   	   	err = unameL();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	   	
   	else if(TestStepName() == Kuname_null)
   		{
   	   	INFO_PRINTF1(_L("uname_null():"));
   	   	err = uname_null();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	
   	else if(TestStepName() == Kftruncate_negTest)
   	   		{
   	   	   	INFO_PRINTF1(_L("ftruncate_negTest():"));
   	   	   	err = ftruncate_negTest();
   	   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	   	}
   	
   	else if(TestStepName() == Ktruncate_negTest)
   	   	   		{
   	   	   	   	INFO_PRINTF1(_L("truncate_negTest():"));
   	   	   	   	err = truncate_negTest();
   	   	   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	   	   	}
	else if(TestStepName() == Kfcntl_largefileTest)
   	   	   		{
   	   	   	   	INFO_PRINTF1(_L("fcntl_largefileTest():"));
   	   	   	   	err = fcntl_largefileTest();
   	   	   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	   	   	}     	
	return TestStepResult(); 

	}
/**
   Create a UDP socket. Perform a zero-length SendTo, then attempt to receive the zero-length datagram.

   @return EPass on success, EFail on failure
*/
TVerdict CEsockTest9_6::easyTestStepL()
	{
	Logger().WriteFormat(_L("TE_ESock: test 9.6"));
	
	TInt cleanupCount = 0;		// Number of items we've put on Cleanup Stack - remember to increment this after every Push operation.
	
	RSocket sendSocket;

	CleanupClosePushL( sendSocket );
	++cleanupCount;

	TSockAddr sendSocketAddress;
	Logger().WriteFormat(_L("Creating Send Socket"));
	if( !CreateUdpSocket( sendSocket, sendSocketAddress ) )
		{
		CleanupStack::PopAndDestroy( cleanupCount );
		return EFail;
		}


	RSocket recvSocket;

	CleanupClosePushL( recvSocket );
	++cleanupCount;

	TSockAddr recvSocketAddress;
	Logger().WriteFormat(_L("Creating Receive Socket"));
	if( !CreateUdpSocket( recvSocket, recvSocketAddress ) )
		{
		CleanupStack::PopAndDestroy( cleanupCount );
		return EFail;
		}



	HBufC8 *udpWriteBuffer = HBufC8::NewLC( 0 ); // Empty buffer for zero-length write
	++cleanupCount;

	HBufC8 *udpReadBuffer  = HBufC8::NewMaxLC( 32 ); // Non-Empty buffer for reads - 32 is an unimportant magic number
	++cleanupCount;

	TPtrC8  ptrWritebuf( udpWriteBuffer->Des() );
	TPtr8   ptrReadbuf( udpReadBuffer->Des() );
	TSockAddr toAddress( recvSocketAddress );

	TBool isOk = PerformSend( sendSocket, ptrWritebuf, toAddress );
	if( isOk )
		{
		TSockAddr fromAddress;
		isOk = PerformRecv( recvSocket, ptrReadbuf, fromAddress );
		if( isOk )
			{
			Logger().WriteFormat(_L("Receieved %d bytes"), udpReadBuffer->Length());
			if( udpReadBuffer->Length() != 0 )
				{
				isOk = EFalse;
				}
			}
		}
	
	CleanupStack::PopAndDestroy( cleanupCount );

	return isOk ? EPass : EFail;
	}
LOCAL_D void GeneralTestsL()
	{
	CBookmarkDb* db = CBookmarkDb::NewL(Bookmark::EVisibilityManager, NULL);
	CleanupStack::PushL(db);
	CBookmark& bookmark = db->CreateBookmarkL(db->RootL());

	gTestWrapper->Next(_L("[CBookmarkBase tests] id"));
	gTestWrapper->TEST(bookmark.Id() != KItemId);
	bookmark.SetId(KItemId);
	gTestWrapper->TEST(bookmark.Id() == KItemId);

	gTestWrapper->Next(_L("[CBookmarkBase tests] reference counting"));
	gTestWrapper->TEST(bookmark.RefCount() == 0);
	bookmark.IncRefCount();
	gTestWrapper->TEST(bookmark.RefCount() == 1);
	bookmark.DecRefCount();
	gTestWrapper->TEST(bookmark.RefCount() == 0);
	bookmark.IncRefCount();
	bookmark.IncRefCount();
	bookmark.IncRefCount();
	gTestWrapper->TEST(bookmark.RefCount() == 3);
	bookmark.DecRefCount();
	bookmark.DecRefCount();
	bookmark.DecRefCount();
	gTestWrapper->TEST(bookmark.RefCount() == 0);
	
	gTestWrapper->Next(_L("[CBookmarkBase tests] parent"));
	CBookmarkFolder& folder = db->CreateFolderL(KTxtNewFolder, db->RootL());
	gTestWrapper->TEST(bookmark.Parent()->Id() == db->RootL().Id());
	bookmark.SetParentL(folder);
	gTestWrapper->TEST(bookmark.Parent()->Id() == folder.Id());
	bookmark.SetParentL(db->RootL());
	gTestWrapper->TEST(bookmark.Parent()->Id() == db->RootL().Id());

	gTestWrapper->Next(_L("[CBookmarkBase tests] title"));
	bookmark.SetTitleL(KTxtItem1);
	gTestWrapper->TEST(bookmark.Title().Compare(KTxtItem1) == 0);

	gTestWrapper->Next(_L("[CBookmarkBase tests] public and writable"));
	gTestWrapper->TEST(bookmark.IsPublic());
	
	TInt err = KErrNone;
	gTestWrapper->TEST(bookmark.IsPublic());
	
	gTestWrapper->TEST(bookmark.IsWritable());
	bookmark.SetWritableL(EFalse);
	gTestWrapper->TEST(!bookmark.IsWritable());
	// test that write operations work as application is WriteDeviceData
	TRAP(err, bookmark.SetTitleL(KTxtItem1));
	gTestWrapper->TEST(err == KErrNone);
	TRAP(err, bookmark.SetPublicL(ETrue));
	gTestWrapper->TEST(err == KErrNone);
	bookmark.SetWritableL(ETrue);
	
	gTestWrapper->Next(_L("[CBookmarkBase tests] handle"));
	gTestWrapper->TEST(bookmark.RefCount() == 0);
	RBkFolder root = db->RootL().OpenFolder();
	CleanupClosePushL(root);
	RBkNode handle = root.OpenItemL(0);
	CleanupClosePushL(handle);
	
	gTestWrapper->TEST(bookmark.RefCount() == 1);
	gTestWrapper->TEST(handle.Type() == bookmark.Type());
	gTestWrapper->TEST(handle.Title() == bookmark.Title());
	
	CleanupStack::PopAndDestroy(&handle);
	CleanupStack::PopAndDestroy(&root);

	CleanupStack::PopAndDestroy(db);
	}
示例#23
0
TInt CLayoutLibrary::SetLayout(TInt aId)
    {
    TInt err = KErrNone;
    TBool foundLayout = EFalse;

    // Implementation info array
    RImplInfoPtrArray implInfoArray;

    TRACE_INFO( (_L("[HID]\tCLayoutLibrary::SetLayout: id=%d"), aId));

    if( aId == iId )
        {
        TRACE_INFO( (_L("[HID]\tCLayoutLibrary::SetLayout: Same layout id=%d, don't load twice"), aId));
        return KErrNone;
        }

    // Plain ignore is enough. If listing leaves, the array is just empty.
    TRAP_IGNORE( REComSession::ListImplementationsL( KHidLayoutPluginInterfaceUid, implInfoArray ) );

    TRACE_INFO( (_L("[HID]\tCLayoutLibrary::SetLayout: %d plugins listed"),implInfoArray.Count() ));

    if ( 0 == implInfoArray.Count())
        {
        TRACE_INFO( (_L("[HID]\tCLayoutLibrary::SetLayout: No Drivers found")));
        err = KErrNotFound;
        }
    else
        {
        for (TInt i=0; i<implInfoArray.Count() && !foundLayout; i++)
            {
            // parse implementation UID
            CImplementationInformation* info = implInfoArray[ i ];
            TUid implUid = info->ImplementationUid();
            TRACE_INFO( (_L("[HID]\tCLayoutLibrary::SetLayout: load plugin 0x%08x"),implUid ));
            // load driver
            // Trap so other drivers will be enumerated even if
            // this fails:
            CHidLayoutPluginInterface* plugin = NULL;
            TRAPD( err,
                   plugin = CHidLayoutPluginInterface::NewL( implUid );
                   TRACE_INFO( (_L("[HID]\tCLayoutLibrary::SetLayout: plugin loaded")));
                 );

            if( err == KErrNone)
                {
                CKeyboardLayout* layout = reinterpret_cast<CKeyboardLayout*>(plugin);
                if (aId == layout->LayoutId())
                    {
                    TRACE_INFO( (_L("[HID]\tCLayoutLibrary::SetLayout: Found layout %d!"), aId));
                    foundLayout = ETrue;
                    // Swap the current layout object:
                    CKeyboardLayout* tmpLayout = iLayout;
                    iLayout = layout;
                    iId = aId;
                    iLoaded = ETrue;
                    TRACE_INFO( (_L("[HID]\tCLayoutLibrary::SetLayout: delete old layout")));
                    delete tmpLayout;
                    }
                else
                    {
                    TRACE_INFO( (_L("[HID]\tCLayoutLibrary::SetLayout: wrong layout, delete plugin")));
                    delete plugin;
                    }
                }
            else
                {
                TRACE_INFO( (_L("[HID]\tCLayoutLibrary::SetLayout: plugin creation failed")));
                }
            }// end of for loop
        }
TInt CTestDriveOOMVoiceCall::DoTestL(TInt aAllocFailNumber)
	{
	_LIT(KPhoneModule,"MM");
	_LIT(KPhoneName,  "GsmPhone1");
	_LIT(KLineName,   "Voice");

	RTelServer telServer;
	TInt ret=telServer.Connect();
	if(ret!=KErrNone)
		return ret;

	telServer.__DbgFailNext(aAllocFailNumber);

	ret=telServer.LoadPhoneModule(KPhoneModule);
	if(ret!=KErrNone)
		{
		telServer.Close();
		return ret;
		}

	RMobilePhone mobilePhone;
	ret=mobilePhone.Open(telServer, KPhoneName);
	if(ret!=KErrNone)
		{
		mobilePhone.Close();
		telServer.Close();
		return ret;
		}

	RLine line;
	INFO_PRINTF1(_L("Opening Voice Line"));
	ret=line.Open(mobilePhone,KLineName);
	if(ret!=KErrNone)
		{
		line.Close();
		mobilePhone.Close();
		telServer.Close();
		return ret;
		}

	INFO_PRINTF1(_L("Opening New Voice Call"));
	RCall call;
	ret=call.OpenNewCall(line);
	if(ret!=KErrNone)
		{
		call.Close();
		line.Close();
		mobilePhone.Close();
		telServer.Close();
		return ret;
		}

	INFO_PRINTF1(_L("Initialise the Phone..."));
	
	TRequestStatus reqStatus;
	RMobilePhone::TMMTableSettings tableSettings;
	tableSettings.iLocId=KInternetAccessPoint;
	RMobilePhone::TMMTableSettingsPckg tableSettingsPckg(tableSettings);
	mobilePhone.InitialiseMM(reqStatus, tableSettingsPckg); 	
	User::WaitForRequest(reqStatus);
	TESTL(reqStatus == KErrNone);

	if(reqStatus!=KErrNone)
		{
		call.Close();
		line.Close();
		mobilePhone.Close();
		telServer.Close();
		return ret;
		}

	INFO_PRINTF1(_L("Dial a number..."));
	_LIT(KDialString, "+1234");
	ret=call.Dial(KDialString);
	if(ret!=KErrNone)
		{
		call.Close();
		line.Close();
		mobilePhone.Close();
		telServer.Close();
		return ret;
		}

	INFO_PRINTF1(_L("Hangup a call..."));
	ret=call.HangUp();
	if(ret!=KErrNone)
		{
		call.Close();
		line.Close();
		mobilePhone.Close();
		telServer.Close();
		return ret;
		}

	INFO_PRINTF1(_L("Close the call, line & iPhone..."));
	call.Close();
	line.Close();
	mobilePhone.Close();

	return KErrNone;
	}
void CNcdPreminetProtocolEntityRefParser::ConstructL( const Xml::RTagInfo& aElement,
                                                      const Xml::RAttributeArray& aAttributes,
                                                      const TDesC& aParentId,
                                                      const TDesC& aParentNamespace )
    {
    CNcdSubParser::ConstructL( aElement );
    
    DLTRACEIN(("depth=%d tag=%S",iDepth,iTag));
    DLINFO((_L("parent=%S namespace=%S"),&aParentId,&aParentNamespace));
    
    NcdProtocolUtils::AssignDesL( iParentNamespace, aParentNamespace );


    TPtrC8 type = AttributeValue( KAttrType, aAttributes );
    if( type == KNullDesC8 )
        {
        type.Set( AttributePrefix( KAttrXsiType, aAttributes ) );
        }

    if( type == KValueFolderRef )
        {
        CNcdPreminetProtocolFolderRefImpl* folderRef = CNcdPreminetProtocolFolderRefImpl::NewL();
        iFolderRef = folderRef;
        DLINFO(("New Folder ref!"));
        TPtrC8 count = AttributeValue( KAttrCount, aAttributes );
        if( count != KNullDesC8 )
            {
            folderRef->iCount = NcdProtocolUtils::DesDecToIntL( count );
            }
        TPtrC8 authorizedCount = AttributeValue( KAttrAuthorizedCount, aAttributes );
        if( count != KNullDesC8 )
            {
            folderRef->iAuthorizedCount = NcdProtocolUtils::DesDecToIntL( count );
            }

        // @ Description
        NcdProtocolUtils::AssignDesL( iFolderRef->iParentId, aParentId );
        NcdProtocolUtils::AssignDesL( iFolderRef->iId, AttributeValue( KAttrId, aAttributes ) );
        NcdProtocolUtils::AssignDesL( iFolderRef->iNamespace, AttributeValue( KAttrNamespace, aAttributes ) );
        NcdProtocolUtils::AssignDesL( iFolderRef->iTimestamp, AttributeValue( KAttrTimestamp, aAttributes ) );
        NcdProtocolUtils::AssignDesL( iFolderRef->iServerUri, iObservers->SessionOrigin() );
        NcdProtocolUtils::AssignDesL( iFolderRef->iParentNamespace, *iParentNamespace );
        NcdProtocolUtils::AssignDesL( iFolderRef->iRemoteUri, AttributeValue( KAttrUri, aAttributes ) );

        if( *iFolderRef->iNamespace == KNullDesC )
            {
            // Namespace was not set, use parent.
            NcdProtocolUtils::AssignDesL( iFolderRef->iNamespace, *iParentNamespace );
            }

        }
    else if( type == KValueItemRef || type == KValueActionRef )
        {
        DLINFO(("New Item ref!"));
        iItemRef = CNcdPreminetProtocolItemRefImpl::NewL();
        
        // @ Description
        NcdProtocolUtils::AssignDesL( iItemRef->iParentId, aParentId );
        NcdProtocolUtils::AssignDesL( iItemRef->iId, AttributeValue( KAttrId, aAttributes ) );
        NcdProtocolUtils::AssignDesL( iItemRef->iNamespace, AttributeValue( KAttrNamespace, aAttributes ) );
        NcdProtocolUtils::AssignDesL( iItemRef->iTimestamp, AttributeValue( KAttrTimestamp, aAttributes ) );
        NcdProtocolUtils::AssignDesL( iItemRef->iServerUri, iObservers->SessionOrigin() );
        NcdProtocolUtils::AssignDesL( iItemRef->iParentNamespace, *iParentNamespace );
        NcdProtocolUtils::AssignDesL( iItemRef->iRemoteUri, AttributeValue( KAttrUri, aAttributes ) );

        if( *iItemRef->iNamespace == KNullDesC )
            {
            // Namespace was not set, use parent.
            NcdProtocolUtils::AssignDesL( iItemRef->iNamespace, *iParentNamespace );
            }
 
       }
    else
        {
        // unknown type!
        DLERROR(("Unknown item type=%S",&type));
        // Should there be more some informatic error?
        }

    DLTRACEOUT((""));
    }
示例#26
0
/** Perform CX3pStep3 test step.
This test verifies that the Test Protocol Module correctly handles 
X3P cancellation.
Cancellation occurs after gateway receives location request.

@return TVerdict test result code
*/
TVerdict CX3pStep3::doTestStepL()
	{
	INFO_PRINTF1(_L("\t********************************************************************"));
	INFO_PRINTF1(_L("\tX3P with cancel sent after loc request received"));
	INFO_PRINTF1(_L("\t********************************************************************"));
	INFO_PRINTF1(_L("- START -"));

	// Initiate X3P
	INFO_PRINTF1(_L("\tLBS -> TransmitLocation"));
	TLbsAsistanceDataGroup dataRequestMask = (TUint) EAssistanceDataReferenceTime;
	TLbsNetSessionId sessionId(TUid::Uid(KDummyUid), KX3pSessionId);
	iModule->RequestTransmitLocation(sessionId, KX3pDestination(), KX3pPriority);

	// Check network receives X3P request
	if (EFail == CheckNetworkCallbackL(
				CNetworkObserver::ERegisterLcsMoLr) ||
		KX3pDestination() != iNetworkObserver->X3pDestination())
		{
		SetTestStepResult(EFail);
		return TestStepResult();
		}
	INFO_PRINTF1(_L("\t                                            RegisterLcsMoLr -> NET"));
	
	// Generate network Measurement Control
	INFO_PRINTF1(_L("\t                          ProcessMeasurementControlLocation <- NET"));
	TPositionInfo refLoc;
	RLbsAssistanceDataBuilderSet assistData;
	CleanupClosePushL(assistData);
	assistData.OpenL();
	SetDummyAssistanceData(assistData, dataRequestMask);
	TLbsNetPosRequestQuality quality;
	iNetworkObserver->ProcessMeasurementControlLocationL(refLoc, assistData, quality);
	CleanupStack::PopAndDestroy(&assistData);

	// Check gateway receives Assistance data
	if (EFail == CheckGatewayCallbackL(
				CGatewayObserver::EProcessAssistanceData))
		{
		SetTestStepResult(EFail);
		return TestStepResult();
		}
	INFO_PRINTF1(_L("\tLBS <- ProcessAssistanceData"));

	// Check gateway receives Network Based location
	if (EFail == CheckGatewayCallbackL(
				CGatewayObserver::EProcessLocationUpdate))
		{
		SetTestStepResult(EFail);
		return TestStepResult();
		}
	INFO_PRINTF1(_L("\tLBS <- ProcessLocationUpdate"));

	// Check gateway receives Location Request
	if (EFail == CheckGatewayCallbackL(
				CGatewayObserver::EProcessLocationRequest))
		{
		SetTestStepResult(EFail);
		return TestStepResult();
		}
	INFO_PRINTF1(_L("\tLBS <- ProcessLocationRequest"));

	// Cancel X3P
	INFO_PRINTF1(_L("\tLBS -> CancelTransmitLocation (REASON)"));	
	iModule->CancelTransmitLocation(iGatewayObserver->SessionIdValue(), KErrGeneral);

	// Check network receives cancel response
	if (EFail == CheckNetworkCallbackL(CNetworkObserver::EMeasurementControlFailure) ||
		KErrCancel != iNetworkObserver->MeasurementFailure())
		{
		SetTestStepResult(EFail);
		return TestStepResult();
		}
	INFO_PRINTF1(_L("\t                         MeasurementControlFailure (CANCEL) -> NET"));
	
	// Check network session completed
	if (EFail == CheckNetworkCallbackL(
				CNetworkObserver::EReleaseLcsMoLr) ||
		KErrGeneral != iNetworkObserver->SessionCloseReason())
		{
		SetTestStepResult(EFail);
		return TestStepResult();
		}
	INFO_PRINTF1(_L("\t                                    ReleaseLcsMoLr (REASON) -> NET"));
	
	// Check gateway session completed
	if (EFail == CheckGatewayCallbackL(CGatewayObserver::EProcessSessionComplete) ||
		sessionId != iGatewayObserver->SessionIdValue() ||
		KErrGeneral != iGatewayObserver->SessionCloseReason())
		{
		SetTestStepResult(EFail);
		return TestStepResult();
		}
	INFO_PRINTF1(_L("\tLBS <- ProcessSessionComplete"));

	// Check if more observer activity takes place
	if (iGatewayObserver->IsMoreObserverActivity() ||
		iNetworkObserver->IsMoreObserverActivity())
		{
		SetTestStepResult(EFail);
		return TestStepResult();
		}
								
	INFO_PRINTF1(_L("- END -"));
	SetTestStepResult(EPass);
	return TestStepResult();
	}
/**
@SYMTestCaseID          SYSLIB-LOGENG-CT-1022
@SYMTestCaseDesc	    Tests for operations on log database
@SYMTestPriority 	    High
@SYMTestActions  	    Check by add new event,change the event,and get event and check for integrity of data 
@SYMTestExpectedResults Test must not fail
@SYMREQ                 REQ0000
*/	
LOCAL_C void TestEventViewL(CLogClient& aClient)
	{
	TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-1022 "));
	CTestActive* active = new(ELeave)CTestActive();
	CleanupStack::PushL(active);

	CLogViewChangeObserver* changeObs = CLogViewChangeObserver::NewLC();
	changeObs->SetActive();

  	CLogViewEvent* view = CLogViewEvent::NewL(aClient, *changeObs);
	CleanupStack::PushL(view);

	CLogEvent* event;
	TLogId id;
	TTime now;
	now.UniversalTime();
	TInt count;

	for(count = 0; count < KTestEventNum; count++)
		{
		event = CLogEvent::NewL();
		CleanupStack::PushL(event);
		event->SetEventType(KLogCallEventTypeUid);

		//User::After(Math::Random() % 100000);
		User::After(1000000);
		active->StartL();
		aClient.AddEvent(*event, active->iStatus);
		CActiveScheduler::Start();

		TEST2(active->iStatus.Int(), KErrNone);
		TEST(event->EventType() == KLogCallEventTypeUid);
		TEST(event->Description().Length() > 0);
		TEST(event->Time() >= now);

		now = event->Time();
		id = event->Id();
		
		event->SetRemoteParty(KTestRemoteParty1);
		event->SetDirection(KTestDirection1);
		event->SetDurationType(KTestDurationType1);
		event->SetDuration(KTestDuration1);
		event->SetStatus(KTestStatus1);
		event->SetSubject(KTestSubject1);
		event->SetNumber(KTestNumber1);
		event->SetLink(KTestLink1);
		event->SetDataL(KTestData1);
		event->SetFlags(KTestFlags1);
		event->SetContact((TLogContactItemId) count+1);

		User::After(Math::Random() % 100000);
		active->StartL();
		aClient.ChangeEvent(*event, active->iStatus);
		CActiveScheduler::Start();

		//If the test fails on the next line with -1 or -12 error, it is possible that the contacts database is missing:
		//c:\private\10003a73\SQLite__Contacts.cdb. Copy it to the specified location and rerun the test.
		TEST2(active->iStatus.Int(), KErrNone);
		TEST(event->EventType() == KLogCallEventTypeUid);
		TEST(event->RemoteParty() == KTestRemoteParty1);
		TEST(event->Direction() == KTestDirection1);
		TEST(event->DurationType() == KTestDurationType1);
		TEST(event->Duration() == KTestDuration1);
		TEST(event->Status() == KTestStatus1);
		TEST(event->Subject() == KTestSubject1);
		TEST(event->Number() == KTestNumber1);
		TEST(event->Link() == KTestLink1);
		TEST(event->Data() == KTestData1);
		TLogFlags eventFlags;
		if(TheMatchingIsEnabled)
			{
			eventFlags=KTestFlags1|KLogEventContactSearched;
			}
		else
			{
			eventFlags=KTestFlags1;
			}
		//If the test fails on the next line, it is quite possible that there is a
		//z:\private\10202be9a\101f401d.txt file that sets the contacts match count to 0.
		//Delete the file and run the test again.
		TEST(event->Flags() == eventFlags);
		TEST(event->Contact()==(TLogContactItemId) count+1);

		CleanupStack::PopAndDestroy(); // event;

		event = CLogEvent::NewL();
		CleanupStack::PushL(event);

		event->SetId(id);
		active->StartL();
		aClient.GetEvent(*event, active->iStatus);
		CActiveScheduler::Start();

		TEST2(active->iStatus.Int(), KErrNone);
		TEST(event->EventType() == KLogCallEventTypeUid);
		TEST(event->RemoteParty() == KTestRemoteParty1);
		TEST(event->Direction() == KTestDirection1);
		TEST(event->DurationType() == KTestDurationType1);
		TEST(event->Duration() == KTestDuration1);
		TEST(event->Status() == KTestStatus1);
		TEST(event->Subject() == KTestSubject1);
		TEST(event->Number() == KTestNumber1);
		TEST(event->Link() == KTestLink1);
		TEST(event->Data() == KTestData1);
		TEST(event->Flags() == eventFlags);
		TEST(event->Contact()==(TLogContactItemId) count+1);
		CleanupStack::PopAndDestroy(); // event;
		}

	CleanupStack::PopAndDestroy(3, active); // Delete view, changeObs, active
	}
enum TVerdict CTestSatEnvelopeCmds::doTestStepL()
	{
	INFO_PRINTF1(_L("**************************************"));
	INFO_PRINTF1(_L("Test RSat Envelope Cmds Functionality"));
	INFO_PRINTF1(_L("**************************************"));

	RPhone phone;
	TInt ret=phone.Open(iTelServer,DSATTSY_PHONE_NAME);
	TEST(ret==KErrNone);

	RSat sat;
	ret=sat.Open(phone);
    TEST(ret==KErrNone);

	//
	// Local variables used throughout the sat tests
	//
	TRequestStatus reqStatus;
	iTestCount=1;

	//
	// Get ME side SAT profile for V2
	//
	RSat::TSatProfileV2 profile;
	RSat::TSatProfileV2Pckg profilePckg(profile);

	TEST(profile.ExtensionId() == RSat::KSatV2);

	sat.GetMeSideSatProfile(reqStatus, profilePckg);
	User::WaitForRequest(reqStatus);
	TEST(reqStatus.Int()==KErrNone);

	TEST(profile.iSatProfileByte1==0x01);
	TEST(profile.iSatProfileByte2==0x02);
	TEST(profile.iSatProfileByte3==0x03);
	TEST(profile.iSatProfileByte4==0x04);
	TEST(profile.iSatProfileByte5==0x05);
	TEST(profile.iSatProfileByte6==0x06);
	TEST(profile.iSatProfileByte7==0x07);
	TEST(profile.iSatProfileByte8==0x08);
	TEST(profile.iSatProfileByte9==0x09);
	TEST(profile.iSatProfileByte10==0x0A);
	TEST(profile.iSatProfileByte11==0x0B);
	TEST(profile.iSatProfileByte12==0x0C);
	TEST(profile.iSatProfileByte13==0x0D);
	TEST(profile.iSatProfileByte14==0x0E);
	TEST(profile.iSatProfileByte15==0x0F);
	TEST(profile.iSatProfileByte16==0x10);
	TEST(profile.iSatProfileByte17==0x20);
	TEST(profile.iSatProfileByte18==0x30);
	TEST(profile.iNumOfChannels==DSATTSY_NUMBER_OF_CHANNELS);
	TEST(profile.iScreenHeight==DSATTSY_SCREEN_HEIGHT);
	TEST(profile.iScreenWidth==DSATTSY_SCREEN_WIDTH);
	TEST(profile.iTiaEiaProtoVersion==DSATTSY_PROTO_VERSION);
	TEST(profile.iWidthReduction==DSATTSY_WIDTH_REDUCTION);

	INFO_PRINTF2(_L("Test %d - RSat::GetMeSideSatProfile with RSat::TSatProfileV2 passed"),iTestCount++);

	sat.GetMeSideSatProfile(reqStatus, profilePckg);
	sat.CancelAsyncRequest(ESatGetMeSideSatProfile);
	User::WaitForRequest(reqStatus);
	TEST(reqStatus.Int()==KErrCancel);
	INFO_PRINTF2(_L("Test %d - RSat::GetMeSideSatProfileCancel with RSat::TSatProfileV2 passed"),iTestCount++);

	//
	// Client SAT profile indication
	//
	TEST(sat.ClientSatProfileIndication(profilePckg)==KErrNone);
	INFO_PRINTF2(_L("Test %d - RSat::ClientSatProfileIndication with RSat::TSatProfileV2 passed"),iTestCount++);

	//
	// Get ME side SAT profile for V5
	//
	RSat::TSatProfileV5 profileV5;
	RSat::TSatProfileV5Pckg profileV5Pckg(profileV5);

	TEST(profileV5.ExtensionId() == RSat::KSatV5);

	sat.GetMeSideSatProfile(reqStatus, profileV5Pckg);
	User::WaitForRequest(reqStatus);
	TEST(reqStatus.Int()==KErrNone);

	// Pre-version 5 parameters in SAT profile
	TEST(profileV5.iSatProfileByte1==0x01);
	TEST(profileV5.iSatProfileByte2==0x02);
	TEST(profileV5.iSatProfileByte3==0x03);
	TEST(profileV5.iSatProfileByte4==0x04);
	TEST(profileV5.iSatProfileByte5==0x05);
	TEST(profileV5.iSatProfileByte6==0x06);
	TEST(profileV5.iSatProfileByte7==0x07);
	TEST(profileV5.iSatProfileByte8==0x08);
	TEST(profileV5.iSatProfileByte9==0x09);
	TEST(profileV5.iSatProfileByte10==0x0A);
	TEST(profileV5.iSatProfileByte11==0x0B);
	TEST(profileV5.iSatProfileByte12==0x0C);
	TEST(profileV5.iSatProfileByte13==0x0D);
	TEST(profileV5.iSatProfileByte14==0x0E);
	TEST(profileV5.iSatProfileByte15==0x0F);
	TEST(profileV5.iSatProfileByte16==0x10);
	TEST(profileV5.iSatProfileByte17==0x20);
	TEST(profileV5.iSatProfileByte18==0x30);
	TEST(profileV5.iNumOfChannels==DSATTSY_NUMBER_OF_CHANNELS);
	TEST(profileV5.iScreenHeight==DSATTSY_SCREEN_HEIGHT);
	TEST(profileV5.iScreenWidth==DSATTSY_SCREEN_WIDTH);
	TEST(profileV5.iTiaEiaProtoVersion==DSATTSY_PROTO_VERSION);
	TEST(profileV5.iWidthReduction==DSATTSY_WIDTH_REDUCTION);
	// Version 5 parameters in profile
	// (test also that the TSatProfileByte28 and TSatProfileByte29
	// have been defined correctly as each should set a different bit).
	TEST(profileV5.iSatProfileByte28==
			(RSat::KCapsTextAttributeAlignmentLeft | RSat::KCapsTextAttributeAlignmentCentre |
			 RSat::KCapsTextAttributeAlignmentRight | RSat::KCapsTextAttributeFontSizeNormal |
			 RSat::KCapsTextAttributeFontSizeLarge | RSat::KCapsTextAttributeFontSizeSmall)); // 0x3F
	TEST(profileV5.iSatProfileByte29==(RSat::KCapsTextAttributeStyleNormal |
									 RSat::KCapsTextAttributeStyleBold |
									 RSat::KCapsTextAttributeStyleItalic |
									 RSat::KCapsTextAttributeStyleUnderline |
									 RSat::KCapsTextAttributeStyleStrikethrough |
									 RSat::KCapsTextAttributeStyleForeground |
									 RSat::KCapsTextAttributeStyleBackground)); // 0x7F

	INFO_PRINTF2(_L("Test %d - RSat::GetMeSideSatProfile with RSat::TSatProfileV5 passed"),iTestCount++);

	sat.GetMeSideSatProfile(reqStatus, profileV5Pckg);
	sat.CancelAsyncRequest(ESatGetMeSideSatProfile);
	User::WaitForRequest(reqStatus);
	TEST(reqStatus.Int()==KErrCancel);
	INFO_PRINTF2(_L("Test %d - RSat::GetMeSideSatProfileCancel with RSat::TSatProfileV5 passed"),iTestCount++);

	//
	// Client SAT profile indication for V5
	//
	TEST(sat.ClientSatProfileIndication(profileV5Pckg)==KErrNone);
	INFO_PRINTF2(_L("Test %d - RSat::ClientSatProfileIndication RSat::TSatProfileV5 passed"),iTestCount++);

	// Menu Selection
	RSat::TMenuSelectionV1 selection;
	RSat::TMenuSelectionV1Pckg selectionPckg(selection);

	selection.iHelp		=DSATTSY_HELP_REQUESTED;
	selection.iItemId	=DSATTSY_ITEM_ID;

	sat.MenuSelection(reqStatus, selectionPckg);
	User::WaitForRequest(reqStatus);
	TEST(reqStatus.Int()==KErrNone);
	INFO_PRINTF2(_L("Test %d - RSat::MenuSelection passed"),iTestCount++);

	// Menu Selection Cancel
	sat.MenuSelection(reqStatus,selectionPckg);
	sat.CancelAsyncRequest(ESatMenuSelection);
	User::WaitForRequest(reqStatus);
	TEST(reqStatus.Int()==KErrCancel);
	INFO_PRINTF2(_L("Test %d - RSat::MenuSelectionCancel passed"),iTestCount++);

	// Event Download

	// Test each event

	RSat::TEventList				eventList;
	RSat::TEventDownloadBaseV2		eventBaseV2;
	RSat::TEventDownloadBaseV2Pckg	eventBaseV2Pckg( eventBaseV2 );

	// KUserActivity

	eventList = RSat::KUserActivity;

	sat.EventDownload( reqStatus, eventList, eventBaseV2Pckg );	// No associated data
	User::WaitForRequest(reqStatus);
	TEST(reqStatus.Int()==KErrNone);

	INFO_PRINTF2(_L("Test %d - RSat::EventDownload(KUserActivity) passed"),iTestCount++);

	// Event Download Cancel

	sat.EventDownload( reqStatus, eventList, eventBaseV2Pckg );	// No associated data
	sat.CancelAsyncRequest(ESatEventDownload);
	User::WaitForRequest(reqStatus);
	TEST(reqStatus.Int()==KErrCancel);

	INFO_PRINTF2(_L("Test %d - RSat::EventDownloadCancel passed"),iTestCount++);

	// KIdleScreenAvailable

	eventList = RSat::KIdleScreenAvailable;

	sat.EventDownload( reqStatus, eventList,  eventBaseV2Pckg );	// No associated data
	User::WaitForRequest(reqStatus);
	TEST(reqStatus.Int()==KErrNone);

	INFO_PRINTF2(_L("Test %d - RSat::EventDownload(KIdleScreenAvailable) passed"),iTestCount++);

	sat.EventDownload( reqStatus, eventList,  eventBaseV2Pckg );	// No associated data
	sat.CancelAsyncRequest(ESatEventDownload);
	User::WaitForRequest(reqStatus);

	// KCardReaderStatus

	RSat::TCardReaderStatusEventV2		eventCardStatus;
	RSat::TCardReaderStatusEventV2Pckg	eventCardStatusPckg(eventCardStatus);

	eventList						  = RSat::KCardReaderStatus;
	eventCardStatus.iCardReaderStatus = DSATTSY_EVENT_CARD_READER_STATUS;

	sat.EventDownload( reqStatus, eventList, eventCardStatusPckg );
	User::WaitForRequest(reqStatus);
	TEST(reqStatus.Int()==KErrNone);

	INFO_PRINTF2(_L("Test %d - RSat::EventDownload(KCardReaderStatus) passed"),iTestCount++);

	sat.EventDownload( reqStatus, eventList, eventCardStatusPckg );
	sat.CancelAsyncRequest(ESatEventDownload);
	User::WaitForRequest(reqStatus);

	// KLanguageSelection

	RSat::TLanguageSelectionEventV2		languageSelect;
	RSat::TLanguageSelectionEventV2Pckg	languageSelectPckg(languageSelect);

	eventList				 = RSat::KLanguageSelection;
	languageSelect.iLanguage = DSATTSY_EVENT_LANGUAGE_SELECTION;

	sat.EventDownload( reqStatus, eventList, languageSelectPckg );
	User::WaitForRequest(reqStatus);
	TEST(reqStatus.Int()==KErrNone);

	INFO_PRINTF2(_L("Test %d - RSat::EventDownload(KLanguageSelection) passed"),iTestCount++);

	sat.EventDownload( reqStatus, eventList, languageSelectPckg );
	sat.CancelAsyncRequest(ESatEventDownload);
	User::WaitForRequest(reqStatus);

	// KBrowserTermination

	RSat::TBrowserTerminationEventV2		browserTerm;
	RSat::TBrowserTerminationEventV2Pckg	browserTermPckg( browserTerm );

	eventList		   = RSat::KBrowserTermination;
	browserTerm.iCause = DSATTSY_EVENT_BROWSER_TERMINATION_CAUSE;

	sat.EventDownload( reqStatus, eventList, browserTermPckg );
	User::WaitForRequest(reqStatus);
	TEST(reqStatus.Int()==KErrNone);

	INFO_PRINTF2(_L("Test %d - RSat::EventDownload(KBrowserTermination) passed"),iTestCount++);

	sat.EventDownload( reqStatus, eventList, browserTermPckg );
	sat.CancelAsyncRequest(ESatEventDownload);
	User::WaitForRequest(reqStatus);

	// KDataAvailable

	RSat::TDataAvailableEventV2		dataAvailable;
	RSat::TDataAvailableEventV2Pckg	dataAvailablePckg( dataAvailable );

	eventList	 = RSat::KDataAvailable;

	dataAvailable.iStatus.Append( DSATTSY_EVENT_DATA_AVAILABLE_STATUS );
	dataAvailable.iLength = DSATTSY_EVENT_DATA_AVAILABLE_LENGTH;

	sat.EventDownload( reqStatus, eventList, dataAvailablePckg );
	User::WaitForRequest(reqStatus);
	TEST(reqStatus.Int()==KErrNone);

	INFO_PRINTF2(_L("Test %d - RSat::EventDownload(KDataAvailable) passed"),iTestCount++);

	sat.EventDownload( reqStatus, eventList, dataAvailablePckg );
	sat.CancelAsyncRequest(ESatEventDownload);
	User::WaitForRequest(reqStatus);

	// KChannelStatus

	RSat::TChannelStatusEventV2		channelStatus;
	RSat::TChannelStatusEventV2Pckg	channelStatusPckg( channelStatus );

	eventList			  = RSat::KChannelStatus;
	channelStatus.iStatus = DSATTSY_EVENT_CHANNEL_STATUS;

	sat.EventDownload( reqStatus, eventList, channelStatusPckg );
	User::WaitForRequest(reqStatus);
	TEST(reqStatus.Int()==KErrNone);

	INFO_PRINTF2(_L("Test %d - RSat::EventDownload(KChannelStatus) passed"),iTestCount++);

	sat.EventDownload( reqStatus, eventList, channelStatusPckg );
	sat.CancelAsyncRequest(ESatEventDownload);
	User::WaitForRequest(reqStatus);

	// KDisplayParamsChanges

	RSat::TDisplayParamsEventV2		displayParams;
	RSat::TDisplayParamsEventV2Pckg	displayParamsPckg( displayParams );

	eventList	 = RSat::KDisplayParamsChanges;

	displayParams.iSatProfileByte14 = DSATTSY_EVENT_DISPLAY_PROF14;
	displayParams.iScreenHeight     = DSATTSY_SCREEN_HEIGHT;
	displayParams.iSatProfileByte15 = DSATTSY_EVENT_DISPLAY_PROF15;
	displayParams.iScreenWidth		= DSATTSY_SCREEN_WIDTH;
	displayParams.iSatProfileByte16 = DSATTSY_EVENT_DISPLAY_PROF16;
	displayParams.iWidthReduction   = DSATTSY_WIDTH_REDUCTION;

	sat.EventDownload( reqStatus, eventList, displayParamsPckg );
	User::WaitForRequest(reqStatus);
	TEST(reqStatus.Int()==KErrNone);

	INFO_PRINTF2(_L("Test %d - RSat::EventDownload(KDisplayParams) passed"),iTestCount++);

	sat.EventDownload( reqStatus, eventList, displayParamsPckg );
	sat.CancelAsyncRequest(ESatEventDownload);
	User::WaitForRequest(reqStatus);

	// KLocalConnection

	RSat::TLocalConnectionEventV2		localConnection;
	RSat::TLocalConnectionEventV2Pckg	localConnectionPckg( localConnection );

	eventList	 = RSat::KLocalConnection;
	localConnection.iRecord.iBearerId  = DSATTSY_EVENT_LOCAL_BEARER_ID;
	localConnection.iRecord.iServiceId = DSATTSY_EVENT_LOCAL_SERVICE_ID;
	localConnection.iRecord.iRecord	   = DSATTSY_EVENT_LOCAL_SERVICE_RECORD;
	localConnection.iAddress.iCoding   = DSATTSY_EVENT_LOCAL_ADDR_CODING ;
	localConnection.iAddress.iAddress  = DSATTSY_EVENT_LOCAL_ADDRESS;

	sat.EventDownload( reqStatus, eventList, localConnectionPckg );
	User::WaitForRequest(reqStatus);
	TEST(reqStatus.Int()==KErrNone);

	INFO_PRINTF2(_L("Test %d - RSat::EventDownload(KLocalConnection) passed"),iTestCount++);

	sat.EventDownload( reqStatus, eventList, displayParamsPckg );
	sat.CancelAsyncRequest(ESatEventDownload);
	User::WaitForRequest(reqStatus);
	
	/** Testing the Release 6 features supported by the envelope commands*/
	/**
	Testing Event Download envelope command w.r.t NetworkSearchModeChangeEvent which has been updated
    as part of the Release 6 Features of USIM Application ToolKit
	@test TSAT324
	*/
	RSat::TNetworkSearchModeChangeEventV6 networkSearchModeChangeEvent;	
	RSat::TNetworkSearchModeChangeEventV6Pckg networkSearchModeChangeEventPckg(networkSearchModeChangeEvent);
	
	eventList=RSat::KNetworkSearchModeChange;
	networkSearchModeChangeEvent.iNetworkSearchMode=DSATTSY_NETWORK_SEARCH_MODE1;
	
	sat.EventDownload(reqStatus,eventList,networkSearchModeChangeEventPckg);
	User::WaitForRequest(reqStatus);
	TEST(reqStatus.Int()==KErrNone);
	
    INFO_PRINTF2(_L("Test %d - EventDownload - NetworkSearchModeChangeEvent- passed"),iTestCount++);
    
    /**
    Testing Cancel API for the Event Download envelope command
    @test TSAT325
    */
    
    //Cancel	
	sat.EventDownload(reqStatus,eventList,networkSearchModeChangeEventPckg);
	sat.CancelAsyncRequest(ESatEventDownload);
	User::WaitForRequest(reqStatus);
	TEST(reqStatus.Int()==KErrCancel);
	
	//BrowsingStatusEvent 
	
	/**
	Testing Event Download envelope command w.r.t TBrowsingStatusEventV6 which has been updated
    as part of the Release 6 Features of USIM Application ToolKit
	@test TSAT326
	*/
	RSat::TBrowsingStatusEventV6 browsingStatusEvent;
	RSat::TBrowsingStatusEventV6Pckg	browsingStatusEventPckg(browsingStatusEvent);

	eventList=RSat::KBrowsingStatusChange;
	browsingStatusEvent.iBrowserStatus = DSATTSY_BROWSING_STATUS1;
	
	sat.EventDownload(reqStatus,eventList,browsingStatusEventPckg);
	User::WaitForRequest(reqStatus);
	TEST(reqStatus.Int()==KErrNone);
	
    INFO_PRINTF2(_L("Test %d - EventDownload - BrowsingStatusEvent- passed"),iTestCount++);
    
    /**
    Testing Cancel API for the Event Download envelope command
    @test TSAT327
    */
    
    //Cancel	
	sat.EventDownload(reqStatus,eventList, browsingStatusEventPckg);
	sat.CancelAsyncRequest(ESatEventDownload);
	User::WaitForRequest(reqStatus);
	TEST(reqStatus.Int()==KErrCancel);
	
	//FramesInformationChangedEvent
	
	/**
	Testing Event Download envelope command w.r.t FramesInformationChangedEvent which has been updated
    as part of the Release 6 Features of USIM Application ToolKit
	@test TSAT328
	*/
	RSat::TFramesInformationChangedEventV6 framesInfoChangedEvent;
	RSat::TFramesInformationChangedEventV6Pckg	framesInfoChangedEventPckg(framesInfoChangedEvent);

	eventList=RSat::KFramesInformationChange;
	framesInfoChangedEvent.iFramesInformation.iFrameId = DSATTSY_FRAMES_INFORMATION_FRAMEID;
	framesInfoChangedEvent.iFramesInformation.iFrameList= DSATTSY_FRAMES_INFORMATION_FRAME_LIST;
	
	sat.EventDownload(reqStatus,eventList, framesInfoChangedEventPckg);
	User::WaitForRequest(reqStatus);
	TEST(reqStatus.Int()==KErrNone);
	
    INFO_PRINTF2(_L("Test %d - EventDownload - framesInformationChangedEvent- passed"),iTestCount++);
    
    /**
    Testing Cancel API for the Event Download envelope command
    @test TSAT329
    */
    
    //Cancel	
	sat.EventDownload(reqStatus,eventList, framesInfoChangedEventPckg);
	sat.CancelAsyncRequest(ESatEventDownload);
	User::WaitForRequest(reqStatus);
	TEST(reqStatus.Int()==KErrCancel);
	
	/**
	Testing Multimedia Messaging Service Transfer Status envelope command which has been newly
	added as part of the Release 6 Features of USIM Application ToolKit
	@test TSAT299
	*/
	RSat::TMmsTransferStatusV6 mmsTransferStatus;
	RSat::TMmsTransferStatusV6Pckg	mmsTransferStatusPckg(mmsTransferStatus);

	mmsTransferStatus.iDeviceId = DSATTSYV6_DEVICE_ID3;
	mmsTransferStatus.iMultimediaMessageId =DSATTSYV6_MULTIMEDIA_MESSAGE_ID1;
	mmsTransferStatus.iMultimediaMessageStatus =DSATTSYV6_MULTIMEDIA_MESSAGE_STATUS;
	
	sat.MmsTransferStatus(reqStatus, mmsTransferStatusPckg);
	User::WaitForRequest(reqStatus);
	TEST(reqStatus.Int()==KErrNone);
	
    INFO_PRINTF2(_L("Test %d - RSat::MmsTransferStatus - Multimedia Messaging Service Transfer Status - passed"),iTestCount++);
    
    /**
    Testing Cancel API for the Multimedia Messaging  Service Transfer Status envelope command
    @test TSAT300
    */
    
    //Cancel	
	sat.MmsTransferStatus(reqStatus, mmsTransferStatusPckg);
	sat.CancelAsyncRequest(ESatMmsTransferStatus);
	User::WaitForRequest(reqStatus);
	TEST(reqStatus.Int()==KErrCancel);
	
	/**
	Testing Multimedia Messaging  Service Notificaiton Download envelope command which has been newly
	added as part of the Release 6 Features of USIM Application ToolKit
	@test TSAT301
	*/
	RSat::TMmsNotificationDownloadV6 mmsNotificationDownload;
	RSat::TMmsNotificationDownloadV6Pckg	mmsNotificationDownloadPckg(mmsNotificationDownload);

	mmsNotificationDownload.iDeviceId = DSATTSYV6_DEVICE_ID1;
	mmsNotificationDownload.iLastEnvelope = DSATTSYV6_LAST_ENVELOPE1; 
	mmsNotificationDownload.iMMSNotification = DSATTSYV6_MMS_NOTIFICATION1;
	
	sat.MmsNotificationDownload(reqStatus, mmsNotificationDownloadPckg);
	User::WaitForRequest(reqStatus);
	TEST(reqStatus.Int()==KErrNone);
	
    INFO_PRINTF2(_L("Test %d - RSat::MmsNotificationDownload - Multimedia Messaging  Service Notificaiton Download - passed"),iTestCount++);
    
    /**
    Testing Cancel API for the Multimedia Messaging  Notification Download envelope command
    @test TSAT302
    */
    
    //Cancel	
	sat.MmsNotificationDownload(reqStatus, mmsNotificationDownloadPckg);
	sat.CancelAsyncRequest(ESatMmsNotificationDownload);
	User::WaitForRequest(reqStatus);
	TEST(reqStatus.Int()==KErrCancel);
	
		
	/**
	Testing Ussd Data Download command which has been newly
	added as part of the Release 6 Features of USIM Application ToolKit
	@test TSAT303
	@test TSAT313
	*/
	RSat::TUssdDataDownloadV6 ussdDataDownload;
	RSat::TUssdDataDownloadV6Pckg	ussdDataDownloadPckg(ussdDataDownload);

	ussdDataDownload.iDeviceId = DSATTSYV6_DEVICE_ID1;
	ussdDataDownload.iUssdString.iUssdString = DSATTSY_USSD_STRING;

	sat.UssdDataDownload(reqStatus, ussdDataDownloadPckg);
	User::WaitForRequest(reqStatus);
	TEST(reqStatus.Int()==KErrNone);
    INFO_PRINTF2(_L("Test %d - UssdDataDownload - Ussd Data Download command- passed"),iTestCount++);
    
    /**
    Testing Cancel API for the Ussd Data Download command
    @test TSAT304
    @test TSAT314
    */
    
    //Cancel	
	sat.UssdDataDownload(reqStatus, ussdDataDownloadPckg);
	sat.CancelAsyncRequest(ESatUssdDataDownload);
	User::WaitForRequest(reqStatus);
	TEST(reqStatus.Int()==KErrCancel);
	
	sat.Close();
	phone.Close();

	return TestStepResult();

	}
示例#29
0
// constructor
CCommDbTest023_04::CCommDbTest023_04()
	{
	// store the name of this test case
	SetTestStepName(_L("step_023_04"));
	}
示例#30
0
LOCAL_C void CreateManyFoldersL()
	{
	gTestWrapper->Next(_L("[Folders tests] creating levels of folders"));
	// Create a sub-root folder
	RBkFolder subroot;
	subroot = gDatabase.CreateFolderL(KTxtSubRootName);
	CleanupClosePushL(subroot);

	// Create three folders in the sub-root
	RBkFolder folderL2;
	folderL2 = gDatabase.CreateFolderL(KTxtFolder2_1, &subroot);
	folderL2.Close();

	folderL2 = gDatabase.CreateFolderL(KTxtFolder2_2, &subroot);
	CleanupClosePushL(folderL2);
	// Create a folder in folder 2.2
	RBkFolder folderL3;
	folderL3 = gDatabase.CreateFolderL(KTxtFolder2_2_1, &folderL2);
	folderL3.Close();
	CleanupStack::PopAndDestroy(&folderL2);

	folderL2 = gDatabase.CreateFolderL(KTxtFolder2_3, &subroot);
	folderL2.Close();

	CleanupStack::PopAndDestroy(&subroot);

	// Check that there are three folders in the sub-root
	RBkFolder folder = gDatabase.OpenFolderL(KTxtSubRootName);
	gTestWrapper->TEST(folder.Count() == 3);
	folder.Close();

	// Check that there is a folder in the folder 2.2
	folder = gDatabase.OpenFolderL(KTxtFolder2_2);
	gTestWrapper->TEST(folder.Count() == 1);
	Bookmark::TItemId id = folder.Id();
	folder.Close();

	// Delete folder 2.2. The default action is dump any children to the root folder
	gDatabase.DeleteItemL(id);

	// Check that folder 2.2 can not be found
	TRAPD(error, folder = gDatabase.OpenFolderL(KTxtFolder2_2));
	gTestWrapper->TEST(error == KErrNotFound);

	// There should now be 2 folders in the sub-root
	folder = gDatabase.OpenFolderL(KTxtSubRootName);
	gTestWrapper->TEST(folder.Count() == 2);
	folder.Close();

	// The folder 2.2.1 should now be in the root
	// Check it exists and check that it's parent is the root
	folder = gDatabase.OpenFolderL(KTxtFolder2_2_1);
	CleanupClosePushL(folder);
	subroot = folder.OpenParentL();
	CleanupClosePushL(subroot);
	gTestWrapper->TEST(subroot.Title().Compare(Bookmark::KTxtRootTitle) == 0);
	CleanupStack::PopAndDestroy(2);

	// Get the sub-root and delete it with all it's children
	subroot = gDatabase.OpenFolderL(KTxtSubRootName);
	id = subroot.Id();
	subroot.Close();
	gDatabase.DeleteItemL(id, ETrue);

	// There should now be only one item in the root
	// delete it
	folder = gDatabase.OpenRootL();
	gTestWrapper->TEST(folder.Count() == 1);
	folder.Close();
	folder = gDatabase.OpenFolderL(KTxtFolder2_2_1);
	id = folder.Id();
	folder.Close();
	gDatabase.DeleteItemL(id, ETrue);
	}