featuremgmt/featuremgr/test/rtest/src/t_fmgroom.cpp
branchRCL_3
changeset 10 31a8f755b7fe
parent 9 667e88a979d7
--- a/featuremgmt/featuremgr/test/rtest/src/t_fmgroom.cpp	Mon Mar 15 12:46:30 2010 +0200
+++ b/featuremgmt/featuremgr/test/rtest/src/t_fmgroom.cpp	Thu Apr 01 00:19:42 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -24,14 +24,6 @@
 
 using namespace NFeature;
 
-_LIT( KZOrgFeaturesFile, "Z:\\Private\\10205054\\features.dat" );
-#ifdef EXTENDED_FEATURE_MANAGER_TEST
-_LIT( KZFeaturesFile, "C:\\Private\\102836E5\\features.dat" );
-_LIT( KZFeaturesDir, "C:\\Private\\102836E5\\" );
-#else
-_LIT( KZFeaturesFile, "Z:\\Private\\10205054\\features.dat" );
-_LIT( KZFeaturesDir, "Z:\\Private\\10205054\\" );
-#endif // EXTENDED_FEATURE_MANAGER_TEST
 
 const TInt KInvalidFeatureId    = 90901671;
 const TUid KInvalidFeatureUid   = {KInvalidFeatureId};
@@ -39,8 +31,10 @@
 static TInt TheProcessHandleCount = 0;
 static TInt TheThreadHandleCount = 0;
 static TInt TheAllocatedCellsCount = 0;
+
+#ifdef _DEBUG
 static const TInt KBurstRate = 20;
-
+#endif
 
 enum TFeatMgrOomTestMode
     {
@@ -52,12 +46,7 @@
 
 static RTest TheTest(_L("t_fmgroom"));
 
-///////////////////////////////////////////////////////////////////////////////////////
 
-//Deletes all created test files.
-void DestroyTestEnv()
-    {
-    }
 
 ///////////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////////////
@@ -66,7 +55,6 @@
     {
     if(!aValue)
         {
-        DestroyTestEnv();
         RDebug::Print(_L("*** Expression evaluated to false. Line %d\r\n"), aLine);
         TheTest(EFalse, aLine);
         }
@@ -75,7 +63,6 @@
     {
     if(aValue != aExpected)
         {
-        DestroyTestEnv();
         RDebug::Print(_L("*** Expected: %d, got: %d. Line %d\r\n"), aExpected, aValue, aLine);
         TheTest(EFalse, aLine);
         }
@@ -314,7 +301,8 @@
     const TUid KNewFeatureUid = {0x7888ABCE}; 
     TBitFlags32 flags;
     flags.Set(EFeatureSupported);
-    flags.Set(EFeatureModifiable);
+    flags.Set(EFeatureModifiable);    
+    flags.Set(EFeaturePersisted);
     TFeatureEntry fentry(KNewFeatureUid, flags, 0x0);
     
     err = KErrNoMemory;
@@ -529,53 +517,11 @@
     TheTest.Printf(_L("\r\n===OOM test succeeded at heap failure rate of %d ===\r\n"), failingAllocationNo);
     }
 
-void PreTest()
-    {
-    // Connect session
-    RFs fsSession;
-    User::LeaveIfError(fsSession.Connect()); 
-    
-    TEntry entry;
-    TInt err = fsSession.Entry(KZFeaturesDir, entry);
-    if (err == KErrNotFound)
-        {
-        err = fsSession.MkDir(KZFeaturesDir);
-        }
-    TEST2 (err, KErrNone);
-    err = BaflUtils::CopyFile(fsSession, KZOrgFeaturesFile, KZFeaturesDir);
-    TEST2 (err, KErrNone);
-    
-    // close file server session
-    fsSession.Close();
 
-    }
-
-void PostTest()
-    {
-    // Connect session
-    RFs fsSession;
-    User::LeaveIfError(fsSession.Connect()); 
-    
-    TEntry entry;
-    TInt err = fsSession.Entry(KZFeaturesDir, entry);
-    TEST2 (err, KErrNone);
-    if (err == KErrNone)
-        {
-        //if not extended this is attempting to delte from the Z drive
-#ifdef EXTENDED_FEATURE_MANAGER_TEST
-        err = BaflUtils::DeleteFile(fsSession,KZFeaturesFile);
-        TEST2 (err, KErrNone);
-#endif        
-        }
-    // close file server session
-    fsSession.Close();
-    }
 
 void DoTestsL()
     {
-    
     TheTest.Start(_L("@SYMTestCaseID:PDS-EFM-CT-4068 RFeatureControl::Connect() OOM test"));
-    PreTest();
     ControlOpenOomTest(ETrue);
     TheTest.Next(_L("@SYMTestCaseID:PDS-EFM-CT-4069 RFeatureControl::Open() OOM test"));
     ControlOpenOomTest(EFalse);
@@ -639,8 +585,6 @@
     NotifierNotifyRequestsOomTest(EFeatMgrOomClientTestMode);
     TheTest.Next(_L("@SYMTestCaseID:PDS-EFM-CT-4093 CFeatureNotifier::NotifyRequest(<array>), valid feature, server side OOM test"));
     NotifierNotifyRequestsOomTest(EFeatMgrOomServerTestMode);
-    
-    PostTest();
     }
 
 TInt E32Main()
@@ -653,7 +597,6 @@
     __UHEAP_MARK;
     
     TRAPD(err, DoTestsL());
-    DestroyTestEnv();
     TEST2(err, KErrNone);
 
     __UHEAP_MARKEND;