Example #1
0
LOCAL_C void DoTestsL()
{
    __UHEAP_MARK;

    User::LeaveIfError(TheFs.Connect());
    CleanupClosePushL(TheFs);

    // normal tests
    DoBasicTestL(&DriveMaskTestL, _L("Drive Mask Test."));
    DoBasicTestL(&SubstitutedDriveTestL, _L("Substituted Drive Test."));
    DoBasicTestL(&ExerciseIterator, _L("Getter Test."));
    DoBasicTestL(&SystemDriveTestL, _L("System Drive Test."));

    // panic tests
    ThreadPanicTest(_L("Iterator Panic Testing"),IteratorPanicTest);

    // OOM tests
    DoOOMTestL(&DriveMaskTestL, _L("OOM Test for Drive Mask Test."));
    DoOOMTestL(&ExerciseIterator, _L("OOM Test for Getter."));
    DoOOMTestL(&SystemDriveTestL, _L("OOM Test for System Drive Test."));

    CleanupStack::PopAndDestroy();

    __UHEAP_MARKEND;
}
LOCAL_C void DoTestsL()
	{
	__UHEAP_MARK;

	CreateDeleteTestL();
	DoBasicTestL(&CBackUpNotifierTest::HandleBackupOperationEventTestL, _L("HandleBackupOperationEventL Test"));
	DoBasicTestL(&CBackUpNotifierTest::RegisterForNotificationsTestL,   _L("RegisterForNotificationsL Test"));

	OOMCreateDeleteTest();
	DoOOMTestL(&CBackUpNotifierTest::HandleBackupOperationEventTestL, _L("HandleBackupOperationEventL Test"));
	DoOOMTestL(&CBackUpNotifierTest::RegisterForNotificationsTestL,   _L("RegisterForNotificationsL Test"));

	__UHEAP_MARKEND;
	}
Example #3
0
/**
@SYMTestCaseID PIM-TOOMTEST-0001
*/
GLDEF_C TInt E32Main()
//
// Test the alarm server.
//
{
    __UHEAP_MARK;
    TInt ret = KErrNone;
    CTrapCleanup* cleanup = CTrapCleanup::New();
    if (!cleanup)
    {
        return KErrNoMemory;
    }

    TheAlarmTest.Start(_L("@SYMTestCaseID PIM-TOOMTEST-0001"));
    TheAlarmTest.Title();
    TheAlarmTest.TestStartServers();

    TRAPD(error, DoOOMTestL());

    TheAlarmTest(error == KErrNone, __LINE__);
    TRAP(ret,TheAlarmTest.EndL());
    TheAlarmTest.Test().Close();

    ASTstAlarmTest::Close();

    delete cleanup;
    __UHEAP_MARKEND;
    return ret;
}
LOCAL_C void DoTestsL()
	{
	DoBasicTestL(&CreateDelete_TestL, _L("CreateDelete_TestL"));
	DoBasicTestL(&GetKnownStartupState_TestL, _L("GetKnownStartupState_TestL"));
	DoBasicTestL(&InitialiseL_NonSsa_TestL, _L("InitialiseL_NonSsa_TestL"));
	DoBasicTestL(&InitialiseL_Ssa_TestL, _L("InitialiseL_Ssa_TestL"));
	DoBasicTestL(&RunL_TestL, _L("RunL_TestL"));

	DoOOMTestL(&CreateDelete_TestL, _L("OOM CreateDelete_TestL"));
	DoOOMTestL(&GetKnownStartupState_TestL, _L("OOM GetKnownStartupState_TestL"));
	DoOOMTestL(&InitialiseL_NonSsa_TestL, _L("OOM InitialiseL_NonSsa_TestL"));
	DoOOMTestL(&InitialiseL_Ssa_TestL, _L("OOM InitialiseL_Ssa_TestL"));
	DoOOMTestL(&RunL_TestL, _L("OOM RunL_TestL"));

	RunError_Test();
	}
