TInt E32Main()
	{
	__UHEAP_MARK;

    ::KillEComServerL();

	CTrapCleanup* tc = CTrapCleanup::New();
	TEST(tc != NULL);

	TEST2(TheFs.Connect(), KErrNone);

	CActiveScheduler* activeSched = new CActiveScheduler;
	TEST(activeSched != NULL);
	CActiveScheduler::Install(activeSched);

	TheTest.Title();
	TRAPD(err, ::DoTestL());
	TEST2(err, KErrNone);

	ResetSsa(TheTest, TheFs);

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

	delete activeSched;

	TheFs.Close();

	delete tc;

	__UHEAP_MARKEND;

	User::Heap().Check();
	return KErrNone;
	}
TInt E32Main()
	{
	TheTest.Title();
	
	CTrapCleanup* tc = CTrapCleanup::New();
	TheTest(tc != NULL);
	
	__UHEAP_MARK;
	
	TestEnvInit();
	DeleteTestFiles();
	TheTest.Start(_L(" @SYMTestCaseID:SYSLIB-SQL-CT-1650 OS porting layer tests"));
	DoTests();
	TestEnvDestroy();

	__UHEAP_MARKEND;
	
	TheTest.End();
	TheTest.Close();
	
	delete tc;

	User::Heap().Check();
	return KErrNone;
	}
TInt E32Main()
    {
	__UHEAP_MARK;

	test.Start(_L("@SYMTESTCaseID:PIM-TCAL-DELETE-0001 Calendar Interim API Delete test suite"));

	test.Title();

	CTrapCleanup* trapCleanup = CTrapCleanup::New();
	if (!trapCleanup)
		{
		return KErrNoMemory;
		}

	CActiveScheduler* scheduler = new CActiveScheduler();
	if (!scheduler)
		{
		delete trapCleanup;
		return KErrNoMemory;
		}
	CActiveScheduler::Install(scheduler);	

	TRAPD(ret, DoTestL());
	test(ret == KErrNone);
	
	delete scheduler;
	delete trapCleanup;	

	test.End();
	test.Close();

	__UHEAP_MARKEND;

	return (KErrNone);
    }
TInt E32Main()
	{
	TheTest.Title();

	CTrapCleanup* tc = CTrapCleanup::New();
	TheTest(tc != NULL);

	__UHEAP_MARK;

	GetCmdLineParamsAndSqlConfigString(TheTest, _L("t_sqlperformance4"), TheCmdLineParams, TheSqlConfigString);
	PrepareDbName(KCDriveDatabase, TheCmdLineParams.iDriveName, TheDbFileName);

	TheTest.Printf(_L("==Databases: %S\r\n"), &TheDbFileName); 
	
	TestEnvInit();
	
	DoTests();
	
	TestEnvDestroy();
	
	__UHEAP_MARKEND;
	
	TheTest.End();
	TheTest.Close();
	
	delete tc;

	User::Heap().Check();
	return KErrNone;
	}
TInt E32Main()
	{
	TheTest.Title();

	CTrapCleanup* tc = CTrapCleanup::New();

	__UHEAP_MARK;

	CreateTestDir();
	DeleteTestFiles();

	TRAPD(err, DoTestsL());
	DeleteTestFiles();
	TEST2(err, KErrNone);

	__UHEAP_MARKEND;

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

	delete tc;

	User::Heap().Check();
	return KErrNone;
	}
TInt E32Main()
	{
	CTrapCleanup* tc = CTrapCleanup::New();
	if(!tc)
		{
		User::Panic(KPanicCategory, KErrNoMemory) ;
		}

	__UHEAP_MARK;

	TheTest.Title();
	TheTest.Start(_L(" @SYMTestCaseID:SYSLIB-SQL-LEGACY-T_SQLITEWSD2-0001 "));
	CreateTestEnv();
	DoInserts(KWsdProc2Id, KWsdProc2RecId1, KWsdProc2RecId2);
	DestroyTestEnv();
	TheTest.End();
	TheTest.Close();

	__UHEAP_MARKEND;

	delete tc;

	User::Heap().Check();
	return KErrNone;
	}
