persistentstorage/sql/TEST/t_sqlcompact4.cpp
branchRCL_3
changeset 13 211563e4b919
parent 0 08ec8eefde2f
child 29 cce6680bbf1c
equal deleted inserted replaced
12:31a8f755b7fe 13:211563e4b919
     1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
   431 		err = TheDb.Detach(KAttachDbName);
   431 		err = TheDb.Detach(KAttachDbName);
   432 		TEST2(err, KErrNone);
   432 		TEST2(err, KErrNone);
   433 		//Nonexisting attached database 
   433 		//Nonexisting attached database 
   434 		err = DoManualCompaction((TCompactionType)i, RSqlDatabase::EMaxCompaction, _L("aaa"));
   434 		err = DoManualCompaction((TCompactionType)i, RSqlDatabase::EMaxCompaction, _L("aaa"));
   435 		TEST2(err, KSqlErrGeneral);
   435 		TEST2(err, KSqlErrGeneral);
   436 		//Very long name of a  nonexisting attached database 
   436         //Very long name of a  nonexisting attached database 
   437 		TBuf<KMaxFileName + 10> fname;
   437         TBuf<KMaxFileName + 10> fname;
   438 		fname.SetLength(fname.MaxLength());
   438         fname.SetLength(fname.MaxLength());
   439 		fname.Fill(0xDD);
   439         fname.Fill(0xDD);
   440 		err = DoManualCompaction((TCompactionType)i, RSqlDatabase::EMaxCompaction, fname);
   440         err = DoManualCompaction((TCompactionType)i, RSqlDatabase::EMaxCompaction, fname);
   441 		TEST2(err, KErrBadName);
   441         TEST2(err, KErrBadName);
   442 		//
   442         //Invalid attached database name 
       
   443         fname.Copy(_L("c:\\|aaa|.db"));
       
   444         err = DoManualCompaction((TCompactionType)i, RSqlDatabase::EMaxCompaction, fname);
       
   445         TEST2(err, KSqlErrGeneral);
       
   446         //
   443 		TheDb.Close();
   447 		TheDb.Close();
   444 		(void)RSqlDatabase::Delete(TheTestDbName);
   448 		(void)RSqlDatabase::Delete(TheTestDbName);
   445 		}
   449 		}
   446 	}
   450 	}
   447 
   451