persistentstorage/dbms/tdbms/t_dbscript.cpp
changeset 55 44f437012c90
parent 0 08ec8eefde2f
equal deleted inserted replaced
51:7d4490026038 55:44f437012c90
     1 // Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 1998-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".
   211     if(err == KErrNone)
   211     if(err == KErrNone)
   212         {
   212         {
   213         TEntry entry;
   213         TEntry entry;
   214         if(fsSession.Entry(aFullName, entry) == KErrNone)
   214         if(fsSession.Entry(aFullName, entry) == KErrNone)
   215             {
   215             {
   216             RDebug::Print(_L("Deleting \"%S\" file.\n"), &aFullName);
   216             TheTest.Printf(_L("Deleting \"%S\" file.\n"), &aFullName);
   217             err = fsSession.SetAtt(aFullName, 0, KEntryAttReadOnly);
   217             err = fsSession.SetAtt(aFullName, 0, KEntryAttReadOnly);
   218             if(err != KErrNone)
   218             if(err != KErrNone)
   219                 {
   219                 {
   220                 RDebug::Print(_L("Error %d changing \"%S\" file attributes.\n"), err, &aFullName);
   220             	TheTest.Printf(_L("Error %d changing \"%S\" file attributes.\n"), err, &aFullName);
   221                 }
   221                 }
   222             err = fsSession.Delete(aFullName);
   222             err = fsSession.Delete(aFullName);
   223             if(err != KErrNone)
   223             if(err != KErrNone)
   224                 {
   224                 {
   225                 RDebug::Print(_L("Error %d deleting \"%S\" file.\n"), err, &aFullName);
   225             	TheTest.Printf(_L("Error %d deleting \"%S\" file.\n"), err, &aFullName);
   226                 }
   226                 }
   227             }
   227             }
   228         fsSession.Close();
   228         fsSession.Close();
   229         }
   229         }
   230     else
   230     else
   231         {
   231         {
   232         RDebug::Print(_L("Error %d connecting file session. File: %S.\n"), err, &aFullName);
   232     	TheTest.Printf(_L("Error %d connecting file session. File: %S.\n"), err, &aFullName);
   233         }
   233         }
   234     }
   234     }
   235 
   235 
   236 ///////////////////////////////////////////////////////////////////////////////////////
   236 ///////////////////////////////////////////////////////////////////////////////////////
   237 ///////////////////////////////////////////////////////////////////////////////////////
   237 ///////////////////////////////////////////////////////////////////////////////////////
   239 //If (!aValue) then the test will be panicked, the test data files will be deleted.
   239 //If (!aValue) then the test will be panicked, the test data files will be deleted.
   240 static void Check(TInt aValue, TInt aLine)
   240 static void Check(TInt aValue, TInt aLine)
   241     {
   241     {
   242     if(!aValue)
   242     if(!aValue)
   243         {
   243         {
   244         RDebug::Print(_L("*** Expression evaluated to false\r\n"));
   244     	TheTest.Printf(_L("*** Expression evaluated to false\r\n"));
   245         DeleteDataFile(KTestDatabase);
   245         DeleteDataFile(KTestDatabase);
   246         DeleteDataFile(KOutputFile);
   246         DeleteDataFile(KOutputFile);
   247         TheTest(EFalse, aLine);
   247         TheTest(EFalse, aLine);
   248         }
   248         }
   249     }
   249     }
   250 //If (aValue != aExpected) then the test will be panicked, the test data files will be deleted.
   250 //If (aValue != aExpected) then the test will be panicked, the test data files will be deleted.
   251 static void Check(TInt aValue, TInt aExpected, TInt aLine)
   251 static void Check(TInt aValue, TInt aExpected, TInt aLine)
   252     {
   252     {
   253     if(aValue != aExpected)
   253     if(aValue != aExpected)
   254         {
   254         {
   255         RDebug::Print(_L("*** Expected error: %d, got: %d\r\n"), aExpected, aValue);
   255     	TheTest.Printf(_L("*** Expected error: %d, got: %d\r\n"), aExpected, aValue);
   256         DeleteDataFile(KTestDatabase);
   256         DeleteDataFile(KTestDatabase);
   257         DeleteDataFile(KOutputFile);
   257         DeleteDataFile(KOutputFile);
   258         TheTest(EFalse, aLine);
   258         TheTest(EFalse, aLine);
   259         }
   259         }
   260     }
   260     }