GLDEF_C TInt E32Main()
//
// Test Help file loading
//
    {
	__UHEAP_MARK;

	TheTest.Title();
	TheTest.Start(_L("@SYMTestCaseID PIM-TLOADER-0001"));
	TheTest(TheFs.Connect() == KErrNone);


	TheTrapCleanup = CTrapCleanup::New();
	if	(!TheTrapCleanup)
		return KErrNoMemory;

	TRAPD(r, TestL());
	TheTest(r == KErrNone);

	delete TheTrapCleanup;
	TheFs.Close();
	TheTest.End();
	TheTest.Close();

	__UHEAP_MARKEND;
	return KErrNone;
    }
Exemple #8
0
TInt E32Main()
	{
	TheTest.Title();

	__UHEAP_MARK;

	CTrapCleanup* trapCleanup = CTrapCleanup::New();
	TEST(trapCleanup != NULL);

	DeleteLargeDataFiles();

	TInt err = TheFs.Connect();
	TEST2(err, KErrNone);
	SetupTestDirectory();

	TRAP(err, RunTestsL());
	TheDb.Close();
	TheDbSession.Close();
	TheFs.Close();
	TEST2(err, KErrNone);

	DeleteDataFiles();//delete the data files used by this test

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

	delete trapCleanup;

	__UHEAP_MARKEND;

	return 0;
	}
Exemple #9
0
GLDEF_C TInt E32Main()
	{
	test.Title();
	TInt r=User::LoadLogicalDevice(_L("D_PROF"));
	if (r!=KErrNone && r!=KErrAlreadyExists)
		User::Panic(_L("T_PROF0"),r);
	r=Profile.Open();
	if (r!=KErrNone)
		User::Panic(_L("T_PROF1"),r);
	FOREVER
		{
		TKeyCode key=test.Getch();
		if (key==TKeyCode('r'))
			{
			Profile.Reset();
			}
		else if (key==TKeyCode('p'))
			{
			ProfileAllThreads();
			}
		else if (key==TKeyCode('x'))
			break;
		}
	Profile.Close();
	User::FreeLogicalDevice(_L("Profile"));
	return KErrNone;
	}
TInt E32Main()
	{
	__UHEAP_MARK;

	CTrapCleanup* tc = CTrapCleanup::New();
	TEST(tc != NULL);
	
	TEST2(TheFileSess.Connect(), KErrNone);

	TheTest.Title();
	TRAPD(err, ::MainL());
	TEST2(err, KErrNone);
	
	TheTest.End();
	TheTest.Close();

	TheFileSess.Close();
	
	delete tc;

	__UHEAP_MARKEND;

	User::Heap().Check();
	return KErrNone;
	}
TInt E32Main()
	{
	test.Title();
	test.Start(_L("Test does not run on UREL builds."));
	test.End();
	return 0;
	}
TInt E32Main()
/** 
	Executable entrypoint calls test functions within heap check.
 */
	{
	test.Title();
	test.Start(_L("Testing RLoader::Delete"));

	__UHEAP_MARK;
	const TUint32 KTcbMask = 1UL << ECapabilityTCB;
	const TUint32 KAllFilesMask = 1UL << ECapabilityAllFiles;

	//Check whether RLoader::Delete handles the case of a bad descriptor being passed 
	//as the filename( KBadDescriptor is not itself the malformed desciptor but
	//it trigers the check)
	TestWithCaps(KTcbMask | KAllFilesMask     , KErrBadDescriptor, KBadDescriptor);

	// TCB | AllFiles sufficient without any other caps
	TestWithCaps(KTcbMask | KAllFilesMask, KErrNone);
	// TCB necessary
	TestWithCaps(~KTcbMask, KErrPermissionDenied);
	// AllFiles necessary
	TestWithCaps(~KAllFilesMask, KErrPermissionDenied);
	// neither TCB nor AllFiles
	TestWithCaps(~(KTcbMask | KAllFilesMask), KErrPermissionDenied);
	TestWithCaps(0, KErrPermissionDenied);
	__UHEAP_MARKEND;

	test.End();
	return KErrNone;
    }