void DoTestL()
    {
    User::LeaveIfError(fs.Connect());
    CleanupClosePushL(fs);
    CTestRegister* TempFiles = CTestRegister::NewLC();
    TempFiles->RegisterL(KDatabaseCDrive, EFileTypeCnt);

    _LIT(KTestV8Database,"Opening DBMS secured (old) database...");
    _LIT(KTestV7Database,"Opening v7 format database...");
    _LIT(KTestV6Database,"Opening v6 format database...");
    _LIT(KTestV5Database,"Opening v5 format database...");
    _LIT(KTestV4Database,"Opening v4 format database...");
    
    
    test.Next(_L("Opening v7 format database..."));

    DoTestV7DatabaseL();

    test.Next(_L("Opening DBMS secured (old) database..."));

    DoTestV8DatabaseL();

        
    test.Next(_L("Opening v6 format database..."));

    DoTestV6DatabaseL();
    
    test.Next(_L("Opening v5 format database..."));

    DoTestV5DatabaseL();

    test.Next(_L("Opening v4 format database..."));

    DoTestV4DatabaseL(EFalse);

    //v4 conversion to v7 executes code involved in any other conversion.
    DoOOMTestL(DoTestV4DatabaseL); 
    //DoOOMTestL(DoTestV5DatabaseL);
    //DoOOMTestL(DoTestV6DatabaseL);
    //DoOOMTestL(DoTestV7DatabaseL);

    CleanupStack::PopAndDestroy(2); // TempFiles, fs
    }
