os/persistentdata/featuremgmt/featuremgr/test/rtest/src/t_fmgrapi.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
// Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
//
sl@0
    15
sl@0
    16
#include <e32test.h>
sl@0
    17
#include <featmgr.h>
sl@0
    18
#include <featureuids.h>
sl@0
    19
#include <featurecontrol.h>
sl@0
    20
#include <featdiscovery.h>
sl@0
    21
sl@0
    22
using namespace NFeature;
sl@0
    23
sl@0
    24
const TInt KInvalidFeatureId1    = 90901671;
sl@0
    25
const TInt KInvalidNegFeatureId2 = -90901671;
sl@0
    26
const TUid KInvalidFeatureUid1  = {KInvalidFeatureId1};
sl@0
    27
sl@0
    28
///////////////////////////////////////////////////////////////////////////////////////
sl@0
    29
sl@0
    30
static RTest TheTest(_L("t_fmgrapi"));
sl@0
    31
TUid SupportedFeature   = KConnectivity;  //Defaulted to KConnectivity, but we will re-assign it in FeatureTestPreparation().
sl@0
    32
TUid SupportedFeature2  = KSip;          //Defaulted to KSip, but we will re-assign it in FeatureTestPreparation().
sl@0
    33
sl@0
    34
///////////////////////////////////////////////////////////////////////////////////////
sl@0
    35
sl@0
    36
//Deletes all created test files.
sl@0
    37
void DestroyTestEnv()
sl@0
    38
    {
sl@0
    39
    }
sl@0
    40
sl@0
    41
///////////////////////////////////////////////////////////////////////////////////////
sl@0
    42
///////////////////////////////////////////////////////////////////////////////////////
sl@0
    43
//Test macros and functions
sl@0
    44
void Check1(TInt aValue, TInt aLine)
sl@0
    45
    {
sl@0
    46
    if(!aValue)
sl@0
    47
        {
sl@0
    48
        DestroyTestEnv();
sl@0
    49
        RDebug::Print(_L("*** Expression evaluated to false. Line %d\r\n"), aLine);
sl@0
    50
        TheTest(EFalse, aLine);
sl@0
    51
        }
sl@0
    52
    }
sl@0
    53
void Check2(TInt aValue, TInt aExpected, TInt aLine)
sl@0
    54
    {
sl@0
    55
    if(aValue != aExpected)
sl@0
    56
        {
sl@0
    57
        DestroyTestEnv();
sl@0
    58
        RDebug::Print(_L("*** Expected: %d, got: %d. Line %d\r\n"), aExpected, aValue, aLine);
sl@0
    59
        TheTest(EFalse, aLine);
sl@0
    60
        }
sl@0
    61
    }
sl@0
    62
#define TEST(arg) ::Check1((arg), __LINE__)
sl@0
    63
#define TEST2(aValue, aExpected) ::Check2(aValue, aExpected, __LINE__)
sl@0
    64
sl@0
    65
///////////////////////////////////////////////////////////////////////////////////////
sl@0
    66
sl@0
    67
/**
sl@0
    68
@SYMTestCaseID          PDS-EFM-CT-4059
sl@0
    69
@SYMTestCaseDesc        
sl@0
    70
@SYMTestPriority        High
sl@0
    71
@SYMTestActions         
sl@0
    72
@SYMTestExpectedResults Test must not fail
sl@0
    73
@SYMDEF                 DEF144262
sl@0
    74
*/
sl@0
    75
void FeatureSupportedTestL()
sl@0
    76
    {
sl@0
    77
    FeatureManager::InitializeLibL();
sl@0
    78
    FeatureManager::InitializeLibL();
sl@0
    79
    
sl@0
    80
    //Feature, default present
sl@0
    81
    TBool rc = FeatureManager::FeatureSupported(KConnectivity.iUid);
sl@0
    82
    TEST(rc);
sl@0
    83
    //Feature, default not present
sl@0
    84
    rc = FeatureManager::FeatureSupported(KPrint.iUid);
sl@0
    85
    TEST(rc);
sl@0
    86
    
sl@0
    87
    //Ivalid feature UID
sl@0
    88
    rc = FeatureManager::FeatureSupported(KInvalidFeatureId1);
sl@0
    89
    TEST(!rc);
sl@0
    90
    //Ivalid feature UID - negative
sl@0
    91
    rc = FeatureManager::FeatureSupported(KInvalidNegFeatureId2);
sl@0
    92
    TEST(!rc);
sl@0
    93
sl@0
    94
    FeatureManager::UnInitializeLib();  
sl@0
    95
    FeatureManager::UnInitializeLib();  
sl@0
    96
    FeatureManager::UnInitializeLib();//it should be safe to call UnInitializeLib() even without matching InitializeLibL() call   
sl@0
    97
    }