TInt E32Main()
	{
	test.Title();
	test.Start(_L("Testing ldd importing"));
	
	test.Next(_L("Load the exporting ldd"));
	TInt r=User::LoadLogicalDevice(KExportTestLddName);
	test_Equal(KErrNone, r);	// Don't allow KErrAlreadyExists as don't want ldd to be XIP.

	RExportLdd exportLdd;
	test_KErrNone(exportLdd.Open());
	// The exported function multiplies the 2 arguments.
	test_Equal(12, exportLdd.RunExport(3, 4));
	
	test.Next(_L("Load the importing ldd"));
	r=User::LoadLogicalDevice(KImportTestLddName);
	test_Equal(KErrNone, r);	// Don't allow KErrAlreadyExists as don't want ldd to be XIP.


	RImportLdd importLdd;
	test_KErrNone(importLdd.Open());
	// The imported function multiplies the 2 arguments.
	test_Equal(12, importLdd.RunImport(3, 4));
	
	exportLdd.Close();
	importLdd.Close();

	test_KErrNone(User::FreeLogicalDevice(KExportTestLddName));
	test_KErrNone(User::FreeLogicalDevice(KImportTestLddName));

	test.End();
	return KErrNone;
    }
Exemple #14
0
GLDEF_C TInt E32Main()
{
    test.Title();
    test.Start(_L("Waiting..."));

    RUndertaker u;
    TInt r=u.Create();
    test(r==KErrNone);
    //to avoid RVCT4 warning of unreachable statement.
    volatile TInt forever = 0;
    while(forever)
    {
        TInt h;
        TRequestStatus s;
        r=u.Logon(s,h);
        test(r==KErrNone);
        User::WaitForRequest(s);
        RThread t;
        t.SetHandle(h);
        TBuf8<128> b;
        t.Context(b);
        TInt *pR=(TInt*)b.Ptr();
        TFullName tFullName = t.FullName();
        TExitCategoryName tExitCategory = t.ExitCategory();
        test.Printf(_L("Thread %S Exit %d %S %d\n"),&tFullName,t.ExitType(),&tExitCategory,t.ExitReason());
        test.Printf(_L("r0 =%08x r1 =%08x r2 =%08x r3 =%08x\n"),pR[0],pR[1],pR[2],pR[3]);
        test.Printf(_L("r4 =%08x r5 =%08x r6 =%08x r7 =%08x\n"),pR[4],pR[5],pR[6],pR[7]);
        test.Printf(_L("r8 =%08x r9 =%08x r10=%08x r11=%08x\n"),pR[8],pR[9],pR[10],pR[11]);
        test.Printf(_L("r12=%08x r13=%08x r14=%08x r15=%08x\n"),pR[12],pR[13],pR[14],pR[15]);
        test.Printf(_L("cps=%08x dac=%08x\n"),pR[16],pR[17]);
        t.Close();
    }
    return 0;
}
TInt E32Main()
	{
	TheSqliteDb = NULL;
	
	TheTest.Title();
	
	CTrapCleanup* tc = CTrapCleanup::New();
	
	__UHEAP_MARK;

	CreateTestEnv();
	TInt err = sqlite3SymbianLibInit();
	TEST2(err, KErrNone);
	DoTests();
	sqlite3SymbianLibFinalize();
	DestroyTestEnv();

	CloseSTDLIB();

	__UHEAP_MARKEND;
	
	TheTest.End();
	TheTest.Close();
	
	delete tc;

	User::Heap().Check();
	return KErrNone;
	}
