localisation/apparchitecture/tef/T_DataMappingPersistenceC.cpp
branchSymbian2
changeset 1 8758140453c0
child 6 c108117318cb
equal deleted inserted replaced
0:e8c1ea2c6496 1:8758140453c0
       
     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 the License "Symbian Foundation License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 
       
    17 
       
    18 /**
       
    19  @file
       
    20  @internalComponent - Internal Symbian test code 
       
    21 */
       
    22 
       
    23 
       
    24 #include "T_DataMappingPersistenceC.h"
       
    25 
       
    26 
       
    27 
       
    28 /**
       
    29  * Constructor
       
    30  */	
       
    31 CT_DataMappingPersistenceCTestStep::CT_DataMappingPersistenceCTestStep()
       
    32 	{
       
    33 	// Call base class method to set up the human readable name for logging
       
    34 	SetTestStepName(KT_DataMappingPersistenceCStep);
       
    35 	}
       
    36 
       
    37 /**
       
    38  * Destructor
       
    39  */
       
    40 CT_DataMappingPersistenceCTestStep::~CT_DataMappingPersistenceCTestStep()
       
    41 	{
       
    42 	iSession.Close();
       
    43 	}
       
    44 
       
    45 /**
       
    46  * @return - TVerdict code
       
    47  * Override of base class virtual
       
    48  */	
       
    49 TVerdict CT_DataMappingPersistenceCTestStep::doTestStepPreambleL()
       
    50 	{
       
    51 	SetTestStepResult(EPass);
       
    52 	TInt error = iSession.Connect();
       
    53 	TEST(error==KErrNone);
       
    54 	return TestStepResult();
       
    55 	}
       
    56 
       
    57 /**
       
    58  * @return - TVerdict code
       
    59  * Override of base class virtual
       
    60  */
       
    61 TVerdict CT_DataMappingPersistenceCTestStep::doTestStepPostambleL()
       
    62 	{
       
    63 	return TestStepResult();
       
    64 	}
       
    65 
       
    66 TVerdict CT_DataMappingPersistenceCTestStep::doTestStepL()
       
    67 	{
       
    68 	INFO_PRINTF1(_L("Testing Apparc...T_DataMappingPersistenceC Test Cases Running..."));
       
    69 
       
    70 	TRAPD(ret,RunTestCasesL());
       
    71 	TEST(ret==KErrNone);
       
    72 	
       
    73 	INFO_PRINTF1(_L("...T_DataMappingPersistenceC Test Cases Completed."));
       
    74 
       
    75 	return TestStepResult();
       
    76 	}
       
    77 	
       
    78 TInt CT_DataMappingPersistenceCTestStep::RunTestCasesL()
       
    79 	{
       
    80 	HEAP_TEST_LS_SESSION(iSession, 0, 0, TestCheckDeleteDataMappingL(), NO_CLEANUP);
       
    81 	
       
    82 	return KErrNone;
       
    83 	}	
       
    84 
       
    85 void CT_DataMappingPersistenceCTestStep::TestCheckDeleteDataMappingL()
       
    86 	{
       
    87 	TUid appUid = {0x10004c58}; 
       
    88 	_LIT8(KLitMimeTypeData,"text/TestDataMappingPersistence");
       
    89 	TDataType dataType (KLitMimeTypeData);
       
    90 	TUid retAppUid;
       
    91 	TInt error = iSession.AppForDataType(dataType,retAppUid);
       
    92 	TEST(error==KErrNone);
       
    93 	TEST(appUid != retAppUid);
       
    94 	}