commsfwtools/preparedefaultcommsdatabase/te_commsdat/src/commsdatAttributeTests.cpp
changeset 0 dfb7c4ff071f
equal deleted inserted replaced
-1:000000000000 0:dfb7c4ff071f
       
     1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // CCommsdatInitAttributes
       
    15 // CCommsdat130Step
       
    16 // CCommsdat131Step
       
    17 // CCommsdat132Step
       
    18 // CCommsdat133Step
       
    19 // CCommsdat134Step
       
    20 // CCommsdat135Step
       
    21 // CCommsdat136Step
       
    22 // CCommsdat137Step
       
    23 // CCommsdat138Step
       
    24 // CCommsdat139Step
       
    25 // CCommsdat140Step
       
    26 // CCommsdat141Step
       
    27 // CCommsdat142Step
       
    28 // 
       
    29 //
       
    30 
       
    31 /**
       
    32  @file commsdatAttributeTests.cpp
       
    33 */
       
    34 #include "commsdatAttributeTests.h"
       
    35 #include "Te_commsdatSuiteDefs.h"
       
    36 #include <e32test.h>
       
    37  
       
    38 const TInt KNetworkWeighting = 125;
       
    39 //----------------------------------------------------------------------------------------------------------------
       
    40 CCommsdatInitAttributes::CCommsdatInitAttributes()
       
    41 /**
       
    42  * Constructor
       
    43  */
       
    44 	{
       
    45 	SetTestStepName(KCommsdatInitAttributes);                                                                                           
       
    46 	}
       
    47 
       
    48 TVerdict CCommsdatInitAttributes::doTestStepL()
       
    49 /**
       
    50  * @return - TVerdict code
       
    51  * This test step actually does not test anything at all.As there is no way to set attributes
       
    52  * with CED for the time being; this step creates the necessary records for the test steps in 
       
    53  * this section. THIS TEST STEP SHOULD BE RUN BEFORE RUNNING ANY TEST STEPS IN THIS SECTION
       
    54  */
       
    55 	{
       
    56     SetTestStepResult(EFail);	
       
    57 	INFO_PRINTF1(_L("THIS TEST STEP SHOULD BE RUN BEFORE RUNNING ANY TEST STEPS IN THIS SECTION"));
       
    58 	
       
    59 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
    60 	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_2);
       
    61 #else
       
    62  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_1);
       
    63 #endif
       
    64 	 
       
    65 	CleanupStack::PushL(cmdbSession); 
       
    66 	
       
    67 	// Enable ECDNoWriteButDelete on session
       
    68 	cmdbSession->SetAttributeMask(ECDNoWriteButDelete);
       
    69 
       
    70 	//
       
    71 	// Necessary for test step 130
       
    72 	CCDIAPRecord *record = static_cast<CCDIAPRecord*>(CCDRecordBase::RecordFactoryL(KCDTIdIAPRecord));
       
    73 	CleanupStack::PushL(record);
       
    74 
       
    75 	record->SetRecordId(1);
       
    76 	record->iNetworkWeighting = KNetworkWeighting;
       
    77 	record->SetAttributes(ECDNoWriteButDelete);
       
    78 	record->StoreL(*cmdbSession);
       
    79 	
       
    80 	CleanupStack::PopAndDestroy(record);
       
    81 	
       
    82     //
       
    83 	// Necessary for test step 131
       
    84     record = static_cast<CCDIAPRecord*>(CCDRecordBase::RecordFactoryL(KCDTIdIAPRecord));
       
    85 	CleanupStack::PushL(record);
       
    86 	
       
    87 	record->SetRecordId(2);
       
    88 	record->iNetworkWeighting = KNetworkWeighting;
       
    89 	record->SetAttributes(ECDNoWriteButDelete);
       
    90 	record->StoreL(*cmdbSession);
       
    91     
       
    92     CleanupStack::PopAndDestroy(record);
       
    93     
       
    94     //
       
    95 	// Necessary for test step 132
       
    96     record = static_cast<CCDIAPRecord*>(CCDRecordBase::RecordFactoryL(KCDTIdIAPRecord));
       
    97 	CleanupStack::PushL(record);
       
    98 	
       
    99 	record->SetRecordId(3);
       
   100 	record->iNetworkWeighting = KNetworkWeighting;
       
   101 	record->SetAttributes(ECDNoWriteButDelete);
       
   102 	record->StoreL(*cmdbSession);
       
   103     
       
   104     CleanupStack::PopAndDestroy(record);
       
   105     
       
   106     //
       
   107 	// Necessary for test step 133
       
   108     record = static_cast<CCDIAPRecord*>(CCDRecordBase::RecordFactoryL(KCDTIdIAPRecord));
       
   109 	CleanupStack::PushL(record);
       
   110 	
       
   111 	record->SetRecordId(4);
       
   112 	record->iNetworkWeighting = KNetworkWeighting;
       
   113 	record->SetAttributes(ECDNoWriteButDelete);
       
   114 	record->StoreL(*cmdbSession);
       
   115     
       
   116     CleanupStack::PopAndDestroy(record);
       
   117     
       
   118     // Disable ECDNoWriteButDelete on session
       
   119 	cmdbSession->ClearAttributeMask(ECDNoWriteButDelete);
       
   120 	
       
   121 	// Enable ECDHidden on session
       
   122 	cmdbSession->SetAttributeMask(ECDHidden);
       
   123 
       
   124     //
       
   125 	// Necessary for test step 134
       
   126     record = static_cast<CCDIAPRecord*>(CCDRecordBase::RecordFactoryL(KCDTIdIAPRecord));
       
   127 	CleanupStack::PushL(record);
       
   128 	
       
   129 	record->SetRecordId(5);
       
   130 	record->iNetworkWeighting = KNetworkWeighting+1;
       
   131 	record->SetAttributes(ECDHidden);
       
   132 	record->StoreL(*cmdbSession);
       
   133 	
       
   134 	CleanupStack::PopAndDestroy(record);
       
   135 	
       
   136 	//
       
   137 	// Necessary for test step 135
       
   138     record = static_cast<CCDIAPRecord*>(CCDRecordBase::RecordFactoryL(KCDTIdIAPRecord));
       
   139 	CleanupStack::PushL(record);
       
   140 	
       
   141 	record->SetRecordId(6);
       
   142 	record->iNetworkWeighting = KNetworkWeighting+2;
       
   143 	record->SetAttributes(ECDHidden);
       
   144 	record->StoreL(*cmdbSession);
       
   145 	
       
   146 	CleanupStack::PopAndDestroy(record);
       
   147 	
       
   148 	//
       
   149 	// Necessary for test step 136
       
   150     record = static_cast<CCDIAPRecord*>(CCDRecordBase::RecordFactoryL(KCDTIdIAPRecord));
       
   151 	CleanupStack::PushL(record);
       
   152 	
       
   153 	record->SetRecordId(7);
       
   154 	record->iNetworkWeighting = KNetworkWeighting+3;
       
   155 	record->SetAttributes(ECDHidden);
       
   156 	record->StoreL(*cmdbSession);
       
   157 	
       
   158 	CleanupStack::PopAndDestroy(record);
       
   159 	
       
   160 	//
       
   161 	// Necessary for test step 137
       
   162     record = static_cast<CCDIAPRecord*>(CCDRecordBase::RecordFactoryL(KCDTIdIAPRecord));
       
   163 	CleanupStack::PushL(record);
       
   164 	
       
   165 	record->SetRecordId(8);
       
   166 	record->iNetworkWeighting = KNetworkWeighting+4;
       
   167 	record->SetAttributes(ECDHidden);
       
   168 	record->StoreL(*cmdbSession);
       
   169 	
       
   170 	CleanupStack::PopAndDestroy(record);
       
   171 	
       
   172 	// Disable ECDHidden on session	
       
   173 	cmdbSession->ClearAttributeMask(ECDHidden);
       
   174 	
       
   175 	// Enable ECDPrivate on session
       
   176 	cmdbSession->SetAttributeMask(ECDPrivate);
       
   177 	
       
   178 	//
       
   179 	// Necessary for test step 138
       
   180     record = static_cast<CCDIAPRecord*>(CCDRecordBase::RecordFactoryL(KCDTIdIAPRecord));
       
   181 	CleanupStack::PushL(record);
       
   182 	
       
   183 	record->SetRecordId(9);
       
   184 	record->iNetworkWeighting = KNetworkWeighting;
       
   185 	record->SetAttributes(ECDPrivate);
       
   186 	record->StoreL(*cmdbSession);
       
   187 	
       
   188 	CleanupStack::PopAndDestroy(record);
       
   189 	
       
   190 	//
       
   191 	// Necessary for test step 139
       
   192     record = static_cast<CCDIAPRecord*>(CCDRecordBase::RecordFactoryL(KCDTIdIAPRecord));
       
   193 	CleanupStack::PushL(record);
       
   194 	
       
   195 	record->SetRecordId(10);
       
   196 	record->iNetworkWeighting = KNetworkWeighting;
       
   197 	record->SetAttributes(ECDPrivate);
       
   198 	record->StoreL(*cmdbSession);
       
   199 	
       
   200 	CleanupStack::PopAndDestroy(record);
       
   201 	
       
   202 	// Disable ECDPrivate on session
       
   203 	cmdbSession->ClearAttributeMask(ECDPrivate);
       
   204 
       
   205 	// Enable ECDProtectedWrite on session
       
   206 	cmdbSession->SetAttributeMask(ECDProtectedWrite);
       
   207 	//
       
   208 	// Necessary for test step 140
       
   209     record = static_cast<CCDIAPRecord*>(CCDRecordBase::RecordFactoryL(KCDTIdIAPRecord));
       
   210 	CleanupStack::PushL(record);
       
   211 	
       
   212 	record->SetRecordId(11);
       
   213 	record->iNetworkWeighting = KNetworkWeighting;
       
   214 	record->SetAttributes(ECDProtectedWrite);
       
   215 	record->StoreL(*cmdbSession);
       
   216 	
       
   217 	CleanupStack::PopAndDestroy(record);
       
   218 	
       
   219 	//
       
   220 	// Necessary for test step 141
       
   221     record = static_cast<CCDIAPRecord*>(CCDRecordBase::RecordFactoryL(KCDTIdIAPRecord));
       
   222 	CleanupStack::PushL(record);
       
   223 	
       
   224 	record->SetRecordId(12);
       
   225 	record->iNetworkWeighting = KNetworkWeighting;
       
   226 	record->SetAttributes(ECDProtectedWrite);
       
   227 	record->StoreL(*cmdbSession);
       
   228 	
       
   229 	CleanupStack::PopAndDestroy(record);
       
   230 
       
   231 	//
       
   232 	// Necessary for test step 142
       
   233     record = static_cast<CCDIAPRecord*>(CCDRecordBase::RecordFactoryL(KCDTIdIAPRecord));
       
   234 	CleanupStack::PushL(record);
       
   235 	
       
   236 	record->SetRecordId(13);
       
   237 	record->iNetworkWeighting = KNetworkWeighting;
       
   238 	record->SetAttributes(ECDProtectedWrite);
       
   239 	record->StoreL(*cmdbSession);
       
   240 
       
   241 	// Disable ECDProtectedWrite on session
       
   242 	cmdbSession->ClearAttributeMask(ECDProtectedWrite);
       
   243 	
       
   244 	CleanupStack::PopAndDestroy(record);
       
   245 	
       
   246     CleanupStack::PopAndDestroy(cmdbSession);
       
   247 	SetTestStepResult(EPass);
       
   248 	return TestStepResult();
       
   249 	}
       
   250 
       
   251 //----------------------------------------------------------------------------------------------------------------
       
   252 CCommsdat130Step::CCommsdat130Step()
       
   253 /**
       
   254  * Constructor
       
   255  */
       
   256 	{
       
   257 	SetTestStepName(KCommsdat130Step);                                                                                           
       
   258 	}
       
   259 
       
   260 
       
   261 TVerdict CCommsdat130Step::doTestStepL()
       
   262 /**
       
   263  * @return - TVerdict code
       
   264  * Test effects of ECDNoWriteButDelete with ModifyL
       
   265  */
       
   266 	{
       
   267     SetTestStepResult(EFail);
       
   268     INFO_PRINTF1(_L("========================================================================================"));
       
   269     INFO_PRINTF1(_L("WARNING:CCommsdatInitAttributes::doTestStepL() MUST be run successfully before this test"));
       
   270     INFO_PRINTF1(_L("========================================================================================"));
       
   271     
       
   272 	INFO_PRINTF1(_L("Testing ECDNoWriteButDelete functionality in CCommsdat130Step::doTestStepL() "));
       
   273 	 
       
   274 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
   275 	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_2);
       
   276 #else
       
   277  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_1);
       
   278 #endif
       
   279  	
       
   280 	CleanupStack::PushL(cmdbSession); 
       
   281 	
       
   282 	CCDIAPRecord *record = static_cast<CCDIAPRecord*>(CCDRecordBase::RecordFactoryL(KCDTIdIAPRecord));
       
   283 	CleanupStack::PushL(record);
       
   284 	
       
   285 	record->SetRecordId(1); // See CCommsdatInitAttributes::doTestStepL()
       
   286 	record->LoadL(*cmdbSession);
       
   287 	TInt oldNw = record->iNetworkWeighting;
       
   288 	record->iNetworkWeighting = 25;
       
   289 	TRAPD(modifyErr, record->ModifyL(*cmdbSession)); //Must return KErrAccessDenied
       
   290 	record->LoadL(*cmdbSession);
       
   291 	
       
   292 	if(modifyErr==KErrAccessDenied && oldNw == record->iNetworkWeighting)
       
   293 		{
       
   294 		SetTestStepResult(EPass);
       
   295 		}
       
   296 	else
       
   297 		{
       
   298 		INFO_PRINTF2(_L("Modify returned : %d should be -21"), modifyErr);
       
   299 		}
       
   300 	
       
   301 	CleanupStack::PopAndDestroy(record);
       
   302     CleanupStack::PopAndDestroy(cmdbSession);
       
   303 	
       
   304 	return TestStepResult();
       
   305 	}
       
   306 //----------------------------------------------------------------------------------------------------------------
       
   307 CCommsdat131Step::CCommsdat131Step()
       
   308 /**
       
   309  * Constructor
       
   310  */
       
   311 	{
       
   312 	SetTestStepName(KCommsdat131Step);                                                                                           
       
   313 	}
       
   314 
       
   315 TVerdict CCommsdat131Step::doTestStepL()
       
   316 /**
       
   317  * @return - TVerdict code
       
   318  * Test effects of ECDNoWriteButDelete with ModifyL on single field
       
   319  */
       
   320 	{
       
   321     SetTestStepResult(EFail);
       
   322     INFO_PRINTF1(_L("========================================================================================"));
       
   323     INFO_PRINTF1(_L("WARNING:CCommsdatInitAttributes::doTestStepL() MUST be run successfully before this test"));
       
   324     INFO_PRINTF1(_L("========================================================================================"));
       
   325     	
       
   326 	INFO_PRINTF1(_L("Testing ECDHidden functionality in CCommsdat131Step::doTestStepL() "));
       
   327 	
       
   328 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
   329 	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_2);
       
   330 #else
       
   331  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_1);
       
   332 #endif
       
   333 	CleanupStack::PushL(cmdbSession); 
       
   334 	
       
   335 	CCDIAPRecord *record = static_cast<CCDIAPRecord*>(CCDRecordBase::RecordFactoryL(KCDTIdIAPRecord));
       
   336 	CleanupStack::PushL(record);
       
   337 	
       
   338 	record->SetRecordId(2); // See CCommsdatInitAttributes::doTestStepL()
       
   339 	record->LoadL(*cmdbSession);
       
   340 	TInt oldNw = record->iNetworkWeighting;
       
   341 	record->iNetworkWeighting = 25;
       
   342 	
       
   343 	TRAPD(modifyErr, record->iNetworkWeighting.ModifyL(*cmdbSession)); //Must return KErrAccessDenied
       
   344 	record->LoadL(*cmdbSession);
       
   345 	
       
   346 	if(modifyErr==KErrAccessDenied && oldNw == record->iNetworkWeighting)
       
   347 		{
       
   348 		SetTestStepResult(EPass);
       
   349 		}
       
   350 	else
       
   351 		{
       
   352 		INFO_PRINTF2(_L("Modify returned : %d should be -21"), modifyErr);
       
   353 		}
       
   354 	
       
   355 	CleanupStack::PopAndDestroy(record);
       
   356     CleanupStack::PopAndDestroy(cmdbSession);
       
   357 	
       
   358 	return TestStepResult();
       
   359 	}
       
   360 
       
   361 //----------------------------------------------------------------------------------------------------------------
       
   362 CCommsdat132Step::CCommsdat132Step()
       
   363 /**
       
   364  * Constructor
       
   365  */
       
   366 	{
       
   367 	SetTestStepName(KCommsdat132Step);                                                                                           
       
   368 	}
       
   369 
       
   370 TVerdict CCommsdat132Step::doTestStepL()
       
   371 /**
       
   372  * @return - TVerdict code
       
   373  * Test effects of ECDNoWriteButDelete with DeleteL
       
   374  */
       
   375 	{
       
   376     SetTestStepResult(EFail);
       
   377     INFO_PRINTF1(_L("========================================================================================"));
       
   378     INFO_PRINTF1(_L("WARNING:CCommsdatInitAttributes::doTestStepL() MUST be run successfully before this test"));
       
   379     INFO_PRINTF1(_L("========================================================================================"));
       
   380     	
       
   381 	INFO_PRINTF1(_L("Testing ECDNoWriteButDelete functionality in CCommsdat132Step::doTestStepL() "));
       
   382 	
       
   383 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
   384 	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_2);
       
   385 #else
       
   386  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_1);
       
   387 #endif
       
   388  	
       
   389 	CleanupStack::PushL(cmdbSession); 
       
   390 	
       
   391 	CCDIAPRecord *record = static_cast<CCDIAPRecord*>(CCDRecordBase::RecordFactoryL(KCDTIdIAPRecord));
       
   392 	CleanupStack::PushL(record);
       
   393 	
       
   394 	record->SetRecordId(3); // See CCommsdatInitAttributes::doTestStepL()
       
   395 	record->LoadL(*cmdbSession);
       
   396 	TRAPD(deleteErr, record->DeleteL(*cmdbSession));
       
   397 	
       
   398 	if(deleteErr == KErrNone)
       
   399 		{
       
   400 		SetTestStepResult(EPass);
       
   401 		}
       
   402 	
       
   403 	CleanupStack::PopAndDestroy(record);
       
   404     CleanupStack::PopAndDestroy(cmdbSession);
       
   405 	
       
   406 	return TestStepResult();
       
   407 	}
       
   408 
       
   409 //----------------------------------------------------------------------------------------------------------------
       
   410 CCommsdat133Step::CCommsdat133Step()
       
   411 /**
       
   412  * Constructor
       
   413  */
       
   414 	{
       
   415 	SetTestStepName(KCommsdat133Step);                                                                                           
       
   416 	}
       
   417 TVerdict CCommsdat133Step::doTestStepL()
       
   418 /**
       
   419  * @return - TVerdict code
       
   420  * Test effects of ECDNoWriteButDelete with DeleteL on a single field
       
   421  */
       
   422 	{
       
   423     SetTestStepResult(EFail);
       
   424     INFO_PRINTF1(_L("========================================================================================"));
       
   425     INFO_PRINTF1(_L("WARNING:CCommsdatInitAttributes::doTestStepL() MUST be run successfully before this test"));
       
   426     INFO_PRINTF1(_L("========================================================================================"));
       
   427     	
       
   428 	INFO_PRINTF1(_L("Testing ECDNoWriteButDelete functionality in CCommsdat133Step::doTestStepL() "));
       
   429 	
       
   430 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
   431 	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_2);
       
   432 #else
       
   433  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_1);
       
   434 #endif
       
   435  	
       
   436 	CleanupStack::PushL(cmdbSession); 
       
   437 	
       
   438 	CCDIAPRecord *record = static_cast<CCDIAPRecord*>(CCDRecordBase::RecordFactoryL(KCDTIdIAPRecord));
       
   439 	CleanupStack::PushL(record);
       
   440 	
       
   441 	record->SetRecordId(4); // See CCommsdatInitAttributes::doTestStepL()
       
   442 	record->LoadL(*cmdbSession);
       
   443 	TRAPD(deleteErr, record->iNetworkWeighting.DeleteL(*cmdbSession));
       
   444 	
       
   445 	if(deleteErr == KErrNone)
       
   446 		{
       
   447 		SetTestStepResult(EPass);
       
   448 		}
       
   449 	
       
   450 	CleanupStack::PopAndDestroy(record);
       
   451     CleanupStack::PopAndDestroy(cmdbSession);
       
   452 	
       
   453 	return TestStepResult();
       
   454 	}
       
   455 
       
   456 //----------------------------------------------------------------------------------------------------------------
       
   457 CCommsdat134Step::CCommsdat134Step()
       
   458 /**
       
   459  * Constructor
       
   460  */
       
   461 	{
       
   462 	SetTestStepName(KCommsdat134Step);                                                                                           
       
   463 	}
       
   464 
       
   465 TVerdict CCommsdat134Step::doTestStepL()
       
   466 /**
       
   467  * @return - TVerdict code
       
   468  * Test effects of ECDHidden with FindL
       
   469  */
       
   470 	{
       
   471     SetTestStepResult(EFail);
       
   472     INFO_PRINTF1(_L("========================================================================================"));
       
   473     INFO_PRINTF1(_L("WARNING:CCommsdatInitAttributes::doTestStepL() MUST be run successfully before this test"));
       
   474     INFO_PRINTF1(_L("========================================================================================"));
       
   475     	
       
   476 	INFO_PRINTF1(_L("Testing ECDHidden functionality in CCommsdat134Step::doTestStepL() "));
       
   477 	
       
   478 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
   479 	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_2);
       
   480 #else
       
   481  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_1);
       
   482 #endif
       
   483  	
       
   484 	CleanupStack::PushL(cmdbSession); 
       
   485 	
       
   486 	CCDIAPRecord *record = static_cast<CCDIAPRecord*>(CCDRecordBase::RecordFactoryL(KCDTIdIAPRecord));
       
   487 	CleanupStack::PushL(record);
       
   488 	
       
   489 	record->iNetworkWeighting = KNetworkWeighting+1;
       
   490 		
       
   491 	if(!record->FindL(*cmdbSession))
       
   492 		{
       
   493 		SetTestStepResult(EPass);
       
   494 		}
       
   495 	
       
   496 	CleanupStack::PopAndDestroy(record);
       
   497     CleanupStack::PopAndDestroy(cmdbSession);
       
   498 	
       
   499 	return TestStepResult();
       
   500 	}
       
   501 //----------------------------------------------------------------------------------------------------------------
       
   502 CCommsdat135Step::CCommsdat135Step()
       
   503 /**
       
   504  * Constructor
       
   505  */
       
   506 	{
       
   507 	SetTestStepName(KCommsdat135Step);                                                                                           
       
   508 	}
       
   509 
       
   510 TVerdict CCommsdat135Step::doTestStepL()
       
   511 /**
       
   512  * @return - TVerdict code
       
   513  * Test effects of ECDHidden with FindL
       
   514  */
       
   515 	{
       
   516     SetTestStepResult(EFail);
       
   517     INFO_PRINTF1(_L("========================================================================================"));
       
   518     INFO_PRINTF1(_L("WARNING:CCommsdatInitAttributes::doTestStepL() MUST be run successfully before this test"));
       
   519     INFO_PRINTF1(_L("========================================================================================"));
       
   520     	
       
   521 	INFO_PRINTF1(_L("Testing ECDHidden functionality in CCommsdat135Step::doTestStepL() "));
       
   522 	
       
   523 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
   524 	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_2);
       
   525 #else
       
   526  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_1);
       
   527 #endif
       
   528 	CleanupStack::PushL(cmdbSession); 
       
   529 	
       
   530 	CCDIAPRecord *record = static_cast<CCDIAPRecord*>(CCDRecordBase::RecordFactoryL(KCDTIdIAPRecord));
       
   531 	CleanupStack::PushL(record);
       
   532 
       
   533 	record->iNetworkWeighting = KNetworkWeighting+2;
       
   534 	cmdbSession->SetAttributeMask(ECDHidden);
       
   535 	
       
   536 	if(record->FindL(*cmdbSession))
       
   537 		{
       
   538 		SetTestStepResult(EPass);
       
   539 		}
       
   540 	
       
   541 	CleanupStack::PopAndDestroy(record);
       
   542     CleanupStack::PopAndDestroy(cmdbSession);
       
   543 	
       
   544 	return TestStepResult();
       
   545 	}
       
   546 //----------------------------------------------------------------------------------------------------------------
       
   547 CCommsdat136Step::CCommsdat136Step()
       
   548 /**
       
   549  * Constructor
       
   550  */
       
   551 	{
       
   552 	SetTestStepName(KCommsdat136Step);                                                                                           
       
   553 	}
       
   554 
       
   555 TVerdict CCommsdat136Step::doTestStepL()
       
   556 /**
       
   557  * @return - TVerdict code
       
   558  * Test effects of ECDHidden with LoadL
       
   559  */
       
   560 	{
       
   561     SetTestStepResult(EFail);
       
   562     INFO_PRINTF1(_L("========================================================================================"));
       
   563     INFO_PRINTF1(_L("WARNING:CCommsdatInitAttributes::doTestStepL() MUST be run successfully before this test"));
       
   564     INFO_PRINTF1(_L("========================================================================================"));
       
   565     	
       
   566 	INFO_PRINTF1(_L("Testing ECDHidden functionality in CCommsdat136Step::doTestStepL() "));
       
   567 	
       
   568 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
   569 	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_2);
       
   570 #else
       
   571  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_1);
       
   572 #endif
       
   573  	
       
   574 	CleanupStack::PushL(cmdbSession); 
       
   575 	
       
   576 	CCDIAPRecord *record = static_cast<CCDIAPRecord*>(CCDRecordBase::RecordFactoryL(KCDTIdIAPRecord));
       
   577 	CleanupStack::PushL(record);
       
   578 	
       
   579 	record->SetRecordId(7); // See CCommsdatInitAttributes::doTestStepL()
       
   580 	cmdbSession->SetAttributeMask(ECDHidden);
       
   581 	TRAPD(loadErr, record->LoadL(*cmdbSession));
       
   582 	
       
   583 	if(loadErr == KErrNone )
       
   584 		{
       
   585 		SetTestStepResult(EPass);
       
   586 		}
       
   587 	
       
   588 	CleanupStack::PopAndDestroy(record);
       
   589     CleanupStack::PopAndDestroy(cmdbSession);
       
   590 	
       
   591 	return TestStepResult();
       
   592 	}
       
   593 //----------------------------------------------------------------------------------------------------------------
       
   594 CCommsdat137Step::CCommsdat137Step()
       
   595 /**
       
   596  * Constructor
       
   597  */
       
   598 	{
       
   599 	SetTestStepName(KCommsdat137Step);                                                                                           
       
   600 	}
       
   601 
       
   602 TVerdict CCommsdat137Step::doTestStepL()
       
   603 /**
       
   604  * @return - TVerdict code
       
   605  * Test effects of ECDHidden with ModifyL
       
   606  */
       
   607 	{
       
   608     SetTestStepResult(EFail);
       
   609     INFO_PRINTF1(_L("========================================================================================"));
       
   610     INFO_PRINTF1(_L("WARNING:CCommsdatInitAttributes::doTestStepL() MUST be run successfully before this test"));
       
   611     INFO_PRINTF1(_L("========================================================================================"));
       
   612     	
       
   613 	INFO_PRINTF1(_L("Testing ECDHidden functionality in CCommsdat137Step::doTestStepL() "));
       
   614 	
       
   615 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
   616 	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_2);
       
   617 #else
       
   618  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_1);
       
   619 #endif
       
   620  	
       
   621 	CleanupStack::PushL(cmdbSession); 
       
   622 	
       
   623 	CCDIAPRecord *record = static_cast<CCDIAPRecord*>(CCDRecordBase::RecordFactoryL(KCDTIdIAPRecord));
       
   624 	CleanupStack::PushL(record);
       
   625 	
       
   626 	record->SetRecordId(8); // See CCommsdatInitAttributes::doTestStepL()
       
   627 	cmdbSession->SetAttributeMask(ECDHidden);
       
   628 	TRAPD(loadErr, record->LoadL(*cmdbSession));
       
   629 	record->iNetworkWeighting = KNetworkWeighting + 100; // just a new iNetworkWeighting value
       
   630 	TRAPD(modifyErr, record->ModifyL(*cmdbSession));
       
   631 	
       
   632 	if(loadErr == KErrNone && modifyErr == KErrNone)
       
   633 		{
       
   634 		SetTestStepResult(EPass);
       
   635 		}
       
   636 	
       
   637 	CleanupStack::PopAndDestroy(record);
       
   638     CleanupStack::PopAndDestroy(cmdbSession);
       
   639     
       
   640    	return TestStepResult();
       
   641 	}
       
   642 
       
   643 //----------------------------------------------------------------------------------------------------------------
       
   644 CCommsdat138Step::CCommsdat138Step()
       
   645 /**
       
   646  * Constructor
       
   647  */
       
   648 	{
       
   649 	SetTestStepName(KCommsdat138Step);                                                                                           
       
   650 	}
       
   651 
       
   652 TVerdict CCommsdat138Step::doTestStepL()
       
   653 /**
       
   654  * @return - TVerdict code
       
   655  * Test effects of ECDPrivate with LoadL
       
   656  */
       
   657 	{
       
   658     SetTestStepResult(EFail);
       
   659     INFO_PRINTF1(_L("========================================================================================"));
       
   660     INFO_PRINTF1(_L("WARNING:CCommsdatInitAttributes::doTestStepL() MUST be run successfully before this test"));
       
   661     INFO_PRINTF1(_L("========================================================================================"));
       
   662     	
       
   663 	INFO_PRINTF1(_L("Testing ECDPrivate functionality in CCommsdat138Step::doTestStepL() "));
       
   664 		
       
   665 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
   666 	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_2);
       
   667 #else
       
   668  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_1);
       
   669 #endif
       
   670  	
       
   671 	CleanupStack::PushL(cmdbSession); 
       
   672 	
       
   673 	CCDIAPRecord *record = static_cast<CCDIAPRecord*>(CCDRecordBase::RecordFactoryL(KCDTIdIAPRecord));
       
   674 	CleanupStack::PushL(record);
       
   675 	
       
   676 	record->SetRecordId(9); // See CCommsdatInitAttributes::doTestStepL()
       
   677 	cmdbSession->SetAttributeMask(ECDPrivate);
       
   678 	TRAPD(loadErr, record->LoadL(*cmdbSession));
       
   679 	
       
   680 	if(loadErr == KErrNone)
       
   681 		{
       
   682 		SetTestStepResult(EPass);
       
   683 		}
       
   684 	
       
   685 	CleanupStack::PopAndDestroy(record);
       
   686     CleanupStack::PopAndDestroy(cmdbSession);
       
   687 
       
   688 	
       
   689 	return TestStepResult();
       
   690 	}
       
   691 //----------------------------------------------------------------------------------------------------------------
       
   692 CCommsdat139Step::CCommsdat139Step()
       
   693 /**
       
   694  * Constructor
       
   695  */
       
   696 	{
       
   697 	SetTestStepName(KCommsdat139Step);                                                                                           
       
   698 	}
       
   699 
       
   700 TVerdict CCommsdat139Step::doTestStepL()
       
   701 /**
       
   702  * @return - TVerdict code
       
   703  * Test effects of ECDPrivate with LoadL
       
   704  */
       
   705 	{
       
   706     SetTestStepResult(EFail);	
       
   707 	INFO_PRINTF1(_L("Testing ECDPrivate functionality in CCommsdat139Step::doTestStepL() "));
       
   708 	
       
   709 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
   710 	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_2);
       
   711 #else
       
   712  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_1);
       
   713 #endif
       
   714  	
       
   715 	CleanupStack::PushL(cmdbSession); 
       
   716 	
       
   717 	CCDIAPRecord *record = static_cast<CCDIAPRecord*>(CCDRecordBase::RecordFactoryL(KCDTIdIAPRecord));
       
   718 	CleanupStack::PushL(record);
       
   719 	
       
   720 	record->SetRecordId(10); // See CCommsdatInitAttributes::doTestStepL()
       
   721 	cmdbSession->SetAttributeMask(ECDPrivate);
       
   722 	TRAPD(loadErr, record->LoadL(*cmdbSession));
       
   723 	
       
   724 	if(loadErr == KErrPermissionDenied)
       
   725 		{
       
   726 		// checks if DeleteL will return correct error value
       
   727 		TRAP(loadErr, record->DeleteL(*cmdbSession));
       
   728 
       
   729 		if(loadErr == KErrPermissionDenied)
       
   730 			{
       
   731 			SetTestStepResult(EPass);
       
   732 			}
       
   733 		}
       
   734 
       
   735 	CleanupStack::PopAndDestroy(record);
       
   736     CleanupStack::PopAndDestroy(cmdbSession);
       
   737 	
       
   738 	return TestStepResult();
       
   739 	}
       
   740 //----------------------------------------------------------------------------------------------------------------
       
   741 CCommsdat140Step::CCommsdat140Step()
       
   742 /**
       
   743  * Constructor
       
   744  */
       
   745 	{
       
   746 	SetTestStepName(KCommsdat140Step);                                                                                           
       
   747 	}
       
   748 
       
   749 TVerdict CCommsdat140Step::doTestStepL()
       
   750 /**
       
   751  * @return - TVerdict code
       
   752  * Test effects of ECDProtectedWrite with LoadL
       
   753  */
       
   754 	{
       
   755     SetTestStepResult(EFail);
       
   756     INFO_PRINTF1(_L("========================================================================================"));
       
   757     INFO_PRINTF1(_L("WARNING:CCommsdatInitAttributes::doTestStepL() MUST be run successfully before this test"));
       
   758     INFO_PRINTF1(_L("========================================================================================"));
       
   759     	
       
   760 	INFO_PRINTF1(_L("Testing ECDProtectedWrite functionality in CCommsdat140Step::doTestStepL() "));
       
   761 	
       
   762 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
   763 	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_2);
       
   764 #else
       
   765  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_1);
       
   766 #endif
       
   767  	
       
   768 	CleanupStack::PushL(cmdbSession); 
       
   769 	
       
   770 	CCDIAPRecord *record = static_cast<CCDIAPRecord*>(CCDRecordBase::RecordFactoryL(KCDTIdIAPRecord));
       
   771 	CleanupStack::PushL(record);
       
   772 	
       
   773 	record->SetRecordId(11); // See CCommsdatInitAttributes::doTestStepL()
       
   774 	cmdbSession->SetAttributeMask(ECDProtectedWrite);
       
   775 	TRAPD(loadErr, record->LoadL(*cmdbSession));
       
   776 	
       
   777 	CleanupStack::PopAndDestroy(record);
       
   778     CleanupStack::PopAndDestroy(cmdbSession);	
       
   779     
       
   780 	if(loadErr == KErrNone)
       
   781 		{
       
   782 		SetTestStepResult(EPass);
       
   783 		}
       
   784 	
       
   785 	return TestStepResult();
       
   786 	}
       
   787 
       
   788 //----------------------------------------------------------------------------------------------------------------
       
   789 CCommsdat141Step::CCommsdat141Step()
       
   790 /**
       
   791  * Constructor
       
   792  */
       
   793 	{
       
   794 	SetTestStepName(KCommsdat141Step);                                                                                           
       
   795 	}
       
   796 
       
   797 TVerdict CCommsdat141Step::doTestStepL()
       
   798 /**
       
   799  * @return - TVerdict code
       
   800  * Test effects of ECDProtectedWrite with LoadL
       
   801  */
       
   802 	{
       
   803     SetTestStepResult(EFail);
       
   804     INFO_PRINTF1(_L("========================================================================================"));
       
   805     INFO_PRINTF1(_L("WARNING:CCommsdatInitAttributes::doTestStepL() MUST be run successfully before this test"));
       
   806     INFO_PRINTF1(_L("========================================================================================"));	
       
   807 	INFO_PRINTF1(_L("Testing ECDProtectedWrite functionality in CCommsdat141Step::doTestStepL() "));
       
   808 	
       
   809 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
   810 	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_2);
       
   811 #else
       
   812  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_1);
       
   813 #endif
       
   814  	
       
   815 	CleanupStack::PushL(cmdbSession); 
       
   816 	
       
   817 	CCDIAPRecord *record = static_cast<CCDIAPRecord*>(CCDRecordBase::RecordFactoryL(KCDTIdIAPRecord));
       
   818 	CleanupStack::PushL(record);
       
   819 	
       
   820 	record->SetRecordId(12); // See CCommsdatInitAttributes::doTestStepL()
       
   821 	record->iNetworkWeighting = KNetworkWeighting;
       
   822 	cmdbSession->SetAttributeMask(ECDProtectedWrite);
       
   823 	record->LoadL(*cmdbSession);
       
   824 	record->iNetworkWeighting = KNetworkWeighting + 100; // just a new iNetworkWeighting value
       
   825 	TRAPD(modErr, record->ModifyL(*cmdbSession));
       
   826 	
       
   827 	CleanupStack::PopAndDestroy(record);
       
   828     CleanupStack::PopAndDestroy(cmdbSession);
       
   829 	
       
   830 	if(modErr == KErrPermissionDenied)
       
   831 		{
       
   832 		SetTestStepResult(EPass);
       
   833 		}
       
   834 	
       
   835 	return TestStepResult();
       
   836 	}
       
   837 //----------------------------------------------------------------------------------------------------------------
       
   838 CCommsdat142Step::CCommsdat142Step()
       
   839 /**
       
   840  * Constructor
       
   841  */
       
   842 	{
       
   843 	SetTestStepName(KCommsdat142Step);                                                                                           
       
   844 	}
       
   845 
       
   846 TVerdict CCommsdat142Step::doTestStepL()
       
   847 /**
       
   848  * @return - TVerdict code
       
   849  * Test effects of ECDProtectedWrite with ModifyL
       
   850  */
       
   851 	{
       
   852     SetTestStepResult(EFail);	
       
   853     INFO_PRINTF1(_L("========================================================================================"));
       
   854     INFO_PRINTF1(_L("WARNING:CCommsdatInitAttributes::doTestStepL() MUST be run successfully before this test"));
       
   855     INFO_PRINTF1(_L("========================================================================================"));
       
   856 	INFO_PRINTF1(_L("Testing ECDProtectedWrite functionality in CCommsdat142Step::doTestStepL() "));
       
   857 	
       
   858 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
   859 	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_2);
       
   860 #else
       
   861  	CMDBSession *cmdbSession = CMDBSession::NewL(KCDVersion1_1);
       
   862 #endif
       
   863  	
       
   864 	CleanupStack::PushL(cmdbSession); 
       
   865 	
       
   866 	CCDIAPRecord *record = static_cast<CCDIAPRecord*>(CCDRecordBase::RecordFactoryL(KCDTIdIAPRecord));
       
   867 	CleanupStack::PushL(record);
       
   868 	
       
   869 	record->SetRecordId(13); // See CCommsdatInitAttributes::doTestStepL()
       
   870 	record->iNetworkWeighting = KNetworkWeighting;
       
   871 	cmdbSession->SetAttributeMask(ECDProtectedWrite);
       
   872 	record->LoadL(*cmdbSession);
       
   873 	record->iNetworkWeighting = KNetworkWeighting + 100; // just a new iNetworkWeighting value
       
   874 	TRAPD(modErr, record->ModifyL(*cmdbSession));
       
   875 	
       
   876 	CleanupStack::PopAndDestroy(record);
       
   877     CleanupStack::PopAndDestroy(cmdbSession);
       
   878 	
       
   879 	if(modErr == KErrNone)
       
   880 		{
       
   881 		SetTestStepResult(EPass);
       
   882 		}
       
   883 	
       
   884 	return TestStepResult();
       
   885 	}
       
   886 
       
   887 //----------------------------------------------------------------------------------------------------------------