TInt E32Main()
	{
	test.Title();

	// Turn off evil lazy dll unloading
	RLoader l;
	test(l.Connect()==KErrNone);
	test(l.CancelLazyDllUnload()==KErrNone);
	l.Close();

	test.Start(_L("Preload t_oedll1.dll"));
	RLibrary library;
	test(library.Load(_L("t_oedll1.dll")) == KErrNone);

	test.Next(_L("Run T_OEEXPORT.EXE..."));
	RProcess p;
	TInt r=p.Create(_L("T_OEEXPORT.EXE"), _L("2"));
	test(r==KErrNone);
	TRequestStatus s;
	p.Logon(s);
	p.Resume();
	User::WaitForRequest(s);
	TExitCategoryName aExitCategory = p.ExitCategory();
	test.Printf(_L("Second test exits with: %d,%d,%S\n"),p.ExitType(),p.ExitReason(),&aExitCategory);
	test(p.ExitType()==EExitKill);
	test(p.ExitReason()==0);
	p.Close();

	library.Close();

	test.End();
	return KErrNone;
	}
Exemple #17
0
GLDEF_C TInt E32Main()
	{
	test.Title();
	test.Start(_L("Create chunk"));
	RChunk c;
	TInt r=c.CreateDisconnectedLocal(0,0x1000,0x100000);
	test(r==KErrNone);
	r=c.Commit(0x10000,0x1000);
	test(r==KErrNone);
	TUint8* pBuf1=c.Base();
	TUint8* pBuf2=pBuf1+0x10000;

	TInt s;
	TInt d;
	TInt l;

	for (l=1; l<300; l+=3)
		{
		for (s=0; s<=4096-l; s+=227)
			{
			test.Printf(_L("\ns=%4d l=%4d: "),s,l);
			for (d=0; d<=4096-l; d+=229)
				{
				DoTest(pBuf1,pBuf2,4096,s,d,l,0);
				DoTest(pBuf1,pBuf2,4096,s,d,l,1);
				}
			}
		}

	for (l=1; l<300; l+=3)
		{
		for (s=4096-l; s>=0; s-=227)
			{
			test.Printf(_L("\ns=%4d l=%4d: "),s,l);
			for (d=4096-l; d>=0; d-=229)
				{
				DoTest(pBuf1,pBuf2,4096,s,d,l,0);
				DoTest(pBuf1,pBuf2,4096,s,d,l,1);
				}
			}
		}
	
	for (l=1; l<400; l+=((l<=64)?1:3) )
		{
		test.Printf(_L("\nOverlap test: l=%4d: "),l);
		for (s=32; s<=4096-32-l; s+=101)	// want s to take all values 0...31 modulo 32
			{
			for (d=s-32; d<=s+32; ++d)
				{
				DoOverlapTest(pBuf1,pBuf2,4096,s,d,l);
				}
			}
		}
	
	c.Close();
	test.End();
	return 0;
	}
GLDEF_C TInt E32Main()
	{

	test.Title();

	if (UserSvr::HalFunction(EHalGroupKernel, EKernelHalSmpSupported, 0, 0) == KErrNone)
		{
		test.Printf(_L("*********************************\n"));
		test.Printf(_L("*  NOT SUPPORTED ON SMP SYSTEMS *\n"));
		test.Printf(_L("*********************************\n"));
		User::After(2000000);
		return(0);
		}

	test.Start(_L("Load LDD"));
	TInt r=User::LoadLogicalDevice(_L("D_IMPLICIT"));
	test(r==KErrNone || r==KErrAlreadyExists);
	test.Next(_L("Open channel"));
	RImpSysTest impSys;
	r=impSys.Open();
	test(r==KErrNone);

	SStats s;
	test.Next(_L("Test with changing priorities"));
	r=impSys.Start(RImpSysTest::ETestPriority);
	test(r==KErrNone);
	Wait(30);
	r=impSys.Stop(s);
	test(r==KErrNone);
	TInt f1=Display(s);

	test.Next(_L("Test with round-robin"));
	r=impSys.Start(RImpSysTest::ETestRoundRobin);
	test(r==KErrNone);
	Wait(30);
	r=impSys.Stop(s);
	test(r==KErrNone);
	TInt f2=Display(s);

	test.Next(_L("Dry run"));
	r=impSys.Start(RImpSysTest::ETestDummy);
	test(r==KErrNone);
	Wait(30);
	r=impSys.Stop(s);
	test(r==KErrNone);
	TInt f3=Display(s);

	test.Next(_L("Close channel"));
	impSys.Close();

	test(f1==0);
	test(f2==0);
	test(f3==0);

	test.End();
	return KErrNone;
	}