sl@0
    98
sl@0
    99
/**
sl@0
   100
@SYMTestCaseID          PDS-EFM-CT-4060
sl@0
   101
@SYMTestCaseDesc        
sl@0
   102
@SYMTestPriority        High
sl@0
   103
@SYMTestActions         
sl@0
   104
@SYMTestExpectedResults Test must not fail
sl@0
   105
@SYMDEF                 DEF144262
sl@0
   106
*/
sl@0
   107
void FeatureControlTest1()
sl@0
   108
    {
sl@0
   109
    RFeatureControl ctrl;
sl@0
   110
    TInt err = ctrl.Open();
sl@0
   111
    TEST2(err, KErrNone);
sl@0
   112
    /////////////////////////////////////////////////////////////
sl@0
   113
    RFeatureUidArray farray;
sl@0
   114
    err = ctrl.ListSupportedFeatures(farray);
sl@0
   115
    TEST2(err, KErrNone);
sl@0
   116
    TheTest.Printf(_L("RFeatureControl::ListSupportedFeatures()\r\n"));
sl@0
   117
    for(TInt i=0;i<farray.Count();++i)
sl@0
   118
        {
sl@0
   119
        TheTest.Printf(_L("  Feature: %08X\r\n"), farray[i].iUid);
sl@0
   120
        }
sl@0
   121
    /////////////////////////////////////////////////////////////
sl@0
   122
    RFeatureArray farray2;
sl@0
   123
    for(TInt i=0;i<farray.Count();++i)
sl@0
   124
        {
sl@0
   125
        err = farray2.Append(farray[i]); 
sl@0
   126
        TEST2(err, KErrNone);
sl@0
   127
        }
sl@0
   128
    
sl@0
   129
    err = ctrl.FeaturesSupported(farray2);
sl@0
   130
    TEST2(err, KErrNone);
sl@0
   131
sl@0
   132
    TheTest.Printf(_L("RFeatureControl::FeaturesSupported()\r\n"));
sl@0
   133
    for(TInt i=0;i<farray2.Count();++i)
sl@0
   134
        {
sl@0
   135
        TheTest.Printf(_L("  Feature: %08X, Flags: %08X, Data: %08X\r\n"), farray2[i].FeatureUid(), farray2[i].FeatureFlags().iFlags, farray2[i].FeatureData());
sl@0
   136
        }
sl@0
   137
    
sl@0
   138
    RFeatureArray farray3;
sl@0
   139
    err = ctrl.FeaturesSupported(farray3);
sl@0
   140
    TEST2(err, KErrArgument);
sl@0
   141
    
sl@0
   142
    /////////////////////////////////////////////////////////////
sl@0
   143
    farray2.Close();
sl@0
   144
    farray.Close();
sl@0
   145
    ctrl.Close();
sl@0
   146
    ctrl.Close();//It should be safe to call Close() again
sl@0
   147
    }
sl@0
   148
sl@0
   149
/** 
sl@0
   150
@SYMTestCaseID          PDS-EFM-CT-4061
sl@0
   151
@SYMTestCaseDesc        
sl@0
   152
@SYMTestPriority        High
sl@0
   153
@SYMTestActions         
sl@0
   154
@SYMTestExpectedResults Test must not fail
sl@0
   155
@SYMDEF                 DEF144262
sl@0
   156
*/
sl@0
   157
