featuremgmt/featuremgr/test/rtest/src/t_fmgroom.cpp
changeset 55 44f437012c90
parent 17 55f2396f6d25
equal deleted inserted replaced
51:7d4490026038 55:44f437012c90
    19 #include <featureuids.h>
    19 #include <featureuids.h>
    20 #include <featurecontrol.h>
    20 #include <featurecontrol.h>
    21 #include <featdiscovery.h>
    21 #include <featdiscovery.h>
    22 #include <featurenotifier.h>
    22 #include <featurenotifier.h>
    23 #include "../../../src/clientdll/featmgrresourcetester.h"
    23 #include "../../../src/clientdll/featmgrresourcetester.h"
       
    24 #include "../src/inc/featmgrconfiguration.h"
    24 
    25 
    25 using namespace NFeature;
    26 using namespace NFeature;
    26 
    27 
    27 
    28 
    28 const TInt KInvalidFeatureId    = 90901671;
    29 const TInt KInvalidFeatureId    = 90901671;
   515     ctrl.Close();
   516     ctrl.Close();
   516     delete scheduler;
   517     delete scheduler;
   517     TheTest.Printf(_L("\r\n===OOM test succeeded at heap failure rate of %d ===\r\n"), failingAllocationNo);
   518     TheTest.Printf(_L("\r\n===OOM test succeeded at heap failure rate of %d ===\r\n"), failingAllocationNo);
   518     }
   519     }
   519 
   520 
   520 
   521 /**
       
   522 @SYMTestCaseID          PDS-EFM-CT-4112
       
   523 @SYMTestCaseDesc        FeatureManager::InitializeLibL() OOM test.
       
   524 @SYMTestPriority        High
       
   525 @SYMTestActions         
       
   526 @SYMTestExpectedResults Test must not fail
       
   527 */
       
   528 void InitializeLibOomTest()
       
   529 	{
       
   530     TInt err = KErrNoMemory;
       
   531     TInt failingAllocationNo = 0;
       
   532     TheTest.Printf(_L("Iteration:\r\n"));
       
   533     while(err == KErrNoMemory)
       
   534         {
       
   535         TheTest.Printf(_L(" %d"), ++failingAllocationNo);
       
   536         OomPreStep(failingAllocationNo, EFeatMgrOomClientTestMode);
       
   537         TRAP(err, FeatureManager::InitializeLibL());
       
   538         FeatureManager::UnInitializeLib();
       
   539         OomPostStep(EFeatMgrOomClientTestMode);
       
   540         }
       
   541     TEST2(err, KErrNone);
       
   542     TheTest.Printf(_L("\r\n===OOM test succeeded at heap failure rate of %d ===\r\n"), failingAllocationNo);
       
   543 	}
   521 
   544 
   522 void DoTestsL()
   545 void DoTestsL()
   523     {
   546     {
   524     TheTest.Start(_L("@SYMTestCaseID:PDS-EFM-CT-4068 RFeatureControl::Connect() OOM test"));
   547     TheTest.Start(_L("@SYMTestCaseID:PDS-EFM-CT-4068 RFeatureControl::Connect() OOM test"));
   525     ControlOpenOomTest(ETrue);
   548     ControlOpenOomTest(ETrue);
   583 
   606 
   584     TheTest.Next(_L("@SYMTestCaseID:PDS-EFM-CT-4092 CFeatureNotifier::NotifyRequest(<array>), valid feature, client side OOM test"));
   607     TheTest.Next(_L("@SYMTestCaseID:PDS-EFM-CT-4092 CFeatureNotifier::NotifyRequest(<array>), valid feature, client side OOM test"));
   585     NotifierNotifyRequestsOomTest(EFeatMgrOomClientTestMode);
   608     NotifierNotifyRequestsOomTest(EFeatMgrOomClientTestMode);
   586     TheTest.Next(_L("@SYMTestCaseID:PDS-EFM-CT-4093 CFeatureNotifier::NotifyRequest(<array>), valid feature, server side OOM test"));
   609     TheTest.Next(_L("@SYMTestCaseID:PDS-EFM-CT-4093 CFeatureNotifier::NotifyRequest(<array>), valid feature, server side OOM test"));
   587     NotifierNotifyRequestsOomTest(EFeatMgrOomServerTestMode);
   610     NotifierNotifyRequestsOomTest(EFeatMgrOomServerTestMode);
       
   611 
       
   612     TheTest.Next(_L("@SYMTestCaseID:PDS-EFM-CT-4112 FeatureManager::InitializeLibL(), OOM test"));
       
   613     InitializeLibOomTest();
   588     }
   614     }
   589 
   615 
   590 TInt E32Main()
   616 TInt E32Main()
   591     {
   617     {
   592     TheTest.Title();
   618     TheTest.Title();