コード例 #1
0
ファイル: ntp.cpp プロジェクト: flaithbheartaigh/almalert
CNtp::~CNtp()
{
  TRAPD(err,CleanupL());
  Cancel();
  iResolver.Close();
  iSocket.Close();
  iSocketServ.Close();
}
コード例 #2
0
void doTestsL()
	{
	InitL();					//Qualified: no leavescan error

	TestMessagePreCreateL();	//Qualified: no leavescan error
	TestMessageCreatedL();		//Qualified: no leavescan error
	TestMessageDeletedL();		//Qualified: no leavescan error
	TestMessageAddingAttachmentL();	//Qualified: no leavescan error
	TestMessageStartSendingL();		//Qualified: no leavescan error
	TestMessageDuringSendingL();	//Qualified: no leavescan error
	TestMessageSentL();			//Qualified: no leavescan error

	CleanupL();					//Qualified: no leavescan error
	}
コード例 #3
0
void doTestsL()
	{
	InitL();	// Qualified: no leavescan error

	theUtils->Start(_L("Message Add Attachments using RFile"));
	TestMessageAddAttachmentL(EFalse, KNullDesC8);	// Qualified: no leavescan error
	
	theUtils->Start(_L("Message Add Attachments using filename"));
	TestMessageAddAttachmentL(ETrue, KNullDesC8);	// Qualified: no leavescan error

	theUtils->Start(_L("Message Add Attachments using RFile with mime type"));
	TestMessageAddAttachmentL(EFalse, KMimeType);	// Qualified: no leavescan error

	theUtils->Start(_L("Message Add Attachments using filename with mime type"));
	TestMessageAddAttachmentL(ETrue, KMimeType);	// Qualified: no leavescan error

	theUtils->Start(_L("Message Add Linked Attachments"));
	TestMessageAddLinkedAttachmentL(KNullDesC8);	// Qualified: no leavescan error

	theUtils->Start(_L("Message Add Linked Attachments with mime type"));
	TestMessageAddLinkedAttachmentL(KMimeType);		// Qualified: no leavescan error

	theUtils->Start(_L("Message Create Attachments"));
	TestMessageCreateAttachmentL(KNullDesC8);		// Qualified: no leavescan error
	
	theUtils->Start(_L("Message Create Attachments with mime type"));
	TestMessageCreateAttachmentL(KMimeType);		// Qualified: no leavescan error
	
	// Charset testing
	theUtils->Start(_L("Message Add Attachments using RFile with mime type/charset"));
	TestMessageAddAttachmentL(EFalse, KMimeType, KTestCharset);	// Qualified: no leavescan error
	
	theUtils->Start(_L("Message Add Attachments using filename with mime type/charset"));
	TestMessageAddAttachmentL(ETrue, KMimeType, KTestCharset);	// Qualified: no leavescan error

	theUtils->Start(_L("Message Add Linked Attachments with mime type/charset"));
	TestMessageAddLinkedAttachmentL(KMimeType, KTestCharset);	// Qualified: no leavescan error
	
	theUtils->Start(_L("Message Create Attachments with mime type/charset"));
	TestMessageCreateAttachmentL(KMimeType, KTestCharset);		// Qualified: no leavescan error
	
	CleanupL();	// Qualified: no leavescan error
	}
