TInt E32Main()
    {
	__UHEAP_MARK;
	CTrapCleanup* tc = CTrapCleanup::New();
	TEST(tc != NULL);

	TInt err = TheDbs.Connect();
	TEST2(err, KErrNone);

	TBuf<32> format;
	TheTest.Printf(_L("Open database\n"));
	format.Copy(KSecure);
	format.Append(KSecureDbUid.Name());
	err = TheDb.Open(TheDbs, KDbName, format);
	TEST2(err, KErrNone);

	TRAP(err, DoTestL());
	TEST2(err, KErrNone);

	TheView.Close();
	TheTbl.Close();
	TheDb.Close();
	TheDbs.Close();

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

	delete tc;

	__UHEAP_MARKEND;
	User::Heap().Check();
	return KErrNone;
    }
Example #2
0
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()
    {
	__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);
    }
Example #4
0
/**
@SYMTestCaseID          SYSLIB-BAFL-CT-0440
@SYMTestCaseDesc        Resource reader test
@SYMTestPriority        High
@SYMTestActions         Executes all the tests related to resource read
@SYMTestExpectedResults Tests must not fail
@SYMREQ                 REQ0000
*/
void RunTests()
    {
	test.Start(_L(" @SYMTestCaseID:SYSLIB-BAFL-CT-0440 Resource reader "));
    TheFs.Connect();
    TheResourceFile.OpenL(TheFs,KRomResourceFile);
	TRsReadTester lt;
	TRAPD(errCode, lt.TestButtonL());
	test(errCode==KErrNone);
	TRAP(errCode, lt.TestArrayL());
	test(errCode==KErrNone);
	TRAP(errCode, lt.TestFlPtEdL());
	test(errCode==KErrNone);
	TRAP(errCode, lt.TestMenuBarL());
	test(errCode==KErrNone);
	TRAP(errCode, lt.TestAlignment1L());
	test(errCode==KErrNone);
	TRAP(errCode, lt.TestAlignment2L());
	test(errCode==KErrNone);
    TRAP(errCode, lt.TimingTestsL());
	test(errCode==KErrNone);
    TheResourceFile.Close();
    //Test that raises panics
	test(KErrNone==lt.PanicTests());

    TheFs.Close();
	test.End();
	test.Close();
    }
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;
	}
Example #6
0
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;
    }
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;

    ::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;
	}
Example #9
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;
	}
Example #10
0
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;
	}
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()
	{
	__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;
	}
LOCAL_C void MainL()
	{
	test.Start(_L("@SYMTESTCaseID:PIM-ALLDAYEVENTS-0001 Getting list of all day events data...."));

	RDir dataDir;
	CleanupClosePushL(dataDir);
	//Open the Data directory and read the file entries
	User::LeaveIfError(dataDir.Open(calTestLibrary->FileSession(), KDataDir, KEntryAttNormal));
	
	TEntryArray* dataArray = new (ELeave) TEntryArray();

	CleanupStack::PushL(dataArray);
	
	dataDir.Read(*dataArray);
	
	TInt count = dataArray->Count();
	test (count != 0);
		
	for (TInt i=0; i < count; ++i)
	    {
	    test.Next(_L("ALLDAYEVENTS-0002"));

	    TBuf<256> name;
	    name = KDataDir;
	    name.Append((*dataArray)[i].iName);
	    
	    RPointerArray<CCalEntry> calEntries;
	    CleanupResetAndDestroyPushL(calEntries);
	    ImportEntriesL(name, calEntries);
	    TInt calEntriesCount = calEntries.Count();
	    if (calEntriesCount)	
	        {
	        //Test entry for the presence of timzone rules and UTC
	        CheckTimezoneRules(*calEntries[0]);
	        }
	    name = KWriteDataDir;
	    name.Append((*dataArray)[i].iName);
	    
	    ExportEntriesL(calEntries, name);
	    
	    TBool result = TestExportedFile(name);
	    
	    if (result)
	        {
	    	calTestLibrary->FileSession().Delete(name);
	        }
	    
	    CleanupStack::PopAndDestroy(&calEntries);
	    }
	
	CleanupStack::PopAndDestroy(dataArray);
	CleanupStack::PopAndDestroy(&dataDir);
	// This will fail if there was a parsing error in one or more of the data files
	// which will still be then present in the directory for inspecting.
	test (calTestLibrary->FileSession().RmDir(KWriteDataDir) == KErrNone);
	
	test.End();
	test.Close();
	}
Example #14
0
//----------------------------------------------------------------------------------------
LOCAL_C void CloseTestUtils()
//----------------------------------------------------------------------------------------
	{
	testUtils->TestHarnessCompleted();
	CleanupStack::PopAndDestroy(testUtils);
	//gTest.Console()->SetPos(0, 13);
	gTest.End();
	gTest.Close();
	}
Example #15
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);
}
TInt MainL ()
	{
	test.Start(KTest1);
	TestMultipleRofsSectionsL();
	
	test.End();
	test.Close();
	
	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;
	}
