telephonyprotocols/csdagt/TS_CsdAgt/CsdAgtTestCommDBParameters.cpp
changeset 0 3553901f7fa8
child 24 6638e7f4bd8f
equal deleted inserted replaced
-1:000000000000 0:3553901f7fa8
       
     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 CsdAgt TestCase Test 1.1 - 1.8
       
    15 // 
       
    16 //
       
    17 
       
    18 // EPOC includes
       
    19 #include <e32base.h>
       
    20 #include <in_sock.h>
       
    21 #include <dummyetel.h> // include here to avoid picking up the real etel.h
       
    22 #include <etelmm.h>
       
    23 
       
    24 // Test system includes
       
    25 #include "log.h"
       
    26 #include "teststep.h"
       
    27 #include "TestStepCsdAgt.h"
       
    28 #include "TestSuiteCsdAgt.h"
       
    29 
       
    30 // COMMDB Database Undo
       
    31 #include "DbUndo.h"
       
    32 
       
    33 // CsdAgt progress
       
    34 #include <csdprog.h>
       
    35 
       
    36 // CsdAgt errors
       
    37 #include <nd_err.h>
       
    38 
       
    39 // Class definitions
       
    40 #include "CsdAgtTestCommDBParameters.h"
       
    41 
       
    42 // Test case 1.1,  CSD connect with invalid number
       
    43 enum TVerdict CCsdAgtTest1_1::doCsdAgtTestStepL( void )
       
    44 	{
       
    45 
       
    46     TRealAgtNotify AgtNotify;
       
    47 
       
    48 	AgtNotify.SetTestCase(10101);
       
    49 	AgtNotify.SetMode(RTelServer::ENetworkModeGsm);
       
    50 
       
    51 	CDbCsdTable *csd = CDbCsdTable::NewL();
       
    52 	CleanupStack::PushL(csd);
       
    53 	csd->SetColumnTextL(TPtrC(ISP_DEFAULT_TEL_NUM),_L("929292929292929"));
       
    54 
       
    55 	// Expect dial to fail as telnumber is invalid
       
    56 	ConnectExpectErrorL(KErrCommsLineFail,ECsdFinishedDialling);
       
    57 
       
    58 	// Close database object, forcing it to undo all changes that were made
       
    59 	Log(_L("Reverting COMMDB changes"));
       
    60 	csd->UndoDatabaseChangesL();
       
    61 	CleanupStack::PopAndDestroy(csd);
       
    62 
       
    63 	return iTestStepResult;
       
    64 	}
       
    65 
       
    66 // Test case 1.2 CSD connect and break
       
    67 enum TVerdict CCsdAgtTest1_2::doCsdAgtTestStepL( void )
       
    68 	{
       
    69 	TRealAgtNotify AgtNotify;
       
    70 
       
    71 	AgtNotify.SetTestCase(10102);
       
    72 	AgtNotify.SetMode(RTelServer::ENetworkModeGsm);
       
    73 
       
    74 	// Call basic connect / disconnect function from base class
       
    75 	NormalConnectL();
       
    76 
       
    77 	return iTestStepResult;
       
    78 	}
       
    79 
       
    80 // Test case 1.3 CSD connect with invalid protocol
       
    81 enum TVerdict CCsdAgtTest1_3::doCsdAgtTestStepL( void )
       
    82 	{
       
    83 	TRealAgtNotify AgtNotify;
       
    84 
       
    85 	AgtNotify.SetTestCase(10103);
       
    86 	AgtNotify.SetMode(RTelServer::ENetworkModeGsm);
       
    87 
       
    88 	CDbCsdTable *csd = CDbCsdTable::NewL();
       
    89 	CleanupStack::PushL(csd);
       
    90 	csd->SetColumnIntL(TPtrC(ISP_BEARER_PROTOCOL),(TUint32)RMobileCall::EProtocolBitTransparent);
       
    91 
       
    92 	ConnectExpectErrorL(KErrNotSupported,ECsdFinishedDialling);
       
    93 
       
    94 	// Close database object, forcing it to undo all changes that were made
       
    95 	Log(_L("Reverting COMMDB changes"));
       
    96 	csd->UndoDatabaseChangesL();
       
    97 	CleanupStack::PopAndDestroy(csd);
       
    98 
       
    99 	return iTestStepResult;
       
   100 	}
       
   101 
       
   102