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