LOCAL_C void DoOOMTestsL()
	{
	TheTest.Next (_L (" @SYMTestCaseID:SYSLIB-CENTRALREPOSITORY-LEGACY-T_OOMCENREP-0001 Starting CENREPSRV OOM Test "));
	RFs fs;
	User::LeaveIfError(fs.Connect());
	CleanupClosePushL(fs);
	CFileMan* fm = CFileMan::NewL(fs);
	CleanupStack::PushL(fm);

	//Clear any files in the persist directory
	CleanupCDriveL();

	//First Testuid=KTestRepositoryUid
	KCurrentTestUid=KTestRepositoryUid;

	DoOOMTestL(&CenrepSrvOOMTest::GetL,_L("Get Basic Test"),EFalse);
	DoOOMTestL(&CenrepSrvOOMTest::FindL,_L("FindL Basic Test"),EFalse);
	DoOOMTestL(&CenrepSrvOOMTest::NotifyL,_L("NotifyL Basic Test"),EFalse);
	DoOOMTestL(&CenrepSrvOOMTest::ResetL,_L("ResetL Basic Test"),EFalse);
	// Save file without timestamp
	User::LeaveIfError(fm->Copy(KPersistsFile, KPersistsFileNoUpgrade));
	DoOOMTestL(&CenrepSrvOOMTest::SetL,_L("SetL Basic Test"),EFalse);
	DoOOMTestL(&CenrepSrvOOMTest::CreateL,_L("CreateL Basic Test"),EFalse);
	DoOOMTestL(&CenrepSrvOOMTest::DeleteL,_L("DeleteL Basic Test"),EFalse);
	DoOOMTestL(&CenrepSrvOOMTest::MoveL,_L("MoveL Basic Test"),EFalse);

	//Clear any files in the persist directory
	CleanupCDriveL();

	// Simulate response to SWI rom-upgrade and downgrade events
	DoOOMSwiTestL(&CenrepSwiOOMTest::UpgradeROMRev1L,_L("SwiUpgradeROMRev1L Basic Test"),EFalse);
	// Save file with timestamp
	User::LeaveIfError(fm->Copy(KPersistsFile, KPersistsFileUpgraded));
	DoOOMSwiTestL(&CenrepSwiOOMTest::UpgradeROMRev2L,_L("SwiUpgradeROMRev2L Basic Test"),EFalse);
	DoOOMSwiTestL(&CenrepSwiOOMTest::UninstallROMUpgradeL,_L("SwiUninstallROMUpgradeL Basic Test"),EFalse);

	// Simulate response to SWI new rep install/uninstall event events
	DoOOMSwiTestL(&CenrepSwiOOMTest::InstallL,_L("SwiInstallL Basic Test"),EFalse);
	DoOOMSwiTestL(&CenrepSwiOOMTest::UpgradeInstallL,_L("SwiUpgradeInstallL Basic Test"),EFalse);
	DoOOMSwiTestL(&CenrepSwiOOMTest::UninstallL,_L("SwiUninstallL Basic Test"),EFalse);

	// Simulate SWI events before server startup
	DoOOMNoServReposL(&StartupUpgradeL, _L("Startup Upgrade Basic Test"), EFalse);
	DoOOMNoServReposL(&StartupDowngradeL, _L("Startup Downgrade Basic Test"), EFalse);
	DoOOMNoServReposL(&StartupUninstallL,_L("Startup Uninstall Basic Test"), EFalse);

	//OOM Test aOOMMode=ETrue
	DoOOMNoServReposL(&CreateDeleteL, _L("Create Delete OOM Test"),ETrue);
	DoOOMNoServReposL(&CreateDeleteCorruptL, _L("Create Delete Corrupt OOM Test"),ETrue);
	DoOOMTestL(&CenrepSrvOOMTest::GetL,_L("Get OOM Test"),ETrue);
	DoOOMTestL(&CenrepSrvOOMTest::FindL,_L("FindL OOM Test"),ETrue);
	DoOOMTestL(&CenrepSrvOOMTest::NotifyL,_L("NotifyL OOM Test"),ETrue);
	DoOOMTestL(&CenrepSrvOOMTest::ResetL,_L("ResetL OOM Test"),ETrue);
	DoOOMTestL(&CenrepSrvOOMTest::SetL,_L("SetL OOM Test"),ETrue);
	DoOOMTestL(&CenrepSrvOOMTest::CreateL,_L("CreateL OOM Test"),ETrue);
	DoOOMTestL(&CenrepSrvOOMTest::DeleteL,_L("DeleteL OOM Test"),ETrue);
	DoOOMTestL(&CenrepSrvOOMTest::MoveL,_L("MoveL OOM Test"),ETrue);

	//Clear any files in the persist directory
	CleanupCDriveL();

	DoOOMSwiTestL(&CenrepSwiOOMTest::UpgradeROMRev1L,_L("SwiUpgradeROMRev1L OOM Test"),ETrue);
	DoOOMSwiTestL(&CenrepSwiOOMTest::UpgradeROMRev2L,_L("SwiUpgradeROMRev2L OOM Test"),ETrue);
	DoOOMSwiTestL(&CenrepSwiOOMTest::UninstallROMUpgradeL,_L("SwiUninstallROMUpgradeL OOM Test"),ETrue);

	DoOOMSwiTestL(&CenrepSwiOOMTest::InstallL,_L("SwiInstallL OOM Test"),ETrue);
	DoOOMSwiTestL(&CenrepSwiOOMTest::UpgradeInstallL,_L("SwiUpgradeInstallL OOM Test"),ETrue);
	DoOOMSwiTestL(&CenrepSwiOOMTest::UninstallL,_L("SwiUninstallL OOM Test"),ETrue);

	DoOOMNoServReposL(&StartupUpgradeL, _L("Startup Upgrade OOM Test"), ETrue);
	DoOOMNoServReposL(&StartupDowngradeL, _L("Startup Downgrade OOM Test"), ETrue);
	DoOOMNoServReposL(&StartupUninstallL, _L("Startup Uninstall OOM Test"), ETrue);

#ifdef SYMBIAN_CENTREP_SUPPORT_MULTIROFS
	DoPersistedVersionCheckingL();
	DoOOMMultiRofsTestL();
#endif

	// Delete files from bur dir
	User::LeaveIfError(fm->Attribs(KPersistsFileNoUpgrade,0,KEntryAttReadOnly,TTime(0)));
	TInt err=fs.Delete(KPersistsFileNoUpgrade);
	if((err!=KErrNone)&&(err!=KErrNotFound))
		User::Leave(err);

	User::LeaveIfError(fm->Attribs(KPersistsFileUpgraded,0,KEntryAttReadOnly,TTime(0)));
	err=fs.Delete(KPersistsFileUpgraded);
	if((err!=KErrNone)&&(err!=KErrNotFound))
		User::Leave(err);


	//Clear any files in the persist directory
	CleanupCDriveL();

	CleanupStack::PopAndDestroy (2);	// fs and fm
	}