void FeatureControlTest2()
sl@0
   158
    {
sl@0
   159
    RFeatureControl ctrl;
sl@0
   160
    TInt err = ctrl.Open();
sl@0
   161
    TEST2(err, KErrNone);
sl@0
   162
    /////////////////////////////////////////////////////////////
sl@0
   163
    RFeatureUidArray farray;
sl@0
   164
    err = ctrl.ListSupportedFeatures(farray);
sl@0
   165
    TEST2(err, KErrNone);
sl@0
   166
    for(TInt i=0;i<farray.Count();++i)
sl@0
   167
        {
sl@0
   168
        err = ctrl.FeatureSupported(farray[i]);
sl@0
   169
        TEST2(err, KFeatureSupported);
sl@0
   170
        
sl@0
   171
        TFeatureEntry feat(farray[i]);
sl@0
   172
        err = ctrl.FeatureSupported(feat);
sl@0
   173
        TEST2(err, KFeatureSupported);
sl@0
   174
        }
sl@0
   175
sl@0
   176
    err = ctrl.FeatureSupported(TUid::Uid(KInvalidFeatureId1));
sl@0
   177
    TEST2(err, KErrNotFound);
sl@0
   178
sl@0
   179
    TFeatureEntry feat1(TUid::Uid(KInvalidFeatureId1));
sl@0
   180
    err = ctrl.FeatureSupported(feat1);
sl@0
   181
    TEST2(err, KErrNotFound);
sl@0
   182
sl@0
   183
    const TUint KFlags = 0x0134357;
sl@0
   184
    const TUint KData = 0xAB5234;
sl@0
   185
    TFeatureEntry feat2(TUid::Uid(KInvalidFeatureId1), KFlags, KData);
sl@0
   186
    err = ctrl.FeatureSupported(feat2);
sl@0
   187
    TEST2(err, KErrNotFound);
sl@0
   188
    
sl@0
   189
    /////////////////////////////////////////////////////////////
sl@0
   190
    farray.Close();
sl@0
   191
    ctrl.Close();
sl@0
   192
    }
sl@0
   193
sl@0
   194
/** 
sl@0
   195
@SYMTestCaseID          PDS-EFM-CT-4062
sl@0
   196
@SYMTestCaseDesc        
sl@0
   197
@SYMTestPriority        High
sl@0
   198
@SYMTestActions         
sl@0
   199
@SYMTestExpectedResults Test must not fail
sl@0
   200
@SYMDEF                 DEF144262
sl@0
   201
*/
sl@0
   202
void FeatureControlTest3()
sl@0
   203
    {
sl@0
   204
    RFeatureControl ctrl;
sl@0
   205
    TInt err = ctrl.Open();
sl@0
   206
    TEST2(err, KErrNone);
sl@0
   207
    
sl@0
   208
    //Retrieve a uid list of all supported features
sl@0
   209
    RFeatureUidArray farray;
sl@0
   210
    err = ctrl.ListSupportedFeatures(farray);
sl@0
   211
    TEST2(err, KErrNone);
sl@0
   212
    //Retrieve a TFeaureEntry list of all supported features
sl@0
   213
    RFeatureArray farray2;
sl@0
   214
    for(TInt i=0;i<farray.Count();++i)
sl@0
   215
        {
sl@0
   216
        err = farray2.Append(farray[i]); 
sl@0
   217
        TEST2(err, KErrNone);
sl@0
   218
        }
sl@0
   219
    err = ctrl.FeaturesSupported(farray2);
sl@0
   220
    TEST2(err, KErrNone);
sl@0
   221
    //Play with EnableFeature()/DisableFeature() calls. If the EFeatureModifiable flag is not set then 
sl@0
   222
    //the feature cannot be enabled or disabled.
sl@0
   223
    for(TInt i=0;i<farray2.Count();++i)
sl@0
   224
        {
sl@0
   225
        const TFeatureEntry& fentry = farray2[i];
sl@0
   226
        TBitFlags32 flags = fentry.FeatureFlags();
sl@0
   227
        
sl@0
   228
        err = ctrl.DisableFeature(fentry.FeatureUid());
sl@0
   229
        TEST2(err, flags.IsSet(EFeatureModifiable) ? KErrNone : KErrAccessDenied);
sl@0
   230
        
sl@0
   231
        err = ctrl.EnableFeature(fentry.FeatureUid());
sl@0
   232
        TEST2(err, flags.IsSet(EFeatureModifiable) ? KErrNone : KErrAccessDenied);
sl@0
   233
        }
sl@0
   234
    //It is impossible to set non-existing feature
sl@0
   235
    const TUid KNewFeatureUid = {0x7888ABCD}; 
sl@0
   236
    err = ctrl.SetFeature(KNewFeatureUid, ETrue, 0x0);
sl@0
   237
    TEST2(err, KErrNotFound);
sl@0
   238
    //It is impossible to set non-modifiable feature
sl@0
   239
    TBitFlags32 flags = farray2[0].FeatureFlags();
sl@0
   240
    err = ctrl.SetFeature(farray2[0].FeatureUid(), ETrue, 0x0);
sl@0
   241
    TEST2(err, flags.IsSet(EFeatureModifiable) ? KErrNone : KErrAccessDenied);
sl@0
   242
    //Add new feature
sl@0
   243
    flags.ClearAll();
sl@0
   244
    flags.Set(EFeatureSupported);
sl@0
   245
    flags.Set(EFeatureModifiable);
sl@0
   246
    TFeatureEntry fentry(KNewFeatureUid, flags, 0x0);
sl@0
   247
    err = ctrl.AddFeature(fentry);
sl@0
   248
    TEST2(err, KErrNone);
sl@0
   249
    //Retrieve the new feature and check flags
sl@0
   250
    err = ctrl.FeatureSupported(fentry);
sl@0
   251
    TEST2(err, KFeatureSupported);
sl@0
   252
    flags = fentry.FeatureFlags();
sl@0
   253
    TEST(flags.IsSet(EFeatureSupported));
sl@0
   254
    TEST(flags.IsSet(EFeatureModifiable));
sl@0
   255
    //Now, it should be possible to set the new feature - it is modifiable.
sl@0
   256
    err = ctrl.SetFeature(fentry.FeatureUid(), ETrue, 0x0);
sl@0
   257
    TEST2(err, KErrNone);
sl@0
   258
    err = ctrl.SetFeature(fentry.FeatureUid(), EFalse, 0x0);
sl@0
   259
    TEST2(err, KErrNone);
sl@0
   260
    //Enable/disable
sl@0
   261
    err = ctrl.EnableFeature(fentry.FeatureUid());
sl@0
   262
    TEST2(err, KErrNone);
sl@0
   263
    err = ctrl.DisableFeature(fentry.FeatureUid());
sl@0
   264
    TEST2(err, KErrNone);
sl@0
   265
    //Delete the added feature
sl@0
   266
    err = ctrl.DeleteFeature(fentry.FeatureUid());
sl@0
   267
    TEST2(err, KErrNone);
sl@0
   268
    err = ctrl.DeleteFeature(fentry.FeatureUid());
sl@0
   269
    TEST2(err, KErrNotFound);
sl@0
   270
    
sl@0
   271
    /////////////////////////////////////////////////////////////
sl@0
   272
    farray2.Close();
sl@0
   273
    farray.Close();
sl@0
   274
    ctrl.Close();
sl@0
   275
    }