Exemple #19
0
GLDEF_C void CallTestsL(void)
//
// Call all tests
//
{
    test.Title();
    test.Start(_L("Start Benchmarking ..."));

    test.Next(gSessionPath);

    ParseCommandLine();

    AllocateBuffers();
    RProcess().SetPriority(EPriorityBackground);

    TInt r = HAL::Get(HAL::EFastCounterFrequency, gFastCounterFreq);
    test_KErrNone(r);
    test.Printf(_L("HAL::EFastCounterFrequency %d\n"), gFastCounterFreq);

    test.Printf(_L("gReadCachingOn %d  gWriteCachingOn %d gFlushAfterWrite %d gFileSequentialModeOn %d\n"),
                gReadCachingOn, gWriteCachingOn, gFlushAfterWrite, gFileSequentialModeOn);

    TestFileSeek();

    // read once
    TestFileRead(KMaxFileSize, gMisalignedReadWrites, EFalse);

    // re-read
    TestFileRead(KMaxFileSize, gMisalignedReadWrites, ETrue);

    TestFileReadCPU(gMisalignedReadWrites);

    // append to file
    TestFileWrite(KMaxFileSize, gMisalignedReadWrites, EFalse);

    // update (overwrite) file
    TestFileWrite(KMaxFileSize, gMisalignedReadWrites, ETrue);

    TestFileWriteCPU(gMisalignedReadWrites);

    TestFileDelete();

//	TestDirRead();
//	PrintDirResults();
#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
    TestLargeFileDelete();
#endif //SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API

    TestMkDir();

    RecursiveRmDir(gSessionPath);

    DeAllocateBuffers();

    test.End();
    test.Close();
}
GLDEF_C TInt E32Main()
{
    test.Title();
    test.Start(_L(" @SYMTestCaseID:SYSLIB-ECOM-CT-0779 "));

    test.End();
    test.Close();

    return E32Main_TestHarness(NewComponentTestLC);
}
Exemple #21
0
TInt E32Main()
	{
	test.Title();

	test.Start(_L("Test retrieving 0th ordinal from non-stdexe returns NULL"));
	test(RProcess::ExeExportData()==NULL);

	test.End();
	return KErrNone;
	}
TInt E32Main()
	{
	TheTest.Title();
	
 	TheTest.Start(_L("This test works only if the test is built with _SQLPROFILER macro defined!"));
	TheTest.End();
	TheTest.Close();
	
	return KErrNone;
	}
Exemple #23
0
TInt E32Main()
	{
	test.Title();
	test.Start(_L("Test thrashing monitor"));
	
	test_KErrNone(InitBenchmarks());

	TInt actions = ParseCommandLine();
	
	test_KErrNone(GetGlobalPolicies());

	TUint cacheOriginalMin = 0;
	TUint cacheOriginalMax = 0;

	if (gDataPagingSupported)
		{
		test.Next(_L("Thrash test: change cache size to maximum 2Mb"));
		TUint cacheCurrentSize = 0;
		DPTest::CacheSize(cacheOriginalMin, cacheOriginalMax, cacheCurrentSize);
		gMinCacheSize = 512;
		gMaxCacheSize = 520;
		test_KErrNone(DPTest::SetCacheSize(gMinCacheSize * gPageSize, gMaxCacheSize * gPageSize));
		}
	
	if (actions & EActionTest)
		{
		TBool flexibleMemoryModel = (MemModelAttributes() & EMemModelTypeMask) == EMemModelTypeFlexible;
		if (flexibleMemoryModel)
			TestThrashHal();
		else
			TestThrashHalNotSupported();
		}

	if (actions & EActionThrashing)
		{	
		test.Next(_L("Extended thrashing tests"));
		TestThrashing();
		}
	
	if (actions & EActionBenchmarks)
		{	
		test.Next(_L("Benchmarking page replacement"));
		TestDistributions();
		BenchmarkReplacement();
		}

	if (gDataPagingSupported)
		{
		test.Next(_L("Thrash test: Reset cache size to normal"));
		test_KErrNone(DPTest::SetCacheSize(cacheOriginalMin, cacheOriginalMax));
		}
	
	test.End();
	return 0;
	}