コード例 #4
0
void doTestsL()
	{
	InitL();	//Qualified: no leavescan error

	TestSendMessageCancelL();						//Qualified: no leavescan error
	TestSendMessageConfirmedCancelL();				//Qualified: no leavescan error
	TestAddAttachmentCancelL(EByName);				//Qualified: no leavescan error
	TestAddAttachmentCancelL(EByNameWithMimeType);	//Qualified: no leavescan error
	TestAddAttachmentCancelL(EByFile);				//Qualified: no leavescan error
	TestAddAttachmentCancelL(EByFileWithMimeType);	//Qualified: no leavescan error
	TestAddAttachmentCancelL(ELinked);				//Qualified: no leavescan error
	TestAddAttachmentCancelL(ELinkedWithMimeType);	//Qualified: no leavescan error
	TestSendMessageAndSessionCloseL();				//Qualified: no leavescan error
	TestAddAttachmentAndSessionCloseL(EByName);		//Qualified: no leavescan error
	TestAddAttachmentAndSessionCloseL(EByNameWithMimeType);	//Qualified: no leavescan error
	TestAddAttachmentAndSessionCloseL(EByFile);				//Qualified: no leavescan error
	TestAddAttachmentAndSessionCloseL(EByFileWithMimeType);	//Qualified: no leavescan error
	TestAddAttachmentAndSessionCloseL(ELinked);				//Qualified: no leavescan error	
	TestAddAttachmentAndSessionCloseL(ELinkedWithMimeType);	//Qualified: no leavescan error

	CleanupL();	//Qualified: no leavescan error
	}
コード例 #5
0
GLDEF_C TInt E32Main ()
	{
	__UHEAP_MARK;

	TheTest.Printf (_L ("\n"));
	TheTest.Title ();
	TheTest.Start (_L("Defect Tests "));

	TRAPD (err, SetupL ());
	TheTest (err == KErrNone);

	TRAP (err, DoTestsL ());
	TheTest (err == KErrNone);

	CleanupL ();

	TheTest.End ();
	TheTest.Close ();

	__UHEAP_MARKEND;
	return (KErrNone);
	}
コード例 #6
0
TVerdict CContactViewTest::doTestStepL()
	{

	void (CContactViewTest::*mainFunc)() = NULL;

	const TDesC &run = ConfigSection();

	if( run.Find( KRun1 ) > KErrNotFound )
		{
		mainFunc = &CContactViewTest::AllEmptyTestL;
		}
	else if( run.Find( KRun2 ) > KErrNotFound )
		{
		mainFunc = &CContactViewTest::ViewEmptyTestL;
		}
	else if( run.Find( KRun3 ) > KErrNotFound )
		{
		mainFunc = &CContactViewTest::ContactEmptyTestL;
		}
	else if( run.Find( KRun4 ) > KErrNotFound )
		{
		mainFunc = &CContactViewTest::AllFullTestL;
		}
	else if( run.Find( KRun5 ) > KErrNotFound )
		{
		mainFunc = &CContactViewTest::EmptyFieldsetTestL;
		}
	else if( run.Find( KRun6 ) > KErrNotFound )
		{
		mainFunc = &CContactViewTest::EmptyFieldsetSortTestL;
		}
	else if( run.Find( KRun7 ) > KErrNotFound )
		{
		mainFunc = &CContactViewTest::MissingFieldTestL;
		}
	else if( run.Find( KRun8 ) > KErrNotFound )
		{
		mainFunc = &CContactViewTest::PerformanceTestL;
		}
	else if( run.Find( KRun9 ) > KErrNotFound )
		{
		mainFunc = &CContactViewTest::RecoverCompressTestL; // this test does not apply to the SQLite version of contacts
		}
	else if( run.Find( KRun10 ) > KErrNotFound )
		{
		mainFunc = &CContactViewTest::ConcurrentRecoverCompressTestL; // this test does not apply to the SQLite version of contacts
		}
	else
		{
		MissngTestPanic();
		}

	__UHEAP_MARK;

	iRemote = EFalse;
	ALLPRINT(KStars);
	if( iPLView )
		{
		_LIT(KPersistance,"Initialising LocalView on Persistence Layers tests");
		ALLPRINT(KPersistance);
		}
	else
		{
		_LIT(KLocalViewCS,"Initialising LocalView on Client/Server tests");
		ALLPRINT(KLocalViewCS);
		}
	ALLPRINT(KStars);
	InitializeL();
	iObserver->iMainFunc = mainFunc;
	CActiveScheduler::Start();

	if( !iPLView )
		{
		ALLPRINT(KStars);
		_LIT(KRemoteViewCS,"Initialising RemoteView on Client/Server tests");
		ALLPRINT(KRemoteViewCS);
		ALLPRINT(KStars);
		iRemote = ETrue;
        // Ensure that the recover is deleted before another one is created.
        EndRecoverL();
		ResetDatabaseL(10);
		iObserver->iMainFunc = mainFunc;// test to run
		iObserver->iDoFunc = NULL;
		iObserver->CleanView();
		iObserver->Activate();
		CActiveScheduler::Start();
		}

	if( !iPLView )
		{
		ALLPRINT(KStars);
		_LIT(KRemoteViewCS,"Initialising RemoteView on Client/Server tests");
		ALLPRINT(KRemoteViewCS);
		ALLPRINT(KStars);
		iRemote = ETrue;
		ResetDatabaseL(10);
		iObserver->iMainFunc = mainFunc;// test to run
		iObserver->iDoFunc = NULL;
		iObserver->CleanView();
		iObserver->Activate();
		CActiveScheduler::Start();
		}

		CleanupL();
		__UHEAP_MARKEND;

	return TestStepResult();
	}