Example #19
0
// Manual test - requires user to move a card between two physical slots
extern TInt E32Main()
	{
	test.Start(_L("T_MULTISLOT Test"));
	test(fs.Connect()==KErrNone);
	
	// Get the list of removable drive driver-letters
	TDriveList driveList;
	test(fs.DriveList(driveList,KDriveAttRemovable)==KErrNone);
	
	
	TInt length=driveList.Length();
	TBool pass = EFalse;
	
	// i is drive letter (as int)
	// for every removable media logical drive
	for(TInt i=0; i<length; i++)
		{
		if(driveList[i] == 0)
			{
			continue;
			}

		TChar driveChar = i+'A';
		test.Next(_L("Testing Logical Drive"));
		

		TInt FirstlocDrvNum = KErrNotFound;
		TInt SecondlocDrvNum = KErrNotFound;
		TInt driveNum = -1;
		driveNum = i+'A';
		test.Printf(_L("Logical Drive : %d"), driveNum);
		
		// Get local drive number by gettin ghr Serial number fo the card (RFs call), then 
		// enumerating the TBusLocalDrives and finding one that matches.
		test(FindMmcLocalDriveNumber(driveChar,FirstlocDrvNum,driveNum)==KErrNone);
		// Got first local drive number, now move card into second slot.
		test.Printf(_L("<Move MMC Card to second slot, then press any key>"));
		test.Getch();
		// Get second local drive number for same logical drive (should be different local drive number).
		test(FindMmcLocalDriveNumber(driveChar,SecondlocDrvNum,driveNum)==KErrNone);
		if(FirstlocDrvNum!=SecondlocDrvNum)
			{
			pass=ETrue;
			break;
			}
		// else perhaps this wasn't a multislot drive
		}
	test(pass);
	test.End();
	test.Close();
	
	fs.Close();
	return KErrNone;
	}
Example #20
0
TInt E32Main()
	{
	__UHEAP_MARK;
    CTrapCleanup *cleanup=CTrapCleanup::New();
	test.Title();
    TRAPD(err,RunTests());
	test(!err);
	test.Close();
    delete(cleanup);
	__UHEAP_MARKEND;
    return(0);
	}
Example #21
0
GLDEF_C TInt E32Main()
	{
	__UHEAP_MARK;
	CTrapCleanup* cleanup = CTrapCleanup::New();
	__ASSERT_ALWAYS(cleanup, User::Invariant());
	TRAPD(ret,doMainL());		
	test(ret == KErrNone);
	test.Close();
	delete cleanup;	
	__UHEAP_MARKEND;
	return(KErrNone);
	}
LOCAL_C void MainL()
	{
	//Note these files are equivalent, the cre being generated from txt
	TheTest.Start(_L("Central Repository Unit Testing"));		

	User::LeaveIfError(TheFs.Connect());
	DoTestL(EIniFromTxt);
	DoTestL(EIniFromCre);

	TheFs.Close();
	TheTest.End();
	TheTest.Close();
	}
Example #23
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);
	}
GLDEF_C TInt E32Main()
	{	
	__UHEAP_MARK;
	test.Start(_L("Setup"));
	theCleanup = CTrapCleanup::New();
	TRAPD(ret,doMainL());		
	test(ret==KErrNone);
	delete theCleanup;	
	test.Console()->SetPos(0, 13);
	test.End();
	test.Close();
	__UHEAP_MARKEND;
	return(KErrNone);
	}
Example #25
0
/**
@SYMTestCaseID			SYSLIB-CENTRALREPOSITORY-CT-0497-0001
@SYMTestCaseDesc		CentralRepository functionality test
@SYMTestPriority		High
@SYMTestActions			Wrapper function calling up test functions
@SYMTestExpectedResults Test must not fail
@SYMREQ					REQ0000
*/
LOCAL_C void MainL()
	{
	TheTest.Start(_L(" @SYMTestCaseID:SYSLIB-CENTRALREPOSITORY-CT-0497-0001 Restore Factory Settings tests "));
	CleanupCDriveL();
	KillC32Exe(); //Need to kill C32Exe as it is interfering with the test.
	RestoreFactorySettingsTestL();
	PDEF105203();
	RFSRomOnlyL();
	RFSRomAndInstallL();
	RFSInstallOnlyL();
	PDEF133672L();
	CleanupCDriveL();

	TheTest.End();
	TheTest.Close();
	}
Example #26
0
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;
	}
GLDEF_C TInt E32Main()
	{
	__UHEAP_MARK;
	CActiveScheduler* scheduler=new CActiveScheduler;
	CActiveScheduler::Install(scheduler);
	CTrapCleanup* cleanup = CTrapCleanup::New();
	test.Start(_L("@SYMTESTCaseID:PIM-T-CONTACTDBEVENT-0001 Testing Database event"));

	TRAPD(err,RunTestL());
	test(err==KErrNone);
	test.End();
	test.Close();
	delete cleanup;
    delete scheduler;
	__UHEAP_MARKEND;
	return KErrNone;
	}
GLDEF_C TInt E32Main()
	{
	__UHEAP_MARK;
	CTrapCleanup* trapCleanup=CTrapCleanup::New();
	test(TheRFs.Connect()==KErrNone);
	test.Start(_L("Ini Parser Performance Testing"));

	TRAPD(error, DoTestL());
	test(error == KErrNone);

	TheRFs.Close();
	test.End();
	test.Close();
	delete trapCleanup;
	__UHEAP_MARKEND;
	return error;
	}
/**
*  Entry point function.
*/
GLDEF_C TInt E32Main()
    {
    // Create cleanup stack
    __UHEAP_MARK;
    CTrapCleanup* cleanup = CTrapCleanup::New();
	
    TRAPD(mainError, DoTestsL());
    if (mainError)
        MainTest.Printf(KTextFailed, mainError);
    
    MainTest.End();
    MainTest.Close();
    delete cleanup;
    
    __UHEAP_MARKEND;
    return KErrNone;
    }
LOCAL_C void MainL()
	{
	TheTest.Start(_L("Defect tests"));
	CleanupCDriveL();

	FuncTestsL();

	//Testing the processing/resolving of multiple repository list
	DoOOML(_L("Basic Unit Test"),EFalse);
	DoOOML(_L("OOM Unit Test"),ETrue);

	TheTest.Next(_L("Clean out C: files"));
	CleanupCDriveL();

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