Exemple #24
0
TInt E32Main()
	{
	__UHEAP_MARK;
    CTrapCleanup *cleanup=CTrapCleanup::New();
	test.Title();
    TRAPD(err,RunTests());
	test(!err);
	test.Close();
    delete(cleanup);
	__UHEAP_MARKEND;
    return(0);
	}
GLDEF_C TInt E32Main()
	{	
	__UHEAP_MARK;
//	HAL::SetAutoSwitchOffBehavior(ESwitchOffDisabled);	// Can't do this anymore :<
	User::ResetInactivityTime();
	test.Title();
	CTrapCleanup* theCleanup=CTrapCleanup::New();
	TRAPD(result,doMainL()); 
	ReportError(result);
	delete theCleanup;      
	test.Close();
	__UHEAP_MARKEND;
	return(KErrNone);
	}
void E32Main()
	{
	test.Title();
	test.Start(_L("Testing media erase+suspend operations"));

	CSuspendTest suspendTest;
	TRAPD( ret, suspendTest.CreateL() );
	if( KErrNone == ret )
		{
		suspendTest.DoTest();
		}

	test.End();
	}
Exemple #27
0
TInt E32Main()
/**
	Entrypoint establishes a connection with the KMS and
	then calls individual tests.

	@return					KErrNone.  If an error occurs then the
							process is panicked with RTest.
 */
	{
	TInt r;

	test.Title();
	test.Start(_L(" @SYMTestCaseID:SEC-CRYPTOSPI-KMSTEST-0001 E32Main "));

	RLoader l;
	test(l.Connect()==KErrNone);
	test(l.CancelLazyDllUnload()==KErrNone);
	l.Close();
	
	__KHEAP_MARK;				// also ensure no resources leaked by key store
	__UHEAP_MARK;

	TestOpenClose();
	
	test.Next(_L("Connecting to server"));
	r = kms.Connect();
	test(r == KErrNone);

	TestGenerateKey();
	TestStoreKey();
	TestDeleteKey();
	TestAddUsage();
	TestDeleteUsage();
	TestInvalidFunction();
	CleanUp();

	kms.Close();
	
	// pause to allow LDD to be unloaded.
	User::After(5 * 1000 * 1000);
	
	__UHEAP_MARKEND;
	__KHEAP_MARKEND;

	test.End();
	return KErrNone;
	}
Exemple #28
0
TInt E32Main()
    {
	Test.Title();
	Test.Start(_L("RReadWriteLock Testing"));

	TestCreation();
	TestWriterPriority();
	TestAlternatePriority();
	TestReaderPriority();
	TestTryLock();
	TestUpgrade();
	TestDowngrade();
	TestPanics();

	Test.End();
	return KErrNone;
    }
Exemple #29
0
TInt E32Main()
//
// Benchmark for TInt64 functions
//
    {

    test.Title();
    test.Start(_L("Benchmarks for TInt64"));

	runTest(TInt64Addition,_L("Addition"));
	runTest(TInt64Subtraction,_L("Subtraction"));
	runTest(TInt64Multiplication,_L("Multiplication"));
	runTest(TInt64Division,_L("Division"));

	test.End();
	return(KErrNone);
    }
GLDEF_C TInt E32Main()
	{
	CTrapCleanup* tc = CTrapCleanup::New();
	__UHEAP_MARK;

	TheTest.Title();
	TRAPD(err, ::RunTestsL());
	TheTest(err == KErrNone);
	TheTest.End();
	TheTest.Close();

	delete tc;

	__UHEAP_MARKEND;
	User::Heap().Check();
	return KErrNone;
	}