sl@0: // Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include "../../../src/clientdll/featmgrresourcetester.h" sl@0: sl@0: using namespace NFeature; sl@0: sl@0: sl@0: const TInt KInvalidFeatureId = 90901671; sl@0: const TUid KInvalidFeatureUid = {KInvalidFeatureId}; sl@0: sl@0: static TInt TheProcessHandleCount = 0; sl@0: static TInt TheThreadHandleCount = 0; sl@0: static TInt TheAllocatedCellsCount = 0; sl@0: sl@0: #ifdef _DEBUG sl@0: static const TInt KBurstRate = 20; sl@0: #endif sl@0: sl@0: enum TFeatMgrOomTestMode sl@0: { sl@0: EFeatMgrOomServerTestMode, sl@0: EFeatMgrOomClientTestMode, sl@0: }; sl@0: sl@0: /////////////////////////////////////////////////////////////////////////////////////// sl@0: sl@0: static RTest TheTest(_L("t_fmgroom")); sl@0: sl@0: sl@0: sl@0: /////////////////////////////////////////////////////////////////////////////////////// sl@0: /////////////////////////////////////////////////////////////////////////////////////// sl@0: //Test macros and functions sl@0: void Check1(TInt aValue, TInt aLine) sl@0: { sl@0: if(!aValue) sl@0: { sl@0: RDebug::Print(_L("*** Expression evaluated to false. Line %d\r\n"), aLine); sl@0: TheTest(EFalse, aLine); sl@0: } sl@0: } sl@0: void Check2(TInt aValue, TInt aExpected, TInt aLine) sl@0: { sl@0: if(aValue != aExpected) sl@0: { sl@0: RDebug::Print(_L("*** Expected: %d, got: %d. Line %d\r\n"), aExpected, aValue, aLine); sl@0: TheTest(EFalse, aLine); sl@0: } sl@0: } sl@0: #define TEST(arg) ::Check1((arg), __LINE__) sl@0: #define TEST2(aValue, aExpected) ::Check2(aValue, aExpected, __LINE__) sl@0: sl@0: /////////////////////////////////////////////////////////////////////////////////////// sl@0: sl@0: static void MarkHandles() sl@0: { sl@0: RThread().HandleCount(TheProcessHandleCount, TheThreadHandleCount); sl@0: } sl@0: sl@0: static void MarkAllocatedCells() sl@0: { sl@0: TheAllocatedCellsCount = User::CountAllocCells(); sl@0: } sl@0: sl@0: static void CheckAllocatedCells() sl@0: { sl@0: TInt allocatedCellsCount = User::CountAllocCells(); sl@0: TEST2(allocatedCellsCount, TheAllocatedCellsCount); sl@0: } sl@0: sl@0: static void CheckHandles() sl@0: { sl@0: TInt endProcessHandleCount; sl@0: TInt endThreadHandleCount; sl@0: sl@0: RThread().HandleCount(endProcessHandleCount, endThreadHandleCount); sl@0: sl@0: TEST2(TheProcessHandleCount, endProcessHandleCount); sl@0: TEST2(TheThreadHandleCount, endThreadHandleCount); sl@0: } sl@0: sl@0: static void OomPreStep(TInt aFailingAllocationNo, TFeatMgrOomTestMode aMode = EFeatMgrOomClientTestMode) sl@0: { sl@0: if(aMode == EFeatMgrOomClientTestMode) sl@0: { sl@0: MarkHandles(); sl@0: MarkAllocatedCells(); sl@0: __UHEAP_MARK; sl@0: __UHEAP_SETBURSTFAIL(RAllocator::EBurstFailNext, aFailingAllocationNo, KBurstRate); sl@0: } sl@0: else sl@0: { sl@0: TFeatMgrResourceTester::Mark(); sl@0: TFeatMgrResourceTester::SetHeapFailure(RHeap::EBurstFailNext, aFailingAllocationNo); sl@0: } sl@0: } sl@0: sl@0: static void OomPostStep(TFeatMgrOomTestMode aMode = EFeatMgrOomClientTestMode) sl@0: { sl@0: if(aMode == EFeatMgrOomClientTestMode) sl@0: { sl@0: __UHEAP_RESET; sl@0: __UHEAP_MARKEND; sl@0: CheckAllocatedCells(); sl@0: CheckHandles(); sl@0: } sl@0: else sl@0: { sl@0: TFeatMgrResourceTester::SetHeapFailure(RHeap::ENone, 0); sl@0: TFeatMgrResourceTester::Check(); sl@0: } sl@0: } sl@0: sl@0: /////////////////////////////////////////////////////////////////////////////////////// sl@0: sl@0: /** sl@0: @SYMTestCaseID PDS-EFM-CT-4068 sl@0: @SYMTestCaseDesc Include test case 4069 too sl@0: @SYMTestPriority High sl@0: @SYMTestActions sl@0: @SYMTestExpectedResults Test must not fail sl@0: @SYMDEF DEF144262 sl@0: */ sl@0: void ControlOpenOomTest(TBool aUseConnect) sl@0: { sl@0: TInt err = KErrNoMemory; sl@0: TInt failingAllocationNo = 0; sl@0: RFeatureControl ctrl; sl@0: TheTest.Printf(_L("Iteration:\r\n")); sl@0: while(err == KErrNoMemory) sl@0: { sl@0: TheTest.Printf(_L(" %d"), ++failingAllocationNo); sl@0: OomPreStep(failingAllocationNo); sl@0: err = aUseConnect ? ctrl.Connect() : ctrl.Open(); sl@0: ctrl.Close(); sl@0: OomPostStep(); sl@0: } sl@0: if(err != KErrNoMemory) sl@0: { sl@0: TEST2(err, KErrNone); sl@0: } sl@0: TheTest.Printf(_L("\r\n===OOM test succeeded at heap failure rate of %d ===\r\n"), failingAllocationNo); sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID PDS-EFM-CT-4070 sl@0: @SYMTestCaseDesc Include test case 4071-4077 too sl@0: @SYMTestPriority High sl@0: @SYMTestActions sl@0: @SYMTestExpectedResults Test must not fail sl@0: @SYMDEF DEF144262 sl@0: */ sl@0: void ControlFeatureSupportedOomTest(TBool aUseUid, TBool aInvalidFeature, TFeatMgrOomTestMode aMode) sl@0: { sl@0: RFeatureControl ctrl; sl@0: TInt err = ctrl.Open(); sl@0: TEST2(err, KErrNone); sl@0: sl@0: const TUid KFeatureUid(aInvalidFeature ? KInvalidFeatureUid : KConnectivity); sl@0: TFeatureEntry fentry(KFeatureUid); sl@0: sl@0: err = KErrNoMemory; sl@0: TInt failingAllocationNo = 0; sl@0: TheTest.Printf(_L("Iteration:\r\n")); sl@0: while(err == KErrNoMemory) sl@0: { sl@0: TheTest.Printf(_L(" %d"), ++failingAllocationNo); sl@0: OomPreStep(failingAllocationNo, aMode); sl@0: err = aUseUid ? ctrl.FeatureSupported(KFeatureUid) : ctrl.FeatureSupported(fentry); sl@0: OomPostStep(aMode); sl@0: } sl@0: ctrl.Close(); sl@0: if(err != KErrNoMemory) sl@0: { sl@0: TEST2(err, aInvalidFeature ? KErrNotFound : KFeatureSupported); sl@0: } sl@0: TheTest.Printf(_L("\r\n===OOM test succeeded at heap failure rate of %d ===\r\n"), failingAllocationNo); sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID PDS-EFM-CT-4078 sl@0: @SYMTestCaseDesc Include test case 4079 too sl@0: @SYMTestPriority High sl@0: @SYMTestActions sl@0: @SYMTestExpectedResults Test must not fail sl@0: @SYMDEF DEF144262 sl@0: */ sl@0: void ControlListSupportedFeaturesOomTest(TFeatMgrOomTestMode aMode) sl@0: { sl@0: RFeatureControl ctrl; sl@0: TInt err = ctrl.Open(); sl@0: TEST2(err, KErrNone); sl@0: sl@0: err = KErrNoMemory; sl@0: TInt failingAllocationNo = 0; sl@0: TheTest.Printf(_L("Iteration:\r\n")); sl@0: while(err == KErrNoMemory) sl@0: { sl@0: TheTest.Printf(_L(" %d"), ++failingAllocationNo); sl@0: OomPreStep(failingAllocationNo, aMode); sl@0: const TInt KGranularity = 1; sl@0: RFeatureUidArray farray(KGranularity); sl@0: err = ctrl.ListSupportedFeatures(farray); sl@0: if(err != KErrNoMemory) sl@0: { sl@0: TEST2(err, KErrNone); sl@0: TInt count = farray.Count(); sl@0: TheTest.Printf(_L("===Features count: %d\r\n"), count); sl@0: TEST(count > 0); sl@0: } sl@0: farray.Close(); sl@0: OomPostStep(aMode); sl@0: } sl@0: ctrl.Close(); sl@0: TheTest.Printf(_L("\r\n===OOM test succeeded at heap failure rate of %d ===\r\n"), failingAllocationNo); sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID PDS-EFM-CT-4080 sl@0: @SYMTestCaseDesc Include test case 4081 too sl@0: @SYMTestPriority High sl@0: @SYMTestActions sl@0: @SYMTestExpectedResults Test must not fail sl@0: @SYMDEF DEF144262 sl@0: */ sl@0: void ControlFeaturesSupportedOomTest(TFeatMgrOomTestMode aMode) sl@0: { sl@0: RFeatureControl ctrl; sl@0: TInt err = ctrl.Open(); sl@0: TEST2(err, KErrNone); sl@0: RFeatureUidArray farray; sl@0: err = ctrl.ListSupportedFeatures(farray); sl@0: TEST2(err, KErrNone); sl@0: sl@0: err = KErrNoMemory; sl@0: TInt failingAllocationNo = 0; sl@0: TheTest.Printf(_L("Iteration:\r\n")); sl@0: while(err == KErrNoMemory) sl@0: { sl@0: TheTest.Printf(_L(" %d"), ++failingAllocationNo); sl@0: OomPreStep(failingAllocationNo, aMode); sl@0: RFeatureArray farray2; sl@0: err = KErrNone; sl@0: for(TInt i=0;i 0); sl@0: } sl@0: farray2.Close(); sl@0: OomPostStep(aMode); sl@0: } sl@0: farray.Close(); sl@0: ctrl.Close(); sl@0: TheTest.Printf(_L("\r\n===OOM test succeeded at heap failure rate of %d ===\r\n"), failingAllocationNo); sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID PDS-EFM-CT-4082 sl@0: @SYMTestCaseDesc Include test case 4083 too sl@0: @SYMTestPriority High sl@0: @SYMTestActions sl@0: @SYMTestExpectedResults Test must not fail sl@0: @SYMDEF DEF144262 sl@0: */ sl@0: void ControlAddFeatureOomTest(TFeatMgrOomTestMode aMode) sl@0: { sl@0: RFeatureControl ctrl; sl@0: TInt err = ctrl.Open(); sl@0: TEST2(err, KErrNone); sl@0: sl@0: const TUid KNewFeatureUid = {0x7888ABCE}; sl@0: TBitFlags32 flags; sl@0: flags.Set(EFeatureSupported); sl@0: flags.Set(EFeatureModifiable); sl@0: flags.Set(EFeaturePersisted); sl@0: TFeatureEntry fentry(KNewFeatureUid, flags, 0x0); sl@0: sl@0: err = KErrNoMemory; sl@0: TInt failingAllocationNo = 0; sl@0: TheTest.Printf(_L("Iteration:\r\n")); sl@0: while(err == KErrNoMemory) sl@0: { sl@0: TheTest.Printf(_L(" %d"), ++failingAllocationNo); sl@0: OomPreStep(failingAllocationNo, aMode); sl@0: err = ctrl.AddFeature(fentry); sl@0: OomPostStep(aMode); sl@0: if(err == KErrNoMemory) sl@0: { sl@0: err = ctrl.EnableFeature(fentry.FeatureUid()); sl@0: TEST2(err, KErrNotFound); sl@0: } sl@0: } sl@0: TEST2(err, KErrNone); sl@0: err = ctrl.DeleteFeature(fentry.FeatureUid()); sl@0: TEST2(err, KErrNone); sl@0: sl@0: ctrl.Close(); sl@0: TheTest.Printf(_L("\r\n===OOM test succeeded at heap failure rate of %d ===\r\n"), failingAllocationNo); sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID PDS-EFM-CT-4084 sl@0: @SYMTestCaseDesc Include test case 4085 too sl@0: @SYMTestPriority High sl@0: @SYMTestActions sl@0: @SYMTestExpectedResults Test must not fail sl@0: @SYMDEF DEF144262 sl@0: */ sl@0: void ControlDeleteFeatureOomTest(TFeatMgrOomTestMode aMode) sl@0: { sl@0: RFeatureControl ctrl; sl@0: TInt err = ctrl.Open(); sl@0: TEST2(err, KErrNone); sl@0: sl@0: const TUid KNewFeatureUid = {0x7888ABCE}; sl@0: TBitFlags32 flags; sl@0: flags.Set(EFeatureSupported); sl@0: flags.Set(EFeatureModifiable); sl@0: TFeatureEntry fentry(KNewFeatureUid, flags, 0x0); sl@0: err = ctrl.AddFeature(fentry); sl@0: TEST2(err, KErrNone); sl@0: sl@0: err = KErrNoMemory; sl@0: TInt failingAllocationNo = 0; sl@0: TheTest.Printf(_L("Iteration:\r\n")); sl@0: while(err == KErrNoMemory) sl@0: { sl@0: TheTest.Printf(_L(" %d"), ++failingAllocationNo); sl@0: OomPreStep(failingAllocationNo, aMode); sl@0: err = ctrl.DeleteFeature(fentry.FeatureUid()); sl@0: OomPostStep(aMode); sl@0: if(err == KErrNoMemory) sl@0: { sl@0: err = ctrl.EnableFeature(fentry.FeatureUid()); sl@0: TEST2(err, KErrNone); sl@0: } sl@0: } sl@0: TEST2(err, KErrNone); sl@0: sl@0: ctrl.Close(); sl@0: TheTest.Printf(_L("\r\n===OOM test succeeded at heap failure rate of %d ===\r\n"), failingAllocationNo); sl@0: } sl@0: sl@0: ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// sl@0: ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// sl@0: sl@0: class TTestFeatureObserver : public MFeatureObserver sl@0: { sl@0: public: sl@0: virtual void HandleNotifyChange(TFeatureChangeType /*aType*/, TFeatureEntry /*aFeature*/) sl@0: { sl@0: } sl@0: virtual void HandleNotifyError(TInt /*aError*/) sl@0: { sl@0: } sl@0: }; sl@0: sl@0: /** sl@0: @SYMTestCaseID PDS-EFM-CT-4086 sl@0: @SYMTestCaseDesc Include test case 4087 too sl@0: @SYMTestPriority High sl@0: @SYMTestActions sl@0: @SYMTestExpectedResults Test must not fail sl@0: @SYMDEF DEF144262 sl@0: */ sl@0: void NotifierNewLOomTest(TFeatMgrOomTestMode aMode) sl@0: { sl@0: CActiveScheduler* scheduler = new CActiveScheduler; sl@0: TEST(scheduler != NULL); sl@0: CActiveScheduler::Install(scheduler); sl@0: sl@0: RFeatureControl ctrl; sl@0: TInt err = ctrl.Open(); sl@0: TEST2(err, KErrNone); sl@0: sl@0: TTestFeatureObserver observer; sl@0: err = KErrNoMemory; sl@0: TInt failingAllocationNo = 0; sl@0: TheTest.Printf(_L("Iteration:\r\n")); sl@0: while(err == KErrNoMemory) sl@0: { sl@0: TheTest.Printf(_L(" %d"), ++failingAllocationNo); sl@0: OomPreStep(failingAllocationNo, aMode); sl@0: CFeatureNotifier* notifier = NULL; sl@0: TRAP(err, notifier = CFeatureNotifier::NewL(observer)); sl@0: delete notifier; sl@0: OomPostStep(aMode); sl@0: } sl@0: TEST2(err, KErrNone); sl@0: ctrl.Close(); sl@0: delete scheduler; sl@0: TheTest.Printf(_L("\r\n===OOM test succeeded at heap failure rate of %d ===\r\n"), failingAllocationNo); sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID PDS-EFM-CT-4088 sl@0: @SYMTestCaseDesc Include test case 4089-4091 too sl@0: @SYMTestPriority High sl@0: @SYMTestActions sl@0: @SYMTestExpectedResults Test must not fail sl@0: @SYMDEF DEF144262 sl@0: */ sl@0: void NotifierNotifyRequestOomTest(TBool aInvalidFeature, TFeatMgrOomTestMode aMode) sl@0: { sl@0: CActiveScheduler* scheduler = new CActiveScheduler; sl@0: TEST(scheduler != NULL); sl@0: CActiveScheduler::Install(scheduler); sl@0: sl@0: RFeatureControl ctrl; sl@0: TInt err = ctrl.Open(); sl@0: TEST2(err, KErrNone); sl@0: sl@0: TTestFeatureObserver observer; sl@0: CFeatureNotifier* notifier = NULL; sl@0: TRAP(err, notifier = CFeatureNotifier::NewL(observer)); sl@0: TEST2(err, KErrNone); sl@0: sl@0: const TUid KFeatureUid(aInvalidFeature ? KInvalidFeatureUid : KConnectivity); sl@0: sl@0: err = KErrNoMemory; sl@0: TInt failingAllocationNo = 0; sl@0: TheTest.Printf(_L("Iteration:\r\n")); sl@0: while(err == KErrNoMemory) sl@0: { sl@0: TheTest.Printf(_L(" %d"), ++failingAllocationNo); sl@0: OomPreStep(failingAllocationNo, aMode); sl@0: err = notifier->NotifyRequest(KFeatureUid); sl@0: (void)notifier->NotifyCancelAll(); sl@0: OomPostStep(aMode); sl@0: } sl@0: TEST2(err, KErrNone); sl@0: delete notifier; sl@0: ctrl.Close(); sl@0: delete scheduler; sl@0: TheTest.Printf(_L("\r\n===OOM test succeeded at heap failure rate of %d ===\r\n"), failingAllocationNo); sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID PDS-EFM-CT-4092 sl@0: @SYMTestCaseDesc Include test case 4093 too sl@0: @SYMTestPriority High sl@0: @SYMTestActions sl@0: @SYMTestExpectedResults Test must not fail sl@0: @SYMDEF DEF144262 sl@0: */ sl@0: void NotifierNotifyRequestsOomTest(TFeatMgrOomTestMode aMode) sl@0: { sl@0: CActiveScheduler* scheduler = new CActiveScheduler; sl@0: TEST(scheduler != NULL); sl@0: CActiveScheduler::Install(scheduler); sl@0: sl@0: RFeatureControl ctrl; sl@0: TInt err = ctrl.Open(); sl@0: TEST2(err, KErrNone); sl@0: sl@0: TTestFeatureObserver observer; sl@0: CFeatureNotifier* notifier = NULL; sl@0: TRAP(err, notifier = CFeatureNotifier::NewL(observer)); sl@0: TEST2(err, KErrNone); sl@0: sl@0: RFeatureUidArray features; sl@0: err = features.Append(KConnectivity); sl@0: TEST2(err, KErrNone); sl@0: err = features.Append(KFax); sl@0: TEST2(err, KErrNone); sl@0: err = features.Append(KConnectivity); sl@0: TEST2(err, KErrNone); sl@0: err = features.Append(KLocationManagement); sl@0: TEST2(err, KErrNone); sl@0: sl@0: err = KErrNoMemory; sl@0: TInt failingAllocationNo = 0; sl@0: TheTest.Printf(_L("Iteration:\r\n")); sl@0: while(err == KErrNoMemory) sl@0: { sl@0: TheTest.Printf(_L(" %d"), ++failingAllocationNo); sl@0: OomPreStep(failingAllocationNo, aMode); sl@0: err = notifier->NotifyRequest(features); sl@0: (void)notifier->NotifyCancelAll(); sl@0: OomPostStep(aMode); sl@0: } sl@0: TEST2(err, KErrNone); sl@0: features.Close(); sl@0: delete notifier; sl@0: ctrl.Close(); sl@0: delete scheduler; sl@0: TheTest.Printf(_L("\r\n===OOM test succeeded at heap failure rate of %d ===\r\n"), failingAllocationNo); sl@0: } sl@0: sl@0: sl@0: sl@0: void DoTestsL() sl@0: { sl@0: TheTest.Start(_L("@SYMTestCaseID:PDS-EFM-CT-4068 RFeatureControl::Connect() OOM test")); sl@0: ControlOpenOomTest(ETrue); sl@0: TheTest.Next(_L("@SYMTestCaseID:PDS-EFM-CT-4069 RFeatureControl::Open() OOM test")); sl@0: ControlOpenOomTest(EFalse); sl@0: sl@0: TheTest.Next(_L("@SYMTestCaseID:PDS-EFM-CT-4070 RFeatureControl::FeatureSupported(UID) + valid feature, client side OOM test")); sl@0: ControlFeatureSupportedOomTest(ETrue, EFalse, EFeatMgrOomClientTestMode); sl@0: TheTest.Next(_L("@SYMTestCaseID:PDS-EFM-CT-4071 RFeatureControl::FeatureSupported(UID) + valid feature, server side OOM test")); sl@0: ControlFeatureSupportedOomTest(ETrue, EFalse, EFeatMgrOomServerTestMode); sl@0: sl@0: TheTest.Next(_L("@SYMTestCaseID:PDS-EFM-CT-4072 RFeatureControl::FeatureSupported() + valid feature, client side OOM test")); sl@0: ControlFeatureSupportedOomTest(EFalse, EFalse, EFeatMgrOomClientTestMode); sl@0: TheTest.Next(_L("@SYMTestCaseID:PDS-EFM-CT-4073 RFeatureControl::FeatureSupported() + valid feature, server side OOM test")); sl@0: ControlFeatureSupportedOomTest(EFalse, EFalse, EFeatMgrOomServerTestMode); sl@0: sl@0: TheTest.Next(_L("@SYMTestCaseID:PDS-EFM-CT-4074 RFeatureControl::FeatureSupported(UID) + invalid feature, client side OOM test")); sl@0: ControlFeatureSupportedOomTest(ETrue, ETrue, EFeatMgrOomClientTestMode); sl@0: TheTest.Next(_L("@SYMTestCaseID:PDS-EFM-CT-4075 RFeatureControl::FeatureSupported(UID) + invalid feature, server side OOM test")); sl@0: ControlFeatureSupportedOomTest(ETrue, ETrue, EFeatMgrOomServerTestMode); sl@0: sl@0: TheTest.Next(_L("@SYMTestCaseID:PDS-EFM-CT-4076 RFeatureControl::FeatureSupported() + invalid feature, client side OOM OOM test")); sl@0: ControlFeatureSupportedOomTest(EFalse, ETrue, EFeatMgrOomClientTestMode); sl@0: TheTest.Next(_L("@SYMTestCaseID:PDS-EFM-CT-4077 RFeatureControl::FeatureSupported() + invalid feature, server side OOM OOM test")); sl@0: ControlFeatureSupportedOomTest(EFalse, ETrue, EFeatMgrOomServerTestMode); sl@0: sl@0: TheTest.Next(_L("@SYMTestCaseID:PDS-EFM-CT-4078 RFeatureControl::ListSupportedFeatures(), client side OOM test")); sl@0: ControlListSupportedFeaturesOomTest(EFeatMgrOomClientTestMode); sl@0: TheTest.Next(_L("@SYMTestCaseID:PDS-EFM-CT-4079 RFeatureControl::ListSupportedFeatures(), server side OOM test")); sl@0: ControlListSupportedFeaturesOomTest(EFeatMgrOomServerTestMode); sl@0: sl@0: TheTest.Next(_L("@SYMTestCaseID:PDS-EFM-CT-4080 RFeatureControl::FeaturesSupported(), client side OOM test")); sl@0: ControlFeaturesSupportedOomTest(EFeatMgrOomClientTestMode); sl@0: TheTest.Next(_L("@SYMTestCaseID:PDS-EFM-CT-4081 RFeatureControl::FeaturesSupported(),server side OOM test")); sl@0: ControlFeaturesSupportedOomTest(EFeatMgrOomServerTestMode); sl@0: sl@0: TheTest.Next(_L("@SYMTestCaseID:PDS-EFM-CT-4082 RFeatureControl::AddFeature(), client side OOM test")); sl@0: ControlAddFeatureOomTest(EFeatMgrOomClientTestMode); sl@0: TheTest.Next(_L("@SYMTestCaseID:PDS-EFM-CT-4083 RFeatureControl::AddFeature(), server side OOM test")); sl@0: ControlAddFeatureOomTest(EFeatMgrOomServerTestMode); sl@0: sl@0: TheTest.Next(_L("@SYMTestCaseID:PDS-EFM-CT-4084 RFeatureControl::DeleteFeature(), client side OOM test")); sl@0: ControlDeleteFeatureOomTest(EFeatMgrOomClientTestMode); sl@0: TheTest.Next(_L("@SYMTestCaseID:PDS-EFM-CT-4085 RFeatureControl::DeleteFeature(), server side OOM test")); sl@0: ControlDeleteFeatureOomTest(EFeatMgrOomServerTestMode); sl@0: sl@0: TheTest.Next(_L("@SYMTestCaseID:PDS-EFM-CT-4086 CFeatureNotifier::NewL(), client side OOM test")); sl@0: NotifierNewLOomTest(EFeatMgrOomClientTestMode); sl@0: TheTest.Next(_L("@SYMTestCaseID:PDS-EFM-CT-4087 CFeatureNotifier::NewL(), server side OOM test")); sl@0: NotifierNewLOomTest(EFeatMgrOomServerTestMode); sl@0: sl@0: TheTest.Next(_L("@SYMTestCaseID:PDS-EFM-CT-4088 CFeatureNotifier::NotifyRequest(), valid feature, client side OOM test")); sl@0: NotifierNotifyRequestOomTest(ETrue, EFeatMgrOomClientTestMode); sl@0: TheTest.Next(_L("@SYMTestCaseID:PDS-EFM-CT-4089 CFeatureNotifier::NotifyRequest(), valid feature, server side OOM test")); sl@0: NotifierNotifyRequestOomTest(ETrue, EFeatMgrOomServerTestMode); sl@0: sl@0: TheTest.Next(_L("@SYMTestCaseID:PDS-EFM-CT-4090 CFeatureNotifier::NotifyRequest(), invalid feature, client side OOM test")); sl@0: NotifierNotifyRequestOomTest(EFalse, EFeatMgrOomClientTestMode); sl@0: TheTest.Next(_L("@SYMTestCaseID:PDS-EFM-CT-4091 CFeatureNotifier::NotifyRequest(), invalid feature, server side OOM test")); sl@0: NotifierNotifyRequestOomTest(EFalse, EFeatMgrOomServerTestMode); sl@0: sl@0: TheTest.Next(_L("@SYMTestCaseID:PDS-EFM-CT-4092 CFeatureNotifier::NotifyRequest(), valid feature, client side OOM test")); sl@0: NotifierNotifyRequestsOomTest(EFeatMgrOomClientTestMode); sl@0: TheTest.Next(_L("@SYMTestCaseID:PDS-EFM-CT-4093 CFeatureNotifier::NotifyRequest(), valid feature, server side OOM test")); sl@0: NotifierNotifyRequestsOomTest(EFeatMgrOomServerTestMode); sl@0: } sl@0: sl@0: TInt E32Main() sl@0: { sl@0: TheTest.Title(); sl@0: sl@0: CTrapCleanup* tc = CTrapCleanup::New(); sl@0: TheTest(tc != NULL); sl@0: sl@0: __UHEAP_MARK; sl@0: sl@0: TRAPD(err, DoTestsL()); sl@0: TEST2(err, KErrNone); sl@0: sl@0: __UHEAP_MARKEND; sl@0: sl@0: TheTest.End(); sl@0: TheTest.Close(); sl@0: sl@0: delete tc; sl@0: sl@0: User::Heap().Check(); sl@0: return KErrNone; sl@0: }