sl@0
   276
sl@0
   277
/** 
sl@0
   278
@SYMTestCaseID          PDS-EFM-CT-4063
sl@0
   279
@SYMTestCaseDesc        
sl@0
   280
@SYMTestPriority        High
sl@0
   281
@SYMTestActions         
sl@0
   282
@SYMTestExpectedResults Test must not fail
sl@0
   283
@SYMDEF                 DEF144262
sl@0
   284
*/
sl@0
   285
void FeatureDiscoveryTest1L()
sl@0
   286
    {
sl@0
   287
    TBool rc = CFeatureDiscovery::IsFeatureSupportedL(KInvalidFeatureId1);
sl@0
   288
    TEST(!rc);
sl@0
   289
    rc = CFeatureDiscovery::IsFeatureSupportedL(SupportedFeature.iUid);
sl@0
   290
    TEST(rc);
sl@0
   291
    
sl@0
   292
    rc = CFeatureDiscovery::IsFeatureSupportedL(KInvalidFeatureUid1);
sl@0
   293
    TEST(!rc);
sl@0
   294
    rc = CFeatureDiscovery::IsFeatureSupportedL(SupportedFeature);
sl@0
   295
    TEST(rc);
sl@0
   296
sl@0
   297
    CFeatureDiscovery* fdiscovery = CFeatureDiscovery::NewLC();
sl@0
   298
    
sl@0
   299
    rc = fdiscovery->IsSupported(KInvalidFeatureId1);
sl@0
   300
    TEST(!rc);
sl@0
   301
    rc = fdiscovery->IsSupported(SupportedFeature.iUid);
sl@0
   302
    TEST(rc);
sl@0
   303
sl@0
   304
    rc = fdiscovery->IsSupported(KInvalidFeatureUid1);
sl@0
   305
    TEST(!rc);
sl@0
   306
    rc = fdiscovery->IsSupported(SupportedFeature);
sl@0
   307
    TEST(rc);
sl@0
   308
    
sl@0
   309
    CleanupStack::PopAndDestroy(fdiscovery);
sl@0
   310
    }
sl@0
   311
sl@0
   312
