commsconfig/commsdatabaseshim/TE_commdb/src/Step_047_xx.cpp
changeset 72 ae47d0499bee
equal deleted inserted replaced
68:5da8188e392b 72:ae47d0499bee
       
     1 //
       
     2 // Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 // All rights reserved.
       
     4 // This component and the accompanying materials are made available
       
     5 // under the terms of "Eclipse Public License v1.0"
       
     6 // which accompanies this distribution, and is available
       
     7 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 //
       
     9 // Initial Contributors:
       
    10 // Nokia Corporation - initial contribution.
       
    11 //
       
    12 // Contributors:
       
    13 //
       
    14 // Description:
       
    15 //
       
    16 //
       
    17 //
       
    18 // This contains CommDb Unit Test Cases 046.XX
       
    19 
       
    20 // EPOC includes
       
    21 #include <e32base.h>
       
    22 #include <commdb.h>
       
    23 #include <d32comm.h>
       
    24 #include <cdbstore.h>
       
    25 
       
    26 // Test system includes
       
    27 #include "Teststepcommdb.h"
       
    28 #include "Step_047_xx.h"
       
    29 #include <e32math.h>
       
    30 
       
    31 
       
    32 /////////////////////
       
    33 //	Test step 0047.001
       
    34 /////////////////////
       
    35 
       
    36 // constructor
       
    37 CCommDbTest047_01::CCommDbTest047_01()
       
    38 	{
       
    39 	// store the name of this test case
       
    40 	SetTestStepName(_L("step_047_01"));
       
    41 	}
       
    42 
       
    43 // destructor
       
    44 CCommDbTest047_01::~CCommDbTest047_01()
       
    45 	{
       
    46 	}
       
    47 
       
    48 
       
    49 TVerdict CCommDbTest047_01::doTestStepPreambleL()
       
    50 	{
       
    51         SetTestStepResult(EPass);	return TestStepResult();
       
    52 	}
       
    53 
       
    54 
       
    55 TBool CCommDbTest047_01::executeStepL()
       
    56 	{
       
    57 	iOverSet=CCommDbOverrideSettings::NewL(CCommDbOverrideSettings::EParamListPartial,EDatabaseTypeIAP);
       
    58 	return KErrNone;
       
    59 	}
       
    60 
       
    61 TVerdict CCommDbTest047_01::doTestStepL( )
       
    62 	{
       
    63 	TRAPD(ret,executeStepL());
       
    64 	if(ret==KErrNone)
       
    65 		{
       
    66          SetTestStepResult(EPass);		return TestStepResult();	//If we've got this far we've passed
       
    67 		}
       
    68 	else
       
    69 		{
       
    70          SetTestStepResult(EFail);		return TestStepResult();
       
    71 		}
       
    72 	}
       
    73 
       
    74 TVerdict CCommDbTest047_01::doTestStepPostambleL()
       
    75 	{
       
    76 	delete iOverSet;
       
    77         SetTestStepResult(EPass);	return TestStepResult();
       
    78 	}
       
    79 
       
    80 /////////////////////
       
    81 //	Test step 0047.02
       
    82 /////////////////////
       
    83 
       
    84 // constructor
       
    85 CCommDbTest047_02::CCommDbTest047_02()
       
    86 	{
       
    87 	// store the name of this test case
       
    88 	SetTestStepName(_L("step_047_02"));
       
    89 	}
       
    90 
       
    91 // destructor
       
    92 CCommDbTest047_02::~CCommDbTest047_02()
       
    93 	{
       
    94 	}
       
    95 
       
    96 
       
    97 TVerdict CCommDbTest047_02::doTestStepPreambleL()
       
    98 	{
       
    99         SetTestStepResult(EPass);	return TestStepResult();
       
   100 	}
       
   101 
       
   102 
       
   103 TBool CCommDbTest047_02::executeStepL()
       
   104 	{
       
   105 	CCommsDatabase::NewL(EDatabaseTypeIAP);
       
   106 	return KErrNone; 
       
   107 	} //lint !e550
       
   108 
       
   109 TVerdict CCommDbTest047_02::doTestStepL( )
       
   110 	{
       
   111 	TRAPD(ret,executeStepL());
       
   112 	if(ret==KErrNone)
       
   113 		{
       
   114          SetTestStepResult(EPass);		return TestStepResult();	//If we've got this far we've passed
       
   115 		}
       
   116 	else
       
   117 		{
       
   118          SetTestStepResult(EFail);		return TestStepResult();
       
   119 		}
       
   120 	}
       
   121 
       
   122 TVerdict CCommDbTest047_02::doTestStepPostambleL()
       
   123 	{
       
   124         SetTestStepResult(EPass);	return TestStepResult();
       
   125 	}
       
   126 
       
   127 /////////////////////
       
   128 //	Test step 0047.03
       
   129 /////////////////////
       
   130 
       
   131 // constructor
       
   132 CCommDbTest047_03::CCommDbTest047_03()
       
   133 	{
       
   134 	// store the name of this test case
       
   135 	SetTestStepName(_L("step_047_03"));
       
   136 	}
       
   137 
       
   138 // destructor
       
   139 CCommDbTest047_03::~CCommDbTest047_03()
       
   140 	{
       
   141 	}
       
   142 
       
   143 
       
   144 TVerdict CCommDbTest047_03::doTestStepPreambleL()
       
   145 	{	
       
   146         SetTestStepResult(EPass);	return TestStepResult();
       
   147 	}
       
   148 
       
   149 
       
   150 TBool CCommDbTest047_03::executeStepL()
       
   151 	{
       
   152 	CStoreableOverrideSettings::NewL(CStoreableOverrideSettings::EParamListPartial,EDatabaseTypeIAP);
       
   153 	return KErrNone;
       
   154 	} //lint !e550
       
   155 
       
   156 TVerdict CCommDbTest047_03::doTestStepL( )
       
   157 	{
       
   158 	TRAPD(ret,executeStepL());
       
   159 	if(ret==KErrNone)
       
   160 		{
       
   161          SetTestStepResult(EPass);		return TestStepResult();	//If we've got this far we've passed
       
   162 		}
       
   163 	else
       
   164 		{
       
   165          SetTestStepResult(EFail);		return TestStepResult();
       
   166 		}
       
   167 	}
       
   168 
       
   169 TVerdict CCommDbTest047_03::doTestStepPostambleL()
       
   170 	{
       
   171         SetTestStepResult(EPass);	return TestStepResult();
       
   172 	}
       
   173 
       
   174 /////////////////////
       
   175 //	Test step 0047.04
       
   176 /////////////////////
       
   177 
       
   178 // constructor
       
   179 CCommDbTest047_04::CCommDbTest047_04()
       
   180 	{
       
   181 	// store the name of this test case
       
   182 	SetTestStepName(_L("step_047_04"));
       
   183 	}
       
   184 
       
   185 // destructor
       
   186 CCommDbTest047_04::~CCommDbTest047_04()
       
   187 	{
       
   188 	}
       
   189 
       
   190 
       
   191 TVerdict CCommDbTest047_04::doTestStepPreambleL()
       
   192 	{	
       
   193 	iTheDb=CCommsDatabase::NewL();
       
   194 	iPrefView = iTheDb->OpenConnectionPrefTableLC();
       
   195 	CleanupStack::Pop();
       
   196 
       
   197         SetTestStepResult(EPass);	return TestStepResult();
       
   198 	}
       
   199 
       
   200 
       
   201 TBool CCommDbTest047_04::executeStepL()
       
   202 	{
       
   203 	CCommsDbConnectionPrefTableView::TCommDbIspConnectionPref pref1;
       
   204 
       
   205 	iPrefView->InsertConnectionPreferenceL(pref1, EFalse);
       
   206 	return KErrNone;
       
   207 	}
       
   208 
       
   209 TVerdict CCommDbTest047_04::doTestStepL( )
       
   210 	{
       
   211 	TRAPD(ret,executeStepL());
       
   212 	if(ret==KErrNotSupported)
       
   213 		{
       
   214          SetTestStepResult(EPass);		return TestStepResult();	//If we've got this far we've passed
       
   215 		}
       
   216 	else
       
   217 		{
       
   218          SetTestStepResult(EFail);		return TestStepResult();
       
   219 		}
       
   220 	}
       
   221 
       
   222 TVerdict CCommDbTest047_04::doTestStepPostambleL()
       
   223 	{
       
   224 	delete iPrefView;
       
   225 	iPrefView = NULL;
       
   226 	delete iTheDb;
       
   227 	iTheDb=NULL;
       
   228 
       
   229         SetTestStepResult(EPass);	return TestStepResult();
       
   230 	}
       
   231 
       
   232 /////////////////////
       
   233 //	Test step 0047.05
       
   234 /////////////////////
       
   235 
       
   236 // constructor
       
   237 CCommDbTest047_05::CCommDbTest047_05()
       
   238 	{
       
   239 	// store the name of this test case
       
   240 	SetTestStepName(_L("step_047_05"));
       
   241 	}
       
   242 
       
   243 // destructor
       
   244 CCommDbTest047_05::~CCommDbTest047_05()
       
   245 	{
       
   246 	}
       
   247 
       
   248 
       
   249 TVerdict CCommDbTest047_05::doTestStepPreambleL()
       
   250 	{	
       
   251 	iTheDb=CCommsDatabase::NewL();
       
   252         SetTestStepResult(EPass);	return TestStepResult();
       
   253 	}
       
   254 
       
   255 
       
   256 TBool CCommDbTest047_05::executeStepL()
       
   257 	{
       
   258 	CCommDbOverrideSettings* overSet=CCommDbOverrideSettings::NewL(CCommDbOverrideSettings::EParamListPartial);
       
   259 	CleanupStack::PushL(overSet);
       
   260 
       
   261 	CCommsDbConnectionPrefTableView::TCommDbIspConnectionPref tempIspPref;
       
   262 
       
   263 	User::LeaveIfError(overSet->GetConnectionPreferenceOverride(tempIspPref));
       
   264 	CleanupStack::PopAndDestroy(overSet);
       
   265 	return KErrNone;
       
   266 	}
       
   267 
       
   268 TVerdict CCommDbTest047_05::doTestStepL( )
       
   269 	{
       
   270 	TRAPD(ret,executeStepL());
       
   271 	if(ret==KErrNotSupported)
       
   272 		{
       
   273          SetTestStepResult(EPass);		return TestStepResult();	//If we've got this far we've passed
       
   274 		}
       
   275 	else
       
   276 		{
       
   277          SetTestStepResult(EFail);		return TestStepResult();
       
   278 		}
       
   279 	}
       
   280 
       
   281 TVerdict CCommDbTest047_05::doTestStepPostambleL()
       
   282 	{
       
   283         SetTestStepResult(EPass);	return TestStepResult();
       
   284 	}
       
   285 
       
   286 /////////////////////
       
   287 //	Test step 0047.06
       
   288 /////////////////////
       
   289 CCommDbTest047_06::CCommDbTest047_06()
       
   290 	{
       
   291 	// store the name of this test case
       
   292 	SetTestStepName(_L("step_047_06"));
       
   293 	}
       
   294 
       
   295 CCommDbTest047_06::~CCommDbTest047_06()
       
   296 	{}
       
   297 
       
   298 TVerdict CCommDbTest047_06::doTestStepL( void )
       
   299 	{
       
   300 	TRAPD(ret,executeStepL());
       
   301 	if(ret==KErrNotSupported)
       
   302 		{
       
   303          SetTestStepResult(EPass);		return TestStepResult();	//If we've got this far we've passed
       
   304 		}
       
   305 	else
       
   306 		{
       
   307          SetTestStepResult(EFail);		return TestStepResult();
       
   308 		}
       
   309 	}
       
   310 
       
   311 TVerdict CCommDbTest047_06::doTestStepPreambleL()
       
   312 	{
       
   313 	iTheDb=CCommsDatabase::NewL();
       
   314 
       
   315 	iPrefView = iTheDb->OpenConnectionPrefTableLC();
       
   316 	CleanupStack::Pop();
       
   317 
       
   318         SetTestStepResult(EPass);	return TestStepResult();
       
   319 	}
       
   320 
       
   321 TInt CCommDbTest047_06::executeStepL()
       
   322 	{
       
   323 	CCommsDbConnectionPrefTableView::TCommDbIspConnectionPref pref;
       
   324 	iPrefView->ReadConnectionPreferenceL(pref);
       
   325 	return KErrNone;
       
   326 	}
       
   327 	
       
   328 TVerdict CCommDbTest047_06::doTestStepPostambleL()
       
   329 	{
       
   330 	delete iPrefView;
       
   331 	iPrefView = NULL;
       
   332 	delete iTheDb;
       
   333 	iTheDb=NULL;
       
   334         SetTestStepResult(EPass);	return TestStepResult();
       
   335 	}
       
   336 
       
   337 /////////////////////
       
   338 //	Test step 0047.07
       
   339 /////////////////////
       
   340 
       
   341 // constructor
       
   342 CCommDbTest047_07::CCommDbTest047_07()
       
   343 	{
       
   344 	// store the name of this test case
       
   345 	SetTestStepName(_L("step_047_07"));
       
   346 	}
       
   347 
       
   348 // destructor
       
   349 CCommDbTest047_07::~CCommDbTest047_07()
       
   350 	{
       
   351 	}
       
   352 
       
   353 
       
   354 TVerdict CCommDbTest047_07::doTestStepPreambleL()
       
   355 	{	
       
   356 	iTheDb=CCommsDatabase::NewL();
       
   357         SetTestStepResult(EPass);	return TestStepResult();
       
   358 	}
       
   359 
       
   360 
       
   361 TBool CCommDbTest047_07::executeStepL()
       
   362 	{
       
   363 	CCommDbOverrideSettings* overSet=CCommDbOverrideSettings::NewL(CCommDbOverrideSettings::EParamListPartial);
       
   364 	CleanupStack::PushL(overSet);
       
   365 
       
   366 	CCommsDbConnectionPrefTableView::TCommDbIspConnectionPref tempIspPref;
       
   367 
       
   368 	User::LeaveIfError(overSet->SetConnectionPreferenceOverride(tempIspPref));
       
   369 	CleanupStack::PopAndDestroy(overSet);
       
   370 	return KErrNone;
       
   371 	}
       
   372 
       
   373 TVerdict CCommDbTest047_07::doTestStepL( )
       
   374 	{
       
   375 	TRAPD(ret,executeStepL());
       
   376 	if(ret==KErrNotSupported)
       
   377 		{
       
   378          SetTestStepResult(EPass);		return TestStepResult();	//If we've got this far we've passed
       
   379 		}
       
   380 	else
       
   381 		{
       
   382          SetTestStepResult(EFail);		return TestStepResult();
       
   383 		}
       
   384 	}
       
   385 
       
   386 TVerdict CCommDbTest047_07::doTestStepPostambleL()
       
   387 	{
       
   388         SetTestStepResult(EPass);	return TestStepResult();
       
   389 	}
       
   390 
       
   391 /////////////////////
       
   392 //	Test step 0047.08
       
   393 /////////////////////
       
   394 CCommDbTest047_08::CCommDbTest047_08()
       
   395 	{
       
   396 	// store the name of this test case
       
   397 	SetTestStepName(_L("step_047_08"));
       
   398 	}
       
   399 
       
   400 CCommDbTest047_08::~CCommDbTest047_08()
       
   401 	{}
       
   402 
       
   403 TVerdict CCommDbTest047_08::doTestStepL( void )
       
   404 	{
       
   405 	TRAPD(ret,executeStepL());
       
   406 	if(ret==KErrNotSupported)
       
   407 		{
       
   408          SetTestStepResult(EPass);		return TestStepResult();	//If we've got this far we've passed
       
   409 		}
       
   410 	else
       
   411 		{
       
   412          SetTestStepResult(EFail);		return TestStepResult();
       
   413 		}
       
   414 	}
       
   415 
       
   416 TVerdict CCommDbTest047_08::doTestStepPreambleL()
       
   417 	{
       
   418 	iTheDb=CCommsDatabase::NewL();
       
   419 
       
   420 	iPrefView = iTheDb->OpenConnectionPrefTableLC();
       
   421 	CleanupStack::Pop();
       
   422 
       
   423         SetTestStepResult(EPass);	return TestStepResult();
       
   424 	}
       
   425 
       
   426 TInt CCommDbTest047_08::executeStepL()
       
   427 	{
       
   428 	CCommsDbConnectionPrefTableView::TCommDbIspConnectionPref pref;
       
   429 	iPrefView->UpdateBearerL(pref.iBearer);
       
   430 	return KErrNone;
       
   431 	}
       
   432 	
       
   433 TVerdict CCommDbTest047_08::doTestStepPostambleL()
       
   434 	{
       
   435 	delete iPrefView;
       
   436 	iPrefView = NULL;
       
   437 	delete iTheDb;
       
   438 	iTheDb=NULL;
       
   439         SetTestStepResult(EPass);	return TestStepResult();
       
   440 	}
       
   441 
       
   442 /////////////////////
       
   443 //	Test step 0047.13
       
   444 /////////////////////
       
   445 
       
   446 // constructor
       
   447 CCommDbTest047_13::CCommDbTest047_13()
       
   448 	{
       
   449 	// store the name of this test case
       
   450 	SetTestStepName(_L("step_047_13"));
       
   451 	}
       
   452 
       
   453 // destructor
       
   454 CCommDbTest047_13::~CCommDbTest047_13()
       
   455 	{
       
   456 	}
       
   457 
       
   458 
       
   459 TVerdict CCommDbTest047_13::doTestStepPreambleL()
       
   460 	{	
       
   461         SetTestStepResult(EPass);	return TestStepResult();
       
   462 	}
       
   463 
       
   464 
       
   465 TBool CCommDbTest047_13::executeStepL()
       
   466 	{
       
   467 	TCommDbOpeningMethod openingMethod(ECommDbCreated);
       
   468 	CCommsDatabase::NewL(EDatabaseTypeISP,openingMethod);
       
   469 	return KErrNone;
       
   470 	} //lint !e550
       
   471 
       
   472 TVerdict CCommDbTest047_13::doTestStepL( )
       
   473 	{
       
   474 	TRAPD(ret,executeStepL());
       
   475 	if(ret==KErrNone)
       
   476 		{
       
   477          SetTestStepResult(EPass);		return TestStepResult();	//If we've got this far we've passed
       
   478 		}
       
   479 	else
       
   480 		{
       
   481          SetTestStepResult(EFail);		return TestStepResult();
       
   482 		}
       
   483 	}
       
   484 
       
   485 TVerdict CCommDbTest047_13::doTestStepPostambleL()
       
   486 	{
       
   487         SetTestStepResult(EPass);	return TestStepResult();
       
   488 	}