void CTestConductor::CopyCdbFileL(const TDesC& aFileName, const TDesC& aToFileName) { RPIMTestServer serv; User::LeaveIfError(serv.Connect()); serv.CopyFileL(aFileName, aToFileName); serv.Close(); }
void CopyOldCdbFileToCDriveL(const TDesC& aFileName) { //Will probably need more additions to sos to do this RPIMTestServer serv; User::LeaveIfError(serv.Connect()); serv.CopyFileL(aFileName, KOldDatabaseCDriveFullPath); serv.Close(); }
LOCAL_C void CopyFileL(const TDesC& aCopyFromFile, const TDesC& aCopyToFile) { RPIMTestServer serv; CleanupClosePushL(serv); User::LeaveIfError(serv.Connect()); serv.CopyFileL(aCopyFromFile, aCopyToFile); CleanupStack::PopAndDestroy(&serv); }
LOCAL_C void CopyFileL(const TDesC& aFile1, const TDesC& aFile2) { RPIMTestServer serv; User::LeaveIfError(serv.Connect()); serv.DeleteFileL(aFile2); serv.CopyFileL(aFile1, aFile2); serv.Close(); }
static void DoTestsL() { User::LeaveIfError(Serv.Connect()); test.Title(); ResetTimeZoneToLondonL(); CTzUserDataTest* userDataTest = CTzUserDataTest::NewLC(); test.Start(_L("Test Basic User Data")); userDataTest->TestBasicUserDataL(); test.Next(_L("Test Out Of Memory Behaviour (Client)")); userDataTest->TestOutOfMemoryBehaviourL(CTzUserDataTest::EClientOOM); test.Next(_L("Test Out Of Memory Behaviour (Server)")); userDataTest->TestOutOfMemoryBehaviourL(CTzUserDataTest::EServerOOM ); test.Next(_L("@SYMTestCaseID PIM-APPSERV-TZS-TZR-0001 Test Time Conversion")); userDataTest->TestTimeConversionL(); test.Next(_L("@SYMTestCaseID PIM-APPSERV-TZS-TZR-0002 Test Daylight Save")); userDataTest->TestDaylightSaveL(); test.Next(_L("Test Boundary Test")); userDataTest->BoundaryTestL(); test.Next(_L("Test Server Response To Changes")); userDataTest->TestServerResponseToChangesL(); // Delete the user-defined TZ database before the next test case. Serv.CloseTzSession(); Serv.DeleteFileL(KTzUserDataDb); test.Next(_L("Test Reusability Of TZ IDs")); userDataTest->TestTzIdReusabilityL(); // Delete the user defined TZ database. Serv.CloseTzSession(); Serv.DeleteFileL(KTzUserDataDb); test.Next(_L("Null Test")); userDataTest->NullTestL(); ResetTimeZoneToLondonL(); CleanupStack::PopAndDestroy(userDataTest); test.End(); Serv.Close(); }
LOCAL_C void DeleteFilesL() { RPIMTestServer serv; CleanupClosePushL(serv); User::LeaveIfError(serv.Connect()); serv.DeleteFileL(Ktimezonegroups_r01()); serv.DeleteFileL(Ktimezonegroups_r02()); serv.DeleteFileL(Ktimezonegroups_rsc()); serv.DeleteFileL(Ktimezones_r01()); serv.DeleteFileL(Ktimezones_r02()); serv.DeleteFileL(Ktimezones_rsc()); CleanupStack::PopAndDestroy(&serv); }
void DoTestL() { TAutoClose<RFs> theFS; TestNoErrL(theFS.iObj.Connect()); User::LeaveIfError(serv.Connect()); CleanupClosePushL(serv); TestExtHintFieldCreationL(theFS.iObj); CViewTester* viewTester = CViewTester::NewLC(); viewTester->CreateFilterViewsL(); CleanupStack::PopAndDestroy(viewTester); serv.DeleteFileL(KDatabaseFileName); serv.DeleteFileL(KDatabaseSecurePhysicalName); CleanupStack::PopAndDestroy(&serv); }
TInt DeleteIniFile() { TInt retval = KErrNone; //TInt deleteSuccess; // Delete any existing ini file so that we can be sure this test is ok RPIMTestServer serv; User::LeaveIfError(serv.Connect()); TRAPD (deleteSuccess, serv.DeleteFileL(KContactsModelIniFile)); if ( deleteSuccess != KErrNotFound && deleteSuccess != KErrNone ) { retval = deleteSuccess; } return retval; }
//as the porting on SQLite database allows the thorough DC break and //doesn't support the feature of database update from old database on //Symbian DBMS. void TestDbUpdateL() { RPIMTestServer serv; User::LeaveIfError(serv.Connect()); serv.CopyFileL(KSrcDatabaseName, KDatabaseName); serv.Close(); // Contact model must open and upgrade database test.Printf(_L("Opening and upgrading database\n")); CContactDatabase* db = NULL; db = CContactDatabase::OpenL(KDatabaseOpenName); // Add a contact with a 15 digit phone number and match the same number _LIT(K15DigitTestNumber,"0086 207 3453 1212"); _LIT(K15DigitMatch,"0086 207 3453 1212"); CreateContactL(KCntName,KCntSurname,K15DigitTestNumber,KNullDesC); CheckPhoneMatchL(K15DigitMatch,KMatch15Digits,1); delete db; db = NULL; }
/** Kill the Central Repository server if the test configuration requires it. */ void CTestGetFrequentlyUsedZoneInfoStep::KillCenRepServerL() { TBool killCenRepServer = EFalse; GetBoolFromConfig(ConfigSection(), _L("KillCenRepServer"), killCenRepServer); if (killCenRepServer == EFalse) { return; } RPIMTestServer serv; User::LeaveIfError(serv.Connect()); CleanupClosePushL(serv); _LIT(KCenRepServer,"centralrepositorysrv*"); TRAP_IGNORE(serv.KillProcessL(KCenRepServer)); CleanupStack::PopAndDestroy(&serv); _LIT(KCenRepServerKilled, "Central Repository server has been killed."); INFO_PRINTF1(KCenRepServerKilled); }
/** Second phase constructor for CDbDbmsDumper @param aDbName name of the database to be dumped. @param aOutputDir directory where html file will be generated */ void CDbDbmsDumper::ConstructL(const TDesC& aDbName, const TDesC& aOutputDir) { // Output File Name _LIT(KOutputFile,"DbDump.html"); TBuf<KMaxPathLength> path(aOutputDir); path.Append(KOutputFile); User::LeaveIfError(iFsSession.Connect()); User::LeaveIfError(iDbsSession.Connect()); // Copy the Contacts database from the contacts server private directory to // the DBMS private directory RPIMTestServer serv; User::LeaveIfError(serv.Connect()); _LIT(KDBContactsPrivFile, "?:\\private\\10003a73\\Contacts.cdb"); _LIT(KDBDBMsPrivFile, "?:\\private\\100012a5\\DBS_100065FF_Contacts.cdb"); TBuf<sizeof(KDBContactsPrivFile)> contactsDBPrivFilePath(KDBContactsPrivFile); TBuf<sizeof(KDBDBMsPrivFile)> dBMsPrivFilePath(KDBDBMsPrivFile); contactsDBPrivFilePath[0] = (TUint8) RFs::GetSystemDriveChar(); dBMsPrivFilePath[0] = (TUint8) RFs::GetSystemDriveChar(); serv.CopyFileL(contactsDBPrivFilePath, dBMsPrivFilePath); serv.Close(); _LIT(KCntDbSecureFormat,"secure[100065FF]"); // Contact databases are in DBMS private directory User::LeaveIfError(iDatabase.Open(iDbsSession, aDbName, KCntDbSecureFormat)); User::LeaveIfError(iFile.Replace(iFsSession, path, EFileWrite) ); iBuffer = HBufC8::NewL(KBufferLength); iTableNames = iDatabase.TableNamesL(); }