void DoFeatureDiscoveryTest2L(TBool aStaticMethodsUsed)
sl@0
   313
    {
sl@0
   314
    CFeatureDiscovery* fdiscovery = NULL;
sl@0
   315
    if(!aStaticMethodsUsed)
sl@0
   316
        {
sl@0
   317
        fdiscovery = CFeatureDiscovery::NewL();
sl@0
   318
        }
sl@0
   319
    //////////////////////////////////////////////////////////
sl@0
   320
    //A test with a set: one valid and one invalid feature 
sl@0
   321
    TFeatureSet fset;
sl@0
   322
    TInt err = fset.Append(SupportedFeature);
sl@0
   323
    TEST2(err, KErrNone);
sl@0
   324
    err = fset.Append(KInvalidFeatureUid1);
sl@0
   325
    TEST2(err, KErrNone);
sl@0
   326
    TBool rc = fset.IsFeatureSupported(SupportedFeature);
sl@0
   327
    TEST(!rc);
sl@0
   328
    rc = fset.IsFeatureSupported(KInvalidFeatureUid1);
sl@0
   329
    TEST(!rc);
sl@0
   330
    if(aStaticMethodsUsed)
sl@0
   331
        {
sl@0
   332
        TRAP(err, CFeatureDiscovery::FeaturesSupportedL(fset));
sl@0
   333
        }
sl@0
   334
    else
sl@0
   335
        {
sl@0
   336
        err = fdiscovery->FeaturesSupported(fset);
sl@0
   337
        }
sl@0
   338
    TEST2(err, KErrNone);
sl@0
   339
    rc = fset.IsFeatureSupported(SupportedFeature);
sl@0
   340
    TEST(rc);
sl@0
   341
    rc = fset.IsFeatureSupported(KInvalidFeatureUid1);
sl@0
   342
    TEST(!rc);
sl@0
   343
    rc = fset.AreAllFeaturesSupported();
sl@0
   344
    TEST(!rc);
sl@0
   345
    //////////////////////////////////////////////////////////
sl@0
   346
    //A test with an empty set 
sl@0
   347
    TFeatureSet fset2;
sl@0
   348
    rc = fset2.IsFeatureSupported(SupportedFeature);
sl@0
   349
    TEST(!rc);
sl@0
   350
    rc = fset2.IsFeatureSupported(KInvalidFeatureUid1);
sl@0
   351
    TEST(!rc);
sl@0
   352
    if(aStaticMethodsUsed)
sl@0
   353
        {
sl@0
   354
        TRAP(err, CFeatureDiscovery::FeaturesSupportedL(fset2));
sl@0
   355
        }
sl@0
   356
    else
sl@0
   357
        {
sl@0
   358
        err = fdiscovery->FeaturesSupported(fset2);
sl@0
   359
        }
sl@0
   360
    TEST2(err, KErrArgument);
sl@0
   361
    rc = fset2.IsFeatureSupported(SupportedFeature);
sl@0
   362
    TEST(!rc);
sl@0
   363
    rc = fset2.IsFeatureSupported(KInvalidFeatureUid1);
sl@0
   364
    TEST(!rc);
sl@0
   365
    rc = fset2.AreAllFeaturesSupported();
sl@0
   366
    TEST(rc);//because fset2 is empty
sl@0
   367
    //////////////////////////////////////////////////////////
sl@0
   368
    //A test with a set: two valid features 
sl@0
   369
    TFeatureSet fset3;
sl@0
   370
    err = fset3.Append(SupportedFeature);
sl@0
   371
    TEST2(err, KErrNone);
sl@0
   372
    err = fset3.Append(SupportedFeature2);
sl@0
   373
    TEST2(err, KErrNone);
sl@0
   374
    if(aStaticMethodsUsed)
sl@0
   375
        {
sl@0
   376
        TRAP(err, CFeatureDiscovery::FeaturesSupportedL(fset3));
sl@0
   377
        }
sl@0
   378
    else
sl@0
   379
        {
sl@0
   380
        err = fdiscovery->FeaturesSupported(fset3);
sl@0
   381
        }
sl@0
   382
    TEST2(err, KErrNone);
sl@0
   383
    rc = fset3.IsFeatureSupported(SupportedFeature);
sl@0
   384
    TEST(rc);
sl@0
   385
    rc = fset3.IsFeatureSupported(SupportedFeature2);
sl@0
   386
    TEST(rc);
sl@0
   387
    rc = fset3.AreAllFeaturesSupported();
sl@0
   388
    TEST(rc);
sl@0
   389
    //////////////////////////////////////////////////////////
sl@0
   390
    delete fdiscovery;
sl@0
   391
   }
