commsconfig/commsdatabaseshim/ts_commdb/Step_024_xx.cpp
changeset 72 ae47d0499bee
parent 68 5da8188e392b
child 77 c9776eadbffd
equal deleted inserted replaced
68:5da8188e392b 72:ae47d0499bee
     1 // Copyright (c) 2001-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 // This contains CommDb Unit Test Cases 024.XX
       
    15 // 
       
    16 //
       
    17 
       
    18 // EPOC includes
       
    19 #include <e32base.h>
       
    20 #include <commdb.h>
       
    21 #include <d32comm.h>
       
    22 
       
    23 // Test system includes
       
    24 #include <networking/log.h>
       
    25 #include <networking/teststep.h>
       
    26 #include "Teststepcommdb.h"
       
    27 #include "TestSuiteCommdb.h"
       
    28 #include "Step_024_xx.h"
       
    29 
       
    30 
       
    31 
       
    32 //
       
    33 //	Test step 024.01
       
    34 //
       
    35 
       
    36 // constructor
       
    37 CCommDbTest024_01::CCommDbTest024_01()
       
    38 	{
       
    39 	// store the name of this test case
       
    40 	iTestStepName = _L("step_024_01");
       
    41 	}
       
    42 
       
    43 // destructor
       
    44 CCommDbTest024_01::~CCommDbTest024_01()
       
    45 	{
       
    46 	}
       
    47 
       
    48 
       
    49 TVerdict CCommDbTest024_01::doTestStepPreambleL()
       
    50 	{	
       
    51 	// Have a temp copy of database
       
    52 	openDbL();
       
    53 	return EPass;
       
    54 	}
       
    55 
       
    56 TInt CCommDbTest024_01::executeStepL()
       
    57 	{
       
    58 	TInt ret=KErrGeneral;
       
    59 
       
    60 	//Now test the settings
       
    61 	TUint32 value;
       
    62 	TRAPD(r,iTheDb->GetCurrentDialOutSettingL( TPtrC(MODEM_BEARER),value));
       
    63 
       
    64 	if(r==KErrNotSupported)
       
    65 		{
       
    66 		return KErrNotSupported;
       
    67 		}
       
    68 
       
    69 	return ret;
       
    70 	}
       
    71 
       
    72 
       
    73 TVerdict CCommDbTest024_01::doTestStepL( )
       
    74 	{
       
    75 	Log(_L("Step 024.03 called "));
       
    76 
       
    77 
       
    78 	if ( executeStepL() == KErrNotSupported )
       
    79 		iTestStepResult = EPass;
       
    80 	else
       
    81 		iTestStepResult = EFail;
       
    82 
       
    83 	return iTestStepResult;
       
    84 	}
       
    85 
       
    86 
       
    87 //
       
    88 //	Test step 024.02
       
    89 //
       
    90 
       
    91 // constructor
       
    92 CCommDbTest024_02::CCommDbTest024_02()
       
    93 	{
       
    94 	// store the name of this test case
       
    95 	iTestStepName = _L("step_024_02");
       
    96 	}
       
    97 
       
    98 // destructor
       
    99 CCommDbTest024_02::~CCommDbTest024_02()
       
   100 	{
       
   101 	}
       
   102 
       
   103 
       
   104 TVerdict CCommDbTest024_02::doTestStepPreambleL()
       
   105 	{	
       
   106 	openDbL();
       
   107 	return EPass;
       
   108 	}
       
   109 
       
   110 TInt CCommDbTest024_02::executeStepL()
       
   111 	{
       
   112 	TInt ret=KErrGeneral;
       
   113 
       
   114 	//Now test the settings
       
   115 	TUint32 value;
       
   116 	TRAPD(r,iTheDb->GetCurrentDialOutSettingL( TPtrC(LOCATION), value ));
       
   117 
       
   118 	if(r==KErrNotSupported)
       
   119 		{
       
   120 		return KErrNotSupported;
       
   121 		}
       
   122 
       
   123 	return ret;
       
   124 	}
       
   125 
       
   126 
       
   127 TVerdict CCommDbTest024_02::doTestStepL( )
       
   128 	{
       
   129 	Log(_L("Step 024.04 called "));
       
   130 
       
   131 
       
   132 	if ( executeStepL() == KErrNotSupported )
       
   133 		iTestStepResult = EPass;
       
   134 	else
       
   135 		iTestStepResult = EFail;
       
   136 
       
   137 	return iTestStepResult;
       
   138 	}
       
   139 
       
   140 
       
   141 
       
   142 
       
   143 //
       
   144 //	Test step 024.03
       
   145 //
       
   146 
       
   147 // constructor
       
   148 CCommDbTest024_03::CCommDbTest024_03()
       
   149 	{
       
   150 	// store the name of this test case
       
   151 	iTestStepName = _L("step_024_03");
       
   152 	}
       
   153 
       
   154 // destructor
       
   155 CCommDbTest024_03::~CCommDbTest024_03()
       
   156 	{
       
   157 	}
       
   158 
       
   159 
       
   160 TVerdict CCommDbTest024_03::doTestStepPreambleL()
       
   161 	{	
       
   162 	openDbL();
       
   163 	return EPass;
       
   164 	}
       
   165 
       
   166 TInt CCommDbTest024_03::executeStepL()
       
   167 	{
       
   168 	TInt ret=KErrGeneral;
       
   169 
       
   170 	//Point to an IAP record
       
   171 	iTheDb->SetGlobalSettingL( TPtrC(DEFAULT_NETWORK), 0 );
       
   172 
       
   173 	//Now test the settings
       
   174 	TUint32 value;
       
   175 	TRAPD(r1,iTheDb->GetCurrentDialOutSettingL( TPtrC(IAP_SERVICE), value ));
       
   176 
       
   177 	if(r1==KErrNotSupported)
       
   178 		{
       
   179 		return KErrNotSupported;
       
   180 		}
       
   181 
       
   182 	return ret;
       
   183 	}
       
   184 
       
   185 
       
   186 TVerdict CCommDbTest024_03::doTestStepL( )
       
   187 	{
       
   188 	Log(_L("Step 024.03 called "));
       
   189 
       
   190 
       
   191 	if ( executeStepL() == KErrNotSupported )
       
   192 		iTestStepResult = EPass;
       
   193 	else
       
   194 		iTestStepResult = EFail;
       
   195 
       
   196 	return iTestStepResult;
       
   197 	}
       
   198 
       
   199 
       
   200 
       
   201 //
       
   202 //	Test step 024.04
       
   203 //
       
   204 
       
   205 // constructor
       
   206 CCommDbTest024_04::CCommDbTest024_04()
       
   207 	{
       
   208 	// store the name of this test case
       
   209 	iTestStepName = _L("step_024_04");
       
   210 	}
       
   211 
       
   212 // destructor
       
   213 CCommDbTest024_04::~CCommDbTest024_04()
       
   214 	{
       
   215 	}
       
   216 
       
   217 
       
   218 TVerdict CCommDbTest024_04::doTestStepPreambleL()
       
   219 	{	
       
   220 	openDbL();
       
   221 	return EPass;
       
   222 	}
       
   223 
       
   224 TInt CCommDbTest024_04::executeStepL()
       
   225 	{
       
   226 	TInt ret=KErrGeneral;
       
   227 
       
   228 	//Point to an IAP record
       
   229 	iTheDb->SetGlobalSettingL( TPtrC(DEFAULT_NETWORK), 0 );
       
   230 
       
   231 	//Now test the settings
       
   232 	TUint32 value;
       
   233 	TRAPD(r1,iTheDb->GetCurrentDialOutSettingL( TPtrC(IAP_NETWORK),value));
       
   234 
       
   235 	if(r1==KErrNotSupported)
       
   236 		{
       
   237 		return KErrNotSupported;
       
   238 		}
       
   239 
       
   240 	return ret;
       
   241 	}
       
   242 
       
   243 
       
   244 TVerdict CCommDbTest024_04::doTestStepL( )
       
   245 	{
       
   246 	Log(_L("Step 024.02 called "));
       
   247 
       
   248 
       
   249 	if ( executeStepL() == KErrNotSupported )
       
   250 		iTestStepResult = EPass;
       
   251 	else
       
   252 		iTestStepResult = EFail;
       
   253 
       
   254 	return iTestStepResult;
       
   255 	}
       
   256 
       
   257 
       
   258 //
       
   259 //	Test step 024.05
       
   260 //
       
   261 
       
   262 // constructor
       
   263 CCommDbTest024_05::CCommDbTest024_05()
       
   264 	{
       
   265 	// store the name of this test case
       
   266 	iTestStepName = _L("step_024_05");
       
   267 	}
       
   268 
       
   269 // destructor
       
   270 CCommDbTest024_05::~CCommDbTest024_05()
       
   271 	{
       
   272 	}
       
   273 
       
   274 
       
   275 TVerdict CCommDbTest024_05::doTestStepPreambleL()
       
   276 	{	
       
   277 	openDbL();
       
   278 	return EPass;
       
   279 	}
       
   280 
       
   281 TInt CCommDbTest024_05::executeStepL()
       
   282 	{
       
   283 	TInt ret=KErrGeneral;
       
   284 
       
   285 	//Now test the settings
       
   286 	TUint32 value;
       
   287 	TRAPD(r1,iTheDb->GetCurrentDialInSettingL( TPtrC(MODEM_BEARER), value));
       
   288 
       
   289 	if(r1==KErrNotSupported)
       
   290 		{
       
   291 		return KErrNotSupported;
       
   292 		}
       
   293 
       
   294 	return ret;
       
   295 	}
       
   296 
       
   297 
       
   298 TVerdict CCommDbTest024_05::doTestStepL( )
       
   299 	{
       
   300 	Log(_L("Step 024.03 called "));
       
   301 
       
   302 
       
   303 	if ( executeStepL() == KErrNotSupported )
       
   304 		iTestStepResult = EPass;
       
   305 	else
       
   306 		iTestStepResult = EFail;
       
   307 
       
   308 	return iTestStepResult;
       
   309 	}
       
   310 
       
   311 
       
   312 
       
   313 //
       
   314 //	Test step 024.06
       
   315 //
       
   316 
       
   317 // constructor
       
   318 CCommDbTest024_06::CCommDbTest024_06()
       
   319 	{
       
   320 	// store the name of this test case
       
   321 	iTestStepName = _L("step_024_06");
       
   322 	}
       
   323 
       
   324 // destructor
       
   325 CCommDbTest024_06::~CCommDbTest024_06()
       
   326 	{
       
   327 	}
       
   328 
       
   329 
       
   330 TVerdict CCommDbTest024_06::doTestStepPreambleL()
       
   331 	{	
       
   332 	openDbL();
       
   333 	return EPass;
       
   334 	}
       
   335 
       
   336 TInt CCommDbTest024_06::executeStepL()
       
   337 	{
       
   338 	TInt ret=KErrGeneral;
       
   339 
       
   340 	//Now test the settings
       
   341 	TUint32 value;
       
   342 	TRAPD(r1,iTheDb->GetCurrentDialInSettingL( TPtrC(LOCATION), value));
       
   343 
       
   344 	if(r1==KErrNotSupported)
       
   345 		{
       
   346 		return KErrNotSupported;
       
   347 		}
       
   348 
       
   349 	return ret;
       
   350 	}
       
   351 
       
   352 
       
   353 TVerdict CCommDbTest024_06::doTestStepL( )
       
   354 	{
       
   355 	Log(_L("Step 024.04 called "));
       
   356 
       
   357 
       
   358 	if ( executeStepL() == KErrNotSupported )
       
   359 		iTestStepResult = EPass;
       
   360 	else
       
   361 		iTestStepResult = EFail;
       
   362 
       
   363 	return iTestStepResult;
       
   364 	}
       
   365 
       
   366 
       
   367 
       
   368 
       
   369 //
       
   370 //	Test step 024.07
       
   371 //
       
   372 
       
   373 // constructor
       
   374 CCommDbTest024_07::CCommDbTest024_07()
       
   375 	{
       
   376 	// store the name of this test case
       
   377 	iTestStepName = _L("step_024_07");
       
   378 	}
       
   379 
       
   380 // destructor
       
   381 CCommDbTest024_07::~CCommDbTest024_07()
       
   382 	{
       
   383 	}
       
   384 
       
   385 
       
   386 TVerdict CCommDbTest024_07::doTestStepPreambleL()
       
   387 	{	
       
   388 	openDbL();
       
   389 	return EPass;
       
   390 	}
       
   391 
       
   392 TInt CCommDbTest024_07::executeStepL()
       
   393 	{
       
   394 	TInt ret=KErrGeneral;
       
   395 
       
   396 	//Point to an IAP record
       
   397 	iTheDb->SetGlobalSettingL( TPtrC(DEFAULT_NETWORK), 0 );
       
   398 
       
   399 	//Now test the settings
       
   400 	TUint32 value;
       
   401 	TRAPD(r1,iTheDb->GetCurrentDialInSettingL( TPtrC(IAP_SERVICE),value));
       
   402 
       
   403 	if(r1==KErrNotSupported)
       
   404 		{
       
   405 		return KErrNotSupported;
       
   406 		}
       
   407 
       
   408 	return ret;
       
   409 	}
       
   410 
       
   411 
       
   412 TVerdict CCommDbTest024_07::doTestStepL( )
       
   413 	{
       
   414 	Log(_L("Step 024.01 called "));
       
   415 
       
   416 
       
   417 	if ( executeStepL() == KErrNotSupported )
       
   418 		iTestStepResult = EPass;
       
   419 	else
       
   420 		iTestStepResult = EFail;
       
   421 
       
   422 	return iTestStepResult;
       
   423 	}
       
   424 
       
   425 
       
   426 
       
   427 //
       
   428 //	Test step 024.08
       
   429 //
       
   430 
       
   431 // constructor
       
   432 CCommDbTest024_08::CCommDbTest024_08()
       
   433 	{
       
   434 	// store the name of this test case
       
   435 	iTestStepName = _L("step_024_08");
       
   436 	}
       
   437 
       
   438 // destructor
       
   439 CCommDbTest024_08::~CCommDbTest024_08()
       
   440 	{
       
   441 	}
       
   442 
       
   443 
       
   444 TVerdict CCommDbTest024_08::doTestStepPreambleL()
       
   445 	{	
       
   446 	openDbL();
       
   447 	return EPass;
       
   448 	}
       
   449 
       
   450 TInt CCommDbTest024_08::executeStepL()
       
   451 	{
       
   452 	TInt ret=KErrGeneral;
       
   453 
       
   454 	//Point to an IAP record
       
   455 	iTheDb->SetGlobalSettingL( TPtrC(DEFAULT_NETWORK), 0 );
       
   456 
       
   457 	//Now test the settings
       
   458 	TUint32 value;
       
   459 	TRAPD(r1,iTheDb->GetCurrentDialInSettingL( TPtrC(IAP_SERVICE),value));
       
   460 
       
   461 	if(r1==KErrNotSupported)
       
   462 		{
       
   463 		return KErrNotSupported;
       
   464 		}
       
   465 
       
   466 	return ret;
       
   467 	}
       
   468 
       
   469 
       
   470 TVerdict CCommDbTest024_08::doTestStepL( )
       
   471 	{
       
   472 	Log(_L("Step 024.02 called "));
       
   473 
       
   474 
       
   475 	if ( executeStepL() == KErrNotSupported )
       
   476 		iTestStepResult = EPass;
       
   477 	else
       
   478 		iTestStepResult = EFail;
       
   479 
       
   480 	return iTestStepResult;
       
   481 	}
       
   482 
       
   483 
       
   484 //
       
   485 //	Test step 024.09
       
   486 //
       
   487 
       
   488 // constructor
       
   489 CCommDbTest024_09::CCommDbTest024_09()
       
   490 	{
       
   491 	// store the name of this test case
       
   492 	iTestStepName = _L("step_024_09");
       
   493 	}
       
   494 
       
   495 // destructor
       
   496 CCommDbTest024_09::~CCommDbTest024_09()
       
   497 	{
       
   498 	}
       
   499 
       
   500 TVerdict CCommDbTest024_09::doTestStepL( )
       
   501 	{
       
   502 	Log(_L("Step 024.09 called "));
       
   503 
       
   504 	iTestStepResult = EPass;
       
   505 
       
   506 		// Heap test for 024.01
       
   507 
       
   508 	CCommDbTest024_01* step024_01 = new(ELeave) CCommDbTest024_01;
       
   509 	CleanupStack::PushL(step024_01);
       
   510 	step024_01->iSuite = iSuite;
       
   511 	if ( doTestStepWithHeapFailureL( *step024_01, KErrNotSupported) == EFail )
       
   512 		iTestStepResult = EFail;
       
   513 	CleanupStack::PopAndDestroy(step024_01);
       
   514 
       
   515 
       
   516 		// Heap test for 024.02
       
   517 
       
   518 	CCommDbTest024_02* step024_02 = new CCommDbTest024_02;
       
   519 	CleanupStack::PushL(step024_02);
       
   520 	step024_02->iSuite = iSuite;
       
   521 	if ( doTestStepWithHeapFailureL( *step024_02, KErrNotSupported) == EFail ) 
       
   522 		iTestStepResult = EFail;
       
   523 	CleanupStack::PopAndDestroy(step024_02);
       
   524 
       
   525 		// Heap test for 024.03
       
   526 
       
   527 	CCommDbTest024_03* step024_03 = new CCommDbTest024_03;
       
   528 	CleanupStack::PushL(step024_03);
       
   529 	step024_03->iSuite = iSuite;
       
   530 	if ( doTestStepWithHeapFailureL( *step024_03, KErrNotSupported) == EFail )
       
   531 		iTestStepResult = EFail;
       
   532 	CleanupStack::PopAndDestroy(step024_03);
       
   533 
       
   534 
       
   535 		// Heap test for 024.04
       
   536 
       
   537 	CCommDbTest024_04* step024_04 = new CCommDbTest024_04;
       
   538 	CleanupStack::PushL(step024_04);
       
   539 	step024_04->iSuite = iSuite;
       
   540 	if ( doTestStepWithHeapFailureL( *step024_04, KErrNotSupported) == EFail )
       
   541 		iTestStepResult = EFail;
       
   542 	CleanupStack::PopAndDestroy(step024_04);
       
   543 
       
   544 		// Heap test for 024.05
       
   545 
       
   546 	CCommDbTest024_05* step024_05 = new CCommDbTest024_05;
       
   547 	CleanupStack::PushL(step024_05);
       
   548 	step024_05->iSuite = iSuite;
       
   549 	if ( doTestStepWithHeapFailureL( *step024_05, KErrNotSupported) == EFail )
       
   550 		iTestStepResult = EFail;
       
   551 	CleanupStack::PopAndDestroy(step024_05);
       
   552 
       
   553 		// Heap test for 024.06
       
   554 
       
   555 	CCommDbTest024_06* step024_06 = new CCommDbTest024_06;
       
   556 	CleanupStack::PushL(step024_06);
       
   557 	step024_06->iSuite = iSuite;
       
   558 	if ( doTestStepWithHeapFailureL( *step024_06, KErrNotSupported) == EFail )
       
   559 		iTestStepResult = EFail;
       
   560 	CleanupStack::PopAndDestroy(step024_06);
       
   561 
       
   562 		// Heap test for 024.07
       
   563 
       
   564 	CCommDbTest024_07* step024_07 = new CCommDbTest024_07;
       
   565 	CleanupStack::PushL(step024_07);
       
   566 	step024_07->iSuite = iSuite;
       
   567 	if ( doTestStepWithHeapFailureL( *step024_07, KErrNotSupported) == EFail )
       
   568 		iTestStepResult = EFail;
       
   569 	CleanupStack::PopAndDestroy(step024_07);
       
   570 
       
   571 	
       
   572 		// Heap test for 024.08
       
   573 
       
   574 	CCommDbTest024_08* step024_08 = new CCommDbTest024_08;
       
   575 	CleanupStack::PushL(step024_08);
       
   576 	step024_08->iSuite = iSuite;
       
   577 	if ( doTestStepWithHeapFailureL( *step024_08, KErrNotSupported) == EFail )
       
   578 		iTestStepResult = EFail;
       
   579 	CleanupStack::PopAndDestroy(step024_08);
       
   580 
       
   581 	return iTestStepResult;	
       
   582 
       
   583 }