コード例 #7
0
ファイル: t_dcnone.cpp プロジェクト: kuailexs/symbiandump-os1
GLDEF_C void CallTestsL(/*TChar aDriveLetter*/)
//
// Do all tests
//
	{
	if( !PlatSec::IsCapabilityEnforced(ECapabilityTCB) || 
		!PlatSec::IsCapabilityEnforced(ECapabilityAllFiles) ||
		!PlatSec::IsCapabilityEnforced(ECapabilityDiskAdmin))
		{
		test.Printf(_L("Insufficient capabilities enabled - leaving t_dcnone"));
		test.Printf(_L("\n")); // Prevent overwrite by next print
		return;
		}
	TurnAllocFailureOff();
	TheFs.CharToDrive(gDriveToTest,gTheDriveNum);
	
	TBuf<30> sesspath;
	sesspath=_L("?:\\");
	sesspath[0] = (TText)gDriveToTest;

	TInt r= TheFs.SetSessionPath(sesspath);
	test_KErrNone(r);

	TBuf<2> cmd;
	cmd.SetLength(1);
	cmd[0] = (TText)gDriveToTest;
	RProcess tp;
	r=tp.Create(_L("clean_prepdc.exe"),sesspath);
	test_KErrNone(r);
	{
	TRequestStatus ps;
	tp.Logon(ps);
	tp.Resume();
	tp.Close();
	User::WaitForRequest(ps);
	}

	//check double mode ie that Defpath still works	
	RFs fs1;
	RFs fs2;
	
	r=fs1.Connect();
	test_KErrNone(r);
	r=fs1.SessionPath(sesspath);
	test_KErrNone(r);
	test.Printf(_L("session1 Path=%S"),&sesspath);

	TBuf<30> privatepath;
	r=fs1.SetSessionToPrivate(gTheDriveNum);
	test_KErrNone(r);
	r=fs1.PrivatePath(privatepath);
	test_KErrNone(r);
	r=privatepath.Compare(KExpectedPrivatePath());
	test_Value(r, r == 0);
	r=fs1.SessionPath(sesspath);
	test_KErrNone(r);
	r=privatepath.Compare(sesspath.Mid(KPathPosition));
	test_Value(r, r == 0);
	r=fs1.CreatePrivatePath(gTheDriveNum);
	test_KErrNone(r);
	fs1.Close();

	r=fs2.Connect();
	test_KErrNone(r);
	r=fs2.SessionPath(sesspath);
	test_KErrNone(r);
	test.Printf(_L("session2 Path=%S"),&sesspath);
	fs2.Close();

	TestCaps();
	TestCaging();
	TestDirs();
	TestPathCheck();
	TestSystemDrive();

	test.Printf(_L("No of files open=%d"), TheFs.ResourceCount());
	
	CleanupL();
	}