sl@0
   392
sl@0
   393
/** 
sl@0
   394
@SYMTestCaseID          PDS-EFM-CT-4064
sl@0
   395
@SYMTestCaseDesc        
sl@0
   396
@SYMTestPriority        High
sl@0
   397
@SYMTestActions         
sl@0
   398
@SYMTestExpectedResults Test must not fail
sl@0
   399
@SYMDEF                 DEF144262
sl@0
   400
*/
sl@0
   401
void FeatureDiscoveryTest2L()
sl@0
   402
    {
sl@0
   403
    DoFeatureDiscoveryTest2L(ETrue);
sl@0
   404
    DoFeatureDiscoveryTest2L(EFalse);
sl@0
   405
    }
sl@0
   406
sl@0
   407
void FeatureTestPreparation()
sl@0
   408
    {
sl@0
   409
    RFeatureControl ctrl;
sl@0
   410
    TInt err = ctrl.Open();
sl@0
   411
    TEST2(err, KErrNone);
sl@0
   412
    /////////////////////////////////////////////////////////////
sl@0
   413
    RFeatureUidArray farray;
sl@0
   414
    TheTest.Printf(_L("Getting supported feature for CFeatureDiscovery test\r\n"));
sl@0
   415
    err = ctrl.ListSupportedFeatures(farray);
sl@0
   416
    if (err == KErrNone && farray.Count() > 1)
sl@0
   417
        {
sl@0
   418
        SupportedFeature = farray[0]; //Take the first supported value
sl@0
   419
        SupportedFeature2 = farray[1]; //Take the first supported value
sl@0
   420
        }
sl@0
   421
    else
sl@0
   422
        {
sl@0
   423
        TheTest.Printf(_L("Warning: Failed to get supported feature for testing. CFeatureDiscovery tests are going to fail\r\n"));
sl@0
   424
        }
sl@0
   425
    farray.Close();
sl@0
   426
    ctrl.Close();
sl@0
   427
    }
sl@0
   428
sl@0
   429
void DoTestsL()
sl@0
   430
    {
sl@0
   431
    FeatureTestPreparation(); //Preparation for the test.
sl@0
   432
    TheTest.Start(_L("@SYMTestCaseID:PDS-EFM-CT-4059 FeatureManager::FeatureSupported() test"));
sl@0
   433
    FeatureSupportedTestL();
sl@0
   434
    TheTest.Next(_L("@SYMTestCaseID:PDS-EFM-CT-4060 RFeatureControl tests-1"));
sl@0
   435
    FeatureControlTest1();
sl@0
   436
    TheTest.Next(_L("@SYMTestCaseID:PDS-EFM-CT-4061 RFeatureControl tests-2"));
sl@0
   437
    FeatureControlTest2();
sl@0
   438
    TheTest.Next(_L("@SYMTestCaseID:PDS-EFM-CT-4062 RFeatureControl tests-3"));
sl@0
   439
    FeatureControlTest3();
sl@0
   440
    TheTest.Next(_L("@SYMTestCaseID:PDS-EFM-CT-4063 CFeatureDiscovery tests-1"));
sl@0
   441
    FeatureDiscoveryTest1L();
sl@0
   442
    TheTest.Next(_L("@SYMTestCaseID:PDS-EFM-CT-4064 CFeatureDiscovery & TFeatureSet tests"));
sl@0
   443
    FeatureDiscoveryTest2L();
sl@0
   444
    }
sl@0
   445
sl@0
   446
TInt E32Main()
sl@0
   447
    {
sl@0
   448
    TheTest.Title();
sl@0
   449
    
sl@0
   450
    CTrapCleanup* tc = CTrapCleanup::New();
sl@0
   451
    TheTest(tc != NULL);
sl@0
   452
    
sl@0
   453
    __UHEAP_MARK;
sl@0
   454
    
sl@0
   455
    TRAPD(err, DoTestsL());
sl@0
   456
    DestroyTestEnv();
sl@0
   457
    TEST2(err, KErrNone);
sl@0
   458
sl@0
   459
    __UHEAP_MARKEND;
sl@0
   460
    
sl@0
   461
    TheTest.End();
sl@0
   462
    TheTest.Close();
sl@0
   463
    
sl@0
   464
    delete tc;
sl@0
   465
sl@0
   466
    User::Heap().Check();
sl@0
   467
    return KErrNone;
sl@0
   468
    }