loc_plat/location_centre_api/tsrc/src/testlocationappinfo.cpp
branchRCL_3
changeset 16 4721bd00d3da
parent 14 3a25f69541ff
child 21 e15b7f06eba6
equal deleted inserted replaced
14:3a25f69541ff 16:4721bd00d3da
     1 /*
       
     2 * Copyright (c) 2007 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:  Test Class which has the list of test cases for CLcLocationAppInfo
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 // System Includes
       
    21 #include <lclocationappinfo.h>
       
    22 
       
    23 // User Includes
       
    24 #include "testlocationappinfo.h"
       
    25 
       
    26 
       
    27 // Constant Declarations
       
    28 
       
    29     
       
    30 // ======== MEMBER FUNCTIONS ========
       
    31 
       
    32 // ---------------------------------------------------------------------------
       
    33 // C++ Default Constructor
       
    34 // ---------------------------------------------------------------------------
       
    35 //
       
    36 CTestLocationAppInfo::CTestLocationAppInfo(CStifLogger* aLog)
       
    37     : iLcLocationAppInfo(NULL),iLog(aLog)
       
    38     {
       
    39 
       
    40     }
       
    41 
       
    42 // ---------------------------------------------------------------------------
       
    43 // C++ Destructor
       
    44 // ---------------------------------------------------------------------------
       
    45 //
       
    46 CTestLocationAppInfo::~CTestLocationAppInfo()
       
    47     {
       
    48 
       
    49     }
       
    50 
       
    51 // ---------------------------------------------------------
       
    52 // CTestLocationAppInfo::CheckNewL
       
    53 //
       
    54 // (other items were commented in a header).
       
    55 // ---------------------------------------------------------
       
    56 //
       
    57 TInt CTestLocationAppInfo::CheckNewL()
       
    58 	{
       
    59 	TInt err = KErrNone;
       
    60 
       
    61 	TRAP(err, iLcLocationAppInfo = CLcLocationAppInfo::NewL());
       
    62 
       
    63 	iLog->Log(_L("CheckNewL return with %d"), err);
       
    64 
       
    65 	delete iLcLocationAppInfo;
       
    66 	return err;
       
    67 	}
       
    68 
       
    69 // ---------------------------------------------------------
       
    70 // CTestLocationAppInfo::CheckNewLC
       
    71 //
       
    72 // (other items were commented in a header).
       
    73 // ---------------------------------------------------------
       
    74 //
       
    75 TInt CTestLocationAppInfo::CheckNewLC()
       
    76 	{
       
    77 	TInt err = KErrNone;
       
    78 
       
    79 	TRAP(err, iLcLocationAppInfo = CLcLocationAppInfo::NewLC();
       
    80 		CleanupStack::Pop(iLcLocationAppInfo));
       
    81 
       
    82 	iLog->Log(_L("CheckNewLC return with %d"), err);
       
    83 
       
    84 	delete iLcLocationAppInfo;
       
    85 	return err;
       
    86 	}
       
    87 
       
    88 // ---------------------------------------------------------
       
    89 // CTestLocationAppInfo::CheckCopyNewL
       
    90 //
       
    91 // (other items were commented in a header).
       
    92 // ---------------------------------------------------------
       
    93 //
       
    94 TInt CTestLocationAppInfo::CheckCopyNewL()
       
    95 	{
       
    96 	TInt err = KErrNone;
       
    97 	
       
    98 	CLcLocationAppInfo* lcLocationAppInfo = CLcLocationAppInfo::NewL();
       
    99 	
       
   100 	TRAP(err, iLcLocationAppInfo = CLcLocationAppInfo::NewL(*lcLocationAppInfo));
       
   101 
       
   102 	iLog->Log(_L("CheckCopyNewL return with %d"), err);
       
   103 
       
   104 	delete lcLocationAppInfo;
       
   105 	delete iLcLocationAppInfo;
       
   106 	return err;
       
   107 	}
       
   108 
       
   109 // ---------------------------------------------------------
       
   110 // CTestLocationAppInfo::CheckCopyNewLC
       
   111 //
       
   112 // (other items were commented in a header).
       
   113 // ---------------------------------------------------------
       
   114 //
       
   115 TInt CTestLocationAppInfo::CheckCopyNewLC()
       
   116 	{
       
   117 	TInt err = KErrNone;
       
   118 
       
   119 	CLcLocationAppInfo* lcLocationAppInfo = CLcLocationAppInfo::NewLC();
       
   120 
       
   121 	TRAP(err, iLcLocationAppInfo = CLcLocationAppInfo::NewLC(*lcLocationAppInfo);
       
   122 		CleanupStack::Pop(iLcLocationAppInfo));
       
   123 
       
   124 	iLog->Log(_L("CheckCopyNewLC return with %d"), err);
       
   125 
       
   126 	CleanupStack::PopAndDestroy(lcLocationAppInfo);
       
   127 
       
   128 	delete iLcLocationAppInfo;
       
   129 	return err;
       
   130 	}
       
   131 
       
   132 // ---------------------------------------------------------
       
   133 // CTestLocationAppInfo::CheckId
       
   134 //
       
   135 // (other items were commented in a header).
       
   136 // ---------------------------------------------------------
       
   137 //
       
   138 TInt CTestLocationAppInfo::CheckId()
       
   139 	{
       
   140 	TInt err = KErrNone;
       
   141 
       
   142 	iLcLocationAppInfo = CLcLocationAppInfo::NewL();
       
   143 
       
   144 	if(0 != (iLcLocationAppInfo->Id()).Compare(_L("")) )
       
   145 		err = KErrGeneral;
       
   146 
       
   147 	iLog->Log(_L("CheckId return with %d"), err);
       
   148 
       
   149 	delete iLcLocationAppInfo;
       
   150 	return err;
       
   151 	}
       
   152 
       
   153 // ---------------------------------------------------------
       
   154 // CTestLocationAppInfo::CheckName
       
   155 //
       
   156 // (other items were commented in a header).
       
   157 // ---------------------------------------------------------
       
   158 //
       
   159 TInt CTestLocationAppInfo::CheckName()
       
   160 	{
       
   161 	TInt err = KErrNone;
       
   162 
       
   163 	iLcLocationAppInfo = CLcLocationAppInfo::NewL();
       
   164 	
       
   165 	if(0 != (iLcLocationAppInfo->Name()).Compare(_L("")) )
       
   166 		err = KErrGeneral;
       
   167 
       
   168 	iLog->Log(_L("CheckName return with %d"), err);
       
   169 
       
   170 	delete iLcLocationAppInfo;
       
   171 	return err;
       
   172 	}
       
   173 	
       
   174 // ---------------------------------------------------------
       
   175 // CTestLocationAppInfo::CheckLaunchMode
       
   176 //
       
   177 // (other items were commented in a header).
       
   178 // ---------------------------------------------------------
       
   179 //
       
   180 TInt CTestLocationAppInfo::CheckLaunchMode()
       
   181 	{
       
   182 	TInt err = KErrNone;
       
   183 
       
   184 	iLcLocationAppInfo = CLcLocationAppInfo::NewL();
       
   185 	
       
   186 	if(CLcLocationAppInfo::EDefaultMode != iLcLocationAppInfo->LaunchMode())
       
   187 		err = KErrGeneral;
       
   188 
       
   189 	iLog->Log(_L("LaunchMode return with %d"), err);
       
   190 
       
   191 	delete iLcLocationAppInfo;
       
   192 	return err;
       
   193 	}
       
   194 
       
   195 // ---------------------------------------------------------
       
   196 // CTestLocationAppInfo::CheckSystemCharacteristics
       
   197 //
       
   198 // (other items were commented in a header).
       
   199 // ---------------------------------------------------------
       
   200 //
       
   201 TInt CTestLocationAppInfo::CheckSystemCharacteristics()
       
   202 	{
       
   203 	TInt err = KErrNone;
       
   204 
       
   205 	iLcLocationAppInfo = CLcLocationAppInfo::NewL();
       
   206 	
       
   207 	if(CLcLocationAppInfo::ESysCharNone != iLcLocationAppInfo->SystemCharacteristics())
       
   208 		err = KErrGeneral;
       
   209 
       
   210 	iLog->Log(_L("CheckSystemCharacteristics return with %d"), err);
       
   211 
       
   212 	delete iLcLocationAppInfo;
       
   213 	return err;
       
   214 	}
       
   215 
       
   216 // ---------------------------------------------------------
       
   217 // CTestLocationAppInfo::CheckApplicationCharacteristics
       
   218 //
       
   219 // (other items were commented in a header).
       
   220 // ---------------------------------------------------------
       
   221 //
       
   222 TInt CTestLocationAppInfo::CheckApplicationCharacteristics()
       
   223 	{
       
   224 	TInt err = KErrNone;
       
   225 
       
   226 	iLcLocationAppInfo = CLcLocationAppInfo::NewL();
       
   227 	
       
   228 	if(CLcLocationAppInfo::EAppCharNone != iLcLocationAppInfo->ApplicationCharacteristics())
       
   229 		err = KErrGeneral;
       
   230 
       
   231 	iLog->Log(_L("CheckApplicationCharacteristics return with %d"), err);
       
   232 
       
   233 	delete iLcLocationAppInfo;
       
   234 	return err